VSECT	MACRO M1110  22-AUG-78 02:02  PAGE 2





      1						.TITLE	VSECT

      2						.IDENT	/00/

      3

      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					;

     25					; VERSION 00

     26					;

     27					; C. MONIA 30-MAY-76

     28					;

     29					; PROCESS VIRTUAL SECTION KEYWORD OPTION

     30					;

     31					;+

     32					;

     33					; **-$VSECT-PROCESS VIRTUAL SECTION KEYWORD OPTION

     34					;

     35					; THIS SUBROUTINE IS CALLED BY THE PHASE 2 OPTION PROCESSOR TO VALIDATE

     36					; KEYWORD PARAMETERS AND ENTER THE VIRTUAL SECTION IN THE VSECT LIST.

     37					;

     38					; INPUTS:

     39					;

     40					;	R3=NUMBER OF PARAMETERS SPECIFIED

     41					;	R5=ADDRESS OF PARAMETER LIST ($PARM)

     42					;

     43					;	PARAMETER LIST CONTAINS THE FOLLOWING:

     44					;

     45					;	.WORD	NAME		; SECTION NAME

     46					;	.WORD	NAME		; ...

     47					;	.WORD	BASE		; BASE VIRTUAL ADDRESS

     48					;	.WORD	LENGTH		; WINDOW SIZE IN BYTES

     49					;	.WORD	PALLOC		; PHYSICAL ALLOCATION IN 64 BYTE BLOCKS

     50					;

     51					; OUTPUTS:

     52					;

     53					;	KEYWORD PARAMETERS ARE PROCESSED AND VSECT LIST ENTRY

     54					;	IS CONSTRUCTED IF PARAMETERS ARE VALID.

     55					;

     56					; THE CONTENTS OF REGISTERS R0 - R5 ARE PRESERVED

     57					;

