MACFLM	MACRO M1110  22-AUG-78 01:40  PAGE 3





      1						.IF NDF	W$$KST

      2

      3						.TITLE	CVRL

      4

      5						.IFF

      6

      7						.TITLE	CVRS

      8

      9						.ENDC

     10						.IDENT	/02/

     11					                                                                                ;**-1

     12					;

     13					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.

     14					;

     15					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE

     16					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION

     17					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT

     18					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.

     19					;

     20					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT

     21					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL

     22					; EQUIPMENT CORPORATION.

     23					;

     24					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY

     25					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.

     26					;

     27					; VERSION 02

     28					;                                                                               ;**-1

     29					; C. MONIA 22-FEB-74

     30					;

     31					; MODIFICATIONS:

     32					;

     33					; NO.		DATE		PROGRAMMER

     34					; ---		----		----------

     35					;

     36					; 043		28-OCT-75	C. MONIA

     37					;

     38					;

     39					; CONVERT A VIRTUAL ADDRESS TO REAL ADDRESS

     40					;

     41					;+

     42					; **-$CVRL-MAKE VIRTUAL STORE RESIDENT

     43					;

     44					; INPUTS:

     45					;

     46					;	R1=VIRTUAL ADDRESS

     47					;

     48					; OUTPUTS:

     49					;

     50					;	R0=REAL ADDRESS

     51					;

     52					; R1 IS UNCHANGED

     53					;

     54					; THIS ROUTINE IS CALLED TO CONVERT A VIRTUAL ADDRESS INTO

     55					; AN ADDRESS IN REAL MEMORY. THE LIST OF RESIDENT PAGE

     56					; BUFFERS IS CHECKED FIRST. IF THE PAGE IS NOT

     57					; IN MEMORY A BUFFER IS ALLOCATED AND THE PAGE IS READ INTO

CVRS	MACRO M1110  22-AUG-78 01:40  PAGE 3-1





     58					; CORE

     59					;

     60					;-

     61

     62	000000				$CVRL::				;

     63	000000					SAVRG			; SAVE NON-VOLATILE REGISTERS

     64	000004	010105 				MOV	R1,R5		; COPY VIRTUAL ADDRESS

     65	000006	000305 				SWAB	R5		; POSITION BLOCK NUMBER TO LOW BYTE

     66	000010					CALL	$FNDPG		; SEARCH FOR PAGE

     67	000014	103032 				BCC	10$		; IF C/C PAGE IN CORE.

     68	000016	012701 	000000G			MOV	#P$GSIZ,R1	; GET SIZE OF PAGE BUFFER

     69	000022					CALL	$ALBLK		; ALLOCATE MEMORY

     70	000026	016704 	000000G			MOV	$PAGLS,R4	; GET ADDRESS OF PAGE LIST                      ;**NEW**

     71	000032	001405 				BEQ	5$		; IF EQ NONE                                    ;**NEW**

     72	000034	005002 				CLR	R2		; SET FOR MOVB WITH NO EXTEND                   ;**NEW**

     73	000036	150502 				BISB	R5,R2		; GET RELATIVE BLOCK NUMBER                     ;**NEW**

     74	000040	006302 				ASL	R2		; CONVERT TO WORD OFFSET                        ;**NEW**

     75	000042	060204 				ADD	R2,R4		; COMPUTE LIST ADDRESS                          ;**NEW**

     76	000044	010014 				MOV	R0,(R4)		; STORE ADDRESS OF PAGE                         ;**NEW**

     77	000046				5$:				;                                               ;**NEW**

     78	000046	110560 	000000G			MOVB	R5,P$GBLK(R0)	; SET RELATIVE BLOCK NUMBER

     79	000052					CALL	$RDPAG		; READ PAGE INTO CORE

     80	000056	016760 	000000G	000000G		MOV	$PAGHD,P$GNXT(R0) ; LINK OLD FIRST TO NEW FIRST

     81	000064	010067 	000000G			MOV	R0,$PAGHD	; SET NEW FIRST

     82	000070	016760 	000000G	000000G		MOV	$TIME,P$GTIM(R0) ; TIME-STAMP PAGE

     83	000076	010501 				MOV	R5,R1		; RESTORE VIRTUAL ADDRESS

     84	000100	000301 				SWAB	R1		; STRAIGHTEN IT

     85	000102				10$:				;

     86	000102	105005 				CLRB	R5		; CLEAR BLOCK NUMBER

     87	000104	000305 				SWAB	R5		; GET WORD DISPLACEMENT IN LOW BYTE

     88	000106	006305 				ASL	R5		; MAKE BYTE OFFSET

     89	000110	060500 				ADD	R5,R0		; ADD DISPLACEMENT IN BLOCK

     90	000112	062700 	000000G			ADD	#P$GHD,R0	; OFFSET PAST HEADER

     91

     92						.IF DF	W$$KST

     93

     94	000116	005267 	000002G			INC	$WRKAC+2	; INCREMENT TOTAL ACCESS COUNT

     95	000122	001002 				BNE	20$		; IF NE NO OVERFLOW

     96	000124	005267 	000000G			INC	$WRKAC		; INCREMENT HIGH PART OF COUNT

     97	000130				20$:				;

     98

     99						.ENDC

    100

    101	000130					RETURN			;

    102

    103		000001 				.END

CVRS	MACRO M1110  22-AUG-78 01:40  PAGE 3-2

SYMBOL TABLE



CR    = 000015   	P$GHD = ****** GX	SPA   = 000040   	$FNDPG= ****** GX	$SAVRG= ****** GX

FF    = 000014   	P$GNXT= ****** GX	VT    = 000013   	$PAGHD= ****** GX	$TIME = ****** GX

HT    = 000011   	P$GSIZ= ****** GX	W$$KST= 000000   	$PAGLS= ****** GX	$WRKAC= ****** GX

LF    = 000012   	P$GTIM= ****** GX	$ALBLK= ****** GX	$RDPAG= ****** GX	$$    = 000001

P$GBLK= ****** GX	R$$11M= 000000   	$CVRL   000000RG



. ABS.	000000	   000

      	000132	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  640 WORDS  ( 3 PAGES)

DYNAMIC MEMORY:  2772 WORDS  ( 10 PAGES)

ELAPSED TIME:  00:00:07

OBJ$:CVRS,LIS$:CVRS/-SP=SRC$:MACFLM,WRKST,CVRL

