MPVBN	X0001 - MAP VIRTUAL TO 	MACRO M1110  21-AUG-78 20:52  PAGE 3





      1	000000					$BEGIN	MPVBN,0001,<MAP VIRTUAL TO LOGICAL (ODS-2)>

						.TITLE	MPVBN	X0001 - MAP VIRTUAL TO LOGICAL (ODS-2)

						.IDENT	"X0001"

      2

      3					;

      4					; COPYRIGHT (C) 1977 BY DIGITAL EQUIPMENT CORPORATION,

      5					; MAYNARD, MASSACHUSETTS

      6					;

      7					; THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY ON A

      8					; SINGLE  COMPUTER  SYSTEM AND MAY BE COPIED ONLY WITH THE IN-

      9					; CLUSION OF THE ABOVE COPYRIGHT NOTICE.   THIS  SOFTWARE,  OR

     10					; ANY  OTHER  COPIES THEREOF, MAY NOT BE PROVIDED OR OTHERWISE

     11					; MADE AVAILABLE TO ANY OTHER PERSON EXCEPT FOR  USE  ON  SUCH

     12					; SYSTEM  AND TO ONE WHO AGREES TO THESE LICENSE TERMS.  TITLE

     13					; TO AND OWNERSHIP OF THE SOFTWARE SHALL AT ALL  TIMES  REMAIN

     14					; IN DIGITAL.

     15					;

     16					; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITH-

     17					; OUT  NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY

     18					; DIGITAL EQUIPMENT CORPORATION.

     19					;

     20					; DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY  FOR

     21					; THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIPMENT WHICH IS

     22					; NOT SUPPLIED BY DIGITAL.

     23					;

     24					; JOSEPH A. CARCHIDI  9-DEC-77  17:30

     25

     26

     27						.MCALL	FHDL2$

     28	000000					FHDL2$				; DEFINE FILE HEADER LAYOUT

MPVBN	X0001 - MAP VIRTUAL TO 	MACRO M1110  21-AUG-78 20:52  PAGE 4





     30					;+

     31					;

     32					; *** - $MPVBN	MAP VIRTUAL BLOCKS TO LOGICAL BLOCKS

     33					;

     34					; THIS ROUTINE MAPS THE INDICATED VIRTUAL BLOCKS (GIVEN RELATIVE TO

     35					; THE START OF THE FILE HEADER) TO THEIR CORRESPONDING LOGICAL

     36					; BLOCKS AND INDICATES THE NUMBER OF BLOCKS THAT MAP CONTIGUOUSLY.

     37					;

     38					; INPUTS:

     39					;

     40					;	R2, R3 = HIGH AND LOW STARTING VBN

     41					;	R5 =	 ADDRESS OF FILE HEADER TO USE

     42					;

     43					; OUTPUTS:

     44					;

     45					;	CC - C	CLEAR IF SUCCESSFUL MAP

     46					;		SET IF VBN NOT CONTAINED IN FILE

     47					;	R0, R1 = NUMBER OF BLOCKS MAPPED

     48					;	R2, R3 = HIGH AND LOW STARTING LBN

     49					;	ALL OTHER REGISTERS PRESERVED

     50					;-

     51

     52	000000				$MPVBN::

     53	000000					PUSH  R4,R5			; SAVE CALLER'S REGS.

     54	000004					LET R3 := R3 - #01		; NORMALIZE VBN TO 0

     55	000010					LET R2 := R2 - CARRY

     56	000012	005046 				CLR  -(SP)			; CREATE LOOP COUNTER.

     57	000014	156516 	000072 			BISB  H.USE(R5),(SP)		; SET LOOP COUNT.

     58	000020	005004 				CLR  R4

     59	000022	156504 	000001 			BISB  H.MPOF(R5),R4		; MAP AREA OFFSET.

     60	000026	006304 				ASL  R4				; CONVERT TO BYTES.

     61	000030	060405 				ADD  R4,R5			; POINT R5 AT MAP AREA.

     62	000032					PUSH  R2,R3			; PUT VBN INTO TEMPS.

     63	000036					BEGIN MAP

     64	000036					  BEGIN SCAN

     65	000036					    WHILE  4(SP)  GT  #0	; LOOP FOR ALL POINTERS.

     66	000044	004767 	000100 			      CALL  $GT1RP		; GET ONE RETRIEVAL POINTER.

     67	000050	062701 	000001 			      ADD   #1,R1		; ADJUST TO ACTUAL

     68	000054	005500 				      ADC   R0			; BLOCK COUNT.

     69	000056	160116 				      SUB   R1,(SP)		; DEDUCT FROM VBN.

     70	000060	005666 	000002 			      SBC   2(SP)

     71	000064					      IF RESULT IS CS LEAVE SCAN  ; THIS IS THE POINTER.

     72	000066	160066 	000002 			      SUB   R0,2(SP)

     73	000072					      IF RESULT IS CS LEAVE SCAN  ; THIS IS THE POINTER.

     74	000074	160466 	000004 			      SUB   R4,4(SP)		; DECR LOOP CTR BY PTR SIZE.

     75	000100					    END  LOOP

     76	000102	022626 				    CMP  (SP)+,(SP)+		; DISCARD VBN.

     77	000104	000261 				    SEC				; TO HERE IF EMPTY HEADER

     78	000106					    LEAVE MAP

     79	000110					  END SCAN