VSECT	MACRO M1110  22-AUG-78 02:02  PAGE 2-1





     58					;-

     59

     60	000000				$VSECT::			;

     61	000000					SAVVR			; SAVE THE VOLATILE REGISTERS

     62	000004	020327 	000004 			CMP	R3,#4		; PHYSICAL ALLOCATION SPECIFIED?

     63	000010	103007 				BHIS	10$		; IF HIS YES

     64	000012	005065 	000010 			CLR	10(R5)		; CLEAR ALLOCATION SIZE

     65	000016	020327 	000003 			CMP	R3,#3		; WINDOW SIZE SPECIFIED?

     66	000022	103002 				BHIS	10$		; IF HIS YES

     67	000024	005065 	000006 			CLR	6(R5)		; CLEAR WINDOW SIZE

     68	000030				10$:				;

     69	000030	032767 	000000G	000000G		BIT	#MP$SY,$SWTCH	; MEMORY MANAGEMENT IN EFFECT?

     70	000036	001002 				BNE	15$		; IF NE YES

     71	000040	005065 	000010 			CLR	10(R5)		; IGNORE PHYSICAL ALLOCATION

     72	000044				15$:				;

     73	000044	010500 				MOV	R5,R0		; COPY ADDRESS OF PARAMETER LIST

     74	000046	022020 				CMP	(R0)+,(R0)+	; STEP PAST NAME

     75	000050	012001 				MOV	(R0)+,R1	; GET BASE ADDRESS

     76	000052	001401 				BEQ	20$		; IF EQ AT ZERO

     77	000054	005301 				DEC	R1		; BACK OFF BASE BY ONE

     78	000056				20$:				;

     79	000056	062001 				ADD	(R0)+,R1	; ADD WINDOW SIZE

     80	000060	103456 				BCS	70$		; IF C/S ERROR

     81	000062	010501 				MOV	R5,R1		; GET PARAMETER LIST AGAIN

     82	000064	005741 				TST	-(R1)		; ADJUST POINTER

     83	000066	012704 	000000G			MOV	#$VSCHD,R4	; GET ADDRESS OF LISTHEAD

     84	000072	010400 				MOV	R4,R0		; COPY LISTHEAD ADDRESS

     85	000074					CALL	$SRCHR		; SEARCH LIST FOR PREVIOUS ENTRY

     86	000100	103006 				BCC	40$		; IF C/C IN LIST

     87	000102	012701 	000014 			MOV	#14,R1		; GET SIZE OF ENTRY IN BYTES

     88	000106					CALL	$ALBLK		; ALLOCATE BLOCK

     89	000112	011410 				MOV	(R4),(R0)	; COPY FIRST IN LIST

     90	000114	010014 				MOV	R0,(R4)		; SET NEW FIRST

     91	000116				40$:				;

     92	000116	005720 				TST	(R0)+		; POINT TO SPACE FOR NAME

     93	000120	010501 				MOV	R5,R1		; COPY ADDRESS OF PARAMETER LIST

     94	000122	012702 	000005 			MOV	#5,R2		; GET COUNT OF WORDS TO MOVE

     95	000126				50$:				;

     96	000126	012120 				MOV	(R1)+,(R0)+	; COPY ENTRY

     97	000130					SOB	R2,50$		; ...

     98	000134					CALL	$GTRT		; GET ADDRESS OF ROOT SEGMENT

     99	000140	062700 	000000G			ADD	#S$GCST,R0	; POINT TO CONTROL SECTION TABLE

    100	000144	010501 				MOV	R5,R1		; COPY ADDRESS OF PARAMETER LIST

    101	000146	005741 				TST	-(R1)		; ADJUST ADDRESS

    102	000150					CALL	$SRCH		; SEARCH FOR ENTRY

    103	000154	103417 				BCS	60$		; IF C/S NO ENTRY

    104	000156	132760 	000000G	000000G		BITB	#CS$REL,C$SFLG(R0) ; SECTION RELOCATABLE?

    105	000164	001413 				BEQ	60$		; IF EQ NO

    106	000166					CALL	$WRMPG		; WRITE-MARK PAGE

    107	000172	152760 	000000G	000001G		BISB	#CS$VSC,C$SFLG+1(R0) ; MARK SECTION AS VIRTUAL

    108	000200	016560 	000004 	000000G		MOV	4(R5),C$SBSE(R0) ; SET BASE ADDRESS

    109	000206	016560 	000006 	000000G		MOV	6(R5),C$SLTH(R0) ; SET WINDOW SIZE

    110	000214				60$:				;

    111	000214					RETURN			; EXIT

    112	000216				70$:				;

    113	000216	012703 	000000C			MOV	#<S$V1*400!E$R90>,R3 ; GET ERROR/SEVERITY

    114	000222					CALLR	$P2OPE		; REPORT ALLOCATION ERROR

VSECT	MACRO M1110  22-AUG-78 02:02  PAGE 2-2





    115

    116		000001 				.END

VSECT	MACRO M1110  22-AUG-78 02:02  PAGE 2-3

SYMBOL TABLE



CR    = 000015   	E$R90 = ****** GX	SPA   = 000040   	$GTRT = ****** GX	$SWTCH= ****** GX

CS$REL= ****** GX	FF    = 000014   	S$GCST= ****** GX	$P2OPE= ****** GX	$VSCHD= ****** GX

CS$VSC= ****** GX	HT    = 000011   	S$V1  = ****** GX	$SAVVR= ****** GX	$VSECT  000000RG

C$SBSE= ****** GX	LF    = 000012   	VT    = 000013   	$SRCH = ****** GX	$WRMPG= ****** GX

C$SFLG= ****** GX	MP$SY = ****** GX	$ALBLK= ****** GX	$SRCHR= ****** GX	$$    = 000001

C$SLTH= ****** GX	R$$11M= 000000



. ABS.	000000	   000

      	000226	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  690 WORDS  ( 3 PAGES)

DYNAMIC MEMORY:  2772 WORDS  ( 10 PAGES)

ELAPSED TIME:  00:00:06

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

