ALVRT	MACRO M1110  22-AUG-78 01:39  PAGE 2





      1						.TITLE	ALVRT

      2						.IDENT	/04/

      3					                                                                                ;**-1

      4					;

      5					; COPYRIGHT (C) 1976

      6					; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

      7					;

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

      9					; SINGLE COMPUTER SYSTEM AND MAY  BE  COPIED   ONLY  WITH  THE

     10					; INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE,  OR

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

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

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

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

     15					; IN DEC.

     16					;

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

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

     19					; EQUIPMENT CORPORATION.

     20					;

     21					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF

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

     23					;

     24					; VERSION 02                                                                    ;**NEW**

     25					;                                                                               ;**-1

     26					; C. MONIA 22-FEB-74

     27					;

     28					; ALLOCATE VIRTUAL STORAGE

     29					;

     30					;+

     31					; **-$ALVRT-ALLOCATE VIRTUAL MEMORY

     32					;

     33					; INPUTS:

     34					;

     35					;	R1=NUMBER OF BYTES TO ALLOCATE

     36					;

     37					; OUTPUTS:

     38					;

     39					;	R0=REAL ADDRESS OF ALLOCATION

     40					;	R1=VIRTUAL ADDRESS OF ALLOCATION

     41					;

     42					;	THE SPECIFIED PAGE IS WRITE-MARKED

     43					;

     44					; THIS ROUTINE IS CALLED TO ALLOCATE VIRTUAL MEMORY AND MAKE

     45					; THE ALLOCATED SPACE RESIDENT IN CORE. THE AMOUNT OF SPACE

     46					; TO BE ALLOCATED IS ROUNDED TO THE NEAREST WORD

     47					;

     48					;

     49					;-

     50

     51	000000				$ALVRT::			;

     52	000000					SAVRG			; SAVE NON-VOLATILE REGISTERS

     53	000004					CALL	$RQVCB		; REQUEST VIRTUAL CORE BLOCK

     54	000010	103435 				BCS	40$		; IF C/S NO VIRTUAL SPACE LEFT

     55	000012	010105 				MOV	R1,R5		; SAVE VIRTUAL ADDRESS

     56	000014	000305 				SWAB	R5		; PUT RELATIVE BLOCK IN LOW BYTE

     57	000016	105701 				TSTB	R1		; IS REQUEST ON BLOCK BOUNDRY?

ALVRT	MACRO M1110  22-AUG-78 01:39  PAGE 2-1





     58	000020	001025 				BNE	20$		; IF NE NO, BLOCK ALREADY EXISTS

     59	000022	012701 	000000G			MOV	#P$GSIZ,R1	; CREATE A PAGE BUFFER

     60	000026					CALL	$ALBLK		; ALLOCATE STORAGE SPACE

     61	000032	016702 	000000G			MOV	$PAGLS,R2	; GET ADDRESS OF PAGE LIST                      ;**NEW**

     62	000036	001405 				BEQ	10$		; IF EQ NONE                                    ;**NEW**

     63	000040	005001 				CLR	R1		; SET FOR MOVB WITHOUT EXTEND                   ;**NEW**

     64	000042	150501 				BISB	R5,R1		; GET RELATIVE BLOCK NUMBER                     ;**NEW**

     65	000044	006301 				ASL	R1		; CONVERT TO WORD OFFSET                        ;**NEW**

     66	000046	060102 				ADD	R1,R2		; COMPUTE ADDRESS IN LIST                       ;**NEW**

     67	000050	010012 				MOV	R0,(R2)		; STORE ADDRESS                                 ;**NEW**

     68	000052				10$:				;                                               ;**NEW**

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

     70	000060	010067 	000000G			MOV	R0,$PAGHD	; SET NEW FIRST

     71	000064	110560 	000000G			MOVB	R5,P$GBLK(R0)	; SET RELATIVE BLOCK NUMBER OF PAGE

     72	000070	010501 				MOV	R5,R1		; RESTORE SWAPPED VIRTUAL ADDRESS

     73	000072	000301 				SWAB	R1		; STRAIGHTEN IT

     74	000074				20$:				;

     75	000074					CALL	$CVRL		; CONVERT TO REAL ADDRESS

     76	000100				30$:				;

     77	000100					CALLR	$WRMPG		; WRITE-MARK PAGE

     78	000104				40$:				;

     79	000104	012701 	000000C			MOV	#<S$V2*400!E$R76>,R1 ; GET ERROR/SEVERITY

     80	000110	005002 				CLR	R2		; SET DUMMY PARAMETER BLOCK ADDRESS

     81	000112					CALL	$ERMSG		; FATAL-NO RETURN

     82

     83		000001 				.END

ALVRT	MACRO M1110  22-AUG-78 01:39  PAGE 2-2

SYMBOL TABLE



CR    = 000015   	P$GBLK= ****** GX	S$V2  = ****** GX	$CVRL = ****** GX	$RQVCB= ****** GX

E$R76 = ****** GX	P$GNXT= ****** GX	VT    = 000013   	$ERMSG= ****** GX	$SAVRG= ****** GX

FF    = 000014   	P$GSIZ= ****** GX	$ALBLK= ****** GX	$PAGHD= ****** GX	$WRMPG= ****** GX

HT    = 000011   	R$$11M= 000000   	$ALVRT  000000RG 	$PAGLS= ****** GX	$$    = 000001

LF    = 000012   	SPA   = 000040



. ABS.	000000	   000

      	000116	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  655 WORDS  ( 3 PAGES)

DYNAMIC MEMORY:  2772 WORDS  ( 10 PAGES)

ELAPSED TIME:  00:00:05

OBJ$:ALVRT,LIS$:ALVRT/-SP=SRC$:MACFLM,ALVRT