MPVBN	X0001 - MAP VIRTUAL TO 	MACRO M1110  21-AUG-78 20:52  PAGE 5





     81					;

     82					; R2,R3 CONTAIN THE LBN FROM THE RETRIEVAL POINTER.

     83					; ADD THE COUNT AND THE DECREMENTED VBN TO GENERATE

     84					; THE ACTUAL LBN.

     85					;

     86	000110	060103 				  ADD  R1,R3			; ADD THE COUNT AND

     87	000112	005502 				  ADC  R2

     88	000114	060002 				  ADD  R0,R2

     89	000116	061603 				  ADD  (SP),R3			; THE DECREMENTED VBN TO

     90	000120	005502 				  ADC  R2			; COMPUTE THE LBN OFFSET.

     91	000122	066602 	000002 			  ADD  2(SP),R2

     92					;

     93					; WE HAVE FOUND THE RETRIEVAL POINTER THAT MAPS THE STARTING VBN.

     94					; CONVERT NUMBER OF CONTIGUOUS BLOCKS MAPPED TO POSITIVE AND

     95					; RETURN IN R0,R1.

     96					;

     97	000126	012601 				  MOV  (SP)+,R1			; MOV THE NUMBER OF CONTIGUOUS

     98	000130	012600 				  MOV  (SP)+,R0			; BLOCKS MAPPED TO R0,R1.

     99	000132	005400 				  NEG  R0			; MAKE IT POSITIVE.

    100	000134	005401 				  NEG  R1

    101	000136	005600 				  SBC  R0

    102	000140					END MAP

    103

    104	000140	005226 				INC  (SP)+			; DISCARD LOOP COUNTER.

    105	000142					POP  R5,R4			; RESTORE CALLER'S REGS.

    106	000146					RETURN

    107

    108

    109

MPVBN	X0001 - MAP VIRTUAL TO 	MACRO M1110  21-AUG-78 20:52  PAGE 6





    111					;+

    112					; *** - $GT1RP  GET 1 RETRIEVAL POINTER.

    113					;

    114					; THIS ROUTINE EXTRACTS THE COUNT AND LBN VALUES FROM ONE

    115					; RETRIEVAL POINTER AND RETURNS THEM IN REGISTERS.

    116					; IN ADDITION, IT RETURNS THE POINTER SIZE IN WORDS.

    117					;

    118					; INPUTS:

    119					;

    120					;	R5 = ADDRESS OF CURRENT RETRIEVAL POINTER.

    121					;

    122					; OUTPUTS:

    123					;

    124					; 	R0,R1 = COUNT FROM RETRIEVAL POINTER (UNADJUSTED).

    125					;	R2,R3 = LBN FROM RETRIEVAL POINTER.

    126					;	R4 = SIZE OF POINTER IN WORDS.

    127					;	R5 = ADDRESS OF NEXT RETRIEVAL POINTER.

    128					;-

    129	000150				$GT1RP::

    130	000150	012704 	000003 			MOV  #3,R4			; INIT TO INDICATE 3 WORD POINTER.

    131	000154	005000 				CLR  R0				; ZERO THE HIGH ORDER COUNT.

    132	000156	012501 				MOV  (R5)+,R1			; GET FIRST WORD OF RETRIEVAL POINTER.

    133	000160	010102 				MOV  R1,R2			; MAKE A COPY.

    134	000162					IF  RESULT  IS  PL		; 2 WORD POINTER ?

    135					;

    136					; 2 WORD POINTER.

    137					;

    138	000164	042701 	177400 			  BIC  #^C377,R1		; ISOLATE COUNT.

    139	000170	105002 				  CLRB  R2			; ISOLATE HIGH ORDER LBN.

    140	000172	000302 				  SWAB  R2

    141	000174	042702 	177700 			  BIC  #^C77,R2			; SIX BITS ONLY.

    142	000200	012704 	000002 			  MOV  #2,R4			; INDICATE 2 WORD POINTER.

    143	000204	012503 				  MOV  (R5)+,R3			; LOW ORDER LBN TO R3.

    144	000206					ELSE				; MUST BE 3 WORD OR 4 WORD POINTER.

    145					;

    146					; 3 OR 4 WORD POINTER.

    147					;

    148	000210	042701 	140000 			  BIC  #140000,R1		; ISOLATE THE COUNT.

    149	000214					  IF  #040000  SET.IN  R2	; 4 WORD POINTER ?

    150					;

    151					; 4 WORD POINTER.

    152					;

    153	000222	010100 				    MOV  R1,R0			; HIGH ORDER COUNT TO R0.

    154	000224	012501 				    MOV  (R5)+,R1		; GET LOW ORDER COUNT.

    155	000226	012704 	000004 			    MOV  #4,R4			; INDICATE 4 WORD POINTER.

    156	000232					  END

    157					;

    158					; 3 OR 4 WORD POINTER.

    159					;

    160	000232	012503 				  MOV  (R5)+,R3			; LOW ORDER LBN TO R3.

    161	000234	012502 				  MOV  (R5)+,R2			; HIGH ORDER LBN TO R2.

    162	000236					END

    163					;

    164					; ALL POINTER TYPES.

    165					;

    166	000236					RETURN

    167

MPVBN	X0001 - MAP VIRTUAL TO 	MACRO M1110  21-AUG-78 20:52  PAGE 6-1





    168		000001 				.END

MPVBN	X0001 - MAP VIRTUAL TO 	MACRO M1110  21-AUG-78 20:52  PAGE 6-2

SYMBOL TABLE



B0      000036R  	H.FOWN= 000074   	IIII  = 177777   	SCAN  = 000001   	$I$   = 000001

B1      000036R  	H.FPRO= 000100   	I.BKDT= 000052   	SC.BAD= 000100   	$K$   = 000000

B2      000036R  	H.FRVN= 000014   	I.CRDT= 000022   	SC.DIR= 000040   	$L    = 000003

E0      000140R  	H.FSEG= 000004   	I.EXDT= 000042   	SC.MDL= 000200   	$L$   = 000000

E1      000110R  	H.FSEQ= 000012   	I.FNAM= 000000   	S.HDHD= 000114   	$MPVBN  000000RG

E2      000102R  	H.IDOF= 000000   	I.RVDT= 000032   	S.IDHD= 000202   	$O$   = 000000

FP.DEL= 000010   	H.MPOF= 000001   	I.RVNO= 000020   	S.MPHD= 000000   	$R    = 177777

FP.EXE= 000004   	H.PRIV= 000073   	I.ULAB= 000062   	TYPS0 = 000000   	$SUPMC= 000043

FP.RDV= 000001   	H.PROG= 000074   	LBLS0 = 000002   	TYPS1 = 000000   	$T    = 000004

FP.WRV= 000002   	H.PROJ= 000076   	LBLS1 = 000003   	TYPS2 = 000000   	$T1   = 000000

H.ACOF= 000002   	H.RPRO= 000102   	LBLS2 = 000000   	TYPS3 = 000001   	$T2   = 000002

H.CKSM= 000776   	H.RSOF= 000003   	LBLS3 = 000002   	TYPS4 = 000000   	$Y$   = 000000

H.EFNU= 000016   	H.SCHA= 000065   	LBLS4 = 000001   	UC.CON= 000200   	$Z$   = 000000

H.EFSQ= 000020   	H.SEMK= 000104   	L0      000102R  	UC.DLK= 000100   	$$T   = 000000

H.ERVN= 000022   	H.SMMX= 000110   	L1      000210R  	$DIDDO= 000000   	$$TT  = 000001

H.FCHA= 000064   	H.UCHA= 000064   	L2      000236R  	$EF$  = 000000   	...GBL= 000000

H.FLEV= 000006   	H.UFAT= 000024   	L3      000232R  	$E$   = 000001   	...TPC= 000000

H.FNUM= 000010   	H.USE = 000072   	MAP   = 000000   	$GT1RP  000150RG



. ABS.	000000	   000

      	000240	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  12820 WORDS  ( 51 PAGES)

DYNAMIC MEMORY:  14388 WORDS  ( 55 PAGES)

ELAPSED TIME:  00:00:37

EXE$:MPVBN,LIS$:MPVBN/-SP=SRC$:SMAC/PA:1,DSCPRE,MPVBN

