Google
 

Trailing-Edge - PDP-10 Archives - BB-H311B-RM - rsx20f-swskit/listings/tkb.lis
There are no other files named tkb.lis in the archive.
MACFLM	MACRO M1108  05-DEC-77 22:48  PAGE 2


      1		000000 			A$$DRM=0
MACFLM	MACRO M1108  05-DEC-77 22:48  PAGE 3


						.IF	DF	A$$DRM
      2
      3						.TITLE	ADRSM
      4
      5
      6						.IFF
      7
      8						.TITLE	ADRST
      9
     10						.ENDC
     11
     12
     13						.IDENT	/06/                                                           ;**NEW**
     14					                                                                                ;**-1
     15					;
     16					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
     17					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
     18					;
     19					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
     20					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     21					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     22					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     23					;
     24					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     25					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     26					; EQUIPMENT CORPORATION.
     27					;
     28					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     29					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     30					;
     31					; VERSION 06                                                                   ;**NEW**
     32					;                                                                               ;**-1
     33					; D. N. CUTLER/C. MONIA 27-JAN-74
     34					;
     35					; MODIFICATIONS
     36					;
     37					; NO.		DATE		PROGRAMMER
     38					; ---		----		----------
     39					;
     40					; 021		11-JAN-74	C. MONIA
     41					;
     42					;+
     43					; **-$ADRSM-ADDRESS LIMITS SETUP
     44					; **-$ADRST-ADDRESS LIMITS SETUP AND TASK IMAGE BUFFER FLUSHED
     45					;
     46					; THIS ROUTINE IS CALLED TO SET UP THE ADDRESS LIMITS FOR A SEGMENT.
     47					; IF THE SPECIFIED SEGMENT IS THE SAME AS THE CURRENT SEGMENT THAT IS
     48					; IS BEING WRITTEN, THEN AN IMMEDIATE RETURN IS EXECUTED. ELSE THE
     49					; CURRENT OUTPUT BUFFER IS FLUSHED AND THE NEW ADDRESS LIMITS ARE ES-
     50					; TABLISHED.
     51					;
     52					; INPUTS:
     53					;
     54					;	R0=VIRTUAL ADDRESS OF SEGMENT DESCRIPTOR
     55					;
     56					; OUTPUTS:
     57					;
ADRSM	MACRO M1108  05-DEC-77 22:48  PAGE 3-1


     58					;	THE ADDRESS LIMITS FOR THE SPECIFIED SEGMENT ARE ESTABLISHED.
     59					;-
     60
     61
     62						.IF	NDF	A$$DRM
     63
     64					$ADRST::			;
     65						CMP	R0,$WRSEG	; IS SPECIFIED SEGMENT SAME AS CURRENT?
     66						BEQ	50$		;IF EQ YES
     67						MOV	R0,-(SP)	;SAVE SEGMENT ADDRESS
     68						CALL	$FLUSH		;FLUSH CURRENT OUTPUT BUFFER
     69						MOV	(SP)+,R1	; RETRIEVE VIRTUAL SEGMENT ADDRESS
     70
     71					 	.IFF
     72
     73	000000				$ADRSM::			;
     74	000000	010001 				MOV	R0,R1		; COPY VIRTUAL SEGMENT DESCRIPTOR
     75
     76						.ENDC
     77
     78	000002					CALL	$CVRL		; CONVERT TO REAL ADDRESS
     79	000006	010002 				MOV	R0,R2		; SAVE REAL ADDRESS
     80	000010	016200 	000000G			MOV	S$GLDA(R2),R0	; GET VIRTUAL STARTING ADDRESS
     81					                                                                                ;**NEW**
     82						.IF	DF	R$$11M                                                  ;**NEW**
     83					                                                                                ;**NEW**
     84	000014	005067 	000000G			CLR	$LOWRW		; SET LOW R/W MEMORY LIMIT                      ;**NEW**
     85					                                                                                ;**NEW**
     86						.ENDC                                                                   ;**NEW**
     87					                                                                                ;**NEW**
     88	000020	005762 	000000G			TST	S$GDWN(R2)	; ROOT SEGMENT?
     89	000024	001043 				BNE	15$		; IF NE NO
     90	000026	020167 	000000G			CMP	R1,$RTSEG	; RESIDENT ROOT?
     91	000032	001040 				BNE	15$		; IF NE NO
     92	000034	005000 				CLR	R0		;++021 CLEAR RELOCATION BIAS
     93					                                                                                ;**NEW**
     94						.IF	DF	R$$11M                                                  ;**NEW**
     95					                                                                                ;**NEW**
     96	000036	016767 	000000G	000000G		MOV	$HDSIZ,$LOWRW	; SET LOW R/W LIMIT TO EXCLUDE HEADER           ;**NEW**
     97					                                                                                ;**NEW**
     98						.ENDC                                                                   ;**NEW**
     99					                                                                                ;**NEW**
    100						.IIF  NDF  R$$11M, MOV	$HDSIZ,$HDOFF	; SET HEADER OFFSET BIAS
    101	000044	005762 	000000G			TST	S$GRO(R2)	;ANY RO AREA?
    102	000050	001431 				BEQ	20$		;IF EQ NO
    103	000052	016700 	000000G			MOV	$OFFST,R0	;GET OFFSET BIAS
    104	000056	010067 	000000G			MOV	R0,$BEGRW	;SET BEGINNING OF RW AREA
    105	000062	066200 	000000G			ADD	S$GRW(R2),R0	;ADD LENGTH OF RW AREA                          ;**-1
    106						.IIF NDF    R$$11M, SUB	$HDSIZ,R0	; SUBTRACT HEADER SIZE
    107	000066	010067 	000000G			MOV	R0,$ENDRW	;SET END OF RW AREA + 1
    108	000072	005367 	000000G			DEC	$ENDRW		;BACK OFF TO REAL END
    109
    110						.IF	NDF	R$$11M
    111
    112						SUB	$OFFST,R0	;SUBTRACT OUT OFFSET BIAS
    113						ADD	#17777,R0	;ROUND TO NEXT 4K
    114						BIC	#17777,R0	;CLEAR EXCESS BITS
ADRSM	MACRO M1108  05-DEC-77 22:48  PAGE 3-2


    115						ADD	$OFFST,R0	;ADD OFFSET BIAS BACK IN
    116
    117						.ENDC
    118
    119	000076	010067 	000000G			MOV	R0,$BEGRO	;SET BEGINNING OF RO AREA
    120	000102	016267 	000000G	000000G		MOV	S$GRO(R2),$ENDRO;GET LENGTH OF RO AREA
    121	000110	005300 				DEC	R0		;BACK OFF BEGINNING ADDRESS BY ONE
    122	000112	060067 	000000G			ADD	R0,$ENDRO	;CALCULATE END OF RO AREA
    123
    124						.IF	NDF	R$$11M
    125
    126						SUB	$ENDRW,R0	; CALCULATE RO ADDRESS BIAS
    127						BIC	#77,R0		; ROUND TO 32 W BOUNDARY
    128						MOV	R0,$BIAS	; SET RO ADDRESS BIAS
    129
    130						.ENDC
    131
    132	000116	026767 	000000G	000000G		CMP	$BEGRO,$BEGRW	;BEGINNING ADDRESSES MATCH?
    133	000124	001023 				BNE	40$		;IF NE NO
    134	000126	005267 	000000G			INC	$ENDRW		;INCREMENT END OF RW AREA
    135	000132	000420 				BR	40$		;
    136	000134				15$:				;++021
    137						.IIF  NDF  R$$11M, CLR	$HDOFF		; CLEAR HEADER OFFSET BIAS
    138	000134	066700 	000000G		20$:	ADD	$OFFST,R0	;ADD IN OFFSET BIAS
    139	000140	010067 	000000G			MOV	R0,$BEGRO	;SET BEGINNING OF RO AREA
    140	000144	010067 	000000G			MOV	R0,$BEGRW	;SET BEGINNING OF RW AREA
    141	000150	066200 	000000G			ADD	S$GRW(R2),R0	;CALCULATE END OF AREA
    142						.IIF  NDF  R$$11M, SUB	$HDOFF,R0	; SUBTRACT OUT HEADER BIAS
    143	000154	020067 	000000G			CMP	R0,$BEGRO	;ANY LENGTH?
    144	000160	001401 				BEQ	30$		;IF EQ NO
    145	000162	005300 				DEC	R0		;BACK OFF TO REAL END
    146	000164	010067 	000000G		30$:	MOV	R0,$ENDRO	;SET END OF RO AREA
    147	000170	010067 	000000G			MOV	R0,$ENDRW	;SET END OF RW AREA
    148						.IIF  NDF  R$$11M, CLR	$BIAS		; CLEAR RO ADDRESS BIAS
    149	000174	016267 	000000G	000000G	40$:	MOV	S$GBLK(R2),$RLBLK;SET STARTING BLOCK NUMBER
    150					                                                                                ;**NEW**
    151						.IF	DF	R$$11M                                                  ;**NEW**
    152					                                                                                ;**NEW**
    153	000202	066767 	000000G	000000G		ADD	$BEGRW,$LOWRW	; OFFSET LOW R/W LIMIT                          ;**NEW**
    154					                                                                                ;**NEW**
    155						.ENDC                                                                   ;**NEW**
    156					                                                                                ;**NEW**
    157	000210				50$:	RETURN			;
    158
    159		000001 				.END
ADRSM	MACRO M1108  05-DEC-77 22:48  PAGE 3-3
SYMBOL TABLE

A$$DRM= 000000   	R$$11M= 000000   	S$GRO = ****** GX	$BEGRW= ****** GX	$LOWRW= ****** GX
CR    = 000015   	SPA   = 000040   	S$GRW = ****** GX	$CVRL = ****** GX	$OFFST= ****** GX
FF    = 000014   	S$GBLK= ****** GX	VT    = 000013   	$ENDRO= ****** GX	$RLBLK= ****** GX
HT    = 000011   	S$GDWN= ****** GX	$ADRSM  000000RG 	$ENDRW= ****** GX	$RTSEG= ****** GX
LF    = 000012   	S$GLDA= ****** GX	$BEGRO= ****** GX	$HDSIZ= ****** GX	$$    = 000001

. ABS.	000000	   000
      	000212	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  632 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:09
[44,10]ADRSM,[44,20]ADRSM/-SP=[44,30]MACFLM.,ADRSM.,ADRST.006
MACFLM	MACRO M1108  05-DEC-77 22:48  PAGE 2


      1						.IF	DF	A$$DRM
      2
      3						.TITLE	ADRSM
      4
      5
      6						.IFF
      7
      8						.TITLE	ADRST
      9
     10						.ENDC
     11
     12
     13						.IDENT	/06/                                                           ;**NEW**
     14					                                                                                ;**-1
     15					;
     16					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
     17					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
     18					;
     19					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
     20					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     21					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     22					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     23					;
     24					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     25					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     26					; EQUIPMENT CORPORATION.
     27					;
     28					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     29					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     30					;
     31					; VERSION 06                                                                   ;**NEW**
     32					;                                                                               ;**-1
     33					; D. N. CUTLER/C. MONIA 27-JAN-74
     34					;
     35					; MODIFICATIONS
     36					;
     37					; NO.		DATE		PROGRAMMER
     38					; ---		----		----------
     39					;
     40					; 021		11-JAN-74	C. MONIA
     41					;
     42					;+
     43					; **-$ADRSM-ADDRESS LIMITS SETUP
     44					; **-$ADRST-ADDRESS LIMITS SETUP AND TASK IMAGE BUFFER FLUSHED
     45					;
     46					; THIS ROUTINE IS CALLED TO SET UP THE ADDRESS LIMITS FOR A SEGMENT.
     47					; IF THE SPECIFIED SEGMENT IS THE SAME AS THE CURRENT SEGMENT THAT IS
     48					; IS BEING WRITTEN, THEN AN IMMEDIATE RETURN IS EXECUTED. ELSE THE
     49					; CURRENT OUTPUT BUFFER IS FLUSHED AND THE NEW ADDRESS LIMITS ARE ES-
     50					; TABLISHED.
     51					;
     52					; INPUTS:
     53					;
     54					;	R0=VIRTUAL ADDRESS OF SEGMENT DESCRIPTOR
     55					;
     56					; OUTPUTS:
     57					;
ADRST	MACRO M1108  05-DEC-77 22:48  PAGE 2-1


     58					;	THE ADDRESS LIMITS FOR THE SPECIFIED SEGMENT ARE ESTABLISHED.
     59					;-
     60
     61
     62						.IF	NDF	A$$DRM
     63
     64	000000				$ADRST::			;
     65	000000	020067 	000000G			CMP	R0,$WRSEG	; IS SPECIFIED SEGMENT SAME AS CURRENT?
     66	000004	001507 				BEQ	50$		;IF EQ YES
     67	000006	010046 				MOV	R0,-(SP)	;SAVE SEGMENT ADDRESS
     68	000010					CALL	$FLUSH		;FLUSH CURRENT OUTPUT BUFFER
     69	000014	012601 				MOV	(SP)+,R1	; RETRIEVE VIRTUAL SEGMENT ADDRESS
     70
     71					 	.IFF
     72
     73					$ADRSM::			;
     74						MOV	R0,R1		; COPY VIRTUAL SEGMENT DESCRIPTOR
     75
     76						.ENDC
     77
     78	000016					CALL	$CVRL		; CONVERT TO REAL ADDRESS
     79	000022	010002 				MOV	R0,R2		; SAVE REAL ADDRESS
     80	000024	016200 	000000G			MOV	S$GLDA(R2),R0	; GET VIRTUAL STARTING ADDRESS
     81					                                                                                ;**NEW**
     82						.IF	DF	R$$11M                                                  ;**NEW**
     83					                                                                                ;**NEW**
     84	000030	005067 	000000G			CLR	$LOWRW		; SET LOW R/W MEMORY LIMIT                      ;**NEW**
     85					                                                                                ;**NEW**
     86						.ENDC                                                                   ;**NEW**
     87					                                                                                ;**NEW**
     88	000034	005762 	000000G			TST	S$GDWN(R2)	; ROOT SEGMENT?
     89	000040	001043 				BNE	15$		; IF NE NO
     90	000042	020167 	000000G			CMP	R1,$RTSEG	; RESIDENT ROOT?
     91	000046	001040 				BNE	15$		; IF NE NO
     92	000050	005000 				CLR	R0		;++021 CLEAR RELOCATION BIAS
     93					                                                                                ;**NEW**
     94						.IF	DF	R$$11M                                                  ;**NEW**
     95					                                                                                ;**NEW**
     96	000052	016767 	000000G	000000G		MOV	$HDSIZ,$LOWRW	; SET LOW R/W LIMIT TO EXCLUDE HEADER           ;**NEW**
     97					                                                                                ;**NEW**
     98						.ENDC                                                                   ;**NEW**
     99					                                                                                ;**NEW**
    100						.IIF  NDF  R$$11M, MOV	$HDSIZ,$HDOFF	; SET HEADER OFFSET BIAS
    101	000060	005762 	000000G			TST	S$GRO(R2)	;ANY RO AREA?
    102	000064	001431 				BEQ	20$		;IF EQ NO
    103	000066	016700 	000000G			MOV	$OFFST,R0	;GET OFFSET BIAS
    104	000072	010067 	000000G			MOV	R0,$BEGRW	;SET BEGINNING OF RW AREA
    105	000076	066200 	000000G			ADD	S$GRW(R2),R0	;ADD LENGTH OF RW AREA                          ;**-1
    106						.IIF NDF    R$$11M, SUB	$HDSIZ,R0	; SUBTRACT HEADER SIZE
    107	000102	010067 	000000G			MOV	R0,$ENDRW	;SET END OF RW AREA + 1
    108	000106	005367 	000000G			DEC	$ENDRW		;BACK OFF TO REAL END
    109
    110						.IF	NDF	R$$11M
    111
    112						SUB	$OFFST,R0	;SUBTRACT OUT OFFSET BIAS
    113						ADD	#17777,R0	;ROUND TO NEXT 4K
    114						BIC	#17777,R0	;CLEAR EXCESS BITS
ADRST	MACRO M1108  05-DEC-77 22:48  PAGE 2-2


    115						ADD	$OFFST,R0	;ADD OFFSET BIAS BACK IN
    116
    117						.ENDC
    118
    119	000112	010067 	000000G			MOV	R0,$BEGRO	;SET BEGINNING OF RO AREA
    120	000116	016267 	000000G	000000G		MOV	S$GRO(R2),$ENDRO;GET LENGTH OF RO AREA
    121	000124	005300 				DEC	R0		;BACK OFF BEGINNING ADDRESS BY ONE
    122	000126	060067 	000000G			ADD	R0,$ENDRO	;CALCULATE END OF RO AREA
    123
    124						.IF	NDF	R$$11M
    125
    126						SUB	$ENDRW,R0	; CALCULATE RO ADDRESS BIAS
    127						BIC	#77,R0		; ROUND TO 32 W BOUNDARY
    128						MOV	R0,$BIAS	; SET RO ADDRESS BIAS
    129
    130						.ENDC
    131
    132	000132	026767 	000000G	000000G		CMP	$BEGRO,$BEGRW	;BEGINNING ADDRESSES MATCH?
    133	000140	001023 				BNE	40$		;IF NE NO
    134	000142	005267 	000000G			INC	$ENDRW		;INCREMENT END OF RW AREA
    135	000146	000420 				BR	40$		;
    136	000150				15$:				;++021
    137						.IIF  NDF  R$$11M, CLR	$HDOFF		; CLEAR HEADER OFFSET BIAS
    138	000150	066700 	000000G		20$:	ADD	$OFFST,R0	;ADD IN OFFSET BIAS
    139	000154	010067 	000000G			MOV	R0,$BEGRO	;SET BEGINNING OF RO AREA
    140	000160	010067 	000000G			MOV	R0,$BEGRW	;SET BEGINNING OF RW AREA
    141	000164	066200 	000000G			ADD	S$GRW(R2),R0	;CALCULATE END OF AREA
    142						.IIF  NDF  R$$11M, SUB	$HDOFF,R0	; SUBTRACT OUT HEADER BIAS
    143	000170	020067 	000000G			CMP	R0,$BEGRO	;ANY LENGTH?
    144	000174	001401 				BEQ	30$		;IF EQ NO
    145	000176	005300 				DEC	R0		;BACK OFF TO REAL END
    146	000200	010067 	000000G		30$:	MOV	R0,$ENDRO	;SET END OF RO AREA
    147	000204	010067 	000000G			MOV	R0,$ENDRW	;SET END OF RW AREA
    148						.IIF  NDF  R$$11M, CLR	$BIAS		; CLEAR RO ADDRESS BIAS
    149	000210	016267 	000000G	000000G	40$:	MOV	S$GBLK(R2),$RLBLK;SET STARTING BLOCK NUMBER
    150					                                                                                ;**NEW**
    151						.IF	DF	R$$11M                                                  ;**NEW**
    152					                                                                                ;**NEW**
    153	000216	066767 	000000G	000000G		ADD	$BEGRW,$LOWRW	; OFFSET LOW R/W LIMIT                          ;**NEW**
    154					                                                                                ;**NEW**
    155						.ENDC                                                                   ;**NEW**
    156					                                                                                ;**NEW**
    157	000224				50$:	RETURN			;
    158
    159		000001 				.END
ADRST	MACRO M1108  05-DEC-77 22:48  PAGE 2-3
SYMBOL TABLE

CR    = 000015   	S$GBLK= ****** GX	VT    = 000013   	$ENDRO= ****** GX	$OFFST= ****** GX
FF    = 000014   	S$GDWN= ****** GX	$ADRST  000000RG 	$ENDRW= ****** GX	$RLBLK= ****** GX
HT    = 000011   	S$GLDA= ****** GX	$BEGRO= ****** GX	$FLUSH= ****** GX	$RTSEG= ****** GX
LF    = 000012   	S$GRO = ****** GX	$BEGRW= ****** GX	$HDSIZ= ****** GX	$WRSEG= ****** GX
R$$11M= 000000   	S$GRW = ****** GX	$CVRL = ****** GX	$LOWRW= ****** GX	$$    = 000001
SPA   = 000040

. ABS.	000000	   000
      	000226	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  637 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:08
[44,10]ADRST,[44,20]ADRST/-SP=[44,30]MACFLM.,ADRST.006
ALALO	MACRO M1108  05-DEC-77 22:48  PAGE 2


      1						.TITLE	ALALO
      2						.IDENT	/06/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1975,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.               ;**NEW**
      6					;                                                                               ;**-1
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     17					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 05                                                                    ;**NEW**
     20					;                                                                               ;**-1
     21					; D. N. CUTLER/C. MONIA 17-MAR-74
     22					;                                                                               ;**NEW**
     23					; MODIFICATIONS:                                                                ;**NEW**
     24					;                                                                               ;**NEW**
     25					; NO.		DATE		PROGRAMMER                                      ;**NEW**
     26					; ---		----		----------                                      ;**NEW**
     27					;                                                                               ;**NEW**
     28					; 036		16-JAN-75	C. MONIA                                        ;**NEW**
     29					;                                                                               ;**NEW**
     30					; AUTOLOAD VECTOR ALLOCATION                                                    ;**NEW**
     31					;                                                                               ;**NEW**
     32					;
     33					;+
     34					; **-$ALALO-AUTOLOAD VECTOR ALLOCATION
     35					;
     36					; THIS ROUTINE IS CALLED IN PHASE 4 TO ASSIGN ABSOLUTE ADDRESSES
     37					; TO ALL AUTOLOAD VECTORS.
     38					;
     39					; INPUTS:
     40					;
     41					;	NONE.
     42					;
     43					; OUTPUTS:
     44					;
     45					;	ALL AUTOLOAD VECTORS ARE ASSIGNED ABSOLUTE ADDRESSES.
     46					;-
     47
     48	000000	022767 	000001 	000000G	$ALALO::CMP	#1,$NUMSG	;ONLY ONE SEGMENT?
     49	000006	001404 				BEQ	10$		;IF EQ YES
     50	000010	012700 	000022'			MOV	#ALALO,R0	;GET PHASE CONTROL ROUTINE ADDRESS
     51	000014					CALL	$PCTRL		;CALL PHASE CONTROL ROUTINE
     52	000020				10$:	RETURN			;
     53
     54					;
     55					; AUTOLOAD VECTOR ALLOCATION
     56					;
     57					; THIS ROUTINE IS CALLED FOR EACH SEGMENT IN THE ALLOCATION.
ALALO	MACRO M1108  05-DEC-77 22:48  PAGE 2-1


     58					;
     59
     60	000022				ALALO:	SAVRG			;SAVE NONVOLITILE REGISTERS
     61	000026	016705 	000000G			MOV	$CRSEG,R5	;GET ADDRESS OF CURRENT SEGMENT
     62	000032	016500 	000000G			MOV	S$GRWB(R5),R0	;GET VIRTUAL ADDRESS OF RW BASE
     63	000036	026767 	000000G	000000G		CMP	$CRVSG,$RTSEG	; ROOT SEGMENT?
     64	000044	001015 				BNE	10$		;IF NE NO
     65	000046	010002 				MOV	R0,R2		;SAVE VIRTUAL ADDRESS
     66	000050	016700 	000000G			MOV	$NUMSG,R0	;GET NUMBER OF SEGMENTS
     67	000054	016701 	000000G			MOV	$SZSEG,R1	; GET SIZE OF RESIDENT SEGMENT DESCRIPTOR
     68
     69
     70						.IF	NDF	V1145
     71
     72	000060					CALL	$MUL		;
     73
     74						.ENDC
     75
     76
     77						.IF	DF	V1145
     78
     79						MUL	R1,R0		;
     80
     81						.ENDC
     82
     83
     84	000064	010100 				MOV	R1,R0		;RESULT TO R0
     85	000066	062700 	000002 			ADD	#2,R0		; INCLUDE TERMINAL ZERO WORD
     86	000072	060200 				ADD	R2,R0		;ADD BASE VIRTUAL ADDRESS
     87	000074	103001 				BCC	10$		;IF CC OKAY
     88	000076	010200 				MOV	R2,R0		;SET TO ORIGINAL BASE
     89	000100	062705 	000000G		10$:	ADD	#S$GATL,R5	;POINT TO AUTOLOAD LIST HEAD
     90	000104	005046 				CLR	-(SP)		; ALLOCATE SPACE FOR BASE VIRTUAL ADDRESS
     91	000106	010046 				MOV	R0,-(SP)	; SAVE CURRENT VIRTUAL ADDRESS
     92	000110	011505 			20$:	MOV	(R5),R5		;GET ADDRESS OF NEXT IN LIST
     93	000112	001002 				BNE	30$		;IF NE GOT ONE
     94	000114	022626 				CMP	(SP)+,(SP)+	; CLEAN STACK
     95	000116					RETURN			;
     96	000120				30$:				;
     97	000120	016501 	000002 			MOV	2(R5),R1	; GET VIRTUAL ADDRESS OF INDIRECT SYMBOL
     98	000124					CALL	$CVRL		; CONVERT TO REAL ADDRESS
     99	000130					CALL	$WRMPG		; WRITE MARK PAGE
    100	000134	016003 	000000G			MOV	S$YVAL(R0),R3	; GET VIRTUAL ADDRESS OF REAL SYMBOL
    101	000140	152760 	000000C	000000G		BISB	#<SY$REL!SY$ATR>,S$YFLG(R0) ;++036 SET REL., AUTOLOAD REF. FLAGS;**NEW**
    102	000146	142760 	000000G	000000G		BICB	#SY$IND,S$YFLG(R0) ; CLEAR INDIRECT FLAG                        ;**-1
    103	000154	011660 	000000G			MOV	(SP),S$YVAL(R0)	; SET AUTOLOAD VECTOR ADDRESS
    104	000160	010365 	000002 			MOV	R3,2(R5)	; SET AUTOLOAD LIST ENTRY TO REAL SYMBOL
    105	000164	011666 	000002 			MOV	(SP),2(SP)	; TASK-VIRTUAL ADDRESS TO 2(SP)
    106	000170	062766 	000000G	000002 		ADD	#S$ZATL,2(SP)	; ADD SIZE OF AUTOLOAD VECTOR
    107	000176	103002 				BCC	40$		; IF CC OK
    108	000200	011666 	000002 			MOV	(SP),2(SP)	; SET TO SAME ADDRESS
    109	000204				40$:				;
    110	000204	016616 	000002 			MOV	2(SP),(SP)	; SET TASK VIRTUAL ADDRESS OF NEXT VECTOR
    111	000210	000737 				BR	20$		; GO AGAIN
    112
    113		000001 				.END
ALALO	MACRO M1108  05-DEC-77 22:48  PAGE 2-2
SYMBOL TABLE

ALALO   000022R  	SPA   = 000040   	S$YFLG= ****** GX	$CRVSG= ****** GX	$RTSEG= ****** GX
CR    = 000015   	SY$ATR= ****** GX	S$YVAL= ****** GX	$CVRL = ****** GX	$SAVRG= ****** GX
FF    = 000014   	SY$IND= ****** GX	S$ZATL= ****** GX	$MUL  = ****** GX	$SZSEG= ****** GX
HT    = 000011   	SY$REL= ****** GX	VT    = 000013   	$NUMSG= ****** GX	$WRMPG= ****** GX
LF    = 000012   	S$GATL= ****** GX	$ALALO  000000RG 	$PCTRL= ****** GX	$$    = 000001
R$$11M= 000000   	S$GRWB= ****** GX	$CRSEG= ****** GX

. ABS.	000000	   000
      	000212	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  672 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:07
[44,10]ALALO,[44,20]ALALO/-SP=[44,30]MACFLM.,ALALO.006
ALBLK	MACRO M1108  05-DEC-77 22:49  PAGE 2


      1						.TITLE	ALBLK
      2						.IDENT	/03/                                                           ;**NEW**
      3					                                                                                ;**NEW**
      4					;                                                                               ;**NEW**
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.               ;**NEW**
      6					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.               ;**NEW**
      7					;                                                                               ;**NEW**
      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE               ;**NEW**
      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION                ;**NEW**
     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT                ;**NEW**
     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.                               ;**NEW**
     12					;                                                                               ;**NEW**
     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT                ;**NEW**
     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL                ;**NEW**
     15					; EQUIPMENT CORPORATION.                                                        ;**NEW**
     16					;                                                                               ;**NEW**
     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY                ;**NEW**
     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.                 ;**NEW**
     19					;                                                                               ;**NEW**
     20					; VERSION 03                                                                   ;**NEW**
     21					;                                                                               ;**NEW**
     22					; D. N. CUTLER/C. MONIA 04-MAR-74                                               ;**NEW**
     23					;+                                                                              ;**-13
     24					; **-$ALBLK-ALLOCATE BLOCK
     25					;
     26					; THIS ROUTINE IS CALLED TO ALLOCATE A BLOCK OF STORAGE FROM THE FREE
     27					; STORAGE POOL. IF THE BLOCK CANNOT BE ALLOCATED, THEN A FATAL ERROR
     28					; MESSAGE IS ISSUED. ELSE THE BLOCK IS ALLOCATED AND ZEROED AND THE
     29					; ADDRESS IS RETURNED TO THE CALLER.
     30					;
     31					; INPUTS:
     32					;
     33					;	R1=SIZE OF BLOCK TO ALLOCATE IN BYTES.
     34					;
     35					; OUTPUTS:
     36					;
     37					;	R0=ADDRESS OF ALLOCATED BLOCK.
     38					;-
     39
     40	000000				$ALBLK::			;                                               ;**NEW**
     41	000000	010146 				MOV	R1,-(SP)	;SAVE SIZE OF BLOCK                             ;**-1
     42	000002					CALL	$GTCOR		; REQUEST A BLOCK OF STORAGE                    ;**NEW**
     43	000006	103006 				BCC	10$		;IF CC GOT IT                                   ;**-1
     44	000010	012702 	000000G			MOV	#$FRHD,R2	;GET ADDRESS OF FREE POOL HEADER
     45	000014	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
     46	000016	   000G	   000G			.BYTE	E$R4,S$V2	;
     47	000020					CALL	$ERMSG		;ISSUE FATAL ERROR (NO RETURN)
     48	000024	012601 			10$:	MOV	(SP)+,R1	;RETRIEVE SIZE OF BLOCK
     49	000026	062701 	000003 			ADD	#3,R1		;ROUND TO NEXT 2 WORD BOUNDRY
     50	000032	042701 	000003 			BIC	#3,R1		;CLEAR EXECSS BITS
     51	000036	006201 				ASR	R1		;CONVERT TO WORDS
     52	000040	010002 				MOV	R0,R2		;COPY ADDRESS OF BLOCK
     53	000042	005022 			20$:	CLR	(R2)+		;CLEAR BLOCK
     54	000044					SOB	R1,20$		;REPEAT
     55	000050					RETURN			;
     56
     57		000001 				.END
ALBLK	MACRO M1108  05-DEC-77 22:49  PAGE 2-1
SYMBOL TABLE

CR    = 000015   	HT    = 000011   	SPA   = 000040   	$ALBLK  000000RG 	$GTCOR= ****** GX
E$R4  = ****** GX	LF    = 000012   	S$V2  = ****** GX	$ERMSG= ****** GX	$$    = 000001
FF    = 000014   	R$$11M= 000000   	VT    = 000013   	$FRHD = ****** GX

. ABS.	000000	   000
      	000052	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  557 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:05
[44,10]ALBLK,[44,20]ALBLK/-SP=[44,30]MACFLM.,ALBLK.003
ALELD	MACRO M1108  05-DEC-77 22:49  PAGE 3


      1						.TITLE	ALELD
      2						.IDENT	/05/                                                           ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					;
      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     12					;
     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     15					; EQUIPMENT CORPORATION.
     16					;
     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     19					;
     20					; VERSION 05                                                                   ;**NEW**
     21					;                                                                               ;**-1
     22					; D. N. CUTLER/C. MONIA 03-FEB-74
     23					;+
     24					; **-$ALELD-ALLOCATE ELEMENT DESCRIPTOR
     25					; **-$ALELO-ALLOCATE ELEMENT DESCRIPTOR FOR OUTPUT FILE                         ;**NEW**
     26					; **-$ALEL1-ALLOCATE ELEMENT DESCRIPTOR WITH ADDITIONAL WORD                    ;**-1
     27					;
     28					; THIS ROUTINE IS CALLED TO ALLOCATE AND INITIALIZE AN ELEMENT DE-
     29					; SCRIPTOR. IT IS A MONITOR DEPENDENT ROUTINE SINCE IT MUST KNOW
     30					; THE FORMAT OF THE NAME STRING. THE DESCRIPTOR STORAGE IS ALLOCATED
     31					; AND THE NAME STRING INFORMATION IS TAKEN FROM THE $INPPT RECORD
     32					; BLOCK.
     33					;
     34					; INPUTS:
     35					;
     36					;	$INIPT RECORD BLOCK                                                     ;**NEW**
     37					;                                                                               ;**-1
     38					; OUTPUTS:
     39					;
     40					;	AN ELEMENT DESCRIPTOR IS ALLOCATED AND INITIALIZED.
     41					;		R0=REAL ADDRESS OF ELEMENT DESCRIPTOR                           ;**NEW**
     42					;		R1=VIRTUAL ADDRESS OF ELEMENT DESCRIPTOR                        ;**NEW**
     43					;                                                                               ;**-1
     44					;	IF $ALELO IS CALLED THEN THE DIRECTORY I/D                              ;**NEW**
     45					;	IS SAVED INSTEAD OF THE FILE ID (IE. A PREVIOUS                         ;**-1
     46					;	CALL TO .PARSE IS ASSUMED) AND E$LNUM IS SET TO -2.                     ;**NEW**
     47					;-                                                                              ;**-1
     48
     49	000000	012701 	000002G		$ALEL1::MOV	#E$LLGH+2,R1	;GET LENGTH OF DESCRIPTOR PLUS 2
     50	000004	000402 				BR	ALELD1		;
     51	000006	012701 	000000G		$ALELD::MOV	#E$LLGH,R1	;GET LENGTH OF ELEMENT DESCRIPTOR
     52	000012				ALELD1:				;
     53	000012					CALL	ALEL		; ALLOCATE DESCRIPTOR AND SETUP FILENAME
     54	000016	062701 	000000 			ADD	#N.FID,R1	; POINT TO FILE I/D
     55	000022	000410 				BR	ALELO1		; SETUP I/D
     56	000024				$ALELO::			;
     57	000024	012701 	000000G			MOV	#E$LLGH,R1	; SETUP DESCRIPTOR LENGTH
ALELD	MACRO M1108  05-DEC-77 22:49  PAGE 3-1


     58	000030					CALL	ALEL		; ALLOCATE DESCRIPTOR AND SETUP FILENAME
     59	000034	005360 	000000G			DEC	E$LNUM(R0)	; SET HIGHEST SECTION NUMBER TO -2              ;**NEW**
     60	000040	062701 	000024 			ADD	#N.DID,R1	; POINT TO DIRECTORY I/D                        ;**-1
     61	000044				ALELO1:				;
     62	000044	012122 				MOV	(R1)+,(R2)+	; STORE I/D
     63	000046	012122 				MOV	(R1)+,(R2)+	;
     64	000050	012122 				MOV	(R1)+,(R2)+	;
     65	000052					RETURN			;
     66
     67					;
     68					; SETUP ELEMENT DESCRIPTOR (LESS I/D).
     69					; LEAVE R2 POINTING TO SPACE FOR I/D.
     70					;
     71
     72	000054				ALEL:				;
     73	000054					CALL	$ALVRT		; ALLOCATE VIRTUAL MEMORY                       ;**NEW**
     74	000060	011646 				MOV	(SP),-(SP)	; COPY RETURN ADDRESS                           ;**NEW**
     75	000062	010166 	000002 			MOV	R1,2(SP)	; SAVE VIRTUAL ADDRESS                          ;**NEW**
     76	000066	016701 	000000G			MOV	$INIPT,R1	; GET INPUT FILE RECORD BLOCK                   ;**-1
     77	000072	005360 	000000G			DEC	E$LNUM(R0)	;SET HIGHEST SECTION NUM TO -1
     78	000076	016160 	000000G	000000G		MOV	R$SWTH(R1),E$LSWT(R0);STORE SWITCH WORD
     79	000104	062701 	000102 			ADD	#F.FNB,R1	;POINT TO FILE NAME BLOCK
     80	000110	010002 				MOV	R0,R2		;COPY ADDR OF ELEMENT BLOCK
     81	000112	062702 	000000G			ADD	#E$LMND,R2	;CALCULATE ADDR MONITOR INFO
     82	000116	016122 	000034 			MOV	N.UNIT(R1),(R2)+;STORE UNIT NUMBER
     83	000122	016122 	000032 			MOV	N.DVNM(R1),(R2)+;STORE DEVICE NAME
     84	000126	016122 	000006 			MOV	N.FNAM(R1),(R2)+;STORE FILE NAME
     85	000132	016122 	000010 			MOV	N.FNAM+2(R1),(R2)+;
     86	000136	016122 	000012 			MOV	N.FNAM+4(R1),(R2)+;
     87	000142	016122 	000014 			MOV	N.FTYP(R1),(R2)+;STORE FILE TYPE
     88	000146	016122 	000016 			MOV	N.FVER(R1),(R2)+;STORE FILE VERSION
     89	000152					CALL	@(SP)+		; CALL THE CALLER                               ;**NEW**
     90	000154	012601 				MOV	(SP)+,R1	; RESTORE VIRTUAL ADDRESS                       ;**NEW**
     91	000156					RETURN			;
     92
     93		000001 				.END
ALELD	MACRO M1108  05-DEC-77 22:49  PAGE 3-2
SYMBOL TABLE

ALEL    000054R  	FD.PLC= 000004   	F.DFNB= 000046   	F.RTYP= 000000   	N.STAT= 000020
ALELD1  000012R  	FD.RAH= 000001   	F.DSPT= 000044   	F.STBK= 000036   	N.UNIT= 000034
ALELO1  000044R  	FD.RAN= 000002   	F.DVNM= 000134   	F.UNIT= 000136   	R$SWTH= ****** GX
B.BBFS= 000010   	FD.REC= 000001   	F.EFBK= 000010   	F.URBD= 000020   	R$$11M= 000000
B.BFST= 000015   	FD.RWM= 000001   	F.EFN = 000050   	F.VBN = 000064   	R.FIX = 000001
B.NXBD= 000012   	FD.SDI= 000020   	F.EOBB= 000032   	F.VBSZ= 000060   	R.VAR = 000002
B.VBN = 000004   	FD.SQD= 000040   	F.ERR = 000052   	HT    = 000011   	SPA   = 000040
CR    = 000015   	FD.TTY= 000004   	F.FACC= 000043   	LF    = 000012   	S.BFHD= 000020
E$LLGH= ****** GX	FD.WBH= 000002   	F.FFBY= 000014   	NB.DEV= 000200   	S.FATT= 000016
E$LMND= ****** GX	FF    = 000014   	F.FNAM= 000110   	NB.DIR= 000100   	S.FDB = 000140
E$LNUM= ****** GX	FO.APD= 000106   	F.FNB = 000102   	NB.NAM= 000004   	S.FNAM= 000006
E$LSWT= ****** GX	FO.MFY= 000002   	F.FTYP= 000116   	NB.SD1= 000400   	S.FNB = 000036
FA.APD= 000100   	FO.RD = 000001   	F.FVER= 000120   	NB.SD2= 001000   	S.FNBW= 000017
FA.CRE= 000010   	FO.UPD= 000006   	F.HIBK= 000004   	NB.SNM= 000040   	S.FNTY= 000004
FA.EXT= 000004   	FO.WRT= 000016   	F.LUN = 000042   	NB.STP= 000020   	S.FTYP= 000002
FA.NSP= 000100   	F.ALOC= 000040   	F.MBCT= 000054   	NB.SVR= 000010   	S.NFEN= 000020
FA.RD = 000001   	F.BBFS= 000062   	F.MBC1= 000055   	NB.TYP= 000002   	VT    = 000013
FA.SHR= 000040   	F.BDB = 000070   	F.MBFG= 000056   	NB.VER= 000001   	$ALELD  000006RG
FA.TMP= 000020   	F.BGBC= 000057   	F.NRBD= 000024   	N.DID = 000024   	$ALELO  000024RG
FA.WRT= 000002   	F.BKDN= 000026   	F.NREC= 000030   	N.DVNM= 000032   	$ALEL1  000000RG
FD.BLK= 000010   	F.BKDS= 000020   	F.OVBS= 000030   	N.FID = 000000   	$ALVRT= ****** GX
FD.CCL= 000002   	F.BKEF= 000050   	F.RACC= 000016   	N.FNAM= 000006   	$INIPT= ****** GX
FD.CR = 000002   	F.BKP1= 000051   	F.RATT= 000001   	N.FTYP= 000014   	$$    = 000001
FD.DIR= 000010   	F.BKST= 000024   	F.RCNM= 000034   	N.FVER= 000016   	...GBL= 000000
FD.FTN= 000001   	F.BKVB= 000064   	F.RCTL= 000017   	N.NEXT= 000022   	...TPC= 000140
FD.INS= 000010   	F.CNTG= 000034   	F.RSIZ= 000002

. ABS.	000000	   000
      	000160	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1942 WORDS  ( 8 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:16
[44,10]ALELD,[44,20]ALELD/-SP=[44,30]MACFLM.,FCSPR.,ALELD.005
ALSGD	MACRO M1108  05-DEC-77 22:49  PAGE 2


      1						.TITLE	ALSGD
      2						.IDENT	/05/                                                           ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1975, DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 05
     20					;                                                                               ;**-1
     21					; D. N. CUTLER/C. MONIA	14-MAR-74
     22					;
     23					; MODIFICATIONS:
     24					;
     25					; NO.		DATE		PROGRAMMER
     26					; ---		----		----------
     27					;
     28					; 038		22-MAR-75	C. MONIA
     29					;
     30					;
     31					;+
     32					; **-$ALSGD-ALLOCATE SEGMENT DESCRIPTOR
     33					;
     34					; THIS ROUTINE IS CALLED TO ALLOCATE A SEGMENT DESCRIPTOR IN VIRTUAL
     35					; MEMORY. STORAGE IS ALLOCATED AND THE DESCRIPTOR IS INITIALIZED.
     36					;
     37					; INPUTS:
     38					;
     39					;	NONE
     40					;
     41					; OUTPUTS:
     42					;
     43					;	R0=REAL ADDRESS OF DESCRIPTOR
     44					;	R1=VIRTUAL ADDRESS OF DESCRIPTOR
     45					;	SEGMENT COUNT IS INCREMENTED.
     46					;-
     47
     48	000000	012701 	000000G		$ALSGD::MOV	#S$ZSEQ,R1	;GET SIZE OF SEQUENCE LIST ENTRY
     49	000004					CALL	$ALBLK		;ALLOCATE STORAGE
     50	000010	016760 	000000G	000002 		MOV	$ASCT,2(R0)	; SET ADDRESS OF ABS SECTION ENTRY              ;**NEW**
     51	000016	010046 				MOV	R0,-(SP)	;SAVE ADDRESS FOR LATER                         ;**-1
     52	000020	012701 	000000G			MOV	#S$GLGH,R1	;GET SIZE OF SEGMENT DESCRIPTOR
     53	000024					CALL	$ALVRT		; ALLOCATE VIRTUAL MEMORY
     54	000030	012760 	177777G	000000G		MOV	#L$HCNT-1,S$GSTB(R0) ;++038 SET LISTHEAD COUNT FOR SYMBOLS
     55	000036	005260 	000000G			INC	S$GSTS(R0)	;SET STATUS OUT OF CORE
     56	000042	010160 	000000G			MOV	R1,S$GNXT(R0)	; SET VIRTUAL ADDRESS OF NEXT
     57	000046	010160 	000000G			MOV	R1,S$GPRV(R0)	; SET VIRTUAL ADDRESS OF PREVIOUS
ALSGD	MACRO M1108  05-DEC-77 22:49  PAGE 2-1


     58	000052	010160 	000002G			MOV	R1,S$GELT+2(R0)	; SETUP ELEMENT LISTHEAD                        ;**-8
     59	000056	062760 	000000C	000002G		ADD	#<S$GELT/2>,S$GELT+2(R0) ; LAST POINTS TO FIRST INITALLY
     60	000064	010002 				MOV	R0,R2		;COPY ADDRESS OF BLOCK
     61	000066	062702 	000000G			ADD	#S$GATL,R2	;POINT TO AUTOLOAD LIST
     62	000072	010262 	000002 			MOV	R2,2(R2)	;LAST POINTS TO FIRST
     63	000076	011660 	000000G			MOV	(SP),S$GSEQ(R0)	;INITIALIZE SEQUENCE ALLOCATION LISTHEAD
     64	000102	012660 	000002G			MOV	(SP)+,S$GSEQ+2(R0);
     65	000106	005267 	000000G			INC	$NUMSG		;INCREMENT NUMBER OF SEGMENTS
     66	000112					RETURN			;
     67
     68		000001 				.END
ALSGD	MACRO M1108  05-DEC-77 22:49  PAGE 2-2
SYMBOL TABLE

CR    = 000015   	R$$11M= 000000   	S$GNXT= ****** GX	S$ZSEQ= ****** GX	$ALVRT= ****** GX
FF    = 000014   	SPA   = 000040   	S$GPRV= ****** GX	VT    = 000013   	$ASCT = ****** GX
HT    = 000011   	S$GATL= ****** GX	S$GSEQ= ****** GX	$ALBLK= ****** GX	$NUMSG= ****** GX
LF    = 000012   	S$GELT= ****** GX	S$GSTB= ****** GX	$ALSGD  000000RG 	$$    = 000001
L$HCNT= ****** GX	S$GLGH= ****** GX	S$GSTS= ****** GX

. ABS.	000000	   000
      	000114	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  627 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
[44,10]ALSGD,[44,20]ALSGD/-SP=[44,30]MACFLM.,ALSGD.005
ALVRT	MACRO M1108  05-DEC-77 22:49  PAGE 2


      1						.TITLE	ALVRT
      2						.IDENT	/02/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     17					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 02                                                                    ;**NEW**
     20					;                                                                               ;**-1
     21					; C. MONIA 22-FEB-74
     22					;
     23					; ALLOCATE VIRTUAL STORAGE
     24					;
     25					;+
     26					; **-$ALVRT-ALLOCATE VIRTUAL MEMORY
     27					;
     28					; INPUTS:
     29					;
     30					;	R1=NUMBER OF BYTES TO ALLOCATE
     31					;
     32					; OUTPUTS:
     33					;
     34					;	R0=REAL ADDRESS OF ALLOCATION
     35					;	R1=VIRTUAL ADDRESS OF ALLOCATION
     36					;
     37					;	THE SPECIFIED PAGE IS WRITE-MARKED
     38					;
     39					; THIS ROUTINE IS CALLED TO ALLOCATE VIRTUAL MEMORY AND MAKE
     40					; THE ALLOCATED SPACE RESIDENT IN CORE. THE AMOUNT OF SPACE
     41					; TO BE ALLOCATED IS ROUNDED TO THE NEAREST WORD
     42					;
     43					;
     44					;-
     45
     46	000000				$ALVRT::			;
     47	000000					SAVRG			; SAVE NON-VOLATILE REGISTERS
     48	000004					CALL	$RQVCB		; REQUEST VIRTUAL CORE BLOCK
     49	000010	103435 				BCS	40$		; IF C/S NO VIRTUAL SPACE LEFT
     50	000012	010105 				MOV	R1,R5		; SAVE VIRTUAL ADDRESS
     51	000014	000305 				SWAB	R5		; PUT RELATIVE BLOCK IN LOW BYTE
     52	000016	105701 				TSTB	R1		; IS REQUEST ON BLOCK BOUNDRY?
     53	000020	001025 				BNE	20$		; IF NE NO, BLOCK ALREADY EXISTS
     54	000022	012701 	000000G			MOV	#P$GSIZ,R1	; CREATE A PAGE BUFFER
     55	000026					CALL	$ALBLK		; ALLOCATE STORAGE SPACE
     56	000032	016702 	000000G			MOV	$PAGLS,R2	; GET ADDRESS OF PAGE LIST                      ;**NEW**
     57	000036	001405 				BEQ	10$		; IF EQ NONE                                    ;**NEW**
ALVRT	MACRO M1108  05-DEC-77 22:49  PAGE 2-1


     58	000040	005001 				CLR	R1		; SET FOR MOVB WITHOUT EXTEND                   ;**NEW**
     59	000042	150501 				BISB	R5,R1		; GET RELATIVE BLOCK NUMBER                     ;**NEW**
     60	000044	006301 				ASL	R1		; CONVERT TO WORD OFFSET                        ;**NEW**
     61	000046	060102 				ADD	R1,R2		; COMPUTE ADDRESS IN LIST                       ;**NEW**
     62	000050	010012 				MOV	R0,(R2)		; STORE ADDRESS                                 ;**NEW**
     63	000052				10$:				;                                               ;**NEW**
     64	000052	016760 	000000G	000000G		MOV	$PAGHD,P$GNXT(R0) ; LINK OLD FIRST TO NEW FIRST
     65	000060	010067 	000000G			MOV	R0,$PAGHD	; SET NEW FIRST
     66	000064	110560 	000000G			MOVB	R5,P$GBLK(R0)	; SET RELATIVE BLOCK NUMBER OF PAGE
     67	000070	010501 				MOV	R5,R1		; RESTORE SWAPPED VIRTUAL ADDRESS
     68	000072	000301 				SWAB	R1		; STRAIGHTEN IT
     69	000074				20$:				;
     70	000074					CALL	$CVRL		; CONVERT TO REAL ADDRESS
     71	000100				30$:				;
     72	000100					CALLR	$WRMPG		; WRITE-MARK PAGE
     73	000104				40$:				;
     74	000104	012701 	000000C			MOV	#<S$V2*400!E$R76>,R1 ; GET ERROR/SEVERITY
     75	000110	005002 				CLR	R2		; SET DUMMY PARAMETER BLOCK ADDRESS
     76	000112					CALL	$ERMSG		; FATAL-NO RETURN
     77
     78		000001 				.END
ALVRT	MACRO M1108  05-DEC-77 22:49  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:  632 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:07
[44,10]ALVRT,[44,20]ALVRD/-SP=[44,30]MACFLM.,ALVRT.002
BCNTL	MACRO M1108  05-DEC-77 22:49  PAGE 2


      1						.TITLE	BCNTL
      2						.IDENT	/01/
      3					;
      4					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      5					;
      6					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      7					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      8					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
      9					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     10					;
     11					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     12					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     13					; EQUIPMENT CORPORATION.
     14					;
     15					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     16					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     17					;
     18					;
     19					; C. MONIA	17-JAN-74
     20					;
     21					; VERSION 01
     22					;
     23					; INVOKE ROUTINES TO GENERATE SEGMENT DESCRIPTORS
     24					;
     25					;+
     26					; **-$BCNTL-CALL ROUTINES TO GENERATE SEGMENTS
     27					;
     28					; INPUTS:
     29					;
     30					;	R4: UTILTIY FDB POINTER SETUP WITH DEFAULT NAME BLOCK FOR
     31					;	    INPUT FILE
     32					;
     33					; OUTPUTS:
     34					;
     35					;	NONE.
     36					;
     37					;	THIS ROUTINE IS ENTERED VIA JMP AND RETURNS CONTROL
     38					;	TO $BLDSF (BLDSG) ON COMPLETION.
     39					;
     40					;	THE CONTENTS OF R3-R5 ARE PRESERVED
     41					;-
     42					;
     43	000000				$BCNTL::			;
     44	000000	032764 	000000G	000000G		BIT	#SW$MP,R$SWTH(R4) ; "MP" SWITCH SPECIFIED?
     45	000006	001003 				BNE	20$		; IF NE YES
     46	000010					CALL	$SNGSG		; CREATE SINGLE SEGMENT DESCRIPTION
     47	000014	000402 				BR	30$		;
     48	000016				20$:				;
     49	000016					CALL	$MULSG		; CREATE MULTI-SEGMENT DESCRIPTION
     50	000022				30$:				;
     51	000022	000167 	000000G			JMP	$BLDSF 		;EXIT
     52
     53		000001 				.END
BCNTL	MACRO M1108  05-DEC-77 22:49  PAGE 2-1
SYMBOL TABLE

CR    = 000015   	LF    = 000012   	SPA   = 000040   	$BCNTL  000000RG 	$SNGSG= ****** GX
FF    = 000014   	R$SWTH= ****** GX	SW$MP = ****** GX	$BLDSF= ****** GX	$$    = 000001
HT    = 000011   	R$$11M= 000000   	VT    = 000013   	$MULSG= ****** GX

. ABS.	000000	   000
      	000026	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  557 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:05
[44,10]BCNTL,[44,20]BCNTL/-SP=[44,30]MACFLM.,BCNTL.001
BLDSG	MACRO M1108  05-DEC-77 22:49  PAGE 3


      1						.TITLE	BLDSG
      2						.IDENT	/11/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1975,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     17					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 11                                                                    ;**NEW**
     20					;                                                                               ;**-1
     21					; D. N. CUTLER/C. MONIA	16-JAN-74
     22					;
     23					; MODIFICATIONS:                                                                ;**NEW**
     24					;                                                                               ;**NEW**
     25					; NO.		DATE		PROGRAMMER                                      ;**NEW**
     26					; ---		----		----------                                      ;**NEW**
     27					;                                                                               ;**NEW**
     28					; 036		10-JAN-75	C. MONIA                                        ;**NEW**
     29					;                                                                               ;**NEW**
     30					; MONITOR DEPENDENT ROUTINE TO BUILD SEGMENT DESCRIPTION
     31					;
     32					; LOCAL DATA
     33					;
     34
     35	000000				$MRFLG::.BLKW	1		;MORE INPUT FILES FLAG
     36	000002				$SCANR::.BLKW	1		;ADDRESS OF SCANNING ROUTINE
     37	000004	012626 			CRFEX:	.RAD50	/CRF/		;++036 CREF FILE EXTENSION                      ;**NEW**
     38	000006	000002 			ODTDS:	.WORD	ODTDR-ODTDV	;DEVICE DESCRIPTOR
     39	000010	000022'				.WORD	ODTDV		;
     40	000012	000005 				.WORD	ODTFN-ODTDR	;DIRECTORY DESCRIPTOR
     41	000014	000024'				.WORD	ODTDR		;
     42	000016	000007 				.WORD	ODTFE-ODTFN	;FILENAME DESCRIPTOR
     43	000020	000031'				.WORD	ODTFN		;
     44	000022	   123 	   131 		ODTDV:	.ASCII	/SY/		;DEVICE
     45	000024	   133 	   061 	   054 	ODTDR:	.ASCII	/[1,1]/		;DIRECTORY
	000027	   061 	   135
     46	000031	   117 	   104 	   124 	ODTFN:	.ASCII	/ODT.OBJ/	;FILENAME
	000034	   056 	   117 	   102
	000037	   112
     47	000040				ODTFE:				;REF LABEL
     48
     49						.EVEN
     50
     51					;
     52					; CSI SWITCH BLOCK POINTERS
     53					;
     54
BLDSG	MACRO M1108  05-DEC-77 22:49  PAGE 3-1


     55	000040	000000G			SWPT:	.WORD	$TSKSW		; TASK FILE
     56	000042	000000G				.WORD	$MAPSW		; MAP FILE
     57	000044	000000G				.WORD	$STBSW		; STB FILE
     58
     59					;
     60					; FILE SWITCH VALUE POINTERS
     61					;
     62
     63	000046	000000G			SWTB:	.WORD	TS$KF		; TASK FILE SPECIFIED
     64	000050	000000G				.WORD	MA$PF		; MAP FILE SPECIFIED
     65	000052	000000G				.WORD	ST$BF		; SYMBOL TABLE FILE SPECIFIED
     66
     67					;
     68					; OUTPUT FILE NAMEBLOCK VECTORS (REAL) - ADJACENCY ASSUMED
     69					;
     70
     71	000054				TSKNM:	.BLKW	1		; TASK FILE
     72	000056				MAPNM:	.BLKW	1		; MAP FILE
     73	000060				STBNM:	.BLKW	1		; STB FILE
     74
     75
     76					;+
     77					; **-$BLDSG-BUILD SEGMENT DESCRIPTION
     78					;
     79					; THIS ROUTINE IS CALLED TO CREATE THE SEGMENT DESCRIPTION FOR THE
     80					; TASK THAT IS CURRENTLY BEING BUILT. A COMMAND INPUT LINE IS READ
     81					; AND THE OUTPUT FILE SPECIFICATIONS ARE INITIALIZED. THE FIRST INPUT
     82					; FILE SPECIFICATION IS OBTAINED AND PLACED IN THE OBJECT FILE RECORD
     83					; BLOCK. IF THE "MP" SWITCH IS SPECIFIED, THEN $MULSG IS CALLED TO
     84					; CREATE A MULTI-SEGMENT TASK DESCRIPTION. ELSE $SNGSG IS CALLED TO
     85					; CREATE A SINGLE SEGMENT TASK DESCRIPTION.
     86					;
     87					; INPUTS:
     88					;
     89					;	NONE.
     90					;
     91					; OUTPUTS:
     92					;
     93					;	NONE.
     94					;-
     95
     96	000062				$BLDSG::SAVRG			;SAVE NONVOLITILE REGISTERS
     97	000066					CALL	$INITL		;INITIALIZE
     98	000072	016704 	000000G			MOV	$INIPT,R4	; GET FDB ADDRESS
     99	000076	012701 	000000G			MOV	#T$MSIZ,R1	;GET SIZE OF TEMP BUFFER NEEDED
    100	000102					CALL	$ALBLK		;ALLOCATE TEMP BUFFER
    101	000106	010005 				MOV	R0,R5		;SAVE BUFFER ADDRESS
    102	000110				10$:	CALL	$GTCML		;GET NEXT COMMAND INPUT LINE
    103	000114	103002 				BCC	15$		;IF CC CONTINUE
    104	000116	000167 	000000G			JMP	$QUIT		;LOGICAL EOF-QUIT NOW
    105	000122	010501 			15$:	MOV	R5,R1		;GET ADDRESS OF TEMP BUFFER
    106	000124					CALL	$SYNTX		;ANALYZE SYNTAX OF LINE
    107	000130	103767 				BCS	10$		;IF CS SYNTAX ERROR
    108
    109						.IF	NDF	R$$11M
    110
    111						MOV	#<SW$CP!SW$FP>,R$SWTH(R4) ; SET DEFAULT TASK SWITCHES
BLDSG	MACRO M1108  05-DEC-77 22:49  PAGE 3-2


    112
    113						.IFF
    114
    115	000132	012764 	000000G	000000G		MOV	#SW$CP,R$SWTH(R4)	; SET DEFAULT TASK SWITCHES
    116
    117						.ENDC
    118
    119	000140	012764 	000000G	000046 		MOV	#$DFNB,F.DFNB(R4) ; SET DEFAULT NAME BLOCK POINTER
    120	000146	012703 	177772 			MOV	#-6,R3		; SET LOOP COUNT *2
    121	000152				20$:
    122	000152	016364 	000046'	000000G		MOV	SWPT+6(R3),R$SWBK(R4) ; POINT TO CSI SWITCH BLOCK
    123	000160	005063 	000006G			CLR	$TSKNM+6(R3)	; CLEAR NAME BLOCK POINTER
    124	000164	005063 	000062'			CLR	TSKNM+6(R3)	; CLEAR REAL ADDRESS
    125	000170	010400 				MOV	R4,R0		; GET FDB ADDRESS
    126	000172	062700 	000102 			ADD	#F.FNB,R0	; POINT TO FILE NAME BLOCK
    127	000176	012701 	000017 			MOV	#S.FNB/2,R1	; SET SIZE OF BLOCK
    128	000202				25$:				;
    129	000202	005020 				CLR	(R0)+		; CLEAR NAMEBLOCK
    130	000204					SOB	R1,25$		;
    131	000210	010501 				MOV	R5,R1		; SET TEMP BUFFER ADDRESS
    132	000212	010400 				MOV	R4,R0		; SET FDB ADDRESS
    133	000214					CALL	$SCANO		; SCAN FOR OUTPUT FILE
    134	000220	103406 				BCS	35$		; IF C/S NO FILE
    135	000222					CALL	PARSE		;++036 PARSE FILE NAME                          ;**NEW**
    136	000226	103403 				BCS	35$		;++036 IF C/S ERROR                             ;**NEW**
    137	000230				30$:				;                                               ;**-7
    138	000230	056367 	000054'	000000G		BIS	SWTB+6(R3),$SWTCH ; SET FILE-PRESENT SWITCH
    139	000236				35$:				;
    140	000236					CALL	$ALELO		; ALLOCATE ELEMENT DESCRIPTOR FOR OUTPUT
    141	000242					CALL	$LCKPG		; LOCK PAGE IN MEMORY
    142	000246	010063 	000062'			MOV	R0,TSKNM+6(R3)	; SAVE REAL ADDRESS OF NAMEBLOCK
    143	000252	010163 	000006G			MOV	R1,$TSKNM+6(R3)	; SAVE VIRTUAL ADDRESS OF NAMEBLOCK
    144	000256	020327 	177774 			CMP	R3,#-4		;++036 PROCESSING MAP FILE?                     ;**NEW**
    145	000262	001111 				BNE	43$		;++036 IF NE NO                                 ;**NEW**
    146	000264	012700 	000000C			MOV	#<MA$PF!CR$EF>,R0 ;++036 GET MAP, CREF FILE FLAGS               ;**NEW**
    147	000270	046700 	000000G			BIC	$SWTCH,R0	;++036 TEST FLAGS                               ;**NEW**
    148	000274	001104 				BNE	43$		;++036 IF NE NO CREF PRODUCED                   ;**NEW**
    149	000276	005067 	000000G			CLR	$CRODV		;++036 CLEAR CREF OUTPUT DEVICE                 ;**NEW**
    150	000302	005067 	000000G			CLR	$CROUN		;++036 CLEAR CREF OUTPUT UNIT                   ;**NEW**
    151	000306	016446 	000046 			MOV	F.DFNB(R4),-(SP) ;++036 SAVE ADDRESS OF DEFAULT NAMEBLOCK       ;**NEW**
    152	000312	016400 	000044 			MOV	F.DSPT(R4),R0	;++036 GET ADDRESS OF DATASET POINTER           ;**NEW**
    153	000316	016046 	000002 			MOV	2(R0),-(SP)	;++036 SAVE ADDRESS OF STRING                   ;**NEW**
    154	000322	132764 	000041 	000017 		BITB	#<FD.SQD!FD.REC>,F.RCTL(R4) ;++036 SEQUENTIAL OR RECORD DEVICE  ;**NEW**
    155	000330	001447 				BEQ	40$		;++036 IF EQ NO                                 ;**NEW**
    156	000332	052767 	000000G	000000G		BIS	#SP$OL,$SWTCH	;++036 CANCEL REQUEST FOR SPOOLING              ;**NEW**
    157	000340	016467 	000134 	000000G		MOV	F.FNB+N.DVNM(R4),$CRODV ;++036 SAVE OUTPUT DEVICE               ;**NEW**
    158	000346	016467 	000136 	000000G		MOV	F.FNB+N.UNIT(R4),$CROUN ;++036 SAVE OUTPUT UNIT                 ;**NEW**
    159	000354	012764 	000000G	000046 		MOV	#$MAPTM,F.DFNB(R4) ;++036 SET ADDRESS OF TEMP MAP FILE NAMEBLOCK;**NEW**
    160	000362	016400 	000044 			MOV	F.DSPT(R4),R0	;++036 GET ADDRESS OF DATASET                   ;**NEW**
    161	000366	012701 	000000G			MOV	#$MAPTD,R1	;++036 GET ADDRESS OF TEMP DSPT                 ;**NEW**
    162	000372	012120 				MOV	(R1)+,(R0)+	;++036 SET DEVICE STRING LENGTH                 ;**NEW**
    163	000374	012120 				MOV	(R1)+,(R0)+	;++036 SET ADDRESS OF STRING                    ;**NEW**
    164	000376					CALL	PARSE		;++036 PARSE CREF TEMP FILE                     ;**NEW**
    165	000402	103004 				BCC	37$		;++036 IF C/C PARSE SUCCEEDED                   ;**NEW**
    166	000404	042767 	000000G	000000G		BIC	#CR$EF,$SWTCH	;++036 RESET CREF SWITCH                        ;**NEW**
    167	000412	000427 				BR	42$		;++036                                          ;**NEW**
    168	000414				37$:				;++036                                          ;**NEW**
BLDSG	MACRO M1108  05-DEC-77 22:49  PAGE 3-3


    169	000414	016701 	000000G			MOV	$MAPNM,R1	;++036 GET VIRTUAL ADDRESS OF MAP FILE          ;**NEW**
    170	000420					CALL	$UNLPG		;++036 UNLOCK PAGE                              ;**NEW**
    171	000424	010167 	000000G			MOV	R1,$MPFIL	;++036 SAVE VIRTUAL ADDRESS OF REAL DESCRIPTOR  ;**NEW**
    172	000430					CALL	$ALELO		;++036 ALLOCATE AN ELEMENT DESCRIPTOR FOR OUTPUT;**NEW**
    173	000434					CALL	$LCKPG		;++036 LOCK DESCRIPTOR IN MEMORY                ;**NEW**
    174	000440	010067 	177412 			MOV	R0,MAPNM	;++036 SAVE REAL ADDRESS OF NEW DESCRIPTOR      ;**NEW**
    175	000444	010167 	000000G			MOV	R1,$MAPNM	;++036 SAVE VIRTUAL ADDRESS                     ;**NEW**
    176	000450				40$:				;++036                                          ;**NEW**
    177	000450	005064 	000120 			CLR	F.FNB+N.FVER(R4) ;++036 FORCE NEW VERSION                       ;**NEW**
    178	000454	016764 	177324 	000116 		MOV	CRFEX,F.FNB+N.FTYP(R4) ;++036 REPLACE WITH CREF EXTENSION       ;**NEW**
    179	000462					CALL	$ALELO		;++036 ALLOCATE DESCRIPTOR FOR CREF FILE        ;**NEW**
    180	000466	010167 	000000G			MOV	R1,$CRFNM	;++036 SAVE VIRTUAL ADDRESS OF DESCRIPTOR       ;**NEW**
    181	000472				42$:				;++036                                          ;**NEW**
    182	000472	016400 	000044 			MOV	F.DSPT(R4),R0	;++036 GET DATASET POINTER                      ;**NEW**
    183	000476	012660 	000002 			MOV	(SP)+,2(R0)	;++036 RESTORE ADDRESS OF STRING                ;**NEW**
    184	000502	012664 	000046 			MOV	(SP)+,F.DFNB(R4) ;++036 RESTORE ADDRESS OF DFNB                 ;**NEW**
    185	000506				43$:				;++036                                          ;**NEW**
    186	000506	005064 	000000G			CLR	R$SWTH(R4)	; INITIALIZE SWITCH WORD
    187	000512	062764 	000036 	000046 		ADD	#S.FNB,F.DFNB(R4) ; POINT TO NEXT DEFAULT NAME BLOCK
    188	000520	062703 	000002 			ADD	#2,R3		; INCREMENT COUNT
    189	000524	002612 				BLT	20$		; IF LT GO AGAIN
    190	000526	016700 	177322 			MOV	TSKNM,R0	; GET REAL ADDRESS OF TASK NAMEBLOCK
    191	000532	001417 				BEQ	45$		; IF EQ NONE
    192	000534	016701 	177320 			MOV	STBNM,R1	; GET REAL ADDRESS OF STB NAMEBLOCK
    193	000540	001414 				BEQ	45$		; IF EQ NONE
    194	000542	012703 	000000C			MOV	#^C<SW$PI!SW$NH>,R3 ; GET COMPLEMENT OF /PI, /NH FLAGS
    195	000546	016102 	000000G			MOV	E$LSWT(R1),R2	; GET STB FILE SWITCH WORD
    196	000552	040302 				BIC	R3,R2		; ISOLATE SWITCHES
    197	000554	050260 	000000G			BIS	R2,E$LSWT(R0)	; TRANSFER SWITCHES TO TASK FILE
    198	000560	016002 	000000G			MOV	E$LSWT(R0),R2	; GET TASK FILE SWITCH WORD
    199	000564	040302 				BIC	R3,R2		; ISOLATE "/PI" SWITCH
    200	000566	050261 	000000G			BIS	R2,E$LSWT(R1)	; TRANSFER TO STB FILE
    201	000572				45$:				;
    202	000572	012700 	000000G			MOV	#$TSKNM,R0	; GET POINTER TO V/A OF TASK NAMEBLOCK
    203	000576	012702 	000003 			MOV	#3,R2		; SET LOOP COUNT
    204	000602				46$:				;
    205	000602	012001 				MOV	(R0)+,R1	; GET NAMEBLOCK VIRTUAL ADDRESS
    206	000604	001402 				BEQ	47$		; IF EQ NONE SPECIFIED
    207	000606					CALL	$UNLPG		; UNLOCK PAGE
    208	000612				47$:				;
    209	000612					SOB	R2,46$		; REPEAT
    210	000616	012764 	000000G	000000G		MOV	#$INPSW,R$SWBK(R4) ; SET ADDRESS OF INPUT SWITCH BLOCK
    211	000624	012764 	000000G	000000G		MOV	#SW$CC,R$SWTH(R4) ; FORCE DEFAULT CONCATENATED MODULE
    212	000632	012767 	000000G	177142 		MOV	#$SCANI,$SCANR ; SET ADDRESS OF SCANNING ROUTINE
    213	000640	005067 	177134 			CLR	$MRFLG		; CLEAR MORE FILES FLAG
    214
    215					;
    216					; AT THIS POINT F.DFNB(R4) POINTS TO INPUT FILE
    217					; DEFAULT NAME BLOCK
    218					;
    219	000644					CALL	$NXTFL		; GET FIRST INPUT FILE
    220	000650	103005 				BCC	50$		;
    221	000652	012701 	000000C			MOV	#<S$V2*400!E$R2>,R1 ; ASSUME NO INPUT FILES
    222	000656	005002 				CLR	R2		; SET DUMMY PARAMETER BLOCK ADDRESS
    223	000660					CALL	$ERMSG		; FATAL-NO RETURN
    224	000664				50$:				;
    225	000664	000167 	000000G			JMP	$BCNTL		; BUILD SEGMENT DESCRIPTORS
BLDSG	MACRO M1108  05-DEC-77 22:49  PAGE 3-4


    226
    227					;
    228					; BUILD FILE NAME BLOCK FOR DEBUGGING AID AND SYSTEM LIBRARY FILES
    229					;
    230					;	THIS ROUTINE IS ENTERED VIA A JUMP FROM '$BCNTL' AFTER
    231					;	ALL SEGMENT DESCRIPTORS HAVE BEEN BUILT. R3-R5 ARE INTACT.
    232					;
    233
    234	000670				$BLDSF::			;
    235	000670	012700 	000000G			MOV	#$FRHD,R0	; GET ADDRESS OF FREE POOL HEADER
    236	000674	012701 	000000G			MOV	#T$MSIZ,R1	; GET SIZE OF BLOCK TO RELEASE
    237	000700	010502 				MOV	R5,R2		; GET ADDRESS OF BLOCK
    238	000702					CALL	$RLCB		; RELEASE CORE BLOCK
    239	000706	016446 	000046 			MOV	F.DFNB(R4),-(SP) ; SAVE DEFAULT NAMEBLOCK POINTER
    240	000712	016446 	000044 			MOV	F.DSPT(R4),-(SP) ; SAVE DATASET POINTER
    241	000716	016701 	000000G			MOV	$TSKNM,R1	; GET VIRTUAL ADDRESS OF TASK NAMEBLOCK
    242	000722	001432 				BEQ	10$		; IF EQ-NO TASK FILE
    243	000724					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    244	000730	032760 	000000G	000000G		BIT	#SW$DA,E$LSWT(R0) ; DEBUGGING AID REQUESTED?
    245	000736	001424 				BEQ	10$		; IF EQ NO
    246	000740	012764 	000006'	000044 		MOV	#ODTDS,F.DSPT(R4) ; SET ODT DATA DESCRIPTOR
    247	000746	010400 				MOV	R4,R0		; FETCH FDB POINTER
    248	000750					CALL	$PRFND		; PARSE/FIND FILE
    249	000754	103445 				BCS	20$		; IF C/S PARSE/FIND FAILURE
    250	000756	012760 	000000G	000000G		MOV	#SW$DA,R$SWTH(R0) ; SPECIFY DEBUGGING AID
    251	000764					CALL	$ALELD		; ALLOCATE AN ELEMENT DESCRIPTOR
    252	000770	016700 	000000G			MOV	$RTSEG,R0	; GET ADDRESS OF ROOT SEGMENT
    253	000774	062700 	000000C			ADD	#<S$GELT/2>,R0	; POINT TO ELEMENT DESCRIPTOR LISTHEAD
    254	001000	012702 	000000G			MOV	#E$LNXT,R2	; GET LINK-NEXT OFFSET
    255	001004					CALL	$LNKVM		; LINK ELEMENT AS LAST ON LIST
    256	001010				10$:
    257	001010	012764 	000000G	000046 		MOV	#$DFLIB,F.DFNB(R4) ; SET SYSTEM LIBRARY DFNB
    258	001016	012764 	000000G	000044 		MOV	#$DSPLB,F.DSPT(R4) ; SET DATA STRING POINTER
    259	001024	010400 				MOV	R4,R0		; GET FDB ADDRESS
    260	001026	005067 	000000G			CLR	$LIBNM		; ASSUME PARSE/FIND FAILURE
    261	001032					CALL	$PRFND		; PARSE/FIND THE FILE
    262	001036	103407 				BCS	15$		; IF C/S PARSE/FIND FAILED
    263	001040					CALL	$ALELD		; ALLOCATE ELEMENT DESCRIPTOR
    264	001044	010167 	000000G			MOV	R1,$LIBNM	; SAVE VIRTUAL ADDRESS OF LIBRARY DESCRIPTOR
    265	001050	012760 	000000G	000000G		MOV	#SW$LB,E$LSWT(R0) ; SET SWITCH WORD FOR LIBRARY FILE
    266	001056				15$:				;
    267	001056	012664 	000044 			MOV	(SP)+,F.DSPT(R4) ; RESTORE DATASET POINTER
    268	001062	012664 	000046 			MOV	(SP)+,F.DFNB(R4) ; RESTORE DEFAULT NAMEBLOCK POINTER
    269	001066					RETURN			;
    270	001070				20$:				;
    271	001070	016402 	000000G			MOV	R$NAME(R4),R2	; GET NAME STRING ADDRESS
    272	001074	012701 	000000C			MOV	#<S$V2*400!E$R57>,R1 ; PARSE/FIND FAILURE
    273	001100					CALL	$ERMSG		; FATAL-NO RETURN
    274
    275					;++036                                                                          ;**NEW**
    276					;++036 PARSE OUTPUT FILE SPECIFICATION                                          ;**NEW**
    277					;++036                                                                          ;**NEW**
    278					                                                                                ;**NEW**
    279	001104				PARSE:				;++036                                          ;**NEW**
    280	001104	010400 				MOV	R4,R0		;++036 GET ADDRESS OF FDB                       ;**NEW**
    281	001106					CALL	$PARSE		;++036 PARSE FILE                               ;**NEW**
    282	001112	103007 				BCC	10$		;++036 IF C/C OK                                ;**NEW**
BLDSG	MACRO M1108  05-DEC-77 22:49  PAGE 3-5


    283	001114	012701 	000000C			MOV	#<S$V0*400!E$R11>,R1 ;++036 GET ERROR/SEVERITY                  ;**NEW**
    284	001120	016402 	000000G			MOV	R$NAME(R4),R2	;++036 FILE NAME                                ;**NEW**
    285	001124					CALL	$ERMSG		;++036 OUTPUT ERROR MESSAGE                     ;**NEW**
    286	001130	000261 				SEC			;++036 SET FAILURE CONDITION                    ;**NEW**
    287	001132				10$:				;++036                                          ;**NEW**
    288	001132					RETURN			;++036                                          ;**NEW**
    289					                                                                                ;**NEW**
    290
    291		000001 				.END
BLDSG	MACRO M1108  05-DEC-77 22:49  PAGE 3-6
SYMBOL TABLE

B.BBFS= 000010   	FO.UPD= 000006   	F.RTYP= 000000   	R.FIX = 000001   	$CVRL = ****** GX
B.BFST= 000015   	FO.WRT= 000016   	F.STBK= 000036   	R.VAR = 000002   	$DFLIB= ****** GX
B.NXBD= 000012   	F.ALOC= 000040   	F.UNIT= 000136   	SPA   = 000040   	$DFNB = ****** GX
B.VBN = 000004   	F.BBFS= 000062   	F.URBD= 000020   	SP$OL = ****** GX	$DSPLB= ****** GX
CR    = 000015   	F.BDB = 000070   	F.VBN = 000064   	STBNM   000060R  	$ERMSG= ****** GX
CRFEX   000004R  	F.BGBC= 000057   	F.VBSZ= 000060   	ST$BF = ****** GX	$FRHD = ****** GX
CR$EF = ****** GX	F.BKDN= 000026   	HT    = 000011   	SWPT    000040R  	$GTCML= ****** GX
E$LNXT= ****** GX	F.BKDS= 000020   	LF    = 000012   	SWTB    000046R  	$INIPT= ****** GX
E$LSWT= ****** GX	F.BKEF= 000050   	MAPNM   000056R  	SW$CC = ****** GX	$INITL= ****** GX
E$R11 = ****** GX	F.BKP1= 000051   	MA$PF = ****** GX	SW$CP = ****** GX	$INPSW= ****** GX
E$R2  = ****** GX	F.BKST= 000024   	NB.DEV= 000200   	SW$DA = ****** GX	$LCKPG= ****** GX
E$R57 = ****** GX	F.BKVB= 000064   	NB.DIR= 000100   	SW$LB = ****** GX	$LIBNM= ****** GX
FA.APD= 000100   	F.CNTG= 000034   	NB.NAM= 000004   	SW$NH = ****** GX	$LNKVM= ****** GX
FA.CRE= 000010   	F.DFNB= 000046   	NB.SD1= 000400   	SW$PI = ****** GX	$MAPNM= ****** GX
FA.EXT= 000004   	F.DSPT= 000044   	NB.SD2= 001000   	S$GELT= ****** GX	$MAPSW= ****** GX
FA.NSP= 000100   	F.DVNM= 000134   	NB.SNM= 000040   	S$V0  = ****** GX	$MAPTD= ****** GX
FA.RD = 000001   	F.EFBK= 000010   	NB.STP= 000020   	S$V2  = ****** GX	$MAPTM= ****** GX
FA.SHR= 000040   	F.EFN = 000050   	NB.SVR= 000010   	S.BFHD= 000020   	$MPFIL= ****** GX
FA.TMP= 000020   	F.EOBB= 000032   	NB.TYP= 000002   	S.FATT= 000016   	$MRFLG  000000RG
FA.WRT= 000002   	F.ERR = 000052   	NB.VER= 000001   	S.FDB = 000140   	$NXTFL= ****** GX
FD.BLK= 000010   	F.FACC= 000043   	N.DID = 000024   	S.FNAM= 000006   	$PARSE= ****** GX
FD.CCL= 000002   	F.FFBY= 000014   	N.DVNM= 000032   	S.FNB = 000036   	$PRFND= ****** GX
FD.CR = 000002   	F.FNAM= 000110   	N.FID = 000000   	S.FNBW= 000017   	$QUIT = ****** GX
FD.DIR= 000010   	F.FNB = 000102   	N.FNAM= 000006   	S.FNTY= 000004   	$RLCB = ****** GX
FD.FTN= 000001   	F.FTYP= 000116   	N.FTYP= 000014   	S.FTYP= 000002   	$RTSEG= ****** GX
FD.INS= 000010   	F.FVER= 000120   	N.FVER= 000016   	S.NFEN= 000020   	$SAVRG= ****** GX
FD.PLC= 000004   	F.HIBK= 000004   	N.NEXT= 000022   	TSKNM   000054R  	$SCANI= ****** GX
FD.RAH= 000001   	F.LUN = 000042   	N.STAT= 000020   	TS$KF = ****** GX	$SCANO= ****** GX
FD.RAN= 000002   	F.MBCT= 000054   	N.UNIT= 000034   	T$MSIZ= ****** GX	$SCANR  000002RG
FD.REC= 000001   	F.MBC1= 000055   	ODTDR   000024R  	VT    = 000013   	$STBSW= ****** GX
FD.RWM= 000001   	F.MBFG= 000056   	ODTDS   000006R  	$ALBLK= ****** GX	$SWTCH= ****** GX
FD.SDI= 000020   	F.NRBD= 000024   	ODTDV   000022R  	$ALELD= ****** GX	$SYNTX= ****** GX
FD.SQD= 000040   	F.NREC= 000030   	ODTFE   000040R  	$ALELO= ****** GX	$TSKNM= ****** GX
FD.TTY= 000004   	F.OVBS= 000030   	ODTFN   000031R  	$BCNTL= ****** GX	$TSKSW= ****** GX
FD.WBH= 000002   	F.RACC= 000016   	PARSE   001104R  	$BLDSF  000670RG 	$UNLPG= ****** GX
FF    = 000014   	F.RATT= 000001   	R$NAME= ****** GX	$BLDSG  000062RG 	$$    = 000001
FO.APD= 000106   	F.RCNM= 000034   	R$SWBK= ****** GX	$CRFNM= ****** GX	...GBL= 000000
FO.MFY= 000002   	F.RCTL= 000017   	R$SWTH= ****** GX	$CRODV= ****** GX	...TPC= 000140
FO.RD = 000001   	F.RSIZ= 000002   	R$$11M= 000000   	$CROUN= ****** GX

. ABS.	000000	   000
      	001134	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2404 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:30
[44,10]BLDSG,[44,20]BLDSG/-SP=[44,30]MACFLM.,FCSPR.,BLDSG.011
BLMNT	MACRO M1108  05-DEC-77 22:50  PAGE 2


      1						.TITLE	BLMNT
      2						.IDENT	/00/
      3					;
      4					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      5					;
      6					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      7					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      8					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
      9					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     10					;
     11					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     12					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     13					; EQUIPMENT CORPORATION.
     14					;
     15					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     16					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     17					;
     18					; VERSION 00
     19					;
     20					; C. MONIA	29-APR-74
     21					;
     22					; INITIALIZE AND BUILD LIBRARY MODULE NAME LISTS
     23					;
     24					; LOCAL DATA
     25					;
     26
     27
     28	000000				LCLMOD:	.BLKW	17.		; LOCAL STORAGE FOR MODULE NAMES
     29	000042				$LBMOD::.BLKW	1		; VIRTUAL ADDRESS OF NAME TABLE
     30
     31					;+
     32					; **-$CLRMN-INITIALIZE MODULE SWITCH VALUE TABLE
     33					;
     34					; INPUTS:
     35					;
     36					;	NONE
     37					;
     38					; OUTPUTS:
     39					;
     40					;	CSI SWITCH VALUE LIST FOR MODULE NAMES IS INITIALIZED
     41					;
     42					; THIS SUBROUTINE IS CALLED TO SETUP THE MODULE NAME LIST FOR
     43					; SUBSEQUENT SCANNING BY $BLMNT
     44					;-
     45
     46	000044				$CLRMN::			;
     47	000044	012700 	000000G			MOV	#$LBSVT,R0	; GET ADDRESS OF VALUE TABLE
     48	000050	012701 	000010 			MOV	#8.,R1		; GET MAX. NO OF NAMES
     49	000054				10$:				;
     50	000054	105010 				CLRB	(R0)		; CLEAR FIRST BYTE OF ENTRY
     51	000056	062700 	000007 			ADD	#7,R0		; POINT TO START OF NEXT ENTRY
     52	000062					SOB	R1,10$		; REPEAT
     53	000066					RETURN			;
     54
     55					;+
     56					; **-$BLMNT-SCAN CSI SWITCH VALUE LIST FOR MODULE NAMES
     57					;
BLMNT	MACRO M1108  05-DEC-77 22:50  PAGE 2-1


     58					; INPUTS:
     59					;
     60					;	$INIPT RECORD BLOCK
     61					;	$LBSVL CSI SWITCH VALUE LIST
     62					;
     63					; OUTPUTS:
     64					;
     65					;	C-CLEAR
     66					;	$LBMOD=VIRTUAL ADDRESS OF MODULE LIST (0=NONE)
     67					;
     68					;	C-SET
     69					;	NON RADIX-50 NAME SPECIFIED.
     70					;
     71					; THIS ROUTINE IS CALLED TO CONSTRUCT A LIST OF MODULE NAMES FOR A LIBRARY
     72					; FILE. THE LIST CONSISTS OF TWO-WORD RADIX-50 VALUES TERMINATED BY A ZERO.
     73					; LIST STORAGE IS OBTAINED FROM VIRTUAL MEMORY. INPUT IS THE SWITCH VALUE
     74					; TABLE CONTAINING ASCII DATA AS BUILT BY CSI2. IF THE TABLE IS EMPTY NO LIST
     75					; IS CONSTRUCTED.
     76					;-
     77
     78	000070				$BLMNT::			;
     79	000070					SAVRG			; SAVE NON-VILATILE REGISTERS
     80	000074	005067 	177742 			CLR	$LBMOD		; ASSUME TABLE EMPTY (CLEAR C)
     81	000100	016700 	000000G			MOV	$INIPT,R0	; GET INPUT FILE RECORD BLOCK
     82	000104	032760 	000000G	000000G		BIT	#SW$LB,R$SWTH(R0) ; LIBRARY FILE?
     83	000112	001444 				BEQ	40$		; IF EQ NO
     84	000114	012705 	000000'			MOV	#LCLMOD,R5	; GET LOCAL STORAGE ADDRESS
     85	000120	012703 	177771G			MOV	#$LBSVT-7,R3	; GET ADDRESS OF SWITCH VALUE LIST
     86	000124	012746 	000011 			MOV	#9.,-(SP)	; SET LOOP COUNT
     87	000130				10$:				;
     88	000130	062703 	000007 			ADD	#7,R3		; POINT TO NEXT STRING
     89	000134	005316 				DEC	(SP)		; DECREMENT COUNT
     90	000136	003411 				BLE	20$		; IF LE FINISHED SCAN
     91	000140	105713 				TSTB	(R3)		; ANYTHING AT THIS ENTRY?
     92	000142	001772 				BEQ	10$		; IF EQ NO
     93	000144	010300 				MOV	R3,R0		; SET STRING POINTER
     94	000146					CALL	$RR		; CONVERT NAME
     95	000152	005702 				TST	R2		; ANY BAD CHARACTERS?
     96	000154	000261 				SEC			; ASSUME YES
     97	000156	001021 				BNE	35$		; IF NE NO
     98	000160	000763 				BR	10$		; GO AGAIN
     99	000162				20$:				;
    100	000162	005015 				CLR	(R5)		; MARK END OF LIST
    101	000164	012704 	000000'			MOV	#LCLMOD,R4	; GET TABLE ADDRESS
    102	000170	020405 				CMP	R4,R5		; ANY ENTRIES?
    103	000172	001413 				BEQ	35$		; IF EQ NO
    104	000174	012701 	000042 			MOV	#17.*2,R1	; SET TABLE SIZE
    105	000200					CALL	$ALVRT		; ALLOCATE VIRTUAL STORAGE
    106	000204	010167 	177632 			MOV	R1,$LBMOD	; SAVE VIRTUAL ADDRESS
    107	000210	000241 				CLC			; SET SUCCESS
    108	000212				30$:				;
    109	000212	012420 				MOV	(R4)+,(R0)+	; BUILD NAME LIST
    110	000214	001402 				BEQ	35$		; IF EQ DONE WITH LIST
    111	000216	012420 				MOV	(R4)+,(R0)+	; MOVE SECOND HALF OF NAME
    112	000220	000774 				BR	30$		;
    113	000222				35$:				;
    114	000222	005226 				INC	(SP)+		; CLEAN STACK
BLMNT	MACRO M1108  05-DEC-77 22:50  PAGE 2-2


    115	000224				40$:				;
    116	000224					RETURN			;
    117
    118		000001 				.END
BLMNT	MACRO M1108  05-DEC-77 22:50  PAGE 2-3
SYMBOL TABLE

CR    = 000015   	LF    = 000012   	SW$LB = ****** GX	$CLRMN  000044RG 	$RR   = ****** GX
FF    = 000014   	R$SWTH= ****** GX	VT    = 000013   	$INIPT= ****** GX	$SAVRG= ****** GX
HT    = 000011   	R$$11M= 000000   	$ALVRT= ****** GX	$LBMOD  000042RG 	$$    = 000001
LCLMOD  000000R  	SPA   = 000040   	$BLMNT  000070RG 	$LBSVT= ****** GX

. ABS.	000000	   000
      	000226	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  612 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
[44,10]BLMNT,[44,20]BLMNT/-SP=[44,30]MACFLM.,BLMNT.000
CMLCL	MACRO M1108  05-DEC-77 22:50  PAGE 2


      1						.TITLE	CMLCL
      2						.IDENT	/01/
      3
      4					;
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					;
      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     12					;
     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     15					; EQUIPMENT CORPORATION.
     16					;
     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     19					;
     20					; VERSION 01
     21					;
     22					; C.MONIA 08-FEB-74
     23					;
     24					; RESET GCML CONTROL BLOCK
     25					;
     26					; MACRO LIBRARY CALLS
     27					;
     28
     29						.MCALL	RCML$
     30
     31					;
     32					;+
     33					; **-$CMLCL-RESET GCML CONTROL BLOCK
     34					;
     35					; INPUTS:
     36					;
     37					;	NONE
     38					;
     39					; OUTPUTS:
     40					;
     41					;	GCML CONTROL BLOCK IS RE-INITIALIZED
     42					;
     43					;-
     44
     45	000000				$CMLCL::			;
     46	000000	016700 	000000G			MOV	$INIPT,R0	; GET RECORD BLOCK POINTER
     47	000004					CALL	$STRCB		; SET RECORD BLOCK RESIDENT
     48	000010					RCML$	$CMIPT		; RESET TO ZERO LEVEL
     49	000020					RETURN			;
     50
     51		000001 				.END
CMLCL	MACRO M1108  05-DEC-77 22:50  PAGE 2-1
SYMBOL TABLE

CR    = 000015   	LF    = 000012   	SPA   = 000040   	$CMLCL  000000RG 	$$    = 000001
FF    = 000014   	PAR$$$= 000067   	VT    = 000013   	$INIPT= ****** GX	.GCML2= ****** G
HT    = 000011   	R$$11M= 000000   	$CMIPT= ****** GX	$STRCB= ****** GX

. ABS.	000000	   000
      	000022	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  644 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
[44,10]CMLCL,[44,20]CMLCL/-SP=[44,30]MACFLM.,CMLCL.001
CVRL	MACRO M1108  05-DEC-77 22:50  PAGE 2


      1						.TITLE	CVRL
      2						.IDENT	/01/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     17					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 01                                                                    ;**NEW**
     20					;                                                                               ;**-1
     21					; C. MONIA 22-FEB-74
     22					;
     23					; CONVERT A VIRTUAL ADDRESS TO REAL ADDRESS
     24					;
     25					;+
     26					; **-$CVRL-MAKE VIRTUAL STORE RESIDENT
     27					;
     28					; INPUTS:
     29					;
     30					;	R1=VIRTUAL ADDRESS
     31					;
     32					; OUTPUTS:
     33					;
     34					;	R0=REAL ADDRESS
     35					;
     36					; R1 IS UNCHANGED
     37					;
     38					; THIS ROUTINE IS CALLED TO CONVERT A VIRTUAL ADDRESS INTO
     39					; AN ADDRESS IN REAL MEMORY. THE LIST OF RESIDENT PAGE
     40					; BUFFERS IS CHECKED FIRST. IF THE PAGE IS NOT
     41					; IN MEMORY A BUFFER IS ALLOCATED AND THE PAGE IS READ INTO
     42					; CORE
     43					;
     44					;-
     45
     46	000000				$CVRL::				;
     47	000000					SAVRG			; SAVE NON-VOLATILE REGISTERS
     48	000004	010105 				MOV	R1,R5		; COPY VIRTUAL ADDRESS
     49	000006	000305 				SWAB	R5		; POSITION BLOCK NUMBER TO LOW BYTE
     50	000010					CALL	$FNDPG		; SEARCH FOR PAGE
     51	000014	103032 				BCC	10$		; IF C/C PAGE IN CORE.
     52	000016	012701 	000000G			MOV	#P$GSIZ,R1	; GET SIZE OF PAGE BUFFER
     53	000022					CALL	$ALBLK		; ALLOCATE MEMORY
     54	000026	016704 	000000G			MOV	$PAGLS,R4	; GET ADDRESS OF PAGE LIST                      ;**NEW**
     55	000032	001405 				BEQ	5$		; IF EQ NONE                                    ;**NEW**
     56	000034	005002 				CLR	R2		; SET FOR MOVB WITH NO EXTEND                   ;**NEW**
     57	000036	150502 				BISB	R5,R2		; GET RELATIVE BLOCK NUMBER                     ;**NEW**
CVRL	MACRO M1108  05-DEC-77 22:50  PAGE 2-1


     58	000040	006302 				ASL	R2		; CONVERT TO WORD OFFSET                        ;**NEW**
     59	000042	060204 				ADD	R2,R4		; COMPUTE LIST ADDRESS                          ;**NEW**
     60	000044	010014 				MOV	R0,(R4)		; STORE ADDRESS OF PAGE                         ;**NEW**
     61	000046				5$:				;                                               ;**NEW**
     62	000046	110560 	000000G			MOVB	R5,P$GBLK(R0)	; SET RELATIVE BLOCK NUMBER
     63	000052					CALL	$RDPAG		; READ PAGE INTO CORE
     64	000056	016760 	000000G	000000G		MOV	$PAGHD,P$GNXT(R0) ; LINK OLD FIRST TO NEW FIRST
     65	000064	010067 	000000G			MOV	R0,$PAGHD	; SET NEW FIRST
     66	000070	016760 	000000G	000000G		MOV	$TIME,P$GTIM(R0) ; TIME-STAMP PAGE
     67	000076	010501 				MOV	R5,R1		; RESTORE VIRTUAL ADDRESS
     68	000100	000301 				SWAB	R1		; STRAIGHTEN IT
     69	000102				10$:				;
     70	000102	105005 				CLRB	R5		; CLEAR BLOCK NUMBER
     71	000104	000305 				SWAB	R5		; GET WORD DISPLACEMENT IN LOW BYTE
     72	000106	006305 				ASL	R5		; MAKE BYTE OFFSET
     73	000110	060500 				ADD	R5,R0		; ADD DISPLACEMENT IN BLOCK
     74	000112	062700 	000000G			ADD	#P$GHD,R0	; OFFSET PAST HEADER
     75	000116					RETURN			;
     76
     77		000001 				.END
CVRL	MACRO M1108  05-DEC-77 22:50  PAGE 2-2
SYMBOL TABLE

CR    = 000015   	P$GHD = ****** GX	R$$11M= 000000   	$CVRL   000000RG 	$RDPAG= ****** GX
FF    = 000014   	P$GNXT= ****** GX	SPA   = 000040   	$FNDPG= ****** GX	$SAVRG= ****** GX
HT    = 000011   	P$GSIZ= ****** GX	VT    = 000013   	$PAGHD= ****** GX	$TIME = ****** GX
LF    = 000012   	P$GTIM= ****** GX	$ALBLK= ****** GX	$PAGLS= ****** GX	$$    = 000001
P$GBLK= ****** GX

. ABS.	000000	   000
      	000120	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  597 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:07
[44,10]CVRL,[44,20]CVRL/-SP=[44,30]MACFLM.,CVRL.001
DKALO	MACRO M1108  05-DEC-77 22:50  PAGE 3


      1						.TITLE	DKALO
      2						.IDENT	/12/
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					;
      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     12					;
     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     15					; EQUIPMENT CORPORATION.
     16					;
     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     19					;
     20					; VERSION 12
     21					;                                                                               ;**-1
     22					; D. N. CUTLER/C. MONIA	21-JAN-74
     23					;
     24					; MODIFICATIONS:
     25					;
     26					; NO.		DATE		PROGRAMMER
     27					; ---		----		----------
     28					;
     29					; 041		19-MAY-75	C. MONIA
     30					;
     31					; MONITOR DEPENDENT ROUTINE TO ALLOCATE DISK SPACE FOR TASK IMAGE
     32					;
     33					; MACRO LIBRARY CALLS
     34					;
     35
     36						.MCALL	OFNB$W
     37
     38					;
     39					; LOCAL DATA
     40					;
     41
     42
     43						.IF	DF	T$$MP
     44
     45					;
     46					; OUTPUT LOGICAL DISK BLOCK ADDRESS OF TASK IMAGE
     47					;
     48
     49					TSKLM:	.ASCII	/TASK DISK ADDRESS: /
     50					TSKDB:	.ASCII	/000000:000000/
     51					TSKME:
     52						.EVEN
     53					TSKST:	.BLKW	6		; TASK IMAGE FILE STATISTICS BLOCK
     54
     55						.ENDC
     56
     57	000000				SGADR:	.BLKW	1		;NEXT VIRTUAL SEGMENT ADDRESS
DKALO	MACRO M1108  05-DEC-77 22:50  PAGE 3-1


     58
     59					;+
     60					; **-$DKALO-DISK ALLOCATION
     61					;
     62					; THIS ROUTINE IS CALLED IN PHASE 4 TO ALLOCATE THE DISK SPACE
     63					; FOR THE TASK IMAGE FILE. THE FILE IS ALLOCATED AND A BITMAP
     64					; IS CONSTRUCTED THAT CONTAINS A ONE BIT FOR EACH BLOCK IN THE
     65					; FILE.
     66					;
     67					; INPUTS:
     68					;
     69					;	$RLBLK=HIGHEST RELATIVE BLOCK NUMBER.
     70					;
     71					; OUTPUTS:
     72					;
     73					;	TASK IMAGE FILE IS ALLOCATED AND BITMAP IS CONSTRUCTED.
     74					;-
     75
     76	000002	032767 	000000G	000000G	$DKALO::BIT	#TS$KF,$SWTCH	;TASK IMAGE FILE SPECIFIED?
     77	000010	001534 				BEQ	50$		;IF EQ NO
     78	000012					SAVRG			;SAVE NONVOLITILE REGISTERS
     79	000016	066767 	000000G	000000G		ADD	$HDRBN,$RLBLK	;++041 INCLUDE HEADER IN DISK ALLOCATION
     80	000024	016700 	000000G			MOV	$TSKPT,R0	;GET TASK IMAGE FILE RECORD BLOCK
     81	000030	016704 	000000G			MOV	$FSIZI,R4	; GET REQUESTED ALLOCATION                      ;**NEW**
     82	000034	066704 	000000G			ADD	$HDRBN,R4	; INCLUDE CHECKPOINT AREA                       ;**NEW**
     83	000040	020467 	000000G			CMP	R4,$RLBLK	; COMPARE AGAINST TRUE TASK SIZE                ;**NEW**
     84	000044	101002 				BHI	5$		; IF HI ALLOCATE MORE DISK AREA                 ;**NEW**
     85	000046	016704 	000000G			MOV	$RLBLK,R4	; ELSE ALLOCATE JUST ENOUGH FOR TASK IMAGE      ;**NEW**
     86	000052				5$:				;                                               ;**NEW**
     87	000052	010460 	000034 			MOV	R4,F.CNTG(R0)	; SET SIZE OF FILE TO ALLOCATE                  ;**-1
     88	000056	010467 	000000G			MOV	R4,$FSIZI	;SET FILE SIZE INDICATOR
     89	000062	166767 	000000G	000000G		SUB	$LBBLK,$FSIZI	; SUBTRACT OUT LABEL BLOCKS
     90
     91						.IF	DF	T$$MP
     92
     93						MOV	#TSKST,F.STBK(R0) ; READ STATISTICS ON ACCESS
     94
     95						.ENDC
     96
     97	000070					OFNB$W	R0		; OPEN TASK IMAGE FILE
     98	000102	103012 				BCC	10$		;IF CC OKAY
     99	000104	012701 				MOV	(PC)+,R1	;ALLOCATION FAILURE
    100	000106	   000G	   000G			.BYTE	E$R24,S$V0	;DIAGNOSTIC
    101	000110	016002 	000000G			MOV	R$NAME(R0),R2	;GET ADDRESS OF NAME STRING
    102	000114					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    103	000120	042767 	000000G	000000G		BIC	#TS$KF,$SWTCH	;CLEAR TASK IMAGE OPTION BIT
    104	000126	000465 				BR	50$		;VAMOOSA!
    105
    106
    107						.IF	DF	V1145
    108
    109					10$:	MOV	R4,R1		;SET LOW PART OF DIVIDEND
    110						CLR	R0		;CLEAR HIGH PART OF DIVIDEND
    111						DIV	#8.,R0		;CALCULATE SIZE OF BITMAP
    112
    113						.IFF
    114
DKALO	MACRO M1108  05-DEC-77 22:50  PAGE 3-2


    115	000130	010400 			10$:	MOV	R4,R0		;SET DIVIDEND
    116	000132	012701 	000010 			MOV	#8.,R1		;SET DIVISOR
    117	000136					CALL	$DIV		;CALCULATE SIZE OF BITMAP
    118
    119						.ENDC
    120
    121
    122	000142	010105 				MOV	R1,R5		;SAVE REMAINDER
    123	000144	001401 				BEQ	20$		;IF EQ SIZE IS RIGHT
    124	000146	005200 				INC	R0		;INCREMENT LENGTH OF BITMAP
    125	000150	010004 			20$:	MOV	R0,R4		;SAVE SIZE OF BITMAP
    126	000152	010001 				MOV	R0,R1		;SET SIZE OF BLOCK TO ALLOCATE
    127	000154					CALL	$ALBLK		;ALLOCATE STORAGE
    128	000160	010067 	000002G			MOV	R0,$BITMP+2	;SET ADDRESS OF BITMAP
    129	000164	010467 	000000G			MOV	R4,$BITMP	;SET SIZE OF BITMAP
    130	000170	112720 	000377 		30$:	MOVB	#377,(R0)+	;FILL BITMAP WITH ONE BITS
    131	000174					SOB	R4,30$		;REPEAT
    132	000200	005705 				TST	R5		;ANY REMAINDER?
    133	000202	001410 				BEQ	47$		;IF EQ NO
    134	000204	012701 	000001 			MOV	#1,R1		;GET ONE BIT FOR MASK FORMATION
    135
    136
    137						.IF	DF	V1145
    138
    139						ASH	R5,R1		;SHIFT INTO PLACE
    140
    141						.IFF
    142
    143	000210	005305 			43$:	DEC	R5		;DECREMENT SHIFT COUNT
    144	000212	002402 				BLT	45$		;IF LT DONE
    145	000214	006301 				ASL	R1		;SHIFT MASK INTO PLACE
    146	000216	000774 				BR	43$		;
    147
    148						.ENDC
    149
    150
    151	000220	005301 			45$:	DEC	R1		;FORM PARTIAL MAP FOR FINAL BYTE
    152	000222	110140 				MOVB	R1,-(R0)	;INSERT FINAL BYTE
    153	000224				47$:				;
    154	000224	016701 	000000G			MOV	$RTSEG,R1	; GET ROOT SEGMENT VIRTUAL ADDRESS
    155	000230					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    156	000234	016067 	000000G	177536 		MOV	S$GRWB(R0),SGADR ; SET R/W BASE FOR AUTOLOAD VECTORS
    157	000242	012700 	000304'			MOV	#DKALO,R0	;GET PHASE CONTROL ROUTINE ADDRESS
    158	000246					CALL	$PCTRL		;CALL PHASE CONTROL ROUTINE
    159	000252	016701 	000000G			MOV	$RTSEG,R1	; GET ROOT SEGMENT VIRTUAL ADDRESS
    160	000256					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    161	000262					CALL	$WRMPG		; WRITE-MARK PAGE
    162	000266	062767 	000002 	177504 		ADD	#2,SGADR	; INCLUDE TERMINAL ZERO WORD                    ;**NEW**
    163	000274	016760 	177500 	000000G		MOV	SGADR,S$GRWB(R0)  ;SET R/W BASE FOR AUTOLOAD VECTORS
    164
    165						.IF	DF	T$$MP
    166
    167						MOV	#TSKDB,R0	; GET ADDRESS OF OUTPUT TEMPLATE
    168						MOV	TSKST,R1	; FIRST HALF OF LBN
    169						MOV	PC,R2		; NO ZERO SURPRESS
    170						CALL	$CBOMG		; CONVERT
    171						TSTB	(R0)+		; STEP PAST DELIMITER
DKALO	MACRO M1108  05-DEC-77 22:50  PAGE 3-3


    172						MOV	TSKST+2,R1	; GET SECOND HALF OF DISK ADDRESS
    173						MOV	PC,R2		; AGAIN, NO ZERO SURPRESS
    174						CALL	$CBOMG		; CONVERT TO ASCII
    175						MOV	#TSKLM,R1	; GET BUFFER ADDRESS
    176						MOV	#<TSKME-TSKLM>,R2 ; BUFFER LENGTH
    177						CALL	$PUTCO		; OUTPUT TO 'CO'
    178
    179						.ENDC
    180
    181	000302				50$:	RETURN			;
    182
    183					;
    184					; VIRTUAL SEGMENT DESCRIPTOR ADDRESS ASSIGNMENT
    185					;
    186					; THIS ROUTINE IS CALLED FOR EACH SEGMENT IN THE ALLOCATION.
    187					;
    188
    189	000304	016700 	000000G		DKALO:	MOV	$CRSEG,R0	;GET ADDRESS OF CURRENT SEGMENT
    190	000310	066760 	000000G	000000G		ADD	$HDRBN,S$GBLK(R0) ;++041 OFFSET SEGMENT DISK ADDRESS
    191	000316	016760 	177456 	000000G		MOV	SGADR,S$GSEG(R0);SET VIRTUAL ADDR OF SEGMENT DESCRIPTOR
    192	000324	066767 	000000G	177446 		ADD	$SZSEG,SGADR	; ADVANCE TO NEXT SEGMENT DESCRIPTOR ADDR.
    193	000332	016701 	000000G			MOV	$CRVSG,R1	; GET VIRTUAL ADDRESS OF CURRENT SEGMENT
    194	000336					CALLR	$WRMPG		; WRITE-MARK PAGE
    195
    196		000001 				.END
DKALO	MACRO M1108  05-DEC-77 22:50  PAGE 3-4
SYMBOL TABLE

B.BBFS= 000010   	FD.WBH= 000002   	F.FTYP= 000116   	NB.STP= 000020   	S.FNBW= 000017
B.BFST= 000015   	FF    = 000014   	F.FVER= 000120   	NB.SVR= 000010   	S.FNTY= 000004
B.NXBD= 000012   	FO.APD= 000106   	F.HIBK= 000004   	NB.TYP= 000002   	S.FTYP= 000002
B.VBN = 000004   	FO.MFY= 000002   	F.LUN = 000042   	NB.VER= 000001   	S.NFEN= 000020
CR    = 000015   	FO.RD = 000001   	F.MBCT= 000054   	N.DID = 000024   	TS$KF = ****** GX
DKALO   000304R  	FO.UPD= 000006   	F.MBC1= 000055   	N.DVNM= 000032   	VT    = 000013
E$R24 = ****** GX	FO.WRT= 000016   	F.MBFG= 000056   	N.FID = 000000   	$ALBLK= ****** GX
FA.APD= 000100   	F.ALOC= 000040   	F.NRBD= 000024   	N.FNAM= 000006   	$BITMP= ****** GX
FA.CRE= 000010   	F.BBFS= 000062   	F.NREC= 000030   	N.FTYP= 000014   	$CRSEG= ****** GX
FA.EXT= 000004   	F.BDB = 000070   	F.OVBS= 000030   	N.FVER= 000016   	$CRVSG= ****** GX
FA.NSP= 000100   	F.BGBC= 000057   	F.RACC= 000016   	N.NEXT= 000022   	$CVRL = ****** GX
FA.RD = 000001   	F.BKDN= 000026   	F.RATT= 000001   	N.STAT= 000020   	$DIV  = ****** GX
FA.SHR= 000040   	F.BKDS= 000020   	F.RCNM= 000034   	N.UNIT= 000034   	$DKALO  000002RG
FA.TMP= 000020   	F.BKEF= 000050   	F.RCTL= 000017   	PAR$$$= 000000   	$ERMSG= ****** GX
FA.WRT= 000002   	F.BKP1= 000051   	F.RSIZ= 000002   	R$NAME= ****** GX	$FSIZI= ****** GX
FD.BLK= 000010   	F.BKST= 000024   	F.RTYP= 000000   	R$$11M= 000000   	$HDRBN= ****** GX
FD.CCL= 000002   	F.BKVB= 000064   	F.STBK= 000036   	R.FIX = 000001   	$LBBLK= ****** GX
FD.CR = 000002   	F.CNTG= 000034   	F.UNIT= 000136   	R.VAR = 000002   	$PCTRL= ****** GX
FD.DIR= 000010   	F.DFNB= 000046   	F.URBD= 000020   	SGADR   000000R  	$RLBLK= ****** GX
FD.FTN= 000001   	F.DSPT= 000044   	F.VBN = 000064   	SPA   = 000040   	$RTSEG= ****** GX
FD.INS= 000010   	F.DVNM= 000134   	F.VBSZ= 000060   	S$GBLK= ****** GX	$SAVRG= ****** GX
FD.PLC= 000004   	F.EFBK= 000010   	HT    = 000011   	S$GRWB= ****** GX	$SWTCH= ****** GX
FD.RAH= 000001   	F.EFN = 000050   	LF    = 000012   	S$GSEG= ****** GX	$SZSEG= ****** GX
FD.RAN= 000002   	F.EOBB= 000032   	NB.DEV= 000200   	S$V0  = ****** GX	$TSKPT= ****** GX
FD.REC= 000001   	F.ERR = 000052   	NB.DIR= 000100   	S.BFHD= 000020   	$WRMPG= ****** GX
FD.RWM= 000001   	F.FACC= 000043   	NB.NAM= 000004   	S.FATT= 000016   	$$    = 000001
FD.SDI= 000020   	F.FFBY= 000014   	NB.SD1= 000400   	S.FDB = 000140   	.OPFNB= ****** G
FD.SQD= 000040   	F.FNAM= 000110   	NB.SD2= 001000   	S.FNAM= 000006   	...GBL= 000000
FD.TTY= 000004   	F.FNB = 000102   	NB.SNM= 000040   	S.FNB = 000036   	...TPC= 000140

. ABS.	000000	   000
      	000342	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2113 WORDS  ( 9 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:22
[44,10]DKALO,[44,20]DKALO/-SP=[44,30]MACFLM.,FCSPR.,DKALO.012
ERMSG	MACRO M1108  05-DEC-77 22:51  PAGE 2


      1						.TITLE	ERMSG
      2						.IDENT	/15/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 15                                                                    ;**NEW**
     20					;                                                                               ;**-1
     21					; D.N. CUTLER 16-OCT-72
     22					;
     23					;
     24					;
     25					; MODIFICATIONS
     26					;
     27					; NO.		DATE		PROGRAMMER
     28					; ---		----		----------
     29					;
     30					; 004		4-AUG-73	C. MONIA
     31					;
     32					;
     33					;
     34					;
     35					; ERROR MESSAGE ROUTINE
     36					;
     37					; EQUATED SYMBOLS
     38					;
     39
     40		000000 			MXBF=0				; INITIAL SIZE OF TEMP BUFFER
     41		000053 			M$SG1==43.			; NUMBER OF MESSAGES IN GROUP 1                 ;**NEW**
     42		000000 			S$V0==0				;SEV 0=DIAGNOSTIC MESSAGE                       ;**-1
     43		000001 			S$V1==1				;SEV 1=DIAG IF TERM IN/FATAL IF NOT
     44		000002 			S$V2==2				;SEV 2=FATAL ERROR
     45
     46					;
     47					; MACRO LIBRARY CALLS
     48					;
     49
     50						.IF	NDF	R$$11M
     51
     52						.MCALL	CLOSE$,DIR$,PUT$,RCML$
     53
     54						.IFF
     55
     56						.MCALL	CLOSE$,DIR$,QIO$,QIOSY$,RCML$,WTSE$S
     57
ERMSG	MACRO M1108  05-DEC-77 22:51  PAGE 2-1


     58						.ENDC
     59
     60					;
     61					; LOCAL MACROS
     62					;
     63					; ERROR MESSAGE DEFINITION
     64					;
     65					; ERM NUM,FORMAT
     66					;
     67					; WHERE:
     68					;
     69					;	NUM=ERROR NUMBER.
     70					;	FORMAT=ERROR MESSAGE FORMAT STATEMENT.
     71					;
     72
     73						.MACRO	ERM NUM,FORMAT
     74					E$R'NUM==NUM'.
     75					E$RMAX==NUM'.
     76						.NCHR	SZ,<FORMAT>
     77						.IF	GT	SZ-MXBF
     78					MXBF=SZ
     79						.ENDC
     80						.IF	LE	E$RMAX-M$SG1
     81						.PSECT	ETX1$D,D,GBL
     82						.IFF
     83						.PSECT	ETX2$D,D,GBL
     84						.ENDC
     85					NN=.
     86						.ASCIZ	"FORMAT"
     87						.PSECT	EPT$D,D,GBL
     88					.=$MSG+<2*NUM'.>
     89						.WORD	NN
     90						.PSECT
     91						.ENDM
     92
     93					;
     94					; LOCAL DATA
     95					;
     96
     97	000000				$ARGBK::.BLKW	3		; LOCAL ARGUMENT BLOCK
     98
     99	000000					.PSECT	TXT
    100
    101	000000	   124 	   113 	   102 	ABMSG:	.ASCII	/TKB -- *FATAL*-RUN ABORTED/;ABORT MESSAGE
	000003	   040 	   055 	   055
	000006	   040 	   052 	   106
	000011	   101 	   124 	   101
	000014	   114 	   052 	   055
	000017	   122 	   125 	   116
	000022	   040 	   101 	   102
	000025	   117 	   122 	   124
	000030	   105 	   104
    102	000032				ABMSE:				;
    103
    104	000000					.PSECT	EPT$D,D,GBL
    105
    106	000000				$MSG::				; REF. LABEL
ERMSG	MACRO M1108  05-DEC-77 22:51  PAGE 2-2


    107	000006					.PSECT
    108
    109					;
    110					; ERROR MESSAGES
    111					;
    112
    113
    114						.IF	NDF	S$$MSG
    115
    116	000006					ERM	0,^/ILLEGAL GET COMMAND LINE ERROR CODE%2N/
    117	000006					ERM	1,^\COMMAND SYNTAX ERROR%2N%VA%2N\
    118	000006					ERM	2,^\REQUIRED INPUT FILE MISSING%2N\
    119	000006					ERM	3,^\ILLEGAL SWITCH%2N%VA%2N\
    120	000006					ERM	4,^/NO DYNAMIC STORAGE AVAILABLE %P %P%2N/
    121	000006					ERM	5,^/ILLEGAL ERROR-SEVERITY CODE %P %P %P%2N/
    122	000006					ERM	6,^\COMMAND I/O ERROR%2N\
    123	000006					ERM	7,^\INDIRECT FILE OPEN FAILURE%2N%VA%2N\
    124	000006					ERM	8,^\INDIRECT COMMAND SYNTAX ERROR%2N%VA%2N\
    125	000006					ERM	9,^\INDIRECT FILE DEPTH EXCEEDED%2N%VA%2N\
    126	000006					ERM	10,^\I/O ERROR ON INPUT FILE %X%2N\
    127	000006					ERM	11,^/OPEN FAILURE ON FILE %X%2N/
    128	000006					ERM	12,^/SEARCH STACK OVERFLOW ON SEGMENT %2R%2N/
    129	000006					ERM	13,^/PASS CONTROL STACK OVERFLOW AT SEGMENT %2R%2N/
    130	000006					ERM	14,^/FILE %X HAS ILLEGAL FORMAT%2N/
    131	000006					ERM	15,^/MODULE %2R AMBIGUOUSLY DEFINES P-SECTION %2R%2N/
    132	000006					ERM	16,^/MODULE %2R MULTIPLY DEFINES P-SECTION %2R%2N/
    133	000006					ERM	17,^/MODULE %2R MULTIPLY DEFINES XFR ADDR IN SEG %2R%2N/
    134	000006					ERM	18,^/MODULE %2R ILLEGALLY DEFINES XFR ADDR %2R %P%2N/
    135	000006					ERM	19,^/P-SECTION %2R HAS OVERFLOWED%2N/
    136	000006					ERM	20,^/MODULE %2R AMBIGUOUSLY DEFINES SYMBOL %2R%2N/
    137	000006					ERM	21,^/MODULE %2R MULTIPLY DEFINES SYMBOL %2R%2N/
    138	000006					ERM	22,^/SEGMENT %2R HAS RO P-SECTION%2N/
    139	000006					ERM	23,^\SEGMENT %2R HAS ADDRESS OVERFLOW: ALLOCATION DELETED%2N\
    140	000006					ERM	24,^/ALLOCATION FAILURE ON FILE %X%2N/
    141	000006					ERM	25,^\I/O ERROR ON OUTPUT FILE %X%2N\
    142	000006					ERM	26,^/LOAD ADDR OUT OF RANGE IN MODULE %2R%2N/
    143	000006					ERM	27,^/TRUNCATION ERROR IN MODULE %2R%2N/
    144	000006					ERM	28,^\%D UNDEFINED SYMBOLS SEGMENT %2R%2N\
    145	000006					ERM	29,^/INVALID KEYWORD IDENTIFIER%2N%VA%2N/
    146	000006					ERM	30,^\OPTION SYNTAX ERROR%2N%VA%2N\
    147	000006					ERM	31,^/TOO MANY PARAMETERS%2N%VA%2N/
    148	000006					ERM	32,^/ILLEGAL MULTIPLE PARAMETER SETS%2N%VA%2N/
    149	000006					ERM	33,^/INSUFFICIENT PARAMETERS%2N%VA%2N/
    150	000006					ERM	34,^/TASK HAS ILLEGAL MEMORY LIMITS%2N/
    151	000006					ERM	35,^/OVERLAY DIRECTIVE HAS NO OPERANDS%2N%VA%2N/
    152	000006					ERM	36,^/ILLEGAL OVERLAY DIRECTIVE%2N%VA%2N/
    153	000006					ERM	37,^/OVERLAY DIRECTIVE SYNTAX ERROR%2N%VA%2N/
    154	000006					ERM	38,^/ROOT SEGMENT IS MULTIPLY DEFINED%2N%VA%2N/
    155	000006					ERM	39,^/LABEL OR NAME IS MULTIPLY DEFINED%2N%VA%2N/
    156	000006					ERM	40,^/NO ROOT SEGMENT SPECIFIED%2N/
    157	000006					ERM	41,^/BLANK P-SECTION NAME IS ILLEGAL%2N%VA%2N/
    158	000006					ERM	42,^/ILLEGAL P-SECTION ATTRIBUTE%2N%VA%2N/
    159	000006					ERM	43,^/ILLEGAL OVERLAY DESCRIPTION OPERATOR%2N%VA%2N/
    160	000006					ERM	44,^\TOO MANY NESTED .ROOT/.FCTR DIRECTIVES%2N%VA%2N\
    161	000006					ERM	45,^\TOO MANY PARENTHESES LEVELS%2N%VA%2N\                      ;**NEW**
    162	000006					ERM	46,^\UNBALANCED PARENTHESES%2N%VA%2N\                           ;**NEW**
    163	000006					ERM	47,^/ILLEGAL BASE OR TOP ADDRESS OFFSET %D%2N/                  ;**-2
ERMSG	MACRO M1108  05-DEC-77 22:51  PAGE 2-3


    164	000006					ERM	48,^/ILLEGAL LOGICAL UNIT NUMBER%2N%VA%2N/
    165	000006					ERM	49,^/ILLEGAL NUMBER OF LOGICAL UNITS%2N%VA%2N/
    166	000006					ERM	50,^/ILLEGAL NUMBER OF ACTIVE FILES SPECIFIED%2N%VA%2N/
    167	000006					ERM	51,^/ILLEGAL BASE OR TOP BOUNDRY VALUE%2N%VA%2N/
    168	000006					ERM	52,^/ILLEGAL POOL USAGE NUMBER SPECIFIED%2N%VA%2N/
    169	000006					ERM	53,^/ILLEGAL DEFAULT PRIORITY SPECIFIED%2N%VA%2N/
    170	000006					ERM	54,^/ILLEGAL ODT OR TASK VECTOR SIZE%2N/
    171	000006					ERM	55,^\ILLEGAL FILENAME%2N%VA%2N\
    172	000006					ERM	56,^\ILLEGAL DEVICE/VOLUME%2N%VA%2N\
    173	000006					ERM	57,^\LOOKUP FAILURE ON FILE %X%2N\
    174	000006					ERM	58,^\ILLEGAL DIRECTORY%2N%VA%2N\
    175	000006					ERM	59,^\INCOMPATABLE REFERENCE TO LIBRARY P-SECTION %2R%2N\
    176	000006					ERM	60,^\ILLEGAL REFERENCE TO LIBRARY P-SECTION %2R%2N\
    177	000006					ERM	61,^\RESIDENT LIBRARY MEMORY ALLOCATION CONFLICT%2N%VA%2N\
    178	000006					ERM	62,^\LOOKUP FAILURE RESIDENT LIBRARY FILE%2N%VA%2N\
    179	000006					ERM	63,^\INVALID ACCESS TYPE%2N%VA%2N\
    180	000006					ERM	64,^\ILLEGAL PARTITION/COMMON BLOCK SPECIFIED%2N%VA%2N\
    181	000006					ERM	65,^\NO MEMORY AVAILABLE FOR LIBRARY %2R%2N\
    182	000006					ERM	66,^\PIC LIBRARIES MAY NOT REFERENCE OTHER LIBRARIES%N%VA\
    183	000006					ERM	67,^\ILLEGAL APR RESERVATION%N%VA\
    184	000006					ERM	68,^\I/O ERROR LIBRARY IMAGE FILE%N%VA\
    185	000006					ERM	69,^\LIBRARY REFERENCES UNDEFINED LIBRARY%N%VA\
    186	000006					ERM	70,^\REQUIRED PARTITION NOT SPECIFIED%2N\
    187	000006					ERM	71,^\INVALID APR RESERVATION%N%VA\
    188	000006					ERM	72,^\COMPLEX RELOCATION ERROR-DIVIDE BY ZERO MODULE %2R%2N\     ;**NEW**
    189	000006					ERM	73,^\WORK FILE I/O ERROR%2N\                                    ;**-1
    190	000006					ERM	74,^\LOOKUP FAILURE ON SYSTEM LIBRARY FILE%2N\
    191	000006					ERM	75,^\UNABLE TO OPEN WORK FILE%2N\
    192	000006					ERM	76,^\NO VIRTUAL MEMORY STORAGE AVAILABLE%2N\
    193	000006					ERM	77,^\MODULE %2R NOT IN LIBRARY%2N\
    194	000006					ERM	78,^\INCORRECT LIBRARY MODULE SPECIFICATION%N%VA%2N\
    195	000006					ERM	79,^\LIBRARY FILE %X HAS INCORRECT FORMAT%2N\
    196	000006					ERM	80,^\RESIDENT LIBRARY IMAGE HAS INCORRECT FORMAT%2N%VA%2N\
    197	000006					ERM	81,^\PARTITION %2R HAS ILLEGAL MEMORY LIMITS%2N\
    198	000006					ERM	82,^\INVALID PARTITION/COMMON BLOCK SPECIFIED%2N%VA%2N\
    199	000006					ERM	83,^\TASK BUILD ABORTED VIA REQUEST%2N%VA%2N\                   ;**NEW**
    200	000006					ERM	84,^\DISK IMAGE CORE ALLOCATION TOO LARGE%2N%VA%2N\             ;**NEW**
    201
    202						.IFF
    203
    204						ERM	0
    205						ERM	1,^\%2N%VA\
    206						ERM	2
    207						ERM	3,^\%2N%VA\
    208						ERM	4,^\%P  %P\
    209						ERM	5,^\%P  %P  %P\
    210						ERM	6
    211						ERM	7,^\%2N%VA\
    212						ERM	8,^\%2N%VA\
    213						ERM	9,^\%2N%VA\
    214						ERM	10,^\%X\
    215						ERM	11,^\%X\
    216						ERM	12,^\%2R\
    217						ERM	13,^\%2R\
    218						ERM	14,^\%X\
    219						ERM	15,^\%2R  %2R\
    220						ERM	16,^\%2R  %2R\
ERMSG	MACRO M1108  05-DEC-77 22:51  PAGE 2-4


    221						ERM	17,^\%2R  2R\
    222						ERM	18,^\%2R  %2R  %P\
    223						ERM	19,^\%2R\
    224						ERM	20,^\%2R  %2R\
    225						ERM	21,^\%2R  %2R\
    226						ERM	22,^\%2R  %2R\
    227						ERM	23,^\%2R\
    228						ERM	24,^\%X\
    229						ERM	25,^\%X\
    230						ERM	26,^\%2R\
    231						ERM	27,^\%2R\
    232						ERM	28,^\%D  %2R\
    233						ERM	29,^\%2N%VA\
    234						ERM	30,^\%2N%VA\
    235						ERM	31,^\%2N%VA\
    236						ERM	32,^\%2N^VA\
    237						ERM	33,^\%2N%VA\
    238						ERM	34
    239						ERM	35,^\%2N%VA\
    240						ERM	36,^\%2N%VA\
    241						ERM	37,^\%2N%VA\
    242						ERM	38,^\%2N%VA\
    243						ERM	39,^\%2N%VA\
    244						ERM	40
    245						ERM	41,^\%2N%VA\
    246						ERM	42,^\%2N%VA\
    247						ERM	43,^\%2N%VA\
    248						ERM	44,^\%2N%VA\
    249						ERM	45,^\%2N%VA\
    250						ERM	46,^\%2N%VA\
    251						ERM	47,^\%D\
    252						ERM	48,^\%2N%VA\
    253						ERM	49,^\%2N%VA\
    254						ERM	50,^\%2N%VA\
    255						ERM	51,^\%2N%VA\
    256						ERM	52,^\%2N%VA\
    257						ERM	53,^\%2N%VA\
    258						ERM	54
    259						ERM	55,^\%2N%VA\
    260						ERM	56,^\%2N%VA\
    261						ERM	57,^\%X\
    262						ERM	58,^\%2N%VA\
    263						ERM	59,^\%2R\
    264						ERM	60,^\%2R\
    265						ERM	61,^\%2N%VA\
    266						ERM	62,^\%2N%VA\
    267						ERM	63,^\%2N%VA\
    268						ERM	64,^\%2N%VA\
    269						ERM	65,^\%2R\
    270						ERM	66,^\%N%VA\
    271						ERM	67,^\%N%VA\
    272						ERM	68,^\%N%VA\
    273						ERM	69,^\%N%VA\
    274						ERM	70
    275						ERM	71,^\%N%VA\
    276						ERM	72,^\%2R\
    277						ERM	73
ERMSG	MACRO M1108  05-DEC-77 22:51  PAGE 2-5


    278						ERM	74
    279						ERM	75
    280						ERM	76
    281						ERM	77,^\%2R%2N
    282						ERM	78,^\%N%VA%2N\
    283						ERM	79,^\%X %2N\
    284						ERM	80,^\%2N%VA%2N\
    285						ERM	81,^\%2R%2N\
    286						ERM	82,^\%2N%VA%2N\
    287						ERM	83,^\%2N%VA%2N\                                                 ;**NEW**
    288						ERM	84,^\%2N%VA%2N\                                                 ;**NEW**
    289
    290						.ENDC
    291
    292					;
    293					; REDEFINE ERROR MESSAGE MACRO TO FREE UP MACRO STORAGE
    294					;
    295
    296						.MACRO	ERM	NUM,FORMAT
    297						.ENDM
    298
    299
    300	000006					.PSECT
    301
    302						.IF	DF	R$$11M
    303
    304					;
    305					; DEFINE QIO DPB PARAMETERS
    306					;
    307
    308	000006					QIOSY$			;
    309
    310					;
    311					; QIO DPB FOR ERROR MESSAGE OUTPUT
    312					;
    313	000006				CODPB:	QIO$	IO.WVB,2,2,,COSTS,,<0,0,40,0,0,0>
    314
    315					;
    316					; CONSOLE OUTPUT I/O STATUS DOUBLE WORD
    317					;
    318
    319	000036				COSTS:	.BLKW	2
    320
    321						.ENDC
    322
    323					;+
    324					; **-$ERMSG-ERROR MESSAGE ROUTINE
    325					;
    326					; THIS ROUTINE IS CALLED TO OUTPUT AN ERROR MESSAGE. THE SEVERITY OF
    327					; THE ERROR IS USED TO SELECT A PREFIX THAT IS TO BE OUTPUT WITH THE
    328					; MESSAGE. THE ERROR NUMBER SPECIFIES AN ERROR FORMAT WHICH IS PASSED
    329					; TO $EDMSG TO EDIT THE ERROR MESSAGE. THE RESULTANT ERROR MESSAGE IS
    330					; THEN OUTPUT USING THE ROUTINE ERROR$. IF THE SEVERITY OF THE ERROR
    331					; IS 2, AB$RT IS SET, OR THE SEVERITY OF THE ERROR IS 1 AND THE INPUT IS
    332					; NOT COMING FROM A TERMINAL, THEN THE CURRENT BUILD IS TERMINATED. ELSE
    333					; A RETURN TO THE CALLER IS EXECUTED.
    334					;
ERMSG	MACRO M1108  05-DEC-77 22:51  PAGE 2-6


    335					; INPUTS:
    336					;
    337					;	R1=ERROR/SEVERITY NUMBERS.
    338					;	R2=ARGUMENT BLOCK ADDRESS.
    339					;
    340					; OUTPUTS:
    341					;
    342					;	IF THE SEVERITY OF THE ERROR IS FATAL OR AB$RT IS SET, THEN
    343					;	THE CURRENT BUILD IS TERMINATED BY CLOSING ALL OPEN FILES AND
    344					;	JUMPING TO THE RESTART ADDRESS IN THE ROOT SEGMENT.
    345					;-
    346
    347	000042				$ERMSG::SAVRG			;SAVE NONVOLITILE REGISTERS
    348	000046					CALL	$PRCER		; GET UNFORMATTED TEXT
    349	000052					CALL	$EDMSG		; FORMAT OUTPUT
    350	000056	010102 				MOV	R1,R2		; COPY BYTE COUNT
    351	000060	012701 	000000G			MOV	#$OUTBF,R1	; GET BUFFER ADDRESS
    352	000064					CALL	$PUTCO		; OUTPUT MESSAGE
    353	000070	103413 				BCS	10$		; IF C/S LEAVE NOW
    354	000072	032767 	000000G	000000G		BIT	#AB$RT,$SWTCH	; ABORT ON ERROR?
    355	000100	001403 				BEQ	5$		; IF EQ NO                                      ;**NEW**
    356	000102	005367 	000000G			DEC	$ERRCT		; DECREMENT ERROR COUNT                         ;**NEW**
    357	000106	003404 				BLE	10$		; IF LE ENFORCE ABORT SWITCH NOW                ;**NEW**
    358	000110				5$:				;                                               ;**NEW**
    359	000110	020327 	000002 			CMP	R3,#S$V2	; FATAL ERROR?                                  ;**-1
    360	000114	103001 				BHIS	10$		; IF HIS YES
    361	000116					RETURN			;
    362	000120				10$:				;
    363	000120					CALL	$POPCL		;
    364	000124					CALL	$CMLCL		; RESET COMMAND LINE INPUT
    365	000130	032767 	000000G	000000G		BIT	#AB$RT,$SWTCH	; ABORT ON ERROR?
    366	000136	001403 				BEQ	15$		; IF EQ NO                                      ;**NEW**
    367	000140	005767 	000000G			TST	$ERRCT		; TIME TO ENFORCE EXIT?                         ;**NEW**
    368	000144	003402 				BLE	20$		; IF LE YES                                     ;**NEW**
    369	000146				15$:				;                                               ;**NEW**
    370	000146	000167 	000000G			JMP	$RSTRT		; RESTART                                       ;**-1
    371	000152				20$:				;
    372	000152	012701 	000000'			MOV	#ABMSG,R1	; GET BUFFER ADDRESS
    373	000156	012702 	000032 			MOV	#<ABMSE-ABMSG>,R2 ; BYTE COUNT
    374	000162					CALL	$PUTCO		; OUTPUT MESSAGE
    375	000166	000167 	000000G			JMP	$QUIT		; EXIT
    376
    377					;
    378					; SUBROUTINE TO ISSUE A MESSAGE TO DEVICE 'CO'
    379					;
    380					; INPUTS:
    381					;	R1: BUFFER ADDRESS
    382					;	R2: BYTE COUNT
    383					;
    384					; OUTPUTS:
    385					;
    386					;	C-CLEAR: SUCCESS, MESSAGE IS PRINTED ON DEVICE 'CO'
    387					;
    388					;	C-SET: REQUEST FAILED
    389					;
    390
    391	000172				$PUTCO::
ERMSG	MACRO M1108  05-DEC-77 22:51  PAGE 2-7


    392
    393						.IF	NDF	R$$11M
    394
    395						PUT$	$CMOPT,R1,R2
    396						RETURN
    397
    398						.IFF
    399
    400	000172	012700 	000022'			MOV	#<CODPB+Q.IOPL>,R0 ; POINT TO DPB PARAMETERS
    401	000176	010120 				MOV	R1,(R0)+	; SET BUFFER ADDRESS
    402	000200	010220 				MOV	R2,(R0)+	; BYTE COUNT
    403	000202					DIR$	#CODPB		; ISSUE QIO DIRECTIVE
    404	000210	103407 				BCS	10$		; EXIT ON FAILURE
    405	000212					WTSE$S	#2		; WAIT FOR I/O COMPLETION
    406	000224	106167 	177606 			ROLB	COSTS		; MOVE SIGN BIT TO 'C'
    407	000230				10$:
    408	000230					RETURN			; EXIT
    409
    410						.ENDC
    411
    412		000001 				.END
ERMSG	MACRO M1108  05-DEC-77 22:51  PAGE 2-8
SYMBOL TABLE

ABMSE   000032R     002	E$R54 = 000066 G 	IE.CON= 177752   	IE.ULN= 177773   	IO.RDN= 000022
ABMSG   000000R     002	E$R55 = 000067 G 	IE.DAA= 177770   	IE.UPN= 177777   	IO.REL= 013400
AB$RT = ****** GX	E$R56 = 000070 G 	IE.DAO= 177763   	IE.VER= 177774   	IO.RHD= 001010
CODPB   000006R  	E$R57 = 000071 G 	IE.DFU= 177750   	IE.WAC= 177743   	IO.RLB= 001000
COSTS   000036R  	E$R58 = 000072 G 	IE.DNA= 177771   	IE.WAT= 177741   	IO.RLV= 001100
CR    = 000015   	E$R59 = 000073 G 	IE.DNR= 177775   	IE.WER= 177737   	IO.RNA= 005400
E$RMAX= 000124 G 	E$R6  = 000006 G 	IE.DUN= 177767   	IE.WLK= 177764   	IO.RNC= 001004
E$R0  = 000000 G 	E$R60 = 000074 G 	IE.DUP= 177707   	IE.2DV= 177720   	IO.RNE= 001020
E$R1  = 000001 G 	E$R61 = 000075 G 	IE.EBX= 177776   	IO.ACE= 007400   	IO.RTC= 003400
E$R10 = 000012 G 	E$R62 = 000076 G 	IE.EOF= 177766   	IO.ACR= 006400   	IO.RTI= 016400
E$R11 = 000013 G 	E$R63 = 000077 G 	IE.EOT= 177702   	IO.ACW= 007000   	IO.RTK= 000060
E$R12 = 000014 G 	E$R64 = 000100 G 	IE.EOV= 177765   	IO.ADS= 014000   	IO.RVB= 010400
E$R13 = 000015 G 	E$R65 = 000101 G 	IE.EXP= 177676   	IO.APC= 014000   	IO.RWD= 002400
E$R14 = 000016 G 	E$R66 = 000102 G 	IE.FEX= 177717   	IO.APV= 014010   	IO.RWU= 002540
E$R15 = 000017 G 	E$R67 = 000103 G 	IE.FHE= 177705   	IO.ATT= 001400   	IO.R1C= 002400
E$R16 = 000020 G 	E$R68 = 000104 G 	IE.FOP= 177713   	IO.CCI= 014000   	IO.SAO= 004000
E$R17 = 000021 G 	E$R69 = 000105 G 	IE.HFU= 177744   	IO.CCT= 002460   	IO.SCS= 013000
E$R18 = 000022 G 	E$R7  = 000007 G 	IE.HWR= 177772   	IO.CLN= 003400   	IO.SDI= 013000
E$R19 = 000023 G 	E$R70 = 000106 G 	IE.IDU= 177644   	IO.CON= 015400   	IO.SDO= 012400
E$R2  = 000002 G 	E$R71 = 000107 G 	IE.IEF= 177637   	IO.CRC= 001020   	IO.SEC= 002520
E$R20 = 000024 G 	E$R72 = 000110 G 	IE.IFC= 177776   	IO.CRE= 012000   	IO.SEM= 002440
E$R21 = 000025 G 	E$R73 = 000111 G 	IE.IFU= 177747   	IO.CTI= 015400   	IO.SHT= 002410
E$R22 = 000026 G 	E$R74 = 000112 G 	IE.ILL= 177726   	IO.CTL= 016400   	IO.SLO= 005400
E$R23 = 000027 G 	E$R75 = 000113 G 	IE.ILU= 177640   	IO.DAC= 010000   	IO.SMO= 002560
E$R24 = 000030 G 	E$R76 = 000114 G 	IE.INS= 177776   	IO.DCI= 014400   	IO.SNM= 002450
E$R25 = 000031 G 	E$R77 = 000115 G 	IE.IPR= 177641   	IO.DCT= 002470   	IO.SPB= 002420
E$R26 = 000032 G 	E$R78 = 000116 G 	IE.ISQ= 177703   	IO.DEL= 012400   	IO.SPF= 002440
E$R27 = 000033 G 	E$R79 = 000117 G 	IE.ITI= 177643   	IO.DET= 002000   	IO.SSO= 004400
E$R28 = 000034 G 	E$R8  = 000010 G 	IE.ITS= 177770   	IO.DIS= 016000   	IO.SST= 002430
E$R29 = 000035 G 	E$R80 = 000120 G 	IE.LCK= 177745   	IO.DTI= 016000   	IO.STC= 002500
E$R3  = 000003 G 	E$R81 = 000121 G 	IE.LNL= 177646   	IO.ENA= 006000   	IO.STP= 016400
E$R30 = 000036 G 	E$R82 = 000122 G 	IE.MBK= 177721   	IO.EOF= 003000   	IO.SYN= 003040
E$R31 = 000037 G 	E$R83 = 000123 G 	IE.MOD= 177753   	IO.ESA= 002500   	IO.TRM= 002410
E$R32 = 000040 G 	E$R84 = 000124 G 	IE.NBF= 177731   	IO.EXT= 011400   	IO.UNL= 000042
E$R33 = 000041 G 	E$R9  = 000011 G 	IE.NBK= 177727   	IO.FDX= 003020   	IO.WAT= 013400
E$R34 = 000042 G 	FF    = 000014   	IE.NFI= 177704   	IO.FNA= 004400   	IO.WLB= 000400
E$R35 = 000043 G 	HT    = 000011   	IE.NLN= 177733   	IO.HDX= 003010   	IO.WLS= 000410
E$R36 = 000044 G 	IE.ABO= 177761   	IE.NNC= 177674   	IO.HIS= 015000   	IO.WLV= 000500
E$R37 = 000045 G 	IE.ACT= 177771   	IE.NOD= 177751   	IO.INL= 002400   	IO.WVB= 011000
E$R38 = 000046 G 	IE.ADP= 177636   	IE.NSF= 177746   	IO.ITI= 017000   	IO.XMT= 014400
E$R39 = 000047 G 	IE.ALN= 177736   	IE.OFL= 177677   	IO.KIL= 000012   	IO.XNA= 014410
E$R4  = 000004 G 	IE.AST= 177660   	IE.ONP= 177773   	IO.LED= 012000   	IQ.Q  = 000002
E$R40 = 000050 G 	IE.BAD= 177777   	IE.OVR= 177756   	IO.LOV= 001010   	IQ.X  = 000001
E$R41 = 000051 G 	IE.BBE= 177710   	IE.PRI= 177760   	IO.LTK= 000050   	IS.BV = 000005
E$R42 = 000052 G 	IE.BDI= 177714   	IE.RAC= 177724   	IO.MCS= 013400   	IS.CLR= 000000
E$R43 = 000053 G 	IE.BDR= 177716   	IE.RAT= 177723   	IO.MDA= 016000   	IS.CR = 006401
E$R44 = 000054 G 	IE.BDV= 177711   	IE.RBG= 177730   	IO.MDI= 014400   	IS.ESC= 015401
E$R45 = 000055 G 	IE.BHD= 177700   	IE.RCN= 177722   	IO.MDO= 015400   	IS.PND= 000000
E$R46 = 000056 G 	IE.BLK= 177754   	IE.RER= 177740   	IO.MLO= 006000   	IS.RDD= 000002
E$R47 = 000057 G 	IE.BNM= 177712   	IE.RNM= 177715   	IO.MOD= 003000   	IS.SET= 000002
E$R48 = 000060 G 	IE.BTF= 177675   	IE.RSU= 177757   	IO.MSO= 005000   	IS.SUC= 000001
E$R49 = 000061 G 	IE.BTP= 177725   	IE.SDP= 177635   	IO.RAL= 001010   	LF    = 000012
E$R5  = 000005 G 	IE.BVR= 177701   	IE.SNC= 177735   	IO.RAT= 013000   	MXBF  = 000067
E$R50 = 000062 G 	IE.BYT= 177755   	IE.SPC= 177772   	IO.RBC= 003000   	M$SG1 = 000053 G
E$R51 = 000063 G 	IE.CKP= 177766   	IE.SQC= 177734   	IO.RCI= 015000   	NN    = 003066R     005
E$R52 = 000064 G 	IE.CKS= 177742   	IE.SRE= 177762   	IO.RCV= 015000   	Q.IOAE= 000012
E$R53 = 000065 G 	IE.CLO= 177732   	IE.STK= 177706   	IO.RDB= 001200   	Q.IOEF= 000006
ERMSG	MACRO M1108  05-DEC-77 22:51  PAGE 2-9
SYMBOL TABLE

Q.IOFN= 000002   	SZ    = 000055   	$CMLCL= ****** GX	$POPCL= ****** GX	$SWTCH= ****** GX
Q.IOLU= 000004   	S$V0  = 000000 G 	$EDMSG= ****** GX	$PRCER= ****** GX	$$    = 000001
Q.IOPL= 000014   	S$V1  = 000001 G 	$ERMSG  000042RG 	$PUTCO  000172RG 	$$MSG = 000000
Q.IOPR= 000007   	S$V2  = 000002 G 	$ERRCT= ****** GX	$QUIT = ****** GX	$$$ARG= 000014
Q.IOSB= 000010   	VT    = 000013   	$MSG    000000RG    003	$RSTRT= ****** GX	$$$OST= 000014
R$$11M= 000000   	$ARGBK  000000RG 	$OUTBF= ****** GX	$SAVRG= ****** GX	...GBL= 000000
SPA   = 000040

. ABS.	000000	   000
      	000232	   001
TXT   	000032	   002
EPT$D 	000252	   003
ETX1$D	003150	   004
ETX2$D	003144	   005
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  5045 WORDS  ( 20 PAGES)
DYNAMIC MEMORY:  6272 WORDS  ( 24 PAGES)
ELAPSED TIME:  00:01:32
[44,10]ERMSG,[44,20]ERMSG/-SP=[44,30]MACFLM.,ERMSG.015
FNDPG	MACRO M1108  05-DEC-77 22:52  PAGE 2


      1						.TITLE	FNDPG
      2						.IDENT	/02/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     17					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 02                                                                    ;**NEW**
     20					;                                                                               ;**-1
     21					; C. MONIA 22-FEB-74
     22					;
     23					; SCAN PAGE LIST FOR RESIDENT VIRTUAL ADDRESS
     24					;
     25					;+
     26					; **-$FNDPG-SEARCH PAGE BUFFERS FOR RESIDENT ADDRESS
     27					;
     28					; INPUTS:
     29					;
     30					;	R1=VIRTUAL ADDRESS
     31					;
     32					; OUTPUTS:
     33					;
     34					;	C-CLEAR: PAGE BUFFER RESIDENT
     35					;
     36					;		R0=ADDRESS OF BUFFER
     37					;
     38					;	C-SET:   PAGE NOT RESIDENT
     39					;
     40					; IN EITHER CASE R1 IS LEFT UNCHANGED.
     41					;
     42					; IF RESIDENT, PAGE BUFFER IS TIME-STAMPED AND RETURNED
     43					; TO CALLER
     44					;-
     45
     46	000000				$FNDPG::			;
     47	000000	005267 	000000G			INC	$TIME		; ADVANCE TIME
     48	000004	001012 				BNE	4$		; IF NE NO WRAP-AROUND                          ;**NEW**
     49	000006	005267 	000000G			INC	$TIME		; SET TIME TO 1                                 ;**NEW**
     50	000012	012700 	000000C			MOV	#<$PAGHD-P$GNXT>,R0 ; GET RESIDENT PAGE LIST                    ;**NEW**
     51	000016				2$:				;                                               ;**NEW**
     52	000016	016000 	000000G			MOV	P$GNXT(R0),R0	; GET ADDRESS OF NEXT RESIDENT PAGE             ;**NEW**
     53	000022	001403 				BEQ	4$		; IF EQ DONE                                    ;**NEW**
     54	000024	005060 	000000G			CLR	P$GTIM(R0)	; RESET TIME                                    ;**NEW**
     55	000030	000772 				BR	2$		; GO AGAIN                                      ;**NEW**
     56	000032				4$:				;                                               ;**NEW**
     57	000032	010102 				MOV	R1,R2		; COPY VIRTUAL ADDRESS
FNDPG	MACRO M1108  05-DEC-77 22:52  PAGE 2-1


     58	000034	105002 				CLRB	R2		; CLEAR DISPLACEMENT IN BLOCK                   ;**NEW**
     59	000036	000302 				SWAB	R2		; POSITION RELATIVE BLOCK TO LOW BYTE
     60	000040	016700 	000000G			MOV	$PAGLS,R0	; GET ADDRESS OF RESIDENT PAGE LIST             ;**NEW**
     61	000044	001407 				BEQ	8$		; IF EQ NONE                                    ;**NEW**
     62	000046	006302 				ASL	R2		; CONVERT BLOCK TO WORD OFFSET                  ;**NEW**
     63	000050	060200 				ADD	R2,R0		; COMPUTE LIST INDEX                            ;**NEW**
     64	000052	000261 				SEC			; ASSUME PAGE NOT RESIDENT                      ;**NEW**
     65	000054	011000 				MOV	(R0),R0		; GET PAGE ADDRESS                              ;**NEW**
     66	000056	001416 				BEQ	20$		; IF EQ PAGE NOT IN MEMORY                      ;**NEW**
     67	000060	000241 				CLC			; SET SUCCESS                                   ;**NEW**
     68	000062	000411 				BR	15$		; EXIT                                          ;**NEW**
     69	000064				8$:				;                                               ;**NEW**
     70	000064	012700 	000000C			MOV	#<$PAGHD-P$GNXT>,R0 ; GET LISTHEAD ADDRESS MINUS OFFSET
     71	000070				10$:				;
     72	000070	000261 				SEC			; ASSUME PAGE NOT RESIDENT
     73	000072	016000 	000000G			MOV	P$GNXT(R0),R0	; GET NEXT PAGE BUFFER
     74	000076	001406 				BEQ	20$		; IF EQ NO MORE
     75	000100	126002 	000000G			CMPB	P$GBLK(R0),R2	; CHECK RELATIVE BLOCK
     76	000104	001371 				BNE	10$		; IF NE NOT REQUESTED PAGE
     77	000106				15$:				;                                               ;**NEW**
     78	000106	016760 	000000G	000000G		MOV	$TIME,P$GTIM(R0) ; TIME-STAMP THIS PAGE
     79	000114				20$:				;
     80	000114					RETURN			;
     81
     82		000001 				.END
FNDPG	MACRO M1108  05-DEC-77 22:52  PAGE 2-2
SYMBOL TABLE

CR    = 000015   	LF    = 000012   	P$GTIM= ****** GX	VT    = 000013   	$PAGLS= ****** GX
FF    = 000014   	P$GBLK= ****** GX	R$$11M= 000000   	$FNDPG  000000RG 	$TIME = ****** GX
HT    = 000011   	P$GNXT= ****** GX	SPA   = 000040   	$PAGHD= ****** GX

. ABS.	000000	   000
      	000116	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  577 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:05
[44,10]FNDPG,[44,20]FNDPG/-SP=[44,30]MACFLM.,FNDPG.002
FNIT	MACRO M1108  05-DEC-77 22:52  PAGE 2


      1						.TITLE	FNIT
      2						.IDENT	/01/
      3
      4					;
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					;
      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     12					;
     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     15					; EQUIPMENT CORPORATION.
     16					;
     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     19					;
     20					; VERSION 01
     21					;
     22					; C. MONIA 05-FEB-74
     23					;
     24					; INITIALIZE FCS IMPURE AREA
     25					;
     26					; MACRO LIBRARY CALLS
     27					;
     28					;
     29
     30						.MCALL	FINIT$
     31
     32					;+
     33					; **-$FINIT-INITIALIZE FCS IMPURE AREA
     34					;
     35					;	THIS ROUTINE IS CALLED PRIOR TO PERFORMING ANY I/O
     36					; TO SETUP FILE STORAGE REGION 2.
     37					;
     38					; INPUTS:
     39					;
     40					;	NONE
     41					;
     42					; OUTPUTS:
     43					;
     44					;	FSR 2 IS SETUP
     45					;
     46					;-
     47
     48
     49	000000				$FINIT::			;
     50	000000					FINIT$			; INITIALIZE FSR 2
     51	000004					RETURN			;
     52
     53		000001 				.END
FNIT	MACRO M1108  05-DEC-77 22:52  PAGE 2-1
SYMBOL TABLE

CR    = 000015   	HT    = 000011   	R$$11M= 000000   	VT    = 000013   	.FINIT= ****** G
FF    = 000014   	LF    = 000012   	SPA   = 000040   	$FINIT  000000RG

. ABS.	000000	   000
      	000006	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  541 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:05
[44,10]FNIT,[44,20]FNIT/-SP=[44,30]MACFLM.,FNIT.001
GTBYT	MACRO M1108  05-DEC-77 22:53  PAGE 3


      1						.TITLE	GTBYT
      2						.IDENT	/04/                                                           ;**NEW**
      3					;                                                                               ;**NEW**
      4					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.               ;**NEW**
      5					;                                                                               ;**NEW**
      6					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE               ;**NEW**
      7					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION               ;**NEW**
      8					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT               ;**NEW**
      9					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.                               ;**NEW**
     10					;                                                                               ;**NEW**
     11					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT               ;**NEW**
     12					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL               ;**NEW**
     13					; EQUIPMENT CORPORATION.                                                        ;**NEW**
     14					;                                                                               ;**NEW**
     15					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY               ;**NEW**
     16					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.               ;**NEW**
     17					;                                                                               ;**NEW**
     18					; VERSION 04                                                                   ;**NEW**
     19					;                                                                               ;**NEW**
     20					; D.N. CUTLER/C. MONIA	21-JAN-74                                               ;**NEW**
     21					;                                                                               ;**-13
     22					; ROUTINES TO GET BYTE/WORD FROM INPUT FILE
     23					;
     24					; MACRO LIBRARY CALLS
     25					;
     26
     27						.MCALL	GET$S,QIOSY$                                                    ;**NEW**
     28	000000					QIOSY$                                                                  ;**-1
     29
     30					;
     31					; LOCAL DATA
     32					;
     33
     34	000000				BYTEA:	.BLKW	1		;NEXT BYTE IN RECORD ADDRESS
     35	000002				$NBYTE::.BLKW	1		;NUMBER OF BYTES REMAINING IN RECORD
     36
     37					;+
     38					; **-$GTBYT-GET BYTE FROM INPUT FILE
     39					;
     40					; THIS ROUTINE IS CALLED TO GET THE NEXT BYTE FROM THE CURRENT INPUT
     41					; FILE ($INPPT). IF THERE ARE NO MORE BYTES IN THE CURRENT RECORD,
     42					; THEN THE NEXT RECORD IS READ AND THE LENGTH OF THAT RECORD IS RE-
     43					; TURNED TO THE CALLER. ELSE THE NEXT BYTE IS RETURNED TO THE CALLER.
     44					; THUS THE NORMAL USE OF THIS ROUTINE IS TO MAKE A CALL TO OBTAIN THE
     45					; BYTE COUNT AND THEN TO MAKE SUBSEQUENT CALLS TO OBTAIN EACH BYTE.
     46					; BEFORE THE FIRST CALL IS MADE FOR EACH FILE, $NBYTE MUST BE ZEROED
     47					; IN ORDER TO FORCE A READ.
     48					;
     49					; INPUTS:
     50					;
     51					;	$INPPT RECORD BLOCK.
     52					;
     53					; OUTPUTS:
     54					;
     55					;	C=1 IF EOF ENCOUNTERED.
     56					;	C=0 IF NEXT BYTE OR RECORD LENGTH IS OBTAINED.
     57					;		R0=NEXT BYTE OR RECORD LENGTH.
GTBYT	MACRO M1108  05-DEC-77 22:53  PAGE 3-1


     58					;-
     59
     60	000004	005367 	177772 		$GTBYT::DEC	$NBYTE		;ANY MORE BYTES?
     61	000010	002406 				BLT	10$		;IF LT NO
     62	000012	005000 				CLR	R0		;CLEAR R0 AND CARRY
     63	000014	157700 	177760 			BISB	@BYTEA,R0	;PICK UP NEXT BYTE
     64	000020	005267 	177754 			INC	BYTEA		;INCREMENT BYTE ADDRESS
     65	000024	000427 				BR	30$		;EXIT THROUGH COMMON POINT
     66	000026	016700 	000000G		10$:	MOV	$INPPT,R0	;GET INPUT FILE RECORD BLOCK
     67	000032					GET$S	R0		; GET NEXT RECORD                               ;**NEW**
     68	000036	103013 				BCC	20$		;IF CC OKAY                                     ;**-1
     69	000040	122760 	177766 	000052 		CMPB	#IE.EOF,F.ERR(R0);EOF?
     70	000046	000261 				SEC			;ASSUME EOF
     71	000050	001415 				BEQ	30$		;IF EQ YES
     72	000052	016002 	000000G			MOV	R$NAME(R0),R2	;GET ADDRESS OF NAME STRING
     73	000056	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
     74	000060	   000G	   000G			.BYTE	E$R10,S$V2	;FATAL
     75	000062					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
     76	000066	016067 	000026 	177704 	20$:	MOV	F.NRBD+2(R0),BYTEA;SET ADDRESS OF NEXT BYTE
     77	000074	016000 	000024 			MOV	F.NRBD(R0),R0	;GET LENGTH OF RECORD
     78	000100	010067 	177676 			MOV	R0,$NBYTE	;SET NUMBER OF BYTES
     79	000104				30$:	RETURN			;
     80
     81					;+
     82					; **-$GTWRD-GET WORD FROM INPUT FILE
     83					;
     84					; THIS ROUTINE IS CALLED TO GET THE NEXT TWO BYTES FROM THE CURRENT
     85					; INPUT FILE ($INPPT). $GTBYT IS CALLED TWICE TO OBTAIN THE TWO BYTES
     86					; AND THE RESULTANT WORD IS RETURNED TO THE CALLER.
     87					;
     88					; INPUTS:
     89					;
     90					;	NONE.
     91					;
     92					; OUTPUTS:
     93					;
     94					;	R0=NEXT TWO BYTES FROM THE INPUT FILE.
     95					;-
     96
     97	000106				$GTWRD::CALL	$GTBYT		;GET FIRST BYTE
     98	000112	010046 				MOV	R0,-(SP)	;SAVE IT ON STACK
     99	000114					CALL	$GTBYT		;GET SECOND BYTE
    100	000120	000300 				SWAB	R0		;SWAP HALVES
    101	000122	052600 				BIS	(SP)+,R0	;MERGE BYTES
    102	000124					RETURN			;
    103
    104		000001 				.END
GTBYT	MACRO M1108  05-DEC-77 22:53  PAGE 3-2
SYMBOL TABLE

BYTEA   000000R  	F.FNB = 000102   	IE.FHE= 177705   	IO.ATT= 001400   	IO.R1C= 002400
B.BBFS= 000010   	F.FTYP= 000116   	IE.FOP= 177713   	IO.CCI= 014000   	IO.SAO= 004000
B.BFST= 000015   	F.FVER= 000120   	IE.HFU= 177744   	IO.CCT= 002460   	IO.SCS= 013000
B.NXBD= 000012   	F.HIBK= 000004   	IE.HWR= 177772   	IO.CLN= 003400   	IO.SDI= 013000
B.VBN = 000004   	F.LUN = 000042   	IE.IDU= 177644   	IO.CON= 015400   	IO.SDO= 012400
CR    = 000015   	F.MBCT= 000054   	IE.IEF= 177637   	IO.CRC= 001020   	IO.SEC= 002520
E$R10 = ****** GX	F.MBC1= 000055   	IE.IFC= 177776   	IO.CRE= 012000   	IO.SEM= 002440
FA.APD= 000100   	F.MBFG= 000056   	IE.IFU= 177747   	IO.CTI= 015400   	IO.SHT= 002410
FA.CRE= 000010   	F.NRBD= 000024   	IE.ILL= 177726   	IO.CTL= 016400   	IO.SLO= 005400
FA.EXT= 000004   	F.NREC= 000030   	IE.ILU= 177640   	IO.DAC= 010000   	IO.SMO= 002560
FA.NSP= 000100   	F.OVBS= 000030   	IE.INS= 177776   	IO.DCI= 014400   	IO.SNM= 002450
FA.RD = 000001   	F.RACC= 000016   	IE.IPR= 177641   	IO.DCT= 002470   	IO.SPB= 002420
FA.SHR= 000040   	F.RATT= 000001   	IE.ISQ= 177703   	IO.DEL= 012400   	IO.SPF= 002440
FA.TMP= 000020   	F.RCNM= 000034   	IE.ITI= 177643   	IO.DET= 002000   	IO.SSO= 004400
FA.WRT= 000002   	F.RCTL= 000017   	IE.ITS= 177770   	IO.DIS= 016000   	IO.SST= 002430
FD.BLK= 000010   	F.RSIZ= 000002   	IE.LCK= 177745   	IO.DTI= 016000   	IO.STC= 002500
FD.CCL= 000002   	F.RTYP= 000000   	IE.LNL= 177646   	IO.ENA= 006000   	IO.STP= 016400
FD.CR = 000002   	F.STBK= 000036   	IE.MBK= 177721   	IO.EOF= 003000   	IO.SYN= 003040
FD.DIR= 000010   	F.UNIT= 000136   	IE.MOD= 177753   	IO.ESA= 002500   	IO.TRM= 002410
FD.FTN= 000001   	F.URBD= 000020   	IE.NBF= 177731   	IO.EXT= 011400   	IO.UNL= 000042
FD.INS= 000010   	F.VBN = 000064   	IE.NBK= 177727   	IO.FDX= 003020   	IO.WAT= 013400
FD.PLC= 000004   	F.VBSZ= 000060   	IE.NFI= 177704   	IO.FNA= 004400   	IO.WLB= 000400
FD.RAH= 000001   	HT    = 000011   	IE.NLN= 177733   	IO.HDX= 003010   	IO.WLS= 000410
FD.RAN= 000002   	IE.ABO= 177761   	IE.NNC= 177674   	IO.HIS= 015000   	IO.WLV= 000500
FD.REC= 000001   	IE.ACT= 177771   	IE.NOD= 177751   	IO.INL= 002400   	IO.WVB= 011000
FD.RWM= 000001   	IE.ADP= 177636   	IE.NSF= 177746   	IO.ITI= 017000   	IO.XMT= 014400
FD.SDI= 000020   	IE.ALN= 177736   	IE.OFL= 177677   	IO.KIL= 000012   	IO.XNA= 014410
FD.SQD= 000040   	IE.AST= 177660   	IE.ONP= 177773   	IO.LED= 012000   	IQ.Q  = 000002
FD.TTY= 000004   	IE.BAD= 177777   	IE.OVR= 177756   	IO.LOV= 001010   	IQ.X  = 000001
FD.WBH= 000002   	IE.BBE= 177710   	IE.PRI= 177760   	IO.LTK= 000050   	IS.BV = 000005
FF    = 000014   	IE.BDI= 177714   	IE.RAC= 177724   	IO.MCS= 013400   	IS.CLR= 000000
FO.APD= 000106   	IE.BDR= 177716   	IE.RAT= 177723   	IO.MDA= 016000   	IS.CR = 006401
FO.MFY= 000002   	IE.BDV= 177711   	IE.RBG= 177730   	IO.MDI= 014400   	IS.ESC= 015401
FO.RD = 000001   	IE.BHD= 177700   	IE.RCN= 177722   	IO.MDO= 015400   	IS.PND= 000000
FO.UPD= 000006   	IE.BLK= 177754   	IE.RER= 177740   	IO.MLO= 006000   	IS.RDD= 000002
FO.WRT= 000016   	IE.BNM= 177712   	IE.RNM= 177715   	IO.MOD= 003000   	IS.SET= 000002
F.ALOC= 000040   	IE.BTF= 177675   	IE.RSU= 177757   	IO.MSO= 005000   	IS.SUC= 000001
F.BBFS= 000062   	IE.BTP= 177725   	IE.SDP= 177635   	IO.RAL= 001010   	LF    = 000012
F.BDB = 000070   	IE.BVR= 177701   	IE.SNC= 177735   	IO.RAT= 013000   	NB.DEV= 000200
F.BGBC= 000057   	IE.BYT= 177755   	IE.SPC= 177772   	IO.RBC= 003000   	NB.DIR= 000100
F.BKDN= 000026   	IE.CKP= 177766   	IE.SQC= 177734   	IO.RCI= 015000   	NB.NAM= 000004
F.BKDS= 000020   	IE.CKS= 177742   	IE.SRE= 177762   	IO.RCV= 015000   	NB.SD1= 000400
F.BKEF= 000050   	IE.CLO= 177732   	IE.STK= 177706   	IO.RDB= 001200   	NB.SD2= 001000
F.BKP1= 000051   	IE.CON= 177752   	IE.ULN= 177773   	IO.RDN= 000022   	NB.SNM= 000040
F.BKST= 000024   	IE.DAA= 177770   	IE.UPN= 177777   	IO.REL= 013400   	NB.STP= 000020
F.BKVB= 000064   	IE.DAO= 177763   	IE.VER= 177774   	IO.RHD= 001010   	NB.SVR= 000010
F.CNTG= 000034   	IE.DFU= 177750   	IE.WAC= 177743   	IO.RLB= 001000   	NB.TYP= 000002
F.DFNB= 000046   	IE.DNA= 177771   	IE.WAT= 177741   	IO.RLV= 001100   	NB.VER= 000001
F.DSPT= 000044   	IE.DNR= 177775   	IE.WER= 177737   	IO.RNA= 005400   	N.DID = 000024
F.DVNM= 000134   	IE.DUN= 177767   	IE.WLK= 177764   	IO.RNC= 001004   	N.DVNM= 000032
F.EFBK= 000010   	IE.DUP= 177707   	IE.2DV= 177720   	IO.RNE= 001020   	N.FID = 000000
F.EFN = 000050   	IE.EBX= 177776   	IO.ACE= 007400   	IO.RTC= 003400   	N.FNAM= 000006
F.EOBB= 000032   	IE.EOF= 177766   	IO.ACR= 006400   	IO.RTI= 016400   	N.FTYP= 000014
F.ERR = 000052   	IE.EOT= 177702   	IO.ACW= 007000   	IO.RTK= 000060   	N.FVER= 000016
F.FACC= 000043   	IE.EOV= 177765   	IO.ADS= 014000   	IO.RVB= 010400   	N.NEXT= 000022
F.FFBY= 000014   	IE.EXP= 177676   	IO.APC= 014000   	IO.RWD= 002400   	N.STAT= 000020
F.FNAM= 000110   	IE.FEX= 177717   	IO.APV= 014010   	IO.RWU= 002540   	N.UNIT= 000034
GTBYT	MACRO M1108  05-DEC-77 22:53  PAGE 3-3
SYMBOL TABLE

PAR$$$= 000000   	S$V2  = ****** GX	S.FNBW= 000017   	$ERMSG= ****** GX	$$    = 000001
R$NAME= ****** GX	S.BFHD= 000020   	S.FNTY= 000004   	$GTBYT  000004RG 	$$MSG = 000000
R$$11M= 000000   	S.FATT= 000016   	S.FTYP= 000002   	$GTWRD  000106RG 	.GETSQ= ****** G
R.FIX = 000001   	S.FDB = 000140   	S.NFEN= 000020   	$INPPT= ****** GX	...GBL= 000000
R.VAR = 000002   	S.FNAM= 000006   	VT    = 000013   	$NBYTE  000002RG 	...TPC= 000140
SPA   = 000040   	S.FNB = 000036

. ABS.	000000	   000
      	000126	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  4668 WORDS  ( 19 PAGES)
DYNAMIC MEMORY:  5216 WORDS  ( 20 PAGES)
ELAPSED TIME:  00:00:44
[44,10]GTBYT,[44,20]GTBYT/-SP=[44,30]MACFLM.,FCSPR.,GTBYT.004
GTCML	MACRO M1108  05-DEC-77 22:53  PAGE 2


      1						.TITLE	GTCML
      2						.IDENT	/06/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1975, DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 06
     20					;                                                                               ;**-1
     21					; D. N. CUTLER/C. MONIA 07-FEB-74
     22					;
     23					; MODIFICATIONS
     24					;
     25					; NO.		DATE		PROGRAMMER
     26					; ---		----		----------
     27					;
     28					; 039		22-MARR-75	C. MONIA
     29					;
     30					;
     31					; MACRO LIBRARY CALLS
     32					;
     33
     34						.MCALL	GCML$
     35
     36					;+
     37					; **-$GTCML-GET LINE FROM COMMAND INPUT FILE
     38					;
     39					; THIS ROUTINE CALLS THE SYSTEM LIBRARY ROUTINE .GCML TO READ THE NEXT
     40					; RECORD FROM THE COMMAND INPUT FILE. IF THE LINE CONTAINS A LEADING ";",
     41					; THEN IT IS TREATED AS A COMMENT LINE AND ANOTHER LINE IS READ. IF THE
     42					; FIRST TWO CHARACTERS OF THE LINE ARE "/BLANK", "/0", OR "//", THEN A
     43					; LOGICAL EOF IS RETURNED TO THE CALLER. FOR "//" AND A REAL EOF, EN$DR
     44					; IS SET IN $SWTCH THUS CAUSING AN EXIT AT THE END OF THE CURRENT BUILD.
     45					; IF NONE OF THESE CONDITIONS ARE MET, THEN THE LINE IS TRANSFERED TO
     46					; $LNBUF, $LNDES IS SET UP AS THE LINE DESCRIPTOR, AND A RETURN TO THE
     47					; CALLER IS EXECUTED.
     48					;
     49					; INPUTS:
     50					;
     51					;	NONE.
     52					;
     53					; OUTPUTS:
     54					;
     55					;	C=1 IF LOGICAL EOF.
     56					;	C=0 IF REQUEST SUCESSFUL WITH LINE IN $LNBUF AND $LNDES SET UP AS
     57					;		THE LINE DESCRIPTOR.
GTCML	MACRO M1108  05-DEC-77 22:53  PAGE 2-1


     58					;		R0=ADDRESS OF LINE DESCRIPTOR.
     59					;-
     60
     61	000000	016700 	000000G		$GTCML::MOV	$CMIPT,R0	;GET COMMAND BLOCK ADDRESS
     62	000004	005002 				CLR	R2		;ASSUME STANDARD PROMPTING
     63	000006	016701 	000000G			MOV	$CMFLG,R1	;GET ADDRESS OF PROMPT DESCRIPTOR
     64	000012	001402 				BEQ	10$		;IF EQ NONE
     65	000014	012102 				MOV	(R1)+,R2	;GET LENGTH OF PROMPT STRING
     66	000016	011101 				MOV	(R1),R1		;GET ADDRESS OF PROMPT STRING
     67	000020				10$:	GCML$	R0,R1,R2	;GET COMMAND LINE
     68	000034	103435 				BCS	GTCML1		;IF CS EOF OR ERROR
     69	000036	016001 	000146 			MOV	G.CMLD(R0),R1	;GET LENGTH OF LINE
     70	000042	001756 				BEQ	$GTCML		;IF NULL TRY AGAIN
     71	000044	010167 	000000G			MOV	R1,$LNDES	;SET LENGTH OF LINE
     72	000050	016002 	000150 			MOV	G.CMLD+2(R0),R2	; GET LINE BUFFER ADDRESS
     73	000054	010267 	000002G			MOV	R2,$LNDES+2	;SET ADDRESS OF BUFFER
     74	000060	060201 				ADD	R2,R1		; COMPUTE ADDRESS OF LAST BYTE PLUS 1           ;**NEW**
     75	000062	105011 				CLRB	(R1)		; SET ZERO SENTINEL BYTE                        ;**NEW**
     76	000064	005001 				CLR	R1		;++039 SET FOR MOVB WITH NO SIGN EXTEND
     77	000066	156201 	000001 			BISB	1(R2),R1	;++039 GET SECOND BYTE IN STRING
     78	000072	000301 				SWAB	R1		;++039 POSITION TO HIGH BYTE
     79	000074	151201 				BISB	(R2),R1		;++039 GET FIRST BYTE IN STRING
     80	000076	022701 				CMP	(PC)+,R1	;++039 "/BLANK"?                                      ;**-1
     81	000100	   057 	   040 			.BYTE	'/,' 		;
     82	000102	001455 				BEQ	GTCML3		;IF EQ YES
     83	000104	022701 				CMP	(PC)+,R1	;++039 "/0"?
     84	000106	   057 	   000 			.BYTE	'/,0		;
     85	000110	001452 				BEQ	GTCML3		;IF EQ YES
     86	000112	022701 				CMP	(PC)+,R1	;++039 "//"?
     87	000114	   057 	   057 			.BYTE	'/,'/		;
     88	000116	001444 				BEQ	GTCML2		;IF EQ YES
     89	000120	012700 	000000G			MOV	#$LNDES,R0	;GET ADDRESS OF LINE DESCRIPTOR
     90	000124	000241 				CLC			;CLEAR CARRY
     91	000126					RETURN			;
     92
     93					;
     94					; EOF OR ERROR
     95					;
     96
     97	000130	116002 	000140 		GTCML1:	MOVB	G.ERR(R0),R2	;PICK UP ERROR CODE
     98	000134	122702 	177766 			CMPB	#GE.EOF,R2	;EOF?
     99	000140	001433 				BEQ	GTCML2		;IF EQ YES
    100	000142	012701 				MOV	(PC)+,R1	;ASSUME I/O ERROR
    101	000144	   000G	   000G			.BYTE	E$R6,S$V0	;DIAGNOSTIC
    102	000146	122702 	177777 			CMPB	#GE.IOR,R2	;I/O ERROR
    103	000152	001421 				BEQ	10$		;IF EQ YES
    104	000154	012701 				MOV	(PC)+,R1	;ASSUME OPEN FAILURE
    105	000156	   000G	   000G			.BYTE	E$R7,S$V2	;FATAL-NO RETURN
    106	000160	122702 	177776 			CMPB	#GE.OPR,R2	;OPEN FAILURE?
    107	000164	001414 				BEQ	10$		;IF EQ YES
    108	000166	012701 				MOV	(PC)+,R1	;ASSUME BAD FILENAME
    109	000170	   000G	   000G			.BYTE	E$R8,S$V2	;FATAL-NO RETURN
    110	000172	122702 	177775 			CMPB	#GE.BIF,R2	;BAD FILENAME?
    111	000176	001407 				BEQ	10$		;IF EQ YES
    112	000200	012701 				MOV	(PC)+,R1	;ASSUME MAX DEPTH EXCEEDED
    113	000202	   000G	   000G			.BYTE	E$R9,S$V2	;FATAL-NO RETURN
    114	000204	122702 	177774 			CMPB	#GE.MDE,R2	;MAX DEPTH EXCEEDED?
GTCML	MACRO M1108  05-DEC-77 22:53  PAGE 2-2


    115	000210	001402 				BEQ	10$		;IF EQ YES
    116	000212	012701 				MOV	(PC)+,R1	;ILLEGAL ERROR CODE
    117	000214	   000G	   000G			.BYTE	E$R0,S$V2	;FATAL-NO RETURN
    118	000216	010002 			10$:	MOV	R0,R2		;COPY ADDRESS OF CONTROL BLOCK
    119	000220	062702 	000146 			ADD	#G.CMLD,R2	;POINT TO LINE DESCRIPTOR
    120	000224					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    121	000230	052767 	000000G	000000G	GTCML2:	BIS	#EN$DR,$SWTCH	;SET END OF RUN
    122	000236	000261 			GTCML3:	SEC			;SET CARRY
    123	000240					RETURN			;
    124
    125		000001 				.END
GTCML	MACRO M1108  05-DEC-77 22:53  PAGE 2-3
SYMBOL TABLE

CR    = 000015   	GE.COM= 000001   	G.CMLD= 000146   	SPA   = 000040   	VT    = 000013
EN$DR = ****** GX	GE.EOF= 177766   	G.DPRM= 000160   	S$V0  = ****** GX	$CMFLG= ****** GX
E$R0  = ****** GX	GE.IND= 000002   	G.ERR = 000140   	S$V2  = ****** GX	$CMIPT= ****** GX
E$R6  = ****** GX	GE.IOR= 177777   	G.ISIZ= 000020   	S.FDB = 000140   	$ERMSG= ****** GX
E$R7  = ****** GX	GE.LC = 000010   	G.MODE= 000141   	S.FNAM= 000006   	$GTCML  000000RG
E$R8  = ****** GX	GE.MDE= 177774   	G.PSDS= 000142   	S.FNB = 000036   	$LNDES= ****** GX
E$R9  = ****** GX	GE.OPR= 177776   	HT    = 000011   	S.FNBW= 000017   	$SWTCH= ****** GX
FF    = 000014   	GTCML1  000130R  	LF    = 000012   	S.FNTY= 000004   	$$    = 000001
GE.BIF= 177775   	GTCML2  000230R  	PAR$$$= 000000   	S.FTYP= 000002   	.GCML1= ****** G
GE.CLO= 000004   	GTCML3  000236R  	R$$11M= 000000   	S.NFEN= 000020   	...TPC= 000140

. ABS.	000000	   000
      	000242	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2053 WORDS  ( 9 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[44,10]GTCML,[44,20]GTCML/-SP=[44,30]MACFLM.,GTCML.006
GTCOR	MACRO M1108  05-DEC-77 22:54  PAGE 2


      1						.TITLE	GTCOR
      2						.IDENT	/01/                                                            ;**NEW**
      3					;                                                                               ;**-1
      4					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      5					;
      6					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      7					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      8					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
      9					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     10					;
     11					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     12					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     13					; EQUIPMENT CORPORATION.
     14					;
     15					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     16					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     17					;
     18					; VERSION 01                                                                    ;**NEW**
     19					;                                                                               ;**-1
     20					; C. MONIA 22-FEB-74
     21					;
     22					; ALLOCATE DYNAMIC STORAGE
     23					;
     24					;+
     25					; **-GTCOR-ALLOCATE DYNAMIC STORAGE, DISPLACE VIRTUAL PAGE BUFFERS
     26					;
     27					; INPUTS:
     28					;
     29					;	R1=ALLOCATION REQUESTED(BYTES)
     30					;
     31					; OUTPUTS:
     32					;
     33					;	C-CLEAR: ALLOCATION REQUEST SUCCEEDED
     34					;
     35					;	R0=ADDRESS OF STORAGE ALLOCATED
     36					;
     37					;	C-SET: ALLOCATION FAILED
     38					;
     39					; THIS ROUTINE IS CALLED TO OBTAIN DYNAMIC STORAGE, DISPLACING
     40					; UNLOCKED PAGE BUFFERS UNTIL THE REQUESTED SPACE IS AVAILABLE
     41					;
     42					; PAGES ARE DISPLACED ON THE BASIS OF 'LEAST RECENTLY USED'.
     43					;-
     44
     45	000000				$GTCOR::			;
     46	000000					SAVRG			; SAVE NON-VOLATILE REGISTERS
     47	000004				10$:				;
     48	000004	010146 				MOV	R1,-(SP)	; SAVE BYTE COUNT
     49	000006	012700 	000000G			MOV	#$FRHD,R0	; GET ADDRESS OF FREE CORE POOL
     50	000012					CALL	$RQCB		; REQUEST CORE BLOCK
     51	000016	103064 				BCC	60$		; IF C/C HAVE REQUESTED SPACE
     52
     53					;
     54					; INSUFFICIENT STORAGE IS AVAILABLE. FREE UP MEMORY
     55					; BY DISPLACING PAGE BUFFERS
     56					;
     57
GTCOR	MACRO M1108  05-DEC-77 22:54  PAGE 2-1


     58	000020	012704 	000000C			MOV	#<$PAGHD-P$GNXT>,R4 ; GET LISTHEAD ADDRESS MINUS OFFSET
     59	000024	005002 				CLR	R2		; CLEAR ADDRESS OF LRU PAGE
     60	000026	012703 	177777 			MOV	#-1,R3		; SET MAXIMUM TIME
     61	000032	005046 				CLR	-(SP)		; CLEAR LRU PREDECESSOR
     62	000034				20$:				;
     63	000034	010405 				MOV	R4,R5		; SAVE PREDECESSOR
     64	000036	016504 	000000G			MOV	P$GNXT(R5),R4	; GET NEXT PAGE
     65	000042	001413 				BEQ	30$		; IF EQ DONE
     66	000044	026403 	000000G			CMP	P$GTIM(R4),R3	; TEST TIME OF LAST USE VS. LEAST
     67	000050	101371 				BHI	20$		; IF HI, THIS BUFFER NOT LEAST
     68	000052	105764 	000000G			TSTB	P$GLOK(R4)	; THIS PAGE LOCKED IN MEMORY?
     69	000056	001366 				BNE	20$		; IF NE YES
     70	000060	010402 				MOV	R4,R2		; MARK BUFFER AS LRU
     71	000062	016403 	000000G			MOV	P$GTIM(R4),R3	; SAVE TIME
     72	000066	010516 				MOV	R5,(SP)		; SAVE PREDECESSOR FOR RELINK
     73	000070	000761 				BR	20$		; GO AGAIN
     74	000072				30$:				;
     75	000072	005702 				TST	R2		; FIND LRU?
     76	000074	000261 				SEC			; ASSUME NO
     77	000076	001433 				BEQ	50$		; IF EQ NO
     78	000100	132762 	000000G	000000G		BITB	#PG$WRT,P$GSTS(R2) ; PAGE WRITTEN INTO ?
     79	000106	001402 				BEQ	40$		; IF EQ NO
     80	000110					CALL	$WRPAG		; WRITE OUT PAGE INTO VM
     81	000114				40$:				;
     82	000114	016703 	000000G			MOV	$PAGLS,R3	; GET ADDRESS OF PAGE LIST                      ;**NEW**
     83	000120	001406 				BEQ	45$		; IF EQ NONE                                    ;**NEW**
     84	000122	005000 				CLR	R0		; SET FOR MOVB WITH NO SIGN EXTEND              ;**NEW**
     85	000124	156200 	000000G			BISB	P$GBLK(R2),R0	; GET BLOCK NUMBER                              ;**NEW**
     86	000130	006300 				ASL	R0		; CONVERT TO WORD OFFSET                        ;**NEW**
     87	000132	060003 				ADD	R0,R3		; COMPUTE LOCATION IN LIST                      ;**NEW**
     88	000134	005013 				CLR	(R3)		; CLEAR ENTRY                                   ;**NEW**
     89	000136				45$:				;                                               ;**NEW**
     90	000136	012603 				MOV	(SP)+,R3	; RETRIEVE LRU PREDECESSOR
     91	000140	016263 	000000G	000000G		MOV	P$GNXT(R2),P$GNXT(R3) ; RELINK REMAINING PAGES
     92	000146	012700 	000000G			MOV	#$FRHD,R0	; GET ADDRESS OF FREE POOL LISTHEAD
     93	000152	012701 	000000G			MOV	#P$GSIZ,R1	; SET SIZE TO RELEASE
     94	000156					CALL	$RLCB		; RELEASE MEMORY
     95	000162	012601 				MOV	(SP)+,R1	; RESTORE COUNT
     96	000164	000707 				BR	10$		; GO AGAIN
     97	000166				50$:				;
     98	000166	005226 				INC	(SP)+		; CLEAN STACK, LEAVE C INTACT
     99	000170				60$:				;
    100	000170	005226 				INC	(SP)+		; CLEAN STACK
    101	000172					RETURN			;
    102
    103		000001 				.END
GTCOR	MACRO M1108  05-DEC-77 22:54  PAGE 2-2
SYMBOL TABLE

CR    = 000015   	P$GBLK= ****** GX	P$GTIM= ****** GX	$GTCOR  000000RG 	$RQCB = ****** GX
FF    = 000014   	P$GLOK= ****** GX	R$$11M= 000000   	$PAGHD= ****** GX	$SAVRG= ****** GX
HT    = 000011   	P$GNXT= ****** GX	SPA   = 000040   	$PAGLS= ****** GX	$WRPAG= ****** GX
LF    = 000012   	P$GSIZ= ****** GX	VT    = 000013   	$RLCB = ****** GX	$$    = 000001
PG$WRT= ****** GX	P$GSTS= ****** GX	$FRHD = ****** GX

. ABS.	000000	   000
      	000174	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  657 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
[44,10]GTCOR,[44,20]GTCOR/-SP=[44,30]MACFLM.,GTCOR.001
GTPPR	MACRO M1108  05-DEC-77 22:54  PAGE 2


      1						.TITLE	GTPPR
      2						.IDENT	/05/
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 05
     20					;                                                                               ;**-1
     21					; C. MONIA 21-DEC-73
     22					;
     23					; MODIFICATIONS:
     24					;
     25					; NO.		DATE		PROGRAMMER
     26					; ---		----		----------
     27					;
     28					; 041		16-MAY-75	C. MONIA
     29					;
     30					; SUBROUTINE TO RETURN PARTITION PARAMETERS
     31					;
     32					;
     33					;
     34					; MACRO LIBRARY CALLS
     35					;
     36
     37						.MCALL	DIR$,GPRT$
     38
     39					;
     40					; LOCAL DATA
     41					;
     42					;
     43					; DEFAULT PARTITION NAME
     44					;
     45
     46	000000	026226 	000000 		DFPAR:	.RAD50	/GEN   /	;
     47
     48					;
     49					; DPB-'GET PARTITION PARAMETERS' DIRECTIVE
     50					;
     51
     52	000004				PRDPB:	GPRT$	,PRBF		;
     53
     54					;
     55					; BUFFER TO RECEIVE PARTITION DATA
     56					;
     57
GTPPR	MACRO M1108  05-DEC-77 22:54  PAGE 2-1


     58	000014				PRBF:	.BLKW	3		;
     59
     60					;
     61					;+
     62					; **-$GTPPR - 'GET PARTITION PARAMETERS' SUBROUTINE
     63					;
     64					; INPUTS:
     65					;
     66					;	R0:	POINTS TO PARTITION NAME IN 2-WORD
     67					;		RADIX 50 FORMAT. IF R0 IS ZERO
     68					;		THE DEFAULT PARTITION IS RETURNED.
     69					;
     70					; OUTPUTS:
     71					;
     72					;	C-CLEAR:	SPECIFIED PARTITION FOUND
     73					;
     74					;		R0:	UNMODIFIED
     75					;		R1:	BASE ADDRESS OF PARTITION
     76					;		R2:	PARTITION SIZE IN 32W BLOCKS                            ;**NEW**
     77					;		   	(SET TO 0 FOR SYSTEM CONTROLLED PARTITION)
     78					;
     79					;                                                                               ;**-1
     80					;	$PNAME-$PNAME+2: NAME OF DEFAULT PARTITION (IF REQUESTED)
     81					;
     82					;	C-SET:	REQUESTED PARTITION DOES NOT EXIST IN HOST SYSTEM.
     83					;
     84					;-
     85					;
     86
     87	000022				$GTPPR::			;
     88	000022	005767 	000000G			TST	$RSXSY		; TEST SYSTEM RUNNING ON
     89	000026	000261 				SEC			; ASSUME RSX-11D
     90	000030	100035 				BPL	40$		; IF PL RSX-11D, ERROR
     91	000032					SAVRG			; SAVE NON-VOLATILE REGISTERS
     92	000036	010046 				MOV	R0,-(SP)	; SAVE POINTER TO NAME
     93	000040	001007 				BNE	20$		; IF NE NAME SPECIFIED
     94	000042	012704 	000000G			MOV	#$PNAME,R4	; GET LOCATION FOR NAME
     95	000046	012700 	000000'			MOV	#DFPAR,R0	; GET ADDRESS OF DEFAULT NAME
     96	000052	011024 				MOV	(R0),(R4)+	; SET DEFAULT NAME
     97	000054	016024 	000002 			MOV	2(R0),(R4)+	;
     98	000060				20$:				;
     99	000060	012704 	000006'			MOV	#PRDPB+G.PRPN,R4 ; GET ADDRESS OF NAME IN DPB
    100	000064	012024 				MOV	(R0)+,(R4)+	; SETUP NAME
    101	000066	012024 				MOV	(R0)+,(R4)+	;
    102	000070					DIR$	#PRDPB		; ISSUE DIRECTIVE
    103	000076	103411 				BCS	35$		; IF C/S NO SUCH PARTITION
    104	000100	013701 	000000G			MOV	@#$DSW,R1	; GET VIRTUAL PARTITION ADDRESS
    105	000104	016702 	177706 			MOV	PRBF+G.PRPS,R2	;++041 GET LENGTH/64
    106	000110	032767 	000001 	177702 		BIT	#1,PRBF+G.PRFW	;++041 SYSTEM CONTROLLED PARTITION?
    107	000116	001001 				BNE	35$		;++041 IF NE NO
    108	000120	005002 				CLR	R2		;++041 SET LENGTH TO ZERO
    109	000122				35$:				;                                               ;**-5
    110	000122	012600 				MOV	(SP)+,R0	; RESTORE NAME POINTER
    111	000124				40$:				;
    112	000124					RETURN			;
    113					                                                                                ;**-11
    114		000001 				.END
GTPPR	MACRO M1108  05-DEC-77 22:54  PAGE 2-2
SYMBOL TABLE

CR    = 000015   	G.PRPB= 000000   	PRBF    000014R  	VT    = 000013   	$RSXSY= ****** GX
DFPAR   000000R  	G.PRPN= 000002   	PRDPB   000004R  	$DSW  = ****** GX	$SAVRG= ****** GX
FF    = 000014   	G.PRPS= 000002   	R$$11M= 000000   	$GTPPR  000022RG 	$$$OST= 000010
G.PRBA= 000006   	HT    = 000011   	SPA   = 000040   	$PNAME= ****** GX	$$$T1 = 000000
G.PRFW= 000004   	LF    = 000012

. ABS.	000000	   000
      	000126	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1140 WORDS  ( 5 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:08
[44,10]GTPPR,[44,20]GTPPR/-SP=[44,30]MACFLM.,GTPPR.005
HEADR	MACRO M1108  05-DEC-77 22:54  PAGE 2


      1						.TITLE	HEADR
      2						.IDENT	/13/
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1975,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.               ;**NEW**
      6					;                                                                               ;**-1
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 13
     20					;                                                                               ;**-1
     21					; D.N. CUTLER/C. MONIA 26-DEC-73
     22					;
     23					;
     24					;
     25					; MODIFICATIONS
     26					;
     27					; NO.		DATE		PROGRAMMER
     28					; ---		----		----------
     29					;
     30					; 011		25-AUG-73	C. MONIA
     31					; 013		28-AUG-73	C. MONIA
     32					; 034		07-JAN-75	C. MONIA                                        ;**NEW**
     33					; 045		16-MAY-75	C. MONIA
     34					;
     35					; WRITE TASK IMAGE FILE HEADER
     36					;
     37					; EQUATED SYMBOLS
     38					;
     39
     40
     41						.IF	NDF	R$$11M
     42
     43					SF.XA=004000			;NOT ABORTABLE
     44					SF.XC=040000			;NOT CHECKPOINTABLE
     45					SF.XD=010000			;NOT DISABLABLE
     46					SF.XF=020000			;NOT FIXABLE
     47					SF.PT=000200			;PRIVILEGED
     48
     49
     50						.ENDC
     51
     52					;
     53					; MACRO LIBRARY CALLS
     54					;
     55
     56						.MCALL	GTIM$S
     57
HEADR	MACRO M1108  05-DEC-77 22:54  PAGE 2-1


     58					;
     59					; LOCAL MACROS
     60					;
     61					; GENERATE DATA BLOCK
     62					;
     63					; GBLK	ADRS,TXT,COUNT
     64					;
     65					; WHERE:
     66					;
     67					;	ADRS=STARTING ADDRESS IN TASK IMAGE WHERE TEXT IS TO BE WRITTEN.
     68					;	     IF ODD, THIS VALUE POINTS TO THE REAL ADDRESS.
     69					;
     70					;	TXT=STARTING MEMORY ADDRESS OF TEXT TO BE WRITTEN
     71					;
     72					;	COUNT=NUMBER OF WORDS TO BE WRITTEN
     73					;
     74
     75						.MACRO	GBLK	ADRS,TXT,COUNT
     76					.=.-2
     77						.WORD	TXT
     78						.WORD	ADRS
     79						.WORD	COUNT
     80						.WORD	0
     81						.ENDM
     82
     83					;
     84					; GENERATE BIT TRANSFORMATION TABLE ENTRY
     85					;
     86					; GBTBL MSK1,MSK2
     87					;
     88					; WHERE:
     89					;
     90					;	MSK1=MASK WORD THAT SPECIFIES BIT TO BE TESTED.
     91					;	MSK2=MASK WORD THAT SPECIFIES BIT TO BE SET IF MSK1 BIT IS
     92					;		SET IN FILE SWITCH OPTION WORD.
     93					;
     94
     95						.MACRO	GBTBL MSK1,MSK2
     96						.PSECT	BITBL
     97					.=.-2
     98						.WORD	MSK1
     99						.WORD	MSK2
    100						.WORD	0
    101						.PSECT
    102						.ENDM
    103
    104					;
    105					; GENERATE HEADER BLOCK
    106					;
    107					; GHDRB HDADR,TXADR,COUNT
    108					;
    109					; WHERE:
    110					;
    111					;	HDADR=STARTING ADDRESS IN HEADER OF WHERE TEXT IS TO BE
    112					;		WRITTEN.
    113					;	TXADR=STARTING MEMORY ADDRESS OF TEXT TO BE WRITTEN.
    114					;	COUNT=NUMBER OF WORDS TO BE WRITTEN.
HEADR	MACRO M1108  05-DEC-77 22:54  PAGE 2-2


    115					;
    116
    117						.MACRO	GHDRB HDADR,TXADR,COUNT
    118						.PSECT	HDRTBL
    119						GBLK	HDADR,TXADR,COUNT
    120						.PSECT
    121						.ENDM
    122
    123					;
    124					; GENERATE LABEL BLOCK
    125					;
    126					; GLBLB	LBADR,TXADR,COUNT
    127					;
    128					; WHERE:
    129					;
    130					;	LBADR=STARTING ADDRESS IN LABEL WHERE TEXT IS TO BE WRITTEN
    131					;
    132					;	TXADR=STARTING MEMORY ADDRESS OF TEXT TO BE WRITTEN
    133					;
    134					;	COUNT=NUMBER OF WORDS TO BE WRITTEN
    135					;
    136
    137						.MACRO	GLBLB	LBADR,TXADR,COUNT
    138						.PSECT	LBLTBL
    139						GBLK	LBADR,TXADR,COUNT
    140						.PSECT
    141						.ENDM
    142
    143
    144					;
    145					; LOCAL DATA
    146					;
    147					; BIT TRANSFORMATION TABLE
    148					;
    149					; THIS TABLE IS USED TO TRANSFORM TASK BUILDER BIT DEFINITIONS INTO
    150					; RSX11D TASK STATUS BIT DEFINITIONS.
    151					;
    152
    153	000000					.PSECT	BITBL
    154	000000	000000 			BITBAS:	.WORD	0		;DUMMY ZERO WORD AT START OF TBL
    155	000000					.PSECT
    156
    157						.IF	NDF	R$$11M
    158
    159						GBTBL	SW$CP,SF.XC
    160						GBTBL	SW$AB,SF.XA
    161						GBTBL	SW$DS,SF.XD
    162						GBTBL	SW$FX,SF.XF
    163						GBTBL	SW$PR,SF.PT
    164
    165						.IFF
    166
    167	000000					GBTBL	SW$AC,TS$ACP!TS$PRV
    168	000000					GBTBL	SW$CP,TS$CHK
    169	000000					GBTBL	SW$PR,TS$PRV
    170	000000					GBTBL	SW$NH,TS$NHD
    171	000000					GBTBL	SW$PI,TS$PIC
HEADR	MACRO M1108  05-DEC-77 22:54  PAGE 2-3


    172	000000					GBTBL	SW$PM,TS$PMD                                                    ;**NEW**
    173
    174						.ENDC
    175
    176					;
    177					; HEADER BLOCK TABLE
    178					;
    179
    180	000000					.PSECT	HDRTBL
    181	000000	000000 			HDRBAS:	.WORD	0		;DUMMY ZERO WORD AT START OF TBL
    182	000000					.PSECT
    183
    184						.IF	NDF	R$$11M
    185
    186						GHDRB	H$DFLP,HDFLP,1
    187						GHDRB	H$DPDR,$HDPDR,8.
    188						GHDRB	H$DPAR,$HDPAR,8.
    189						GHDRB	H$DPS,HDPS,1
    190						GHDRB	H$DPC,HDPC,1
    191						GHDRB	H$DR0,HDR0,3
    192						GHDRB	H$DR0,HDR0,6
    193						GHDRB	H$DSP,HDSP,1
    194						GHDRB	H$DIPS,HDPS,1
    195						GHDRB	H$DIPC,HDPC,1
    196						GHDRB	H$DISP,HDSP,1
    197						GHDRB	H$DDSV,$ODTV,3
    198						GHDRB	H$DDUC,$TKUIC,1
    199						GHDRB	H$DUIC,$TKUIC,1
    200						GHDRB	H$DSIZ,HDSIZ,1
    201						GHDRB	H$DFZI,$FSIZI,1
    202						GHDRB	H$DLUT,$NUNIT,1
    203
    204						.IFF
    205
    206	000000					GHDRB	H$EFLM,$IDENT,2
    207	000000					GHDRB	H$FSR,$HFSR,1
    208	000000					GHDRB	H$FOT,$HOTV,1
    209	000000					GHDRB	H$OVLY,$HOVLY,1
    210	000000					GHDRB	H$DSIZ,HDSIZ,1
    211	000000					GHDRB	H$IPS,HDPS,1
    212	000000					GHDRB	H$IPC,HDPC,1
    213	000000					GHDRB	H$ISP,HDSP,1
    214	000000					GHDRB	H$ODVA,$ODTV,2
    215	000000					GHDRB	H$TKVA,$TSKV,2
    216	000000					GHDRB	H$FPSA,HDFLP,1
    217	000000					GHDRB	H$DUIC,$TKUIC,1
    218	000000					GHDRB	H$CUIC,$TKUIC,1
    219	000000					GHDRB	H$NLUN,$NUNIT,1
    220	000000					GHDRB	H$GARD,HGARD,1
    221	000000					GHDRB	RGSAV+1,HDR0,6
    222
    223						.ENDC
    224
    225
    226					;
    227					; LABEL BLOCK TABLE
    228					;
HEADR	MACRO M1108  05-DEC-77 22:54  PAGE 2-4


    229
    230	000000					.PSECT	LBLTBL
    231	000000	000000 			LBLBAS:	.WORD	0		; DUMMY ZERO WORD AT START OF TABLE
    232	000000					.PSECT
    233
    234						.IF	NDF	R$$11M
    235
    236						GLBLB	L$BTSK,$TNAME,2
    237						GLBLB	L$BPAR,$PNAME,2
    238						GLBLB	L$BFLG,HDSWT,1
    239						GLBLB	L$BPRI,$PRIOR,1
    240						GLBLB	L$BLDZ,HDLDZ,1
    241						GLBLB	L$BMXZ,HDMXZ,1
    242						GLBLB	L$BPOL,$POOL,1
    243						GLBLB	L$BPIC,HDPIC,1
    244						GLBLB	L$BDAT,HDDAT,3
    245
    246						.IFF
    247
    248	000000					GLBLB	L$BTSK,$TNAME,2
    249	000000					GLBLB	L$BPAR,$PNAME,2
    250	000000					GLBLB	L$BHRB,$HDRBN,1
    251	000000					GLBLB	L$BBLK,$LBBLK,1
    252	000000					GLBLB	L$BFLG,HDSWT,1
    253	000000					GLBLB	L$BPRI,$PRIOR,1
    254	000000					GLBLB	L$BLDZ,HDLDZ,1
    255	000000					GLBLB	L$BMXZ,HDMXZ,1
    256	000000					GLBLB	L$BSA,$OFFST,1
    257	000000					GLBLB	L$BXFR,HDPC,1
    258	000000					GLBLB	L$BDAT,HDDAT,3
    259	000000					GLBLB	L$BEXT,$LBEXT,1
    260
    261						.ENDC
    262
    263					;
    264					; MISC HEADER VALUES-AJACENCY ASSUMED
    265					;
    266
    267	000000				HDDAT:	.BLKW	3		;CREATION DATE
    268						.IIF NDF R$$11M, HDPIC:	.BLKW	1	; POSITION INDEPENDANT FLAG
    269	000006				HDFLP:	.BLKW	1		;FLOATING POINT SAVE AREA POINTER
    270
    271						.IF	DF	R$$11M
    272
    273	000010				HDSIZ:	.BLKW	1		; HEADER SIZE IN BYTES
    274
    275						.ENDC
    276
    277	000012				HDR0:	.BLKW	6		; INITIAL R0 - R5
    278	000026				HDPC:	.BLKW	1		;PC WORD
    279	000030				HDPS:	.BLKW	1		;PS WORD
    280	000032				HDSP:	.BLKW	1		;INITIAL SP CONTENTS
    281	000034				HDLDZ:	.BLKW	1		;LOAD SIZE IN 32W BLOCKS
    282	000036				HDMXZ:	.BLKW	1		;MAX SIZE IN 32W BLOCKS
    283	000040				HDSWT:	.BLKW	1		;TASK FLAG WORD
    284
    285						.IF	NDF	R$$11M
HEADR	MACRO M1108  05-DEC-77 22:54  PAGE 2-5


    286
    287					HDSIZ:	.BLKW	1		;HEADER SIZE IN 32W BLOCKS
    288
    289						.IFF
    290
    291	000042				HGARD:	.BLKW	1		; ADDRESS OF STACK GUARD WORD
    292	000044				RGSAV:	.BLKW	1		; ADDRESS OF REGISTER SAVE AREA
    293
    294						.ENDC
    295
    296					;
    297					; **-$HEADR-WRITE TASK IMAGE FILE HEADER
    298					;
    299					; THIS ROUTINE IS CALLED TO WRITE THE TASK HEADER INTO THE TASK IMAGE.
    300					;
    301					; INPUTS:
    302					;
    303					;	NONE.
    304					;
    305					; OUTPUTS:
    306					;
    307					;	TASK HEADER IS WRITTEN INTO THE TASK IMAGE FILE.
    308					;-
    309
    310	000046	032767 	000000G	000000G	$HEADR::BIT	#TS$KF,$SWTCH	;TASK IMAGE FILE SPECIFIED?
    311	000054	001001 				BNE	10$		;IF NE YES
    312	000056					RETURN			;
    313	000060				10$:	SAVRG			;SAVE NONVOLITILE REGISTERS
    314	000064	016705 	000000G			MOV	$TSKPT,R5	;GET TASK IMAGE FILE RECORD BLOCK
    315	000070	016505 	000000G			MOV	R$SWTH(R5),R5	;GET FILE SWITCH WORD
    316
    317					;
    318					; PROCESS BIT TRANSFORMATION TABLE
    319					;
    320
    321	000074	012704 	000040'		HEADR0:	MOV	#HDSWT,R4	;GET ADDRESS OF HEADER SWITCH WORD
    322	000100	005014 				CLR	(R4)		;SET INITIAL FLAG WORD
    323	000102	012703 	000000'			MOV	#BITBAS,R3	;GET ADDRESS OF BIT TABLE
    324	000106	012302 			10$:	MOV	(R3)+,R2	;GET MSK1
    325	000110	001405 				BEQ	HEADR1		;IF EQ DONE
    326	000112	012301 				MOV	(R3)+,R1	;GET MSK2
    327	000114	030205 				BIT	R2,R5		;BIT SET?
    328	000116	001773 				BEQ	10$		;IF EQ NO
    329	000120	050114 				BIS	R1,(R4)		;SET BIT IN FLAG WORD
    330	000122	000771 				BR	10$		;
    331
    332					;
    333					; ALLOCATE PAR/PDR REGISTERS
    334					;
    335
    336	000124				HEADR1:				;++013
    337	000124	016700 	000000G			MOV	$LBEXT,R0	;++041 GET TASK EXTENSION SIZE
    338	000130	000300 				SWAB	R0		;++041 SWAP HALVES
    339	000132	106200 				ASRB	R0		;++041 BIT 8 -> C
    340	000134	006000 				ROR	R0		;++041 BIT 9 TO C
    341	000136	006000 				ROR	R0		;++041 NOW HAVE EXTEND SIZE IN BYTES
    342	000140	066700 	000000G			ADD	$HVRTL,R0	;++041 ADD TASK LENGTH+1
HEADR	MACRO M1108  05-DEC-77 22:54  PAGE 2-6


    343	000144	103406 				BCS	10$		;++041 IF C/S EXTEND SIZE TOO BIG
    344	000146	066700 	000000G			ADD	$OFFST,R0	;++041 ADD BASE ADDRESS OFFSET
    345	000152	103403 				.IIF   DF  R$$11M, BCS	10$		; OVERFLOW IF CS
    346	000154	020067 	000000G			CMP	R0,$HGHAD	;TASK WITHIN LIMITS?
    347						.IIF NDF  R$$11M, BLOS	35$		; IF LOS - YES
    348	000160	101406 				.IIF  DF  R$$11M, BLOS	HEADR2		; IF LOS - YES
    349	000162				10$:				;
    350	000162	012702 	000000G			MOV	#$OUTBF,R2	;POINT TO DUMMY BUFFER AREA
    351	000166	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
    352	000170	   000G	   000G			.BYTE	E$R34,S$V2	;FATAL-NO RETURN
    353	000172					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    354
    355						.IF	NDF	R$$11M
    356
    357					35$:	CALL	GTRT		; GET REAL ADDRESS OF ROOT
    358						MOV	R0,R3		; COPY REAL ADDRESS
    359						MOV	$HDSIZ,(R4)	;SET HEADER SIZE IN BYTES
    360						CALL	BLOCKS		;CALCULATE NUMBER OF 32W BLOCKS
    361						MOV	-(R4),R4	;SET INITIAL BLOCK OFFSET VALUE
    362						MOV	$OFFST,R0	;GET OFFSET BIAS
    363						MOV	#206,R1		;SET ACCESS CODE
    364						TST	S$GRO(R3)	;ANY RO AREA?
    365						BEQ	50$		;IF EQ NO
    366						MOV	S$GRW(R3),R2	;GET LENGTH OF RW AREA
    367						SUB	$HDSIZ,R2	;SUBTRACT OUT SIZE OF HEADER
    368						BEQ	40$		;IF EQ NO RW AREA
    369						ADD	R0,R2		;CALCULATE ENDING ADDRESS
    370						MOV	R2,-(SP)	;SAVE ENDING ADDRESS
    371						CALL	FLAPR		;FILL APR REGISTERS
    372						MOV	(SP)+,R0	;RETRIEVE ENDING ADDRESS
    373						ADD	#17777,R0	;ROUND TO NEXT 4K BOUNDRY
    374						BIC	#17777,R0	;CLEAR EXCESS BITS
    375					40$:				;
    376						MOV	R0,-(SP)	; SAVE R0
    377						CALL	GTRT		; GET ADDRESS OF ROOT IN R0
    378						MOV	R0,R3		; COPY ADDRESS
    379						MOV	(SP)+,R0	; RESTORE R0
    380						MOV	#202,R1		; SET ACCESS CODE
    381						MOV	S$GRO(R3),R2	;GET LENGTH OF RO AREA
    382						ADD	R0,R2		;CALCULATE ENDING ADDRESS
    383						MOV	R2,-(SP)	;SAVE ENDING ADDRESS
    384						CALL	FLAPR		;FILL APR REGISTERS
    385						MOV	(SP)+,R0	;RETRIEVE ENDING ADDRESS
    386						CMP	#1,$NUMSG	;MORE THAN ONE SEGMENT?
    387						BEQ	HEADR2		;IF EQ NO
    388						ADD	#17777,R0	;ROUND TO NEXT 4K BOUNDRY
    389						BIC	#17777,R0	;CLEAR EXCESS BITS
    390					50$:	MOV	$HVRTL,R2	;GET HIGHEST VIRTUAL ADDRESS
    391						ADD	$OFFST,R2	;ADD IN OFFSET BIAS
    392						CMP	R0,R2		;ANYTHING IN SEGMENT?
    393						BEQ	HEADR2		;IF EQ NO
    394						MOV	#206,R1		;SET ACCESS CODE
    395						CALL	FLAPR		;FILL APR REGISTERS
    396
    397
    398						.ENDC
    399
HEADR	MACRO M1108  05-DEC-77 22:54  PAGE 2-7


    400					;
    401					; SET UP REMAINING HEADER WORDS
    402					;
    403
    404	000176				HEADR2:				; REF LABEL
    405	000176					GTIM$S	#HDDAT		; GET TIME PARAMETERS
    406
    407						.IF	NDF	R$$11M
    408
    409						MOV	#HDPIC,R4	;GET ADDRESS OF MISC DATA AREA
    410						CLR	(R4)+		;ASSUME NOT POSITION INDEPENDENT
    411						BIT	#SW$PI,R5	;POSITION INDEPENDENT?
    412						BEQ	5$		;IF EQ NO
    413						INC	-2(R4)		;SET PIC FLAG
    414
    415						.IFF
    416
    417	000210	012704 	000006'			MOV	#HDFLP,R4	;  GET ADDRESS OF MISC DATA AREA
    418
    419						.IFTF
    420
    421	000214	005024 			5$:	CLR	(R4)+		;ASSUME NO FLOATING POINT
    422
    423						.IFT
    424
    425						BIT	#SW$FP,R5	;FLOATING POINT SPECIFIED?
    426						BEQ	10$		;IF EQ NO
    427						MOV	$NUNIT,R0	;GET NUMBER OF LOGICAL UNITS
    428						ASL	R0		;MULTIPLY BY 4
    429						ASL	R0		;
    430						ADD	#<H$DLUT-H$DFLP+2>,R0 ; COMPUTE POINTER TO FLOATING POINT SAVE
    431						MOV	R0,-2(R4)	;SET POINTER TO FLOATING POINT SAVE AREA
    432
    433						.IFF
    434
    435	000216	016700 	000000G			MOV	$NUNIT,R0	; FETCH NO. OF UNITS
    436	000222	006300 				ASL	R0		; COMPUTE SIZE OF LUN TABLE
    437	000224	006300 				ASL	R0		;
    438	000226	062700 	000000C			ADD	#<H$LUN-H$CSP+4>,R0 ; COMPUTE ADDRESS OF REGISTER SAVE AREA
    439	000232	010067 	177606 			MOV	R0,RGSAV	; COMPUTE OFFSET TO REGISTER SAVE AREA
    440	000236	062700 	000014 			ADD	#14,R0		; COMPUTE ADDRESS OF STACK GUARD WORD
    441	000242	010067 	177574 			MOV	R0,HGARD	; SAVE
    442	000246	066767 	000000G	177566 		ADD	$OFFST,HGARD	; COMPUTE ADDRESS OF GUARD WORD
    443	000254	062700 	000002 			ADD	#2,R0		; OFFSET PAST GUARD
    444	000260	032705 	000000C			BIT	#<SW$FP!SW$EA>,R5 ; EAE OR FLOATING POINT SPECIFIED?
    445	000264	001411 				BEQ	10$		; IF EQ NO
    446	000266	010044 				MOV	R0,-(R4)	; SET OFFSET TO FLOATING POINT/EAE
    447	000270	032767 	000000G	000000G		BIT	#MP$SY,$SWTCH	; SYSTEM MAPPED?
    448	000276	001402 				BEQ	7$		; IF EQ NO
    449	000300	062714 	140000 			ADD	#140000,(R4)	; OFFSET RELATIVE TO APR 6
    450	000304				7$:				;
    451	000304	066724 	000000G			ADD	$OFFST,(R4)+	; CONVERT TO ADDRESS
    452
    453						.IFT
    454
    455					10$:	CLR	(R4)+		;ASSUME ODT NOT SPECIFIED
    456						CLR	(R4)+		;
HEADR	MACRO M1108  05-DEC-77 22:54  PAGE 2-8


    457						CLR	(R4)+		;
    458						MOV	$IDENT,(R4)+	; SETUP IDENT
    459						MOV	$IDENT+2,(R4)+	;
    460						CLR	(R4)+		; CLEAR INITIAL R5
    461
    462						.IFF
    463
    464	000310				10$:				;
    465	000310	010024 				MOV	R0,(R4)+	; SET SIZE OF HEADER
    466	000312	016724 	000000G			MOV	$HDRBN,(R4)+
    467	000316	016724 	000002G			MOV	$IDENT+2,(R4)+	; SETUP IDENT IN INITIAL R3 - R4
    468	000322	016724 	000000G			MOV	$IDENT,(R4)+	;
    469	000326	005024 				CLR	(R4)+		; ASSUME ODT NOT SPECIFIED, CLEAR R2 - R0
    470	000330	005024 				CLR	(R4)+		;
    471	000332	005024 				CLR	(R4)+		;
    472
    473						.ENDC
    474
    475	000334	016724 	000000G			MOV	$XFRAD,(R4)+	;SET TASK TRANSFER ADDRESS
    476	000340	022767 	000001 	000000G		CMP	#1,$ODTAD	;ODT SPECIFIED?
    477	000346	001414 				BEQ	20$		;IF EQ NO
    478
    479						.IF	NDF	R$$11M
    480
    481						MOV	#HDR0,R4	; BACKUP TO INITIAL R0
    482						MOV	$XFRAD,(R4)+	;PROGRAM XFR ADDRESS GOES IN R0
    483						MOV	$TNAME,(R4)+	;TASK NAME IN R1 AND R2
    484						MOV	$TNAME+2,(R4)+	;
    485
    486						.IFF
    487
    488	000350	012704 	000020'			MOV	#HDR0+6,R4	; POINT TO INITIAL R2
    489	000354	016724 	000002G			MOV	$TNAME+2,(R4)+	; TASK NAME TO INITIAL R2 - R1
    490	000360	016724 	000000G			MOV	$TNAME,(R4)+	;
    491	000364	016724 	000000G			MOV	$XFRAD,(R4)+	; TRANSFER ADDRESS GOES IN R0
    492
    493						.ENDC
    494
    495	000370	012704 	000026'			MOV	#HDPC,R4	; POINT TO INITIAL PC
    496	000374	016724 	000000G			MOV	$ODTAD,(R4)+	;SET TRANSFER ADDRESS TO DEBUGGING AID
    497	000400	012724 	174017 		20$:	MOV	#174017,(R4)+	;SET INITIAL PS WORD
    498	000404	032705 	000000G			BIT	#SW$TR,R5	;T BIT REQUESTED?
    499	000410	001403 				BEQ	30$		;IF EQ NO
    500	000412	052764 	000020 	177776 		BIS	#20,-2(R4)	;SET T BIT IN PS WORD
    501	000420				30$:				; REF. LABEL
    502
    503						.IF	DF	R$$11M
    504
    505	000420	016714 	000000G			MOV	$STACK,(R4)	; SET INITIAL SP CONTENTS
    506	000424	066714 	000000G			ADD	$OFFST,(R4)	; ADD IN OFFSET BIAS
    507	000430	066724 	000000G			ADD	$HDSIZ,(R4)+	; ADD HEADER BIAS
    508	000434				35$:
    509	000434					CALL	GTRT		; GET REAL ADDRESS OF ROOT
    510	000440	016014 	000000G			MOV	S$GMEM(R0),(R4) ; SET LOAD SIZE IN BYTES
    511	000444					CALL	BLOCKS		; ROUND TO 32 W BOUNDRY
    512
    513						.IFF
HEADR	MACRO M1108  05-DEC-77 22:54  PAGE 2-9


    514
    515						MOV	$STACK,(R4)	; SET INITIAL STACK POINTER CONTENTS
    516						ADD	$OFFST,(R4)+	; ADD IN OFFSET BIAS
    517						CALL	GTRT		; GET REAL ADDRESS OF ROOT
    518						MOV	S$GMEM(R0),(R4)	;SET SIZE OF ROOT IN BYTES
    519						CALL	BLOCKS		;CALCULATE NUMBER OF 32W BLOCKS
    520
    521						.IFTF
    522
    523	000450	016714 	000000G			MOV	$MXLGH,(R4)	;SET MAX SIZE IN BYTES
    524	000454					CALL	BLOCKS		; ROUND TO 32 W BOUNDRY
    525
    526						.IFF
    527
    528						MOV	#$ODTV,R4	;GET ADDRESS OF ODT SST VECTOR
    529						MOV	R4,R1		;SET SYMBOL ADDRESS FOR SEARCH
    530						CALL	GTSYM		;GET SYMBOL VALUE
    531						MOV	R0,(R4)+	;SET ODT VECTOR ADDRESS
    532						BCC	40$		;IF CC DEFINITION FOUND
    533						CLRB	$ODTSZ		;CLEAR SIZE OF ODT VECTOR
    534					40$:	MOV	#$TSKV,R1	;GET ADDRESS OF TSK VECTOR
    535						CALL	GTSYM		;GET SYMBOL VALUE
    536						MOV	R0,(R4)		;SET TSK VECTOR ADDRESS
    537						BCC	HEADR3		;IF CC DEFINITION FOUND
    538						CLRB	$TSKSZ		;CLEAR SIZE OF TSK VECTOR
    539
    540
    541						.IFT
    542
    543	000460	012746 	000522'			MOV	#HEADR3,-(SP)	; PUSH ADDRESS OF NEXT ROUTINE
    544	000464	012704 	000000G			MOV	#$ODTV,R4	; GET ADDRESS OF ODT SST VECTOR
    545	000470					CALL	40$		; SETUP ODT VECTOR
    546	000474	012704 	000000G			MOV	#$TSKV,R4	; GET ADDRESS OF TASK SST VECTOR
    547	000500				40$:
    548	000500	010401 				MOV	R4,R1	;	; COPY ADDRESS OF SYMBOL FOR SEARCH
    549	000502					CALL	GTSYM		; SEARCH FOR SYMBOL VALUE
    550	000506	010024 				MOV	R0,(R4)+	; SET VALUE
    551	000510	010024 				MOV	R0,(R4)+	; CLEARS VECTOR SIZE IF NOT FOUND
    552	000512	103402 				BCS	50$		; EXIT IF NOT FOUND
    553	000514	011444 				MOV	(R4),-(R4)	; ELSE SET VECTOR  SIZE
    554	000516	006314 				ASL	(R4)		; CONVERT TO BYTES
    555	000520				50$:
    556	000520					RETURN			; EXIT TO CALLER OR NEXT ROUTINE
    557
    558						.ENDC
    559
    560					;
    561					; WRITE FIXED PART OF HEADER
    562					;
    563
    564	000522				HEADR3:				; REF LABEL
    565	000522	012746 	000674'			MOV	#HEADR4,-(SP)	; PUSH ADDRESS OF NEXT ROUTINE
    566	000526	005067 	000000G			CLR	$BEGRW		; SET LOW MEMORY LIMIT
    567
    568						.IF	DF	R$$11M
    569
    570	000532	005067 	000000G			CLR	$LOWRW		; CLEAR LOW R/W ADDRESS LIMIT
HEADR	MACRO M1108  05-DEC-77 22:54  PAGE 2-10


    571
    572						.ENDC
    573
    574	000536	016700 	000000G			MOV	$HDSIZ,R0	; GET SIZE OF HEADER
    575
    576						.IF	NDF	R$$11M
    577
    578						SUB	$LBLSZ,R0	; OFFSET TO START OF HEADER
    579						CLR	$HDOFF		; CLEAR HEADER OFFSET
    580
    581						.IFF
    582
    583	000542	001414 				BEQ	20$		; SKIP HEADER WRITE IF ZERO
    584
    585						.ENDC
    586
    587	000544	012705 	000000'			MOV	#HDRBAS,R5	; GET BASE ADDRESS OF HEADER BLOCK TABLE
    588	000550	005300 				DEC	R0		; BACK OFF TO REAL END  OF HEADER
    589	000552	010067 	000000G			MOV	R0,$ENDRW	; SET MEMORY LIMITS
    590	000556	016767 	000000G	000000G		MOV	$HDRBN,$RLBLK	; SET RELATIVE BLOCK NUMBER
    591	000564					CALL	30$		; WRITE TASK HEADER
    592	000570					CALL	$FLUSH		; OUTPUT BUFFER CONTENTS.
    593	000574				20$:
    594	000574	012705 	000000'			MOV	#LBLBAS,R5	; GET BASE ADDRESS OF LABEL BLOCK TABLE
    595	000600	016767 	000000G	000000G		MOV	$LBLSZ,$ENDRW	; SET ADDRESS LIMIT
    596	000606	005367 	000000G			DEC	$ENDRW		; BACK OFF TO REAL END
    597	000612	005067 	000000G			CLR	$RLBLK		; CLEAR RELATIVE BLOCK NUMBER
    598	000616				30$:				; REF LABEL
    599	000616	005067 	000000G			CLR	$BFFLG		; SET BUFFER FLAG TO FALSE
    600	000622				40$:				; REF LABEL
    601	000622	012503 				MOV	(R5)+,R3	; GET ADDRESS OF TEXT INFORMATION
    602	000624	001422 				BEQ	60$		; IF EQ DONE
    603	000626	012504 				MOV	(R5)+,R4	; GET ADDRESS IN HEADER
    604	000630	032704 	000001 			BIT	#1,R4		; SEE IF INDIRECT ADDRESS SPECIFIED
    605	000634	001403 				BEQ	45$		; IF EQ NO
    606	000636	042704 	000001 			BIC	#1,R4		; YES, CLEAR INDIRECT BIT
    607	000642	011404 				MOV	(R4),R4		; GET REAL ADDRESS
    608	000644				45$:
    609	000644	012546 				MOV	(R5)+,-(SP)	;SET LOOP COUNT
    610	000646				50$:
    611	000646	012301 				MOV	(R3)+,R1	; SET WORD TO BE WRITTEN
    612	000650	010400 				MOV	R4,R0		;SET VIRTUAL ADDRESS OF WORD
    613	000652					CALL	$WRWRD		;WRITE WORD INTO HEADER
    614	000656	062704 	000002 			ADD	#2,R4		;UPDATE VIRTUAL ADDRESS
    615	000662	005316 				DEC	(SP)		;DECREMENT LOOP COUNT
    616	000664	003370 				BGT	50$		; IF GT GO AGAIN
    617	000666	005726 				TST	(SP)+		;CLEAN STACK
    618	000670	000754 				BR	40$		; GO AGAIN
    619	000672				60$:
    620	000672					RETURN
    621
    622					;
    623					; WRITE LUN ASSIGNMENTS
    624					;
    625
    626	000674	012705 	000000G		HEADR4:	MOV	#$LUNHD,R5	;GET ADDRESS OF ASSIGNMENT LISTHEAD
    627	000700	011505 			10$:	MOV	(R5),R5		;GET ADDRESS OF NEXT ASSIGNMENT
HEADR	MACRO M1108  05-DEC-77 22:54  PAGE 2-11


    628	000702	001433 				BEQ	HEADR5		;IF EQ DONE
    629	000704	010503 				MOV	R5,R3		;COPY ENTRY ADDRESS
    630	000706	010546 				MOV	R5,-(SP)	;SAVE ENTRY ADDRESS
    631	000710	005723 				TST	(R3)+		;POINT TO DEVICE NAME
    632	000712	012305 				MOV	(R3)+,R5	;GET DEVICE NAME
    633	000714	112304 				MOVB	(R3)+,R4	;GET PHYSICAL UNIT
    634	000716	005046 				CLR	-(SP)		;CLEAR WORD ON STACK
    635	000720	152316 				BISB	(R3)+,(SP)	;SET LOOP COUNT
    636	000722	012300 			20$:	MOV	(R3)+,R0	;GET LUN NUMBER
    637	000724	006300 				ASL	R0		;MULTIPLY BY 4
    638	000726	006300 				ASL	R0		;
    639	000730	062700 	177774G			ADD	#L$BASG-4,R0	;CALCULATE ADDRESS IN LABEL BLOCK
    640	000734	010046 				MOV	R0,-(SP)	;SAVE ADDRESS IN LABEL BLOCK
    641	000736	010501 				MOV	R5,R1		;SET WORD TO BE WRITTEN
    642	000740					CALL	$WRWRD		;WRITE DEVICE NAME INTO LABEL BLOCK
    643	000744	012600 				MOV	(SP)+,R0	;RETRIEVE ADDRESS IN LABEL BLOCK
    644	000746	062700 	000002 			ADD	#2,R0		;POINT TO SECOND ASSIGNMENT WORD
    645	000752	010401 				MOV	R4,R1		;SET WORD TO BE WRITTEN
    646	000754					CALL	$WRWRD		;WRITE PHYSICAL UNIT INTO LABEL BLOCK
    647	000760	005316 				DEC	(SP)		;DECREMENT LOOP COUNT
    648	000762	003357 				BGT	20$		;IF GT GO AGAIN
    649	000764	005726 				TST	(SP)+		;CLEAN STACK
    650	000766	012605 				MOV	(SP)+,R5	;RETRIEVE ADDRESS OF NEXT ENTRY
    651	000770	000743 				BR	10$		;
    652
    653					;
    654					; WRITE LIBRARY LIST INTO LABEL BLOCK
    655					;
    656
    657	000772	012705 	000000G		HEADR5:	MOV	#$LBRHD,R5	;GET ADDRESS OF LIBRARY LISTHEAD
    658	000776	162705 	000000G			SUB	#L$DNXT,R5	;SUBTRACT OFFSET FOR INDEX ADD
    659	001002	012704 	000000G			MOV	#L$BLIB,R4	;GET INITIAL VIRTUAL ADDRESS
    660	001006	005046 				CLR	-(SP)		;CLEAR LOOP COUNT
    661	001010	016505 	000000G		10$:	MOV	L$DNXT(R5),R5	;GET ADDRESS OF NEXT ENTRY
    662	001014	001450 				BEQ	60$		;IF EQ DONE
    663	001016	012703 	000000G			MOV	#L$DNME,R3	;SET NAME OFFSET
    664	001022					CALL	30$		;WRITE TWO WORDS INTO LABEL BLOCK
    665	001026	012703 	000000G			MOV	#L$DLTH,R3	;SET LENGTH OFFSET
    666	001032					CALL	40$		;WRITE ONE WORD INTO LABEL BLOCK
    667	001036	012703 	000000G			MOV	#L$DDAT,R3	;SET DATE OFFSET
    668	001042					CALL	20$		;WRITE THREE WORDS INTO LABEL BLOCK
    669						.IIF  NDF  R$$11M, MOV	#L$DAPR,R3	; SET APR OFFSET
    670	001046	012703 	000000G			.IIF   DF, R$$11M, MOV	#L$DSA,R3	; SET RELOCATION OFFSET
    671	001052					CALL	40$		;WRITE ONE WORD INTO LABEL BLOCK
    672	001056	042765 	000000G	000000G		BIC	#LD$RSV,L$DFLG(R5);CLEAR APR RESERVATION FLAG
    673	001064	012703 	000000G			MOV	#L$DFLG,R3	;SET FLAG WORD OFFSET
    674	001070					CALL	40$		;WRITE ONE WORD INTO LABEL BLOCK
    675	001074	000745 				BR	10$		;GO AGAIN
    676	001076	005266 	000002 		20$:	INC	2(SP)		;INCREMENT LOOP COUNT
    677	001102	005266 	000002 		30$:	INC	2(SP)		;
    678	001106	005266 	000002 		40$:	INC	2(SP)		;
    679	001112	060503 				ADD	R5,R3		;POINT TO DATA
    680	001114	010400 			50$:	MOV	R4,R0		;SET VIRTUAL ADDRESS TO WRITE DATA
    681	001116	005724 				TST	(R4)+		;UPDATE VIRTUAL ADDRESS
    682	001120	012301 				MOV	(R3)+,R1	;SET WORD TO BE WRITTEN
    683	001122					CALL	$WRWRD		;WRITE WORD INTO LABEL BLOCK
    684	001126	005366 	000002 			DEC	2(SP)		;DECREMENT LOOP COUNT
HEADR	MACRO M1108  05-DEC-77 22:54  PAGE 2-12


    685	001132	003370 				BGT	50$		;IF GT GO AGAIN
    686	001134					RETURN			;
    687	001136	005726 			60$:	TST	(SP)+		;CLEAN STACK
    688	001140					CALL	$FLUSH		;FLUSH CURRENT BUFFER
    689	001144					RETURN			;
    690
    691					;
    692					; SUBROUTINE TO SUBTRACT OUT SIZE OF LABEL BLOCK, ROUND TO NEXT
    693					; 32W BOUNDRY, AND CALCULATE NUMBER OF RESULTANT 32W BLOCKS.
    694					;
    695
    696	001146				BLOCKS:
    697
    698						.IF	NDF	R$$11M
    699
    700						SUB	$LBLSZ,(R4)	; SUBTRACT OUT SIZE OF LABEL BLOCK
    701
    702						.IFTF
    703
    704	001146	062714 	000077 			ADD	#77,(R4)	;ROUND UP TO NEXT 32W BOUNDRY
    705	001152	042714 	000077 			BIC	#77,(R4)	;CLEAR EXCESS BITS
    706	001156	006014 				ROR	(R4)		;PRESERVE POSSIBLE CARRY
    707	001160	006014 				ROR	(R4)		;CONVERT TO 32W BLOCKS
    708	001162	006014 				ROR	(R4)		;
    709	001164	006014 				ROR	(R4)		;
    710	001166	006014 				ROR	(R4)		;
    711	001170	006024 				ROR	(R4)+		;
    712	001172					RETURN			;
    713
    714						.IFT
    715
    716
    717					;
    718					; SUBROUTINE TO FILL APR REGISTERS
    719					;
    720
    721					FLAPR:	MOV	R1,-(SP)	;SAVE ACCESS CODE
    722						MOV	R0,R3		;COPY STARTING ADDRESS
    723						ASL	R3		;ISOLATE APR NUMBER
    724						ROL	R3		;
    725						ROL	R3		;
    726						ROL	R3		;
    727						ASL	R3		;CONVERT TO TABLE INDEX
    728					10$:	MOV	(SP),$HDPDR(R3)	;SET PDR CONTENTS
    729						MOV	R4,$HDPAR(R3)	;SET ADDITIVE BLOCK NUMBER
    730						CLR	R1		;CLEAR 4K ADDRESS ACCUMULATOR
    731						CLR	R4		;CLEAR ADDITIVE BLOCK NUMBER
    732					20$:				;++011
    733						INC	R1		;
    734						INC	R4		;INCREMENT ADDITIVE BLOCK COUNT
    735						ADD	#100,R0		;++011 INCREMENT TO NEXT 32 W BOUNDARY
    736						BCS	40$		;++011 EXIT IF CROSS 32 K WORD LIMIT.
    737						CMP	R0,R2		;DONE?
    738						BHIS	40$		;IF HIS YES
    739						CMP	R1,#200		;CROSS 4K BOUNDRY?
    740						BHIS	30$		;IF HIS YES
    741						ADD	#400,$HDPDR(R3)	;INCREMENT BLOCK LENGTH FIELD
HEADR	MACRO M1108  05-DEC-77 22:54  PAGE 2-13


    742						BR	20$		;
    743					30$:	ADD	#2,R3		;ADVANCE TO NEXT APR
    744						BR	10$		;
    745					40$:	TST	(SP)+		;CLEAN STACK
    746						RETURN			;
    747
    748						.ENDC
    749
    750
    751					;
    752					; SUBROUTINE TO GET SYMBOL VALUE
    753					;
    754
    755	001174	162701 	000000G		GTSYM:	SUB	#S$YM,R1	;CALCULATE PROPER OFFSET
    756	001200					CALL	GTRT		; GET REAL ADDRESS OF ROOT
    757	001204	062700 	000000G			ADD	#S$GSTB,R0	;POINT TO SYMBOL TABLE
    758	001210					CALL	$SRCH		;SEARCH FOR SYMBOL
    759	001214	103431 				BCS	30$		;IF CS NO FIND EM
    760	001216	010001 				MOV	R0,R1		;COPY ENTRY ADDRESS
    761	001220	005000 				CLR	R0		;ASSUME DEFINITION NOT FOUND
    762	001222	132761 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R1);DEFINITION?
    763	001230	000261 				SEC			;ASSUME NOT DEFINITION
    764	001232	001422 				BEQ	30$		;IF EQ NOT A DEFINITION
    765	001234	132761 	000000G	000000G		BITB	#SY$IND,S$YFLG(R1);INDIRECT ENTRY?
    766	001242	001405 				BEQ	10$		;IF EQ NO
    767	001244	016101 	000000G			MOV	S$YVAL(R1),R1	;GET ADDRESS OF REAL ENTRY
    768	001250					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    769	001254	010001 				MOV	R0,R1		; COPY REAL ADDRESS
    770	001256	016100 	000000G		10$:	MOV	S$YVAL(R1),R0	;GET SYMBOL VALUE
    771	001262	132761 	000000G	000000G		BITB	#SY$REL,S$YFLG(R1);RELOCATABLE SYMBOL?
    772	001270	001402 				BEQ	20$		;IF EQ NO
    773	001272	066700 	000000G			ADD	$OFFST,R0	;ADD OFFSET BIAS
    774	001276	000241 			20$:	CLC			;CLEAR CARRY
    775	001300				30$:	RETURN			;
    776
    777					;
    778					; CONVERT VIRTUAL ADDRESS OF ROOT SEGMENT TO REAL ADDRESS IN R0.
    779					;
    780
    781	001302				GTRT:				;
    782	001302	010146 				MOV	R1,-(SP)	; SAVE R1
    783	001304	016701 	000000G			MOV	$RTSEG,R1	; GET VITUAL ADDRESS OF ROOT
    784	001310					CALL	$CVRL		; CONVERT TO REAL ADDRESS IN R0
    785	001314	012601 				MOV	(SP)+,R1	; RESTORE R1
    786	001316					RETURN
    787		000001 				.END
HEADR	MACRO M1108  05-DEC-77 22:54  PAGE 2-14
SYMBOL TABLE

BITBAS  000000R     002	HEADR4  000674R  	L$BLDZ= ****** GX	SY$REL= ****** GX	$IDENT= ****** GX
BLOCKS  001146R  	HEADR5  000772R  	L$BLIB= ****** GX	S$GMEM= ****** GX	$LBBLK= ****** GX
CR    = 000015   	HGARD   000042R  	L$BMXZ= ****** GX	S$GSTB= ****** GX	$LBEXT= ****** GX
E$R34 = ****** GX	HT    = 000011   	L$BPAR= ****** GX	S$V2  = ****** GX	$LBLSZ= ****** GX
FF    = 000014   	H$CSP = ****** GX	L$BPRI= ****** GX	S$YFLG= ****** GX	$LBRHD= ****** GX
GTRT    001302R  	H$CUIC= ****** GX	L$BSA = ****** GX	S$YM  = ****** GX	$LOWRW= ****** GX
GTSYM   001174R  	H$DSIZ= ****** GX	L$BTSK= ****** GX	S$YVAL= ****** GX	$LUNHD= ****** GX
G.TICP= 000016   	H$DUIC= ****** GX	L$BXFR= ****** GX	TS$ACP= ****** GX	$MXLGH= ****** GX
G.TICT= 000014   	H$EFLM= ****** GX	L$DDAT= ****** GX	TS$CHK= ****** GX	$NUNIT= ****** GX
G.TIDA= 000004   	H$FOT = ****** GX	L$DFLG= ****** GX	TS$KF = ****** GX	$ODTAD= ****** GX
G.TIHR= 000006   	H$FPSA= ****** GX	L$DLTH= ****** GX	TS$NHD= ****** GX	$ODTV = ****** GX
G.TIMI= 000010   	H$FSR = ****** GX	L$DNME= ****** GX	TS$PIC= ****** GX	$OFFST= ****** GX
G.TIMO= 000002   	H$GARD= ****** GX	L$DNXT= ****** GX	TS$PMD= ****** GX	$OUTBF= ****** GX
G.TISC= 000012   	H$IPC = ****** GX	L$DSA = ****** GX	TS$PRV= ****** GX	$PNAME= ****** GX
G.TIYR= 000000   	H$IPS = ****** GX	MP$SY = ****** GX	VT    = 000013   	$PRIOR= ****** GX
HDDAT   000000R  	H$ISP = ****** GX	RGSAV   000044R  	$BEGRW= ****** GX	$RLBLK= ****** GX
HDFLP   000006R  	H$LUN = ****** GX	R$SWTH= ****** GX	$BFFLG= ****** GX	$RTSEG= ****** GX
HDLDZ   000034R  	H$NLUN= ****** GX	R$$11M= 000000   	$CVRL = ****** GX	$SAVRG= ****** GX
HDMXZ   000036R  	H$ODVA= ****** GX	SPA   = 000040   	$ENDRW= ****** GX	$SRCH = ****** GX
HDPC    000026R  	H$OVLY= ****** GX	SW$AC = ****** GX	$ERMSG= ****** GX	$STACK= ****** GX
HDPS    000030R  	H$TKVA= ****** GX	SW$CP = ****** GX	$FLUSH= ****** GX	$SWTCH= ****** GX
HDRBAS  000000R     003	LBLBAS  000000R     004	SW$EA = ****** GX	$HDRBN= ****** GX	$TKUIC= ****** GX
HDR0    000012R  	LD$RSV= ****** GX	SW$FP = ****** GX	$HDSIZ= ****** GX	$TNAME= ****** GX
HDSIZ   000010R  	LF    = 000012   	SW$NH = ****** GX	$HEADR  000046RG 	$TSKPT= ****** GX
HDSP    000032R  	L$BASG= ****** GX	SW$PI = ****** GX	$HFSR = ****** GX	$TSKV = ****** GX
HDSWT   000040R  	L$BBLK= ****** GX	SW$PM = ****** GX	$HGHAD= ****** GX	$WRWRD= ****** GX
HEADR0  000074R  	L$BDAT= ****** GX	SW$PR = ****** GX	$HOTV = ****** GX	$XFRAD= ****** GX
HEADR1  000124R  	L$BEXT= ****** GX	SW$TR = ****** GX	$HOVLY= ****** GX	$$    = 000001
HEADR2  000176R  	L$BFLG= ****** GX	SY$DEF= ****** GX	$HVRTL= ****** GX	$$$OST= 000020
HEADR3  000522R  	L$BHRB= ****** GX	SY$IND= ****** GX

. ABS.	000000	   000
      	001320	   001
BITBL 	000032	   002
HDRTBL	000142	   003
LBLTBL	000112	   004
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2108 WORDS  ( 9 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:38
[44,10]HEADR,[44,20]HEADR/-SP=[44,30]MACFLM.,HEADR.013
INITL	MACRO M1108  05-DEC-77 22:55  PAGE 3


      1						.TITLE	INITL
      2						.IDENT	/15/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					;
      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     12					;
     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     15					; EQUIPMENT CORPORATION.
     16					;
     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     19					;
     20					; VERSION 15                                                                    ;**NEW**
     21					;                                                                               ;**-1
     22					; D. N. CUTLER/C. MONIA	21-JAN-74
     23					;
     24					; GENERAL INITIALIZATION ROUTINE
     25					;
     26					; MACRO LIBRARY CALLS
     27					;
     28
     29						.MCALL	DIR$,GPRT$,OFNB$
     30
     31					;
     32					; LOCAL MACROS
     33					;
     34					; MACRO TO ISSUE RSX-11D 'READ EVENT FLAG' DIRECTIVE
     35					;
     36					; RDEF$S	FLAG
     37					;
     38					; WHERE:
     39					;
     40					;	FLAG=EVENT FLAG NUMBER (1 TO 64.)
     41					;
     42
     43						.MACRO	RDEF$S	FLAG
     44						MOV	FLAG,-(SP)
     45						MOV	#<2*400!37.>,-(SP)
     46						DIR$
     47						.ENDM
     48
     49					;
     50					; LOCAL DATA
     51					;
     52					; TASK MEMORY LIMITS
     53					;
     54
     55	000000	000000 	000000 		LIMIT:	.LIMIT			;
     56
     57					;
INITL	MACRO M1108  05-DEC-77 22:55  PAGE 3-1


     58					; 'GET PARTITION PARAMETERS DPB AND BUFFER
     59					;
     60
     61	000004				PPDPB:	GPRT$	,PBUF		;
     62
     63					;
     64					; 'GET PARTITION PARAMETERS' BUFFER
     65					;
     66
     67	000014				PBUF:	.BLKW	3		;
     68
     69
     70					;+
     71					; **-$INITL-GENERAL INITIALIZATION ROUTINE
     72					;
     73					; THIS ROUTINE IS CALLED AT THE START OF EACH TASK BUILD TO
     74					; INITIALIZE STORAGE.
     75					;
     76					; INPUTS:
     77					;
     78					;	NONE.
     79					;
     80					; OUTPUTS:
     81					;
     82					;	INITIAL STATE OF STORAGE IS SET UP.
     83					;-
     84
     85	000022				$INITL::			;
     86	000022					CALL	$FINIT		; INITIALIZE FCS STORAGE
     87	000026	016700 	000000G			MOV	$INIPT,R0	; GET INPUT REDORD BLOCK POINTER
     88	000032	005070 	000000G			CLR	@R$NMBK(R0)	; NO NAME BLOCK TO SETUP
     89	000036					CALL	$STRCB		; SETUP FCS STORAGE
     90	000042	005067 	000000G			CLR	$ERRCT		; CLEAR ERROR COUNT
     91	000046	005067 	000000G			CLR	$SWTCH		; CLEAR OPTION SWITCH WORD
     92	000052	012700 	000000G			MOV	#$FRHD,R0	; GET ADDRESS OF FREE POOL LISTHEAD
     93	000056	012701 	000000G			MOV	#$FRSZ1,R1	; GET FREE POOL ADDRESS (RSX-11D)
     94	000062	012702 	000000C			MOV	#<<$FRSZ2-$FRSZ1>&^C3>,R2 ; GET SIZE OF FREE STORE
     95					;	RDEF$S	#1		; EXECUTE NON RSX-11M DIRECTIVE
     96					;	MOV	$DSW,$RSXSY	; RESULT IDENTIFIES SYSTEM
     97	000066	012767 	177777 	000000G		MOV	#-1,$RSXSY
     98					;	BCC	4$		; IF C/C RUNNING UNDER RSX-11D
     99	000074					DIR$	#PPDPB		; GET PARTITION PARAMETERS
    100
    101						.IF	DF	R$$11M
    102
    103	000102	005767 	000000G			TST	$DSW		; TEST IF MAPPED
    104	000106	001003 				BNE	3$		; IF NE NO
    105	000110	052767 	000000G	000000G		BIS	#MP$SY,$SWTCH	; SET MAPPED SWITCH
    106	000116				3$:				;
    107
    108						.ENDC
    109
    110	000116	016701 	177660 			MOV	LIMIT+2,R1	; GET NEXT FREE ADDRESS
    111	000122	016702 	177670 			MOV	PBUF+2,R2	; GET PARTITION LENGTH IN 32 W BLOCKS
    112	000126	000302 				SWAB	R2		; EXECUTE EFFECTIVE ASL 8
    113	000130	106002 				RORB	R2		; BIT 0 -> C
    114	000132	006002 				ROR	R2		;
INITL	MACRO M1108  05-DEC-77 22:55  PAGE 3-2


    115	000134	006002 				ROR	R2		; NOW ASL 6
    116	000136	066702 	000000G			ADD	$DSW,R2		; COMPUTE NEXT FREE ADDRESS ABOVE PARTITION
    117	000142	160102 				SUB	R1,R2		; COMPUTE AVAILABLE DYNAMIC STORE
    118	000144	042702 	000003 			BIC	#3,R2		; TRUNCATE TO MULTIPLE OF 4 BYTES
    119	000150				4$:				;
    120	000150	010120 				MOV	R1,(R0)+	; SET ADDRESS OF FIRST FREE BLOCK
    121	000152	005010 				CLR	(R0)		; SECOND WORD OF LISTHEAD MUST BE ZERO
    122	000154	005021 				CLR	(R1)+		; CLEAR LINK TO NEXT FREE BLOCK
    123	000156	010211 				MOV	R2,(R1)		; SET SIZE OF BLOCK
    124	000160	005067 	000000G			CLR	$PAGLS		; CLEAR RESIDENT PAGE LIST POINTER              ;**NEW**
    125	000164	020227 	000000C			CMP	R2,#<N$MPAG*512.> ; ROOM FOR 20 PAGES?                          ;**NEW**
    126	000170	103406 				BLO	42$		; IF LO NO                                      ;**NEW**
    127	000172	012701 	001000 			MOV	#512.,R1	; ALLOCATE RESIDENT PAGE LIST                   ;**NEW**
    128	000176					CALL	$ALBLK		; ALLOCATE BLOCK                                ;**NEW**
    129	000202	010067 	000000G			MOV	R0,$PAGLS	; SAVE SAVE POINTER TO RESIDENT LIST            ;**NEW**
    130	000206				42$:				;                                               ;**NEW**
    131	000206	052767 	000000G	000000G		BIS	#AB$RT,$SWTCH	; FORCE EXIT ON ANY INIT. ERROR
    132	000214	016700 	000000G			MOV	$WRKPT,R0	; GET WORK FILE RECORD BLOCK POINTER
    133	000220	005060 	000040 			CLR	F.ALOC(R0)	; SET FOR DEFAULT EXTEND
    134	000224					OFNB$	R0,#<FA.TMP!FO.WRT> ; OPEN TEMP FILE FOR WRITE
    135	000236	103514 				BCS	10$		; IF C/S ERROR
    136	000240					CALL	$MRKDL		; MARK FOR DELETE NOW
    137	000244	103511 				BCS	10$		; IF C/S ERROR
    138	000246	012767 	000001 	000000G		MOV	#1,$HGVAD	; SETUP INITIAL FREE VIRTUAL STORAGE POINTER
    139	000254	005067 	000000G			CLR	$TIME		; CLEAR PAGE TIMER
    140	000260	005067 	000000G			CLR	$PAGHD		; CLEAR RESIDENT PAGE LISTHEAD
    141	000264	012701 	000000G			MOV	#P$GSIZ,R1	; GET PAGE SIZE
    142	000270					CALL	$ALBLK		; ALLOCATE A SINGLE PAGE BUFFER
    143	000274	010067 	000000G			MOV	R0,$PAGHD	; LINK TO RESIDENT PAGE LISTHEAD
    144	000300	016702 	000000G			MOV	$PAGLS,R2	; GET ADDRESS OF RESIDENT PAGE LIST             ;**NEW**
    145	000304	001401 				BEQ	44$		; IF EQ NONE                                    ;**NEW**
    146	000306	010012 				MOV	R0,(R2)		; POINT TO FIRST PAGE                           ;**NEW**
    147	000310				44$:				;                                               ;**NEW**
    148	000310	005067 	000000G			CLR	$CMFLG		;CLEAR PROMPT STRING DESCRIPTOR ADDRESS
    149	000314	005067 	000000G			CLR	$NUMSG		;CLEAR NUMBER OF SEGMENTS
    150	000320	005067 	000000G			CLR	$PHASE		;CLEAR PHASE NUMBER
    151	000324	005067 	000000G			CLR	$MSYMC		;CLEAR MASTER UNDEFINED SYMBOL COUNT
    152	000330	012701 	000000G			MOV	#C$SLGH,R1	; GET LENGTH OF SECTION ENTRY
    153	000334	010146 				MOV	R1,-(SP)	; SAVE LENGTH
    154	000336					CALL	$ALVRT		; ALLOCATE VIRTUAL MEMORY
    155	000342	010167 	000000G			MOV	R1,$ASCT	; SAVE VIRTUAL ADDRESS OF ABS
    156	000346	012701 	000000G			MOV	#$ABSCT,R1	; GET ADDRESS OF PROTOTYPE ABS SECTION
    157	000352	012602 				MOV	(SP)+,R2	; RETRIEVE LENGTH
    158	000354				5$:				;
    159	000354	112120 				MOVB	(R1)+,(R0)+	; COPY ENTRY
    160	000356					SOB	R2,5$		;
    161	000362					CALL	$ALSGD		;ALLOCATE ROOT SEGMENT DESCRIPTOR
    162	000366	005060 	000000G			CLR	S$GSTS(R0)	;ROOT SEGMENT IS ALWAYS IN CORE
    163	000372	010167 	000000G			MOV	R1,$RTSEG	; SET VIRTUAL ADDRESS OF DESCRIPTOR
    164	000376	010167 	000000G			MOV	R1,$CRVSG	; SET VIRTUAL ADDRESS OF CURRENT SEGMENT
    165	000402	010067 	000000G			MOV	R0,$CRSEG	;SET CURRENT SEG POINTER
    166	000406	062701 	000000C			ADD	#S$GCST/2,R1	; POINT TO SECTION TABLE
    167	000412	010100 				MOV	R1,R0		; COPY LISTHEAD ADDRESS
    168	000414	016701 	000000G			MOV	$ASCT,R1	; GET ADDRESS OF ABS SECTION
    169	000420					CALL	$SRCHI		;SEARCH FOR INSERT
    170	000424					CALL	$ISYM		;INSERT SECTION ENTRY IN TABLE
    171	000430	005067 	000000G			CLR	$SCTHD		; CLEAR SECTION EXTENSION LISTHEAD
INITL	MACRO M1108  05-DEC-77 22:55  PAGE 3-3


    172	000434	042767 	000000G	000000G		BIC	#AB$RT,$SWTCH	; CLEAR ABORT FLAG
    173	000442	012767 	000001 	000000G		MOV	#1,$XFRAD	;SET DEFAULT TRANSFER ADDRESSES
    174	000450	012767 	000001 	000000G		MOV	#1,$ODTAD	;FOR TASK AND ODT
    175	000456	005067 	000000G			CLR	$IDENT		;CLEAR PROGRAM IDENTIFICATION
    176	000462	005067 	000002G			CLR	$IDENT+2	;
    177	000466					RETURN			;
    178	000470				10$:				;
    179	000470	012701 	000000C			MOV	#<S$V2*400!E$R75>,R1 ; UNABLE TO OPEN WORK FILE
    180	000474	005002 				CLR	R2		; SET DUMMY PARAMETER BLOCK ADDRESS
    181	000476					CALL	$ERMSG		; FATAL-NO RETURN
    182
    183		000001 				.END
INITL	MACRO M1108  05-DEC-77 22:55  PAGE 3-4
SYMBOL TABLE

AB$RT = ****** GX	FO.UPD= 000006   	F.RATT= 000001   	N.FVER= 000016   	$DSW  = ****** GX
B.BBFS= 000010   	FO.WRT= 000016   	F.RCNM= 000034   	N.NEXT= 000022   	$ERMSG= ****** GX
B.BFST= 000015   	F.ALOC= 000040   	F.RCTL= 000017   	N.STAT= 000020   	$ERRCT= ****** GX
B.NXBD= 000012   	F.BBFS= 000062   	F.RSIZ= 000002   	N.UNIT= 000034   	$FINIT= ****** GX
B.VBN = 000004   	F.BDB = 000070   	F.RTYP= 000000   	PAR$$$= 000000   	$FRHD = ****** GX
CR    = 000015   	F.BGBC= 000057   	F.STBK= 000036   	PBUF    000014R  	$FRSZ1= ****** GX
C$SLGH= ****** GX	F.BKDN= 000026   	F.UNIT= 000136   	PPDPB   000004R  	$FRSZ2= ****** GX
E$R75 = ****** GX	F.BKDS= 000020   	F.URBD= 000020   	P$GSIZ= ****** GX	$HGVAD= ****** GX
FA.APD= 000100   	F.BKEF= 000050   	F.VBN = 000064   	R$NMBK= ****** GX	$IDENT= ****** GX
FA.CRE= 000010   	F.BKP1= 000051   	F.VBSZ= 000060   	R$$11M= 000000   	$INIPT= ****** GX
FA.EXT= 000004   	F.BKST= 000024   	G.PRBA= 000006   	R.FIX = 000001   	$INITL  000022RG
FA.NSP= 000100   	F.BKVB= 000064   	G.PRFW= 000004   	R.VAR = 000002   	$ISYM = ****** GX
FA.RD = 000001   	F.CNTG= 000034   	G.PRPB= 000000   	SPA   = 000040   	$MRKDL= ****** GX
FA.SHR= 000040   	F.DFNB= 000046   	G.PRPN= 000002   	S$GCST= ****** GX	$MSYMC= ****** GX
FA.TMP= 000020   	F.DSPT= 000044   	G.PRPS= 000002   	S$GSTS= ****** GX	$NUMSG= ****** GX
FA.WRT= 000002   	F.DVNM= 000134   	HT    = 000011   	S$V2  = ****** GX	$ODTAD= ****** GX
FD.BLK= 000010   	F.EFBK= 000010   	LF    = 000012   	S.BFHD= 000020   	$PAGHD= ****** GX
FD.CCL= 000002   	F.EFN = 000050   	LIMIT   000000R  	S.FATT= 000016   	$PAGLS= ****** GX
FD.CR = 000002   	F.EOBB= 000032   	MP$SY = ****** GX	S.FDB = 000140   	$PHASE= ****** GX
FD.DIR= 000010   	F.ERR = 000052   	NB.DEV= 000200   	S.FNAM= 000006   	$RSXSY= ****** GX
FD.FTN= 000001   	F.FACC= 000043   	NB.DIR= 000100   	S.FNB = 000036   	$RTSEG= ****** GX
FD.INS= 000010   	F.FFBY= 000014   	NB.NAM= 000004   	S.FNBW= 000017   	$SCTHD= ****** GX
FD.PLC= 000004   	F.FNAM= 000110   	NB.SD1= 000400   	S.FNTY= 000004   	$SRCHI= ****** GX
FD.RAH= 000001   	F.FNB = 000102   	NB.SD2= 001000   	S.FTYP= 000002   	$STRCB= ****** GX
FD.RAN= 000002   	F.FTYP= 000116   	NB.SNM= 000040   	S.NFEN= 000020   	$SWTCH= ****** GX
FD.REC= 000001   	F.FVER= 000120   	NB.STP= 000020   	VT    = 000013   	$TIME = ****** GX
FD.RWM= 000001   	F.HIBK= 000004   	NB.SVR= 000010   	$ABSCT= ****** GX	$WRKPT= ****** GX
FD.SDI= 000020   	F.LUN = 000042   	NB.TYP= 000002   	$ALBLK= ****** GX	$XFRAD= ****** GX
FD.SQD= 000040   	F.MBCT= 000054   	NB.VER= 000001   	$ALSGD= ****** GX	$$    = 000001
FD.TTY= 000004   	F.MBC1= 000055   	N$MPAG= ****** GX	$ALVRT= ****** GX	$$$OST= 000010
FD.WBH= 000002   	F.MBFG= 000056   	N.DID = 000024   	$ASCT = ****** GX	$$$T1 = 000000
FF    = 000014   	F.NRBD= 000024   	N.DVNM= 000032   	$CMFLG= ****** GX	.OPFNB= ****** G
FO.APD= 000106   	F.NREC= 000030   	N.FID = 000000   	$CRSEG= ****** GX	...GBL= 000000
FO.MFY= 000002   	F.OVBS= 000030   	N.FNAM= 000006   	$CRVSG= ****** GX	...TPC= 000140
FO.RD = 000001   	F.RACC= 000016   	N.FTYP= 000014

. ABS.	000000	   000
      	000502	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2640 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:26
[44,10]INITL,[44,20]INITL/-SP=[44,30]MACFLM.,FCSPR.,INITL.015
INIVM	MACRO M1108  05-DEC-77 22:55  PAGE 2


      1						.TITLE	INIVM
      2						.IDENT	/02/
      3
      4					;
      5					; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.  01754
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
     17					; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 02
     20					;
     21					; WRITTEN BY:
     22					;	CLARK A. D'ELIA		01-JUN-74
     23					;
     24					; MODIFICATIONS:
     25					;
     26					; NO.		DATE		PROGRAMMER
     27					; ---		----		----------
     28					;
     29					; 035		09-JAN-75	C. MONIA
     30					;
     31					;
     32
     33					;+
     34					; **-$INIVM-*-INITIALIZE VIRTUAL MEMORY WORK FILE SYSTEM
     35					;
     36					; THIS ROUTINE INITIALIZES THE VIRTUAL MEMORY WORK FILE SUB-
     37					; SYSTEM.  TO DO THIS IT FORCES ALL PAGES TO BE NON-RESIDENT,
     38					; ALLOCATES THE FIRST PAGE, OPENS THE WORK FILE, AND MARKS
     39					; IT FOR DELETION WHEN CLOSED.
     40					;
     41					; INPUTS:
     42					;	$WRKPT CONTAINS ADDRESS OF WORK FILE FDB
     43					;	$FRHD  CONTAINS ADDRESS OF DYNAMIC MEMORY POOL
     44					;
     45					; OUTPUTS:
     46					;	C-BIT CLEAR  AND/OR  R0=0 INDICATES SUCCESS
     47					;
     48					;	-OR-
     49					;
     50					;	C-BIT SET INDICATES FAILURE  AND/OR
     51					;	      R0=-2 INDICATES WORK FILE OPEN FAILURE
     52					;	      R0=-1 INDICATES WORK FILE MARK FOR DELETE FAILURE
     53					;
     54					;-
     55
     56					;
     57					; MACRO LIBRARY CALLS
INIVM	MACRO M1108  05-DEC-77 22:55  PAGE 2-1


     58					;
     59
     60						.MCALL	FCSBT$
     61	000000					FCSBT$	DEF$L
     62						.MCALL	FDOFF$
     63	000000					FDOFF$	DEF$L
     64						.MCALL	OFNB$
     65
     66						.IF	DF	T$$MP
     67
     68						.MCALL	NMBLK$
     69
     70					WRKNM:	NMBLK$	WRKFIL,TMP
     71
     72						.ENDC
     73
     74
     75
     76	000000				$INIVM::			;
     77	000000					SAVRG			;++035 SAVE THE NON-VOLATILE REGISTERS
     78	000004	012767 	000001 	000000G		MOV	#1,$HGVAD	;++035 SET NEXT VIRTUAL ADDRESS TO 1
     79	000012	005067 	000000G			CLR	$PAGHD		;SET NO RESIDENT PAGES
     80	000016	005067 	000000G			CLR	$PAGLS		;++035 CLEAR POINTER TO RESIDENT PAGE LIST
     81	000022	012700 	000000G			MOV	#$FRHD,R0	; GET ADDRESS OF FREE POOL LISTHEAD
     82	000026	012001 				MOV	(R0)+,R1	; GET ADDRESS OF CORE POOL
     83	000030	005010 				CLR	(R0)		; SECOND WORD OF LIST MUST BE ZERO
     84	000032	026127 	000002 	000000C		CMP	2(R1),#<N$MPAG*P$GSIZ> ; ENOUGH ROOM FOR FAST PAGE SEARCH
     85	000040	103406 				BLO	5$		; IF LO NO
     86	000042	012701 	001000 			MOV	#512.,R1	; SET SIZE OF RESIDENT PAGE LIST
     87	000046					CALL	$ALBLK		; ALLOCATE RESIDENT PAGE LIST
     88	000052	010067 	000000G			MOV	R0,$PAGLS	;++035 SAVE ADDRESS OF LIST
     89	000056				5$:				;
     90	000056	012701 	000000G			MOV	#P$GSIZ,R1	;PUT PAGE SIZE IN R1
     91	000062					CALL	$ALBLK		;ALLOCATE FIRST PAGE
     92	000066	010067 	000000G			MOV	R0,$PAGHD	;LINK IT TO RESIDENT PAGE LIST HEAD
     93	000072	016701 	000000G			MOV	$PAGLS,R1	;++035 GET ADDRESS OF RESIDENT PAGE LIST
     94	000076	001401 				BEQ	7$		;++035 IF EQ NONE
     95	000100	010011 				MOV	R0,(R1)		;++035 SET THIS PAGE RESIDENT
     96	000102				7$:				;
     97	000102	016700 	000000G			MOV	$WRKPT,R0	;POINT R0 TO WORK FILE FDB
     98	000106	005060 	000040 			CLR	F.ALOC(R0)	;FILE IS INITIALLY NON-CONTIGUOUS
     99	000112	012746 	177776 			MOV	#-2,-(SP)	;ASSUME FILE OPEN FAILURE (STS=-2)
    100
    101						.IF	DF	T$$MP
    102
    103						MOV	R0,R1		;++035 COPY FDB ADDRESS
    104						ADD	#F.FNB,R1	;++035 POINT TO FILENAME BLOCK
    105						CLR	R2		;++035 NO DATASET DESCRIPTOR
    106						MOV	#WRKNM,R3	;++035 SET ADDRESS OF DEFAULT FILENAME BLOCK
    107						CALL	.PARSE		;++035 ENTER TEMP. FILE NAME IN DIRECTORY
    108						BCS	10$		;++035 IF C/S PARSE FAILED
    109						INC	(SP)		;++035 SPECIFY SUCCESFUL PARSE
    110						OFNB$	R0,#<FO.WRT>	;++035 OPEN FILE FOR WRITE
    111						BCS	10$		;++035 IF C/S OPEN FAILURE
    112
    113						.IFF
    114
INIVM	MACRO M1108  05-DEC-77 22:55  PAGE 2-2


    115	000116					OFNB$	R0,#<FA.TMP!FO.WRT> ;CREATE TEMPORARY WORK FILE
    116	000130	103405 				BCS	10$		;BRANCH IF ERROR
    117	000132	005216 				INC	(SP)		;ASSUME MARK FOR DELETE FAILURE (STS=-1)
    118	000134					CALL	.MRKDL		;MARK FILE FOR DELETE AFTER CLOSE
    119	000140	103401 				BCS	10$		;BRANCH IF ERROR
    120
    121						.ENDC
    122
    123	000142	005216 				INC	(SP)		;SPECIFY SUCCESSFUL INIT (STS=0)
    124	000144	012600 			10$:	MOV	(SP)+,R0	;PUT STATUS IN R0
    125	000146					RETURN			;RETURN WITH C-BIT SET IF ERROR
    126
    127
    128		000001 				.END
INIVM	MACRO M1108  05-DEC-77 22:55  PAGE 2-3
SYMBOL TABLE

CR    = 000015   	FO.APD= 000106   	F.FNAM= 000110   	NB.DEV= 000200   	R.VAR = 000002
FA.APD= 000100   	FO.MFY= 000002   	F.FNB = 000102   	NB.DIR= 000100   	SPA   = 000040
FA.CRE= 000010   	FO.RD = 000001   	F.FTYP= 000116   	NB.NAM= 000004   	S.FATT= 000016
FA.EXT= 000004   	FO.UPD= 000006   	F.FVER= 000120   	NB.SD1= 000400   	S.FDB = 000140
FA.NSP= 000100   	FO.WRT= 000016   	F.HIBK= 000004   	NB.SD2= 001000   	S.FNAM= 000006
FA.RD = 000001   	F.ALOC= 000040   	F.LUN = 000042   	NB.SNM= 000040   	S.FNB = 000036
FA.SHR= 000040   	F.BBFS= 000062   	F.MBCT= 000054   	NB.STP= 000020   	S.FNBW= 000017
FA.TMP= 000020   	F.BDB = 000070   	F.MBC1= 000055   	NB.SVR= 000010   	S.FNTY= 000004
FA.WRT= 000002   	F.BGBC= 000057   	F.MBFG= 000056   	NB.TYP= 000002   	S.FTYP= 000002
FD.BLK= 000010   	F.BKDN= 000026   	F.NRBD= 000024   	NB.VER= 000001   	S.NFEN= 000020
FD.CCL= 000002   	F.BKDS= 000020   	F.NREC= 000030   	N$MPAG= ****** GX	VT    = 000013
FD.CR = 000002   	F.BKEF= 000050   	F.OVBS= 000030   	N.DID = 000024   	$ALBLK= ****** GX
FD.DIR= 000010   	F.BKP1= 000051   	F.RACC= 000016   	N.DVNM= 000032   	$FRHD = ****** GX
FD.FTN= 000001   	F.BKST= 000024   	F.RATT= 000001   	N.FID = 000000   	$HGVAD= ****** GX
FD.INS= 000010   	F.BKVB= 000064   	F.RCNM= 000034   	N.FNAM= 000006   	$INIVM  000000RG
FD.PLC= 000004   	F.CNTG= 000034   	F.RCTL= 000017   	N.FTYP= 000014   	$PAGHD= ****** GX
FD.RAH= 000001   	F.DFNB= 000046   	F.RSIZ= 000002   	N.FVER= 000016   	$PAGLS= ****** GX
FD.RAN= 000002   	F.DSPT= 000044   	F.RTYP= 000000   	N.NEXT= 000022   	$SAVRG= ****** GX
FD.REC= 000001   	F.DVNM= 000134   	F.STBK= 000036   	N.STAT= 000020   	$WRKPT= ****** GX
FD.RWM= 000001   	F.EFBK= 000010   	F.UNIT= 000136   	N.UNIT= 000034   	$$    = 000001
FD.SDI= 000020   	F.EFN = 000050   	F.URBD= 000020   	PAR$$$= 000000   	.MRKDL= ****** GX
FD.SQD= 000040   	F.EOBB= 000032   	F.VBN = 000064   	P$GSIZ= ****** GX	.OPFNB= ****** G
FD.TTY= 000004   	F.ERR = 000052   	F.VBSZ= 000060   	R$$11M= 000000   	...GBL= 000000
FD.WBH= 000002   	F.FACC= 000043   	HT    = 000011   	R.FIX = 000001   	...TPC= 000140
FF    = 000014   	F.FFBY= 000014   	LF    = 000012

. ABS.	000000	   000
      	000150	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1955 WORDS  ( 8 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[44,10]INIVM,[44,20]INIVM/-SP=[44,30]MACFLM.,INIVM
IODAT	MACRO M1108  05-DEC-77 22:55  PAGE 3


      1						.TITLE	IODAT
      2						.IDENT	/17/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1975,  DIGITAL EQUIPMENT CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 17                                                                    ;**NEW**
     20					;                                                                               ;**-1
     21					; D.N. CUTLER/C. MONIA 27-DEC-73
     22					;
     23					;
     24					;
     25					; MODIFICATIONS
     26					;
     27					; NO.		DATE		PROGRAMMER
     28					; ---		----		----------
     29					;
     30					; 008		16-AUG-73	C. MONIA
     31					; 034		07-JAN-74	C. MONIA
     32					; 036		10-JAN-75	C. MONIA                                        ;**NEW**
     33					;
     34					;
     35					;
     36					;
     37					; MONITOR DEPENDENT I/O DATA BASE
     38					;
     39					; EQUATED SYMBOLS
     40					;
     41
     42		000006 			F$DEVL==6.			;MAX LENGTH OF DEVICE NAME
     43		000013 			F$DIRL==11.			; MAX LENGTH OF DIRECTORY NAME
     44		000021 			F$FILL==17.			;MAX LENGTH OF FILENAME
     45		000006 			LMOD=6.				; MAX LENGTH OF LIBRARY MODULE NAME
     46		000010 			NMOD=8.				; MAX NUMBER OF NAMES PER SPEC.
     47
     48					;
     49					; MACRO LIBRARY CALLS
     50					;
     51
     52						.MCALL	CSI$ND,CSI$SV,CSI$SW
     53						.MCALL	FDAT$A,FDBDF$,FDOP$A,FDRC$A,FSRSZ$
     54						.MCALL	GCMLB$,NMBLK$
     55
     56					;
     57					; LOCAL MACROS
IODAT	MACRO M1108  05-DEC-77 22:55  PAGE 3-1


     58					;
     59
     60					;
     61					; GENERATE CONTROL BLOCK
     62					;
     63					; GENBLK	A,B,C,DD,E,F,G,H,I,J
     64					;
     65					; WHERE:
     66					;
     67					;	A=THREE CHARACTER BLOCK NAME
     68					;	B=RECORD TYPE
     69					;	C=RECORD ATTRIBUTES
     70					;	DD=RECORD SIZE
     71					;	E=RECORD ACCESS
     72					;	F=RECORD BUFFER SIZE
     73					;	G=LOGICAL UNIT
     74					;	H=DATASET POINTER SWITCH
     75					;	I=ADDRESS OF DEFAULT NAME BLOCK
     76					;	J=NUMBER OF FCS BLOCK BUFFERS
     77					;
     78
     79						.MACRO	GENBLK	A,B,C,DD,E,F,G,H,I,J
     80						.PSECT	A'$D,D,GBL
     81					$$=0
     82						.IF	NB	F
     83					$$=.
     84						.BLKB	F
     85						.EVEN
     86						.ENDC
     87					$$0=0
     88						.IF	NB	H
     89					$$1=.
     90						.BLKB	F$DEVL
     91						.EVEN
     92					$$2=.
     93						.BLKB	F$DIRL
     94						.EVEN
     95					$$3=.
     96						.BLKB	F$FILL
     97						.EVEN
     98					$$0=.
     99						.BLKW	1
    100						.WORD	$$1
    101						.BLKW	1
    102						.WORD	$$2
    103						.BLKW	1
    104						.WORD	$$3
    105						.ENDC
    106						.PSECT	FILN$D,D,GBL
    107					$'A'NM::.WORD	0
    108						.PSECT	A'P$D,D,GBL
    109					$'A'PT::.WORD	A'PT
    110						.PSECT	A'$D,D,GBL
    111					A'PT:	FDBDF$
    112						FDAT$A	B,C,DD
    113						FDRC$A	E,$$,F
    114						FDOP$A	G,$$0,I
IODAT	MACRO M1108  05-DEC-77 22:55  PAGE 3-2


    115					R$NAME==.-'A'PT
    116						.WORD	A'PT+F.FNB+N.FNAM
    117					R$SWTH==.-'A'PT
    118						.BLKW	1
    119					R$SWBK==.-'A'PT
    120						.BLKW	1
    121					R$NMBK==.-'A'PT
    122						.WORD	$'A'NM
    123					R$BLKB==.-'A'PT
    124						.WORD	0
    125						.IF	NB	J
    126						.PSECT	A'$E,D,GBL
    127					$$E=.
    128						.PSECT	A'$D,D,GBL
    129					.=.-2
    130						.WORD	.+2
    131					$$B=.
    132						.WORD	$$E-$$B-2
    133						.BLKB	J*<512.+S.BFHD>
    134						.ENDC
    135						.ENDM
    136
    137					;
    138					; R$SWTH BIT DEFINITIONS
    139					;
    140
    141
    142					;
    143					; TASK AND STB FILE SWITCHES
    144					;
    145					;		*** NOTE ***
    146					;
    147					; DEBUGGING AID SWITCH, 'SW$DA', ALSO APPLIES TO INPUT FILE
    148					; SWITCHES
    149					;
    150
    151		100000 			SW$CP==100000			; TASK CHECKPOINTABLE (0=YES)
    152		040000 			SW$FP==040000			; TASK USES FLOATING POINT (1=YES)
    153		002000 			SW$DA==002000			; TASK DEBUGGING AID SPECIFIED (1=YES)
    154		001000 			SW$PI==001000			; PIC OUTPUT (1=YES) (ALSO APPLIES TO STB FILE).
    155		000400 			SW$PR==000400			; TASK IS PRIVELEGED (1=YES)
    156		000200 			SW$TR==000200			; SET TRACE BIT IN PS (1=YES)
    157
    158						.IF	NDF	R$$11M
    159
    160					SW$FX==004000			; TASK IS FIXABLE (0=YES)
    161					SW$AB==000020			; TASK ABORTABLE (0=YES)
    162					SW$DS==000010			; TASK DISABLABLE (0=YES)
    163
    164						.IFF
    165
    166		000004 			SW$AC==000004			; TASK IS ANCILLARY CONTROL PROCESSOR (1=YES)
    167		020000 			SW$EA==020000			; TASK USES EAE (1=YES)
    168		010000 			SW$NH==010000			; BUILD TASK IMAGE WITHOUT HEADER (1=YES)
    169		000100 			SW$PM==000100			;++034 POST-MORTEM DUMP (1=YES)
    170
    171						.ENDC
IODAT	MACRO M1108  05-DEC-77 22:55  PAGE 3-3


    172
    173					;
    174					; INPUT FILE SWITCHES
    175					;
    176
    177		020000 			SW$LB==020000			; LIBRARY FILE (1=YES)
    178		010000 			SW$MP==010000			; OVERLAY MAP FILE (1=YES)
    179		000100 			SW$CC==000100			; CONCATENATED FILE (1=YES)
    180		000040 			SW$AL==000040			; AUTOLOAD ELEMENT (1=YES)
    181		000004 			SW$RL==000004			; RESIDENT LIBRARY ELEMENT (1=YES)
    182		000002 			SW$SS==000002			;++008 SELECTIVE SYMBOL SEARCH (1=YES)
    183
    184					;
    185					; LOCAL DATA
    186					;
    187					; ALLOCATE FCS RESIDENT IMPURE AREA
    188					;
    189
    190	000000					.PSECT
    191
    192	000000					FSRSZ$	0
    193
    194					;
    195					; 'GET COMMAND LINE' INPUT CONTROL BLOCK
    196					;
    197
    198	000000					.PSECT	CMIP$D,D,GBL
    199
    200	000000	000000'			$CMIPT::.WORD	CMIPT
    201
    202	000000					.PSECT	CMI$D,D,GBL
    203
    204	000000				CMIPT:				; REF. LABEL
    205	000000					GCMLB$	3,TKB,$LNBUF
    206
    207	000000					.PSECT
    208
    209					;
    210					; I/O DATA BASES (SEQUENCE MUST BE AS SHOWN)
    211					;
    212
    213						.IF	NDF	R$$11M
    214
    215						GENBLK	CMO,R.VAR,FD.CR,80.,,,2
    216
    217						.ENDC
    218
    219	000000					GENBLK	INI,R.FIX,,512.,FD.PLC,,3,1,,1
    220	001254					GENBLK	TSK,R.FIX,,512.,FD.RWM!FD.RAN,,7,,,1
    221	001174					GENBLK	MAP,R.VAR,,100.,,,4,,,2
    222	002214					GENBLK	STB,R.VAR,,128.,,,6,,,1
    223	001174					GENBLK	INP,R.VAR,,,FD.PLC,128.,3
    224	000352					GENBLK	ODL,R.VAR,,80.,,,5,,ODLNM
    225	000152					GENBLK	CRF,R.FIX,,,,,4                                                 ;**NEW**
    226
    227					;
    228					; ODL FILE DEFAULT NAME BLOCK
IODAT	MACRO M1108  05-DEC-77 22:55  PAGE 3-4


    229					;
    230
    231	000152					.PSECT	ODL$D,D,GBL
    232
    233	000152				ODLNM:	NMBLK$	,ODL,,SY	;
    234
    235					;
    236					; LIBRARY NAME BLOCK POINTER
    237					;
    238
    239	000000					.PSECT	LIBN$D,D,GBL
    240
    241	000000	000000 			$LIBNM::.WORD	0		;
    242
    243	000000					.PSECT	INID$D,D,GBL
    244
    245					;
    246					; DEFAULT NAME BLOCKS (ADJACENCY ASSUMED)
    247					;
    248
    249	000000				$DFNB::				; REF LABEL
    250	000000					NMBLK$	,TSK,,SY
    251	000036					NMBLK$	,MAP,,SY
    252	000074					NMBLK$	,STB,,SY
    253	000132					NMBLK$	,OBJ,,SY
    254					                                                                                ;**NEW**
    255					;++036                                                                          ;**NEW**
    256					;++036 TASK BUILDER TEMPORARY MAP OUTPUT NAMEBLOCK                              ;**NEW**
    257					;++036                                                                          ;**NEW**
    258					                                                                                ;**NEW**
    259	000170				$MAPTM::NMBLK$	TKBTMP,MAP,,SY                                                  ;**NEW**
    260					                                                                                ;**NEW**
    261
    262					;
    263					; DEFAULT LIBRARY NAME BLOCK
    264					;
    265
    266	000226				$LIBNB::NMBLK$	,OLB,,SY
    267
    268
    269					;
    270					; SYSTEM LIBRARY FILE
    271					;
    272
    273	000264				$DFLIB::NMBLK$	SYSLIB,OLB,,SY
    274
    275					;
    276					; DATA SET DESCRIPTORS AND STRING POINTERS
    277					;
    278					;++036 SYSTEM LIBRARY DIRECTORY STRING                                          ;**NEW**
    279					;                                                                               ;**-1
    280
    281	000322	   133 	   061 	   054 	DSLIB:	.ASCII	/[1,1]/		; DIRECTORY
	000325	   061 	   135
    282	000327				DSLBE:				; REF LABEL
    283						.EVEN
    284
IODAT	MACRO M1108  05-DEC-77 22:55  PAGE 3-5


    285					;
    286					;++036 SYSTEM LIBRARY STRING DESCRIPTOR                                         ;**NEW**
    287					;                                                                               ;**-1
    288
    289	000330				$DSPLB::			; REF LABEL
    290	000330	000000 				.WORD	0		; DEFAULT DEVICE
    291	000332	000000 				.WORD	0		;
    292	000334	000005 				.WORD	DSLBE-DSLIB	; DIRECTORY STRING
    293	000336	000322'				.WORD	DSLIB		;
    294	000340	000000 				.WORD	0		; DEFAULT FILE I/D
    295	000342	000000 				.WORD	0		;
    296					                                                                                ;**NEW**
    297					;++036                                                                          ;**NEW**
    298					;++036 TASK BUILDER TEMPORARY MAP OUTPUT STRING                                 ;**NEW**
    299					;++036                                                                          ;**NEW**
    300					                                                                                ;**NEW**
    301	000344	   123 	   131 		MAPDV:	.ASCII	/SY/		;++036 DEVICE                                   ;**NEW**
    302	000346				MAPE:				;++036                                          ;**NEW**
    303					                                                                                ;**NEW**
    304						.EVEN                                                                   ;**NEW**
    305					                                                                                ;**NEW**
    306					;++036                                                                          ;**NEW**
    307					;++036 TASK BUILDER MAP OUTPUT STRING DESCRIPTOR                                ;**NEW**
    308					;++036                                                                          ;**NEW**
    309					                                                                                ;**NEW**
    310	000346	000002 			$MAPTD::.WORD	MAPE-MAPDV	;++036 DEVICE DESCRIPTOR                        ;**NEW**
    311	000350	000344'				.WORD	MAPDV		;++036                                          ;**NEW**
    312					                                                                                ;**NEW**
    313					;++036                                                                          ;**NEW**
    314					;++036 TASK BUILDER TEMPORARY MAP OUTPUT DATASET DESCRIPTOR                     ;**NEW**
    315					;++036                                                                          ;**NEW**
    316					                                                                                ;**NEW**
    317
    318					;
    319					; INPUT FILE SWITCHES
    320					;
    321	000352				$INPSW::			; REF LABEL
    322	000352					CSI$SW	CC,SW$CC,INIPT+R$SWTH,SET,NEG
    323	000362					CSI$SW	DA,SW$DA,INIPT+R$SWTH,SET,NEG
    324	000372					CSI$SW	LB,SW$LB,INIPT+R$SWTH,SET,NEG,LBSV
    325	000402					CSI$SW	MP,SW$MP,INIPT+R$SWTH,SET,NEG
    326	000412					CSI$SW	SS,SW$SS,INIPT+R$SWTH,SET,NEG
    327	000422					CSI$ND
    328
    329					;
    330					; MAP FILE SWITCHES
    331					;
    332
    333	000424				$MAPSW::			; REF LABEL
    334	000424					CSI$SW	SH,LG$SH,$SWTCH,SET,NEG
    335	000434					CSI$SW	SP,SP$OL,$SWTCH,CLEAR,NEG
    336	000444					CSI$SW	CR,CR$EF,$SWTCH,SET,NEG                                         ;**NEW**
    337	000454					CSI$ND
    338
    339					;
    340					; STB FILE SWITCHES
    341					;
IODAT	MACRO M1108  05-DEC-77 22:55  PAGE 3-6


    342
    343	000456				$STBSW::			; REF LABEL
    344	000456					CSI$SW	HD,SW$NH,INIPT+R$SWTH,CLEAR,NEG
    345	000466					CSI$SW	PI,SW$PI,INIPT+R$SWTH,SET,NEG
    346	000476					CSI$ND
    347
    348					;
    349					; TASK FILE SWITCHES
    350					;
    351
    352	000500				$TSKSW::			; REF LABEL
    353	000500					CSI$SW	CP,SW$CP,INIPT+R$SWTH,CLEAR,NEG
    354	000510					CSI$SW	DA,SW$DA,INIPT+R$SWTH,SET,NEG
    355	000520					CSI$SW	FP,SW$FP,INIPT+R$SWTH,SET,NEG
    356	000530					CSI$SW	MM,MP$SY,$SWTCH,SET,NEG
    357	000540					CSI$SW	PI,SW$PI,INIPT+R$SWTH,SET,NEG
    358	000550					CSI$SW	PR,SW$PR,INIPT+R$SWTH,SET,NEG
    359	000560					CSI$SW	SQ,SE$QA,$SWTCH,SET,NEG
    360	000570					CSI$SW	TR,SW$TR,INIPT+R$SWTH,SET,NEG
    361	000600					CSI$SW	XT,AB$RT,$SWTCH,SET,NEG,XTSV
    362
    363						.IF	NDF	R$$11M
    364
    365						CSI$SW	AB,SW$AB,INIPT+R$SWTH,SET,NEG
    366						CSI$SW	DS,SW$DS,INIPT+R$SWTH,CLEAR,NEG
    367						CSI$SW	FX,SW$FX,INIPT+R$SWTH,CLEAR,NEG
    368
    369						.IFF
    370
    371	000610					CSI$SW	AC,SW$AC,INIPT+R$SWTH,SET,NEG
    372	000620					CSI$SW	EA,SW$EA,INIPT+R$SWTH,SET,NEG
    373	000630					CSI$SW	HD,SW$NH,INIPT+R$SWTH,CLEAR,NEG
    374	000640					CSI$SW	PM,SW$PM,INIPT+R$SWTH,SET,NEG
    375
    376						.ENDC
    377
    378	000650					CSI$ND
    379
    380					;
    381					; '/LB' SWITCH VALUE TABLE
    382					;
    383
    384		000714'			LB=$LBSVT
    385	000652				LBSV:				;
    386		000010 				.REPT	NMOD
    387						CSI$SV	,LB,LMOD
    388					LB=LB+LMOD+1
    389						.ENDR
    390	000712					CSI$ND
    391
    392					;
    393					; '/LB' SWITCH VALUE STORAGE
    394					;
    395
    396	000714				$LBSVT::			; REF LABEL
    397
    398		000010 				.REPT	NMOD
IODAT	MACRO M1108  05-DEC-77 22:55  PAGE 3-7


    399						.BLKB	LMOD
    400						.BYTE	0
    401						.ENDR
    402
    403						.EVEN
    404
    405					;
    406					; '/XT' SWITCH VALUE TABLE
    407					;
    408
    409	001004				XTSV:	CSI$SV	NUMERIC,$ERRCT,2
    410	001010					CSI$ND
    411
    412
    413	000000					.PSECT
    414
    415
    416					;
    417					;+
    418					; I/O DATA BASE STRUCTURE:
    419					;
    420					;	THE I/O DATA BASE IS DESIGNED TO ALLOCATE STORAGE FOR BLOCK
    421					; BUFFER SPACE,  FDB'S AND ASSOCIATED DATA IN GLOBAL PSECTS
    422					; SUCH THAT THIS DATA MAY BE OVERLAYED WHEN NO LONGER REQUIRED.
    423					;
    424					;	THE DATA BASE CONSISTS OF ONE OR MORE OR THE
    425					; FOLLOWING ELEMENTS:
    426					;
    427					;	(1) AN FDB, RECORD BUFFER, AND POINTERS TO THE FOLLOWING ELEMENTS
    428					;	(2) A DATASET AND DATASET POINTERS
    429					;	(3) A POOL OF BLOCK BUFFERS
    430					;	(4) A DEFAULT NAME BLOCK
    431					;	(5) CSI SWITCH BLOCK AND SWITCH VALUE TABLES
    432					;
    433					;	THE FOLLOWING MACRO'S ARE USED TO CREATE THE DATA BASE:
    434					;
    435					;	GENBLK:	BUILD FDB, POINTERS, DATASET AND FCS BLOCK BUFFER POOL
    436					;	FCS MACROS:	BUILD DEFAULT NAME BLOCK
    437					;	CSI MACROS:	BUILD SWITCH TABLES.
    438					;
    439					;-
    440					;
    441
    442
    443		000001 				.END
IODAT	MACRO M1108  05-DEC-77 22:55  PAGE 3-8
SYMBOL TABLE

AB$RT = ****** GX	F.BBFS= 000062   	GE.COM= 000001   	N.STAT= 000020   	$CMIPT  000000RG    003
B.BBFS= 000010   	F.BDB = 000070   	GE.EOF= 177766   	N.UNIT= 000034   	$CRFNM  000014RG    006
B.BFST= 000015   	F.BGBC= 000057   	GE.IND= 000002   	ODLNM   000152R     024	$CRFPT  000000RG    027
B.NXBD= 000012   	F.BKDN= 000026   	GE.IOR= 177777   	ODLPT   000000R     024	$DFLIB  000264RG    031
B.VBN = 000004   	F.BKDS= 000020   	GE.LC = 000010   	R$BLKB= 000150 G 	$DFNB   000000RG    031
CMIPT   000000R     004	F.BKEF= 000050   	GE.MDE= 177774   	R$NAME= 000140 G 	$DSPLB  000330RG    031
CR    = 000015   	F.BKP1= 000051   	GE.OPR= 177776   	R$NMBK= 000146 G 	$ERRCT= ****** GX
CRFPT   000000R     026	F.BKST= 000024   	G.CMLD= 000146   	R$SWBK= 000144 G 	$ININM  000000RG    006
CR$EF = ****** GX	F.BKVB= 000064   	G.DPRM= 000160   	R$SWTH= 000142 G 	$INIPT  000000RG    007
DSLBE   000327R     031	F.CNTG= 000034   	G.ERR = 000140   	R$$11M= 000000   	$INPNM  000010RG    006
DSLIB   000322R     031	F.DFNB= 000046   	G.ISIZ= 000020   	R.FIX = 000001   	$INPPT  000000RG    023
FA.APD= 000100   	F.DSPT= 000044   	G.LPDL= 000100   	R.VAR = 000002   	$INPSW  000352RG    031
FA.CRE= 000010   	F.DVNM= 000134   	G.MODE= 000141   	SE$QA = ****** GX	$LBSVT  000714RG    031
FA.EXT= 000004   	F.EFBK= 000010   	G.PSDS= 000142   	SPA   = 000040   	$LIBNB  000226RG    031
FA.NSP= 000100   	F.EFN = 000050   	HT    = 000011   	SP$OL = ****** GX	$LIBNM  000000RG    030
FA.RD = 000001   	F.EOBB= 000032   	INIPT   000060R     005	STBPT   000000R     017	$LNBUF= ****** GX
FA.SHR= 000040   	F.ERR = 000052   	INPPT   000200R     022	SW$AC = 000004 G 	$MAPNM  000004RG    006
FA.TMP= 000020   	F.FACC= 000043   	LB    = 001004R     031	SW$AL = 000040 G 	$MAPPT  000000RG    015
FA.WRT= 000002   	F.FFBY= 000014   	LBSV    000652R     031	SW$CC = 000100 G 	$MAPSW  000424RG    031
FD.BLK= 000010   	F.FNAM= 000110   	LF    = 000012   	SW$CP = 100000 G 	$MAPTD  000346RG    031
FD.CCL= 000002   	F.FNB = 000102   	LG$SH = ****** GX	SW$DA = 002000 G 	$MAPTM  000170RG    031
FD.CR = 000002   	F.FTYP= 000116   	LMOD  = 000006   	SW$EA = 020000 G 	$ODLNM  000012RG    006
FD.DIR= 000010   	F.FVER= 000120   	MAPDV   000344R     031	SW$FP = 040000 G 	$ODLPT  000000RG    025
FD.FTN= 000001   	F.HIBK= 000004   	MAPE    000346R     031	SW$LB = 020000 G 	$STBNM  000006RG    006
FD.INS= 000010   	F.LUN = 000042   	MAPPT   000000R     014	SW$MP = 010000 G 	$STBPT  000000RG    020
FD.PLC= 000004   	F.MBCT= 000054   	MP$SY = ****** GX	SW$NH = 010000 G 	$STBSW  000456RG    031
FD.RAH= 000001   	F.MBC1= 000055   	NB.DEV= 000200   	SW$PI = 001000 G 	$SWTCH= ****** GX
FD.RAN= 000002   	F.MBFG= 000056   	NB.DIR= 000100   	SW$PM = 000100 G 	$TSKNM  000002RG    006
FD.REC= 000001   	F.NRBD= 000024   	NB.NAM= 000004   	SW$PR = 000400 G 	$TSKPT  000000RG    012
FD.RWM= 000001   	F.NREC= 000030   	NB.SD1= 000400   	SW$RL = 000004 G 	$TSKSW  000500RG    031
FD.SDI= 000020   	F.OVBS= 000030   	NB.SD2= 001000   	SW$SS = 000002 G 	$$    = 000001
FD.SQD= 000040   	F.RACC= 000016   	NB.SNM= 000040   	SW$TR = 000200 G 	$$B   = 000152R     017
FD.TTY= 000004   	F.RATT= 000001   	NB.STP= 000020   	S.BFHD= 000020   	$$E   = 000000R     021
FD.WBH= 000002   	F.RCNM= 000034   	NB.SVR= 000010   	S.FATT= 000016   	$$$   = 000160R     004
FF    = 000014   	F.RCTL= 000017   	NB.TYP= 000002   	S.FDB = 000140   	$$0   = 000000
FO.APD= 000106   	F.RSIZ= 000002   	NB.VER= 000001   	S.FNAM= 000006   	$$1   = 000000R     005
FO.MFY= 000002   	F.RTYP= 000000   	NMOD  = 000010   	S.FNB = 000036   	$$2   = 000006R     005
FO.RD = 000001   	F.STBK= 000036   	N.DID = 000024   	S.FNBW= 000017   	$$3   = 000022R     005
FO.UPD= 000006   	F.UNIT= 000136   	N.DVNM= 000032   	S.FNTY= 000004   	.FSRCB= ****** G
FO.WRT= 000016   	F.URBD= 000020   	N.FID = 000000   	S.FTYP= 000002   	...GBL= 000000
F$DEVL= 000006 G 	F.VBN = 000064   	N.FNAM= 000006   	S.NFEN= 000020   	...PC1= 000000R     026
F$DIRL= 000013 G 	F.VBSZ= 000060   	N.FTYP= 000014   	TSKPT   000000R     011	...PC2= 000300R     031
F$FILL= 000021 G 	GE.BIF= 177775   	N.FVER= 000016   	VT    = 000013   	...PC3= 000000R     026
F.ALOC= 000040   	GE.CLO= 000004   	N.NEXT= 000022   	XTSV    001004R     031	...TPC= 000140

. ABS.	000000	   000
      	000000	   001
$$FSR1	000000	   002
CMIP$D	000002	   003
CMI$D 	000324	   004
INI$D 	001254	   005
FILN$D	000016	   006
INIP$D	000002	   007
INI$E 	000000	   010
TSK$D 	001174	   011
TSKP$D	000002	   012
TSK$E 	000000	   013
IODAT	MACRO M1108  05-DEC-77 22:55  PAGE 3-9
SYMBOL TABLE

MAP$D 	002214	   014
MAPP$D	000002	   015
MAP$E 	000000	   016
STB$D 	001174	   017
STBP$D	000002	   020
STB$E 	000000	   021
INP$D 	000352	   022
INPP$D	000002	   023
ODL$D 	000210	   024
ODLP$D	000002	   025
CRF$D 	000152	   026
CRFP$D	000002	   027
LIBN$D	000002	   030
INID$D	001012	   031
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  4387 WORDS  ( 18 PAGES)
DYNAMIC MEMORY:  5216 WORDS  ( 20 PAGES)
ELAPSED TIME:  00:01:22
[44,10]IODAT,[44,20]IODAT/-SP=[44,30]MACFLM.,FCSPR.,IODAT.017
MACFLM	MACRO M1108  05-DEC-77 22:57  PAGE 2


      1		000000 			M$$SG1=0
MACFLM	MACRO M1108  05-DEC-77 22:57  PAGE 3


						.IF	DF	M$$SG1
      2
      3						.TITLE	LM1
      4
      5						.IFF
      6
      7						.TITLE	LM2
      8
      9						.ENDC
     10
     11						.IDENT	/00/
     12
     13					;
     14					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
     15					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
     16					;
     17					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
     18					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     19					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     20					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     21					;
     22					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     23					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     24					; EQUIPMENT CORPORATION.
     25					;
     26					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     27					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     28					;
     29					; VERSION 00
     30					;
     31					; C. MONIA 20-APR-74
     32					;
     33					; LOAD ERROR MESSAGE TEXT
     34					;
     35					;+
     36					; **-$LM1-DUMMY SUBROUTINE TO LOAD ERROR TEXT SET 1 OVERLAY
     37					; **-$LM2-DUMMY SUBROUTINE TO LOAD ERROR TEXT SET 2 OVERLAY
     38					;
     39					;	THESE SUBROUTINES ARE CALLED TO CAUSE SEGMENTS
     40					; CONTAINING ERROR MEGGAGE TEXT TO BE LOADED VIA THE AUTOLOAD
     41					; FEATURE
     42					;-
     43
     44						.IF	DF	M$$SG1
     45
     46	000000				$LM1::				;
     47
     48						.IFF
     49
     50					$LM2::				;
     51
     52						.ENDC
     53
     54	000000					RETURN			;
     55
     56		000001 				.END
LM1	MACRO M1108  05-DEC-77 22:57  PAGE 3-1
SYMBOL TABLE

CR    = 000015   	HT    = 000011   	M$$SG1= 000000   	SPA   = 000040   	$LM1    000000RG
FF    = 000014   	LF    = 000012   	R$$11M= 000000   	VT    = 000013

. ABS.	000000	   000
      	000002	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  512 WORDS  ( 2 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:05
[44,10]LMS1,[44,20]LMS1/-SP=[44,30]MACFLM.,LM1.,LMSG.000
MACFLM	MACRO M1108  05-DEC-77 22:57  PAGE 2


      1						.IF	DF	M$$SG1
      2
      3						.TITLE	LM1
      4
      5						.IFF
      6
      7						.TITLE	LM2
      8
      9						.ENDC
     10
     11						.IDENT	/00/
     12
     13					;
     14					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
     15					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
     16					;
     17					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
     18					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     19					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     20					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     21					;
     22					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     23					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     24					; EQUIPMENT CORPORATION.
     25					;
     26					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     27					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     28					;
     29					; VERSION 00
     30					;
     31					; C. MONIA 20-APR-74
     32					;
     33					; LOAD ERROR MESSAGE TEXT
     34					;
     35					;+
     36					; **-$LM1-DUMMY SUBROUTINE TO LOAD ERROR TEXT SET 1 OVERLAY
     37					; **-$LM2-DUMMY SUBROUTINE TO LOAD ERROR TEXT SET 2 OVERLAY
     38					;
     39					;	THESE SUBROUTINES ARE CALLED TO CAUSE SEGMENTS
     40					; CONTAINING ERROR MEGGAGE TEXT TO BE LOADED VIA THE AUTOLOAD
     41					; FEATURE
     42					;-
     43
     44						.IF	DF	M$$SG1
     45
     46					$LM1::				;
     47
     48						.IFF
     49
     50	000000				$LM2::				;
     51
     52						.ENDC
     53
     54	000000					RETURN			;
     55
     56		000001 				.END
LM2	MACRO M1108  05-DEC-77 22:57  PAGE 2-1
SYMBOL TABLE

CR    = 000015   	HT    = 000011   	R$$11M= 000000   	VT    = 000013   	$LM2    000000RG
FF    = 000014   	LF    = 000012   	SPA   = 000040

. ABS.	000000	   000
      	000002	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  507 WORDS  ( 2 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:05
[44,10]LMS2,[44,20]LMS2/-SP=[44,30]MACFLM.,LMSG.000
MLSG0	MACRO M1108  05-DEC-77 22:57  PAGE 3


      1						.TITLE	MLSG0
      2						.IDENT	/05/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1975,  DIGITAL  EQUIPMENT CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 05                                                                    ;**NEW**
     20					;                                                                               ;**-1
     21					; D. N. CUTLER/C. MONIA 10-DEC-73
     22					;
     23					;
     24					; MODIFICATIONS:
     25					;
     26					; NO.		DATE		PROGRAMMER
     27					; ---		----		----------
     28					;
     29					; 033		03-JAN-75	C. MONIA
     30					; 037		28-JAN-75	C. MONIA                                        ;**NEW**
     31					;
     32					; READ OVERLAY DESCRIPTION FILE AND VERIFY LINE FORMAT
     33					;
     34					; MACRO LIBRARY CALLS
     35					;
     36
     37						.MCALL	CLOSE$,GET$S,OFNB$R
     38
     39					;
     40					; LOCAL MACROS
     41					;
     42					; GENERATE DIRECTIVE NAME LIST
     43					;
     44					; GDIR	NAME,FLAG
     45					;
     46					; WHERE:
     47					;
     48					;	NAME=1 TO 5 CHARACTER DIRECTIVE NAME AND ADDRESS OF PROCESSING
     49					;		SUBROUTINE
     50					;
     51					;	FLAG=OPERAND FLAG, IF FLAG IS NB, THEN OPERANDS ARE REQUIRED
     52					;
     53
     54						.MACRO	GDIR	NAME,FLAG
     55						.PSECT	DIRL0
     56					$$=.
     57						.WORD	0
MLSG0	MACRO M1108  05-DEC-77 22:57  PAGE 3-1


     58						.WORD	0
     59					.=$$
     60						.RAD50	/.'NAME/
     61					.=$$+4
     62					N=0
     63						.IIF	NB	FLAG, N=1
     64						.WORD	NAME+N
     65					LNG=.-$$
     66						.PSECT
     67						.ENDM
     68
     69					;
     70					; GENERATE CONTROL SECTION ATTRIBUTE LIST
     71					;
     72					; GSAT	SAT,FBIT,DIS
     73					;
     74					; WHERE:
     75					;
     76					;	SAT=1 TO 3 CHARACTER ATTRIBUTE NAME
     77					;	FBIT=FLAG BYTE BIT
     78					;	DIS= FLAG BIT DISPOSITION. IF DIS NB, THEN SET BIT. ELSE
     79					;		CLEAR BIT.
     80					;
     81
     82						.MACRO	GSAT	SAT,FBIT,DIS
     83						.PSECT	SATL0
     84						.RAD50	/SAT/
     85					N=1
     86						.IIF	NB	DIS, N=-1
     87						.BYTE	FBIT,N
     88						.PSECT
     89						.ENDM
     90
     91					;
     92					; LOCAL DATA
     93					;
     94					; DIRECTIVE LIST
     95					;
     96
     97	000000					.PSECT	DIRL0
     98	000000				DBAS:				; REF LABEL
     99	000000					.PSECT	DIRL1
    100	000000				DBASE:				; REF LABEL
    101	000000					.PSECT
    102
    103					;
    104					; SECTION ATTRIBUTE LIST
    105					;
    106
    107	000000					.PSECT	SATL0
    108	000000				SBAS:				; REF LABEL
    109	000000					GSAT	ABS,CS$REL
    110	000000					GSAT	CON,CS$ALO
    111	000000					GSAT	D,CS$TYP,1
    112	000000					GSAT	GBL,CS$GBL,1
    113	000000					GSAT	HGH,CS$MEM,1
    114	000000					GSAT	I,CS$TYP
MLSG0	MACRO M1108  05-DEC-77 22:57  PAGE 3-2


    115	000000					GSAT	LCL,CS$GBL
    116	000000					GSAT	LOW,CS$MEM
    117	000000					GSAT	OVR,CS$ALO,1
    118	000000					GSAT	REL,CS$REL,1
    119	000000					GSAT	RO,CS$ACC,1
    120	000000					GSAT	RW,CS$ACC
    121
    122	000000					.PSECT	SATL1
    123	000000				SBASE:				; REF LABEL
    124	000000					.PSECT
    125
    126					;
    127					; TEMP STORAGE
    128					;
    129
    130	000000				TMP:	.BLKW	5		; TEMP STORAGE
    131
    132					;
    133					;+
    134					; **-$MLSG0-READ ODL AND VERIFY LINE FORMAT
    135					;
    136					; INPUTS:
    137					;
    138					;	ODL FILE
    139					;
    140					; OUTPUTS:
    141					;
    142					;	EACH LINE IN THE OVERLAY DESCRIPTION IS READ, IDENTIFIED BY
    143					; DIRECTIVE TYPE AND RETAINED IN DYNAMIC STORAGE FOR LATER PROCESSING.
    144					;
    145					;	THIS ROUTINE IS CALLED BY $MULSG TO PERFORM THE ABOVE
    146					; PROCESSING AND VERIFY CORRECT LINE SYNTAX. NOTE THAT ALL I/O
    147					; SPECIFIC TO ODL PROCESSING IS DONE HERE.
    148					;
    149					;-
    150
    151	000012				$MLSG0::			;
    152	000012	005067 	000000G			CLR	$DIRHD		; CLEAR DIRECTIVE LISTHEAD
    153	000016	012767 	000000G	000002G		MOV	#$DIRHD,$DIRHD+2 ; LAST POINTS TO FIRST INITIALLY
    154	000024	005067 	000000G			CLR	$RTDIR		; CLEAR ROOT DIRECTIVE POINTER
    155	000030	016700 	000000G			MOV	$ODLPT,R0	;GET OVERLAY DESCRIPTION RECORD BLOCK
    156	000034	010004 				MOV	R0,R4		; SAVE POINTER
    157	000036					CALL	$STRCB		; SETUP ODL RECORD BLOCK
    158	000042	010400 				MOV	R4,R0		; RETRIEVE RECORD BLOCK POINTER
    159	000044	016701 	000000G			MOV	$INIPT,R1	; GET RECORD BLOCK POINTER
    160	000050	012761 	000000G	000000G		MOV	#SW$CC,R$SWTH(R1) ; ASSUME CONCATENATED OBJECT FILE
    161	000056	016160 	000044 	000044 		MOV	F.DSPT(R1),F.DSPT(R0);SET ADDRESS OF DATA SET DESCRIPTOR
    162	000064					CALL	$PRFND		; PARSE/FIND ODL FILE
    163	000070	103407 				BCS	5$		; IF C/S PARSE-FIND FAILED
    164	000072	016700 	000000G			MOV	$ODLPT,R0	; GET ODL RECORD BLOCK POINTER
    165	000076					OFNB$R	R0		; OPEN ODL FILE
    166	000110				5$:				;
    167	000110	012701 				MOV	(PC)+,R1	;ASSUME OPEN FAILURE
    168	000112	   000G	   000G			.BYTE	E$R11,S$V2	;FATAL-NO RETURN
    169	000114	103525 				BCS	50$		;IF CS OPEN FAILURE
    170	000116	012760 	000120 	000020 		MOV	#80.,F.URBD(R0)	;SET LENGTH OF USER BUFFER
    171	000124	012760 	000000G	000022 		MOV	#$LNBUF,F.URBD+2(R0);SET ADDRESS OF USER BUFFER
MLSG0	MACRO M1108  05-DEC-77 22:57  PAGE 3-3


    172	000132	016700 	000000G		10$:	MOV	$ODLPT,R0	;GET OVERLAY DESCRIPTION RECORD BLOCK
    173	000136					GET$S	R0		; GET NEXT RECORD
    174	000142	012701 				MOV	(PC)+,R1	;ASSUME I/O ERROR
    175	000144	   000G	   000G			.BYTE	E$R10,S$V2	;FATAL-NO RETURN
    176	000146	103510 				BCS	50$		;IF CS I/O ERROR
    177	000150	016002 	000024 			MOV	F.NRBD(R0),R2	;++037 GET LENGTH OF RECORD                     ;**NEW**
    178	000154	001766 				BEQ	10$		;IF EQ NULL LINE                                ;**-1
    179	000156	010267 	000000G			MOV	R2,$LNDES	;++037 SET LENGTH IN LINE DESCRIPTOR            ;**NEW**
    180	000162	016000 	000026 			MOV	F.NRBD+2(R0),R0	;++037 GET ADDRESS OF RECORD                    ;**NEW**
    181	000166	012701 	000000G			MOV	#$LNBUF,R1	;++037 GET ADDRESS OF LINE BUFFER               ;**NEW**
    182	000172	010167 	000002G			MOV	R1,$LNDES+2	;++037 SET ADDRESS IN LINE DESCRIPTOR           ;**NEW**
    183	000176					CALL	$CVTUC		;++037 MOVE LINE TO LINE BUFFER, CONVERT TO UC  ;**NEW**
    184	000202	105010 				CLRB	(R0)		;++037 ZERO SENTINEL BYTE                       ;**NEW**
    185	000204	016700 	000002G			MOV	$LNDES+2,R0	;++037 GET ADDRESS OF LINE BUFFER               ;**NEW**
    186	000210					CALL	$SETNB		;BYPASS LEADING BLANKS AND HT'S                 ;**-4
    187	000214	122710 	000073 			CMPB	#';,(R0)	;COMMENT LINE?
    188	000220	001744 				BEQ	10$		;IF EQ YES
    189	000222	105710 				TSTB	(R0)		;BLANK LINE?
    190	000224	001742 				BEQ	10$		;IF EQ YES
    191	000226	012705 	000010'			MOV	#TMP+8.,R5	;GET ADDRESS OF TEMP AREA
    192		000004 				.REPT	4
    193						CLR	-(R5)		;CLEAR TEMP STORAGE
    194						.ENDR
    195	000242					CALL	$RR		;CONVERT LABEL OR DIRECTIVE NAME
    196	000246	122702 	000072 			CMPB	#':,R2		;LABEL SPECIFIED?
    197	000252	001010 				BNE	20$		;IF NE NO
    198	000254	014565 	000004 			MOV	-(R5),4(R5)	;MOVE LABEL
    199	000260	014565 	000004 			MOV	-(R5),4(R5)	;
    200	000264					CALL	$SETNB		;BYPASS LEADING BLANKS AND HT'S
    201	000270					CALL	$RR		;CONVERT DIRECTIVE NAME
    202	000274	005300 			20$:	DEC	R0		;BACK UP TO TERMINAL BYTE
    203	000276	010046 				MOV	R0,-(SP)	;++033 SAVE ADDRESS OF TERMINAL BYTE
    204	000300	010001 				MOV	R0,R1		;++033 COPY ADDRESS OF BYTE
    205	000302				22$:				;++033
    206	000302	112011 				MOVB	(R0)+,(R1)	;++033 COPY BYTE
    207	000304	001407 				BEQ	25$		;++033 IF EQ FINISHED WITH LINE
    208	000306	122127 	000040 			CMPB	(R1)+,#SPA	;++033 PRINTING CHARACTER?
    209	000312	101373 				BHI	22$		;++033 IF HI YES
    210	000314	005367 	000000G			DEC	$LNDES		;++033 DECREMENT BYTE COUNT
    211	000320	005301 				DEC	R1		;++033 BACKUP BYTE POINTER
    212	000322	000767 				BR	22$		;++033 GO AGAIN
    213	000324				25$:				;++033
    214	000324	012600 				MOV	(SP)+,R0	;++033 RETRIEVE TERMINAL BYTE ADDRESS
    215	000326	024545 				CMP	-(R5),-(R5)	;POINT TO DIRECTIVE NAME
    216	000330	012701 	000000'			MOV	#DBAS,R1	;GET ADDRESS OF DIRECTIVE LIST
    217	000334	021511 			30$:	CMP	(R5),(R1)	;FIRST HALF MATCH?
    218	000336	001004 				BNE	40$		;IF NE NO
    219	000340	026561 	000002 	000002 		CMP	2(R5),2(R1)	;SECOND HALF MATCH?
    220	000346	001414 				BEQ	60$		;IF EQ YES
    221	000350	062701 	000006 		40$:	ADD	#LNG,R1		;ADVANCE TO NEXT NAME
    222	000354	020127 	000000'			CMP	R1,#DBASE	; END OF LIST?
    223	000360	103765 				BLO	30$		;IF LO NO
    224	000362	012701 				MOV	(PC)+,R1	;ILLEGAL DIRECTIVE
    225	000364	   000G	   000G			.BYTE	E$R36,S$V2	;FATAL-NO RETURN
    226	000366	000425 				BR	90$		;
    227	000370	016002 	000000G		50$:	MOV	R$NAME(R0),R2	;GET ADDRESS OF NAME STRING
    228	000374					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
MLSG0	MACRO M1108  05-DEC-77 22:57  PAGE 3-4


    229
    230					;
    231					; DIRECTIVE FOUND-DISPATCH TO DIRECTIVE PROCESSING ROUTINE
    232					;
    233
    234	000400	016101 	000004 		60$:	MOV	LNG-2(R1),R1	;GET ADDRESS OF ROUTINE AND OPERAND FLG
    235	000404	032701 	000001 			BIT	#1,R1		;OPERANDS REQUIRED?
    236	000410	001405 				BEQ	70$		;IF EQ NO
    237	000412	005702 				TST	R2		;TERMINAL ZERO?
    238	000414	001410 				BEQ	80$		;IF EQ YES-ERROR
    239	000416	122702 	000073 			CMPB	#';,R2		;COMMENT TERMINATOR?
    240	000422	001405 				BEQ	80$		;IF EQ YES-ERROR
    241	000424	022525 			70$:	CMP	(R5)+,(R5)+	;POINT TO LABEL
    242	000426	042701 	000001 			BIC	#1,R1		;CLEAR OPERAND FLAG
    243	000432					CALL	(R1)		;CALL DIRECTIVE PROCESSING ROUTINE
    244	000434	000636 				BR	10$		;GO AGAIN
    245	000436	012701 			80$:	MOV	(PC)+,R1	;DIRECTIVE HAS NO OPERANDS
    246	000440	   000G	   000G			.BYTE	E$R35,S$V2	;FATAL-NO RETURN
    247	000442	000167 	000444 		90$:	JMP	SDIRL1		;
    248
    249					;
    250					; END DIRECTIVE
    251					;
    252
    253	000446					GDIR	END
    254
    255	000446	005726 			END:	TST	(SP)+		;REMOVE RETURN FROM STACK
    256	000450	005767 	000000G			TST	$RTDIR		; ROOT SEGMENT SPECIFIED?
    257	000454	001004 				BNE	20$		; IF NE YES
    258	000456	012701 			10$:	MOV	(PC)+,R1	;ROOT SEG NOT DEFFINED
    259	000460	   000G	   000G			.BYTE	E$R40,S$V2	;FATAL-NO RETURN
    260	000462	000167 	000424 			JMP	SDIRL1		;
    261	000466				20$:				;
    262	000466					CLOSE$	$ODLPT		; CLOSE OVERLAY DESCRIPTION FILE
    263	000476					RETURN			; EXIT
    264
    265					;
    266					; NAME DIRECTIVE
    267					;
    268
    269	000500					GDIR	NAME,1
    270
    271	000500				NAME:	CALL	$RR		;GET SEGMENT NAME
    272	000504	024545 				CMP	-(R5),-(R5)	;POINT TO SEGMENT NAME
    273	000506	005715 				TST	(R5)		;ANY NAME SPECIFIED?
    274	000510	001567 				BEQ	SEG3		;IF EQ NO-SYNTAX ERROR
    275	000512	122702 	000073 			CMPB	#';,R2		;COMMENT TERMINATOR?
    276	000516	001402 				BEQ	10$		;IF EQ YES
    277	000520	005702 				TST	R2		;TERMINAL ZERO?
    278	000522	001162 				BNE	SEG3		;IF NE NO-SYNTAX ERROR
    279	000524				10$:	CALL	SDIRL		;SCAN DIRECTIVE LIST FOR DUP NAME
    280	000530	012701 	000010 			MOV	#8.,R1		;GET SIZE OF BLOCK NEEDED
    281	000534					CALL	$ALBLK		;ALLOCATE STORAGE
    282	000540	010001 				MOV	R0,R1		;COPY BLOCK ADDRESS
    283	000542	005721 				TST	(R1)+		;POINT TO SECOND WORD
    284	000544	012721 				MOV	(PC)+,(R1)+	;SET TYPE/SIZE
    285	000546	   000G	   010 			.BYTE	S$EGN,8.	;
MLSG0	MACRO M1108  05-DEC-77 22:57  PAGE 3-5


    286	000550	012521 				MOV	(R5)+,(R1)+	;INSERT SEGMENT NAME
    287	000552	011511 				MOV	(R5),(R1)	;
    288	000554	000540 				BR	SEG2		;
    289
    290					;
    291					; PROGRAM SECTION DIRECTIVE
    292					;
    293
    294	000556					GDIR	PSECT,1
    295
    296	000556	024545 			PSECT:	CMP	-(R5),-(R5)	;POINT TO BEGINNING OF TEMP STORAGE
    297	000560					CALL	$RP		;GET CONTROL SECTION NAME
    298	000564	024545 				CMP	-(R5),-(R5)	;POINT TO CONTROL SECTION NAME
    299	000566	012701 				MOV	(PC)+,R1	;ASSUME BLANK NAME
    300	000570	   000G	   000G			.BYTE	E$R41,S$V2	;FATAL-NO RETURN
    301	000572	005715 				TST	(R5)		;ANY NAME SPECIFIED?
    302	000574	001546 				BEQ	SDIRL1		;IF EQ NO
    303	000576					CALL	SDIRL		;SCAN DIRECTIVE LIST FOR DUP NAME
    304	000602	022525 				CMP	(R5)+,(R5)+	;ADJUST R5
    305	000604	012704 	000000G			MOV	#CS$REL,R4	;GET DEFAULT FLAG BYTE
    306	000610	005702 			10$:	TST	R2		;TERMINAL ZERO?
    307	000612	001433 				BEQ	40$		;IF EQ YES-DONE
    308	000614	122702 	000073 			CMPB	#';,R2		;COMMENT TERMINATOR?
    309	000620	001430 				BEQ	40$		;IF EQ YES-DONE
    310	000622	122702 	000054 			CMPB	#',,R2		;COMMA TERMINATOR?
    311	000626	001120 				BNE	SEG3		;IF NE NO-SYNTAX ERROR
    312	000630					CALL	$SETNB		;BYPASS LEADING BLANKS AND HT'S
    313	000634					CALL	$RP		;GET SECTION ATTRIBUTE NAME
    314	000640	024545 				CMP	-(R5),-(R5)	;BACK UP TO NAME
    315	000642	012703 	000000'			MOV	#SBAS,R3	;GET ADDRESS OF SECTION ATTRIBUTE LIST
    316	000646	021523 			20$:	CMP	(R5),(R3)+	;MATCH?
    317	000650	001407 				BEQ	30$		;IF EQ YES
    318	000652	005723 				TST	(R3)+		;STEP OVER DATA WORD
    319	000654	020327 	000000'			CMP	R3,#SBASE	;END OF LIST?
    320	000660	103772 				BLO	20$		;IF LO NO
    321	000662	012701 				MOV	(PC)+,R1	;ILLEGAL SECTION ATTRIBUTE NAME
    322	000664	   000G	   000G			.BYTE	E$R42,S$V2	;FATAL-NO RETURN
    323	000666	000511 				BR	SDIRL1		;
    324	000670	141304 			30$:	BICB	(R3),R4		;ASSUME BIT IS TO BE CLEARED
    325	000672	005713 				TST	(R3)		;CLEAR BIT?
    326	000674	100345 				BPL	10$		;IF PL YES
    327	000676	151304 				BISB	(R3),R4		;SET BIT
    328	000700	000743 				BR	10$		;GO AGAIN
    329	000702	012701 	000002G		40$:	MOV	#F$LG+2,R1	; GET SIZE OF BLOCK NEEDED
    330	000706					CALL	$ALBLK		;ALLOCATE STORAGE
    331	000712	010001 				MOV	R0,R1		;COPY ADDRESS OF BLOCK
    332	000714	005721 				TST	(R1)+		;POINT TO SECOND WORD
    333	000716	012721 				MOV	(PC)+,(R1)+	;SET TYPE/SIZE
    334	000720	   000G	   002G			.BYTE	S$CTN,F$LG+2	;
    335	000722	016521 	177774 			MOV	-4(R5),(R1)+	;INSERT CONTROL SECTION NAME
    336	000726	016521 	177776 			MOV	-2(R5),(R1)+	;
    337	000732	010411 				MOV	R4,(R1)		;SET FLAG BYTE
    338	000734	000450 				BR	SEG2		;
    339
    340					;
    341					; ROOT DIRECTIVE
    342					;
MLSG0	MACRO M1108  05-DEC-77 22:57  PAGE 3-6


    343
    344	000736					GDIR	ROOT,1
    345
    346	000736	005046 			ROOT:	CLR	-(SP)		;SET ROOT SEGMENT FLAG
    347	000740	005767 	000000G			TST	$RTDIR		; MULTIPLE ROOT DIRECTIVES
    348	000744	001406 				BEQ	SEG1		;IF EQ NO
    349	000746	012701 				MOV	(PC)+,R1	;MULTIPLY DEFINED ROOT SEGMENT
    350	000750	   000G	   000G			.BYTE	E$R38,S$V2	;FATAL-NO RETURN
    351	000752	000457 				BR	SDIRL1		;
    352					;
    353					; FACTOR DIRECTIVE
    354					;
    355
    356	000754					GDIR	FCTR,1
    357
    358	000754	005715 			FCTR:	TST	(R5)		;ANY LABEL SPECIFIED?
    359	000756	001444 				BEQ	SEG3		;IF EQ NO-SYNTAX ERROR
    360	000760	010546 				MOV	R5,-(SP)	;SET SEG SEGMENT FLAG
    361	000762	010003 			SEG1:	MOV	R0,R3		;SAVE ADDRESS OF NEXT BYTE
    362	000764					CALL	SDIRL		;SCAN DIRECTIVE LIST FOR DUP NAME
    363	000770	016701 	000000G			MOV	$LNDES,R1	;GET LENGTH OF LINE
    364	000774	062701 	000013 			ADD	#11.,R1		;ALLOW FOR TERMINAL BYTE AND ENTRY
    365	001000	010146 				MOV	R1,-(SP)	;SAVE LENGTH FOR LATER
    366	001002					CALL	$ALBLK		;ALLOCATE STORAGE
    367	001006	012601 				MOV	(SP)+,R1	;RETRIEVE SIZE OF BLOCK
    368	001010	005726 				TST	(SP)+		;ROOT SEG?
    369	001012	001002 				BNE	10$		;IF NE NO
    370	001014	010067 	000000G			MOV	R0,$RTDIR	; SET POINT TO ROOT SEGMENT
    371	001020	010002 			10$:	MOV	R0,R2		;COPY ADDRESS OF BLOCK
    372	001022	005722 				TST	(R2)+		;POINT TO SECOND WORD
    373	001024	000301 				SWAB	R1		;SIZE TO LEFT BYTE
    374	001026	010122 				MOV	R1,(R2)+	;SET TYPE/SIZE
    375	001030	012522 				MOV	(R5)+,(R2)+	;INSERT SEGMENT NAME
    376	001032	012522 				MOV	(R5)+,(R2)+	;
    377	001034	012701 	000000G			MOV	#$LNBUF,R1	;GET ADDRESS OF INPUT BUFFER
    378	001040	160103 				SUB	R1,R3		;CALCULATE RELATIVE ADDR OF NEXT BYTE
    379	001042	060003 				ADD	R0,R3		;ADD BASE ADDRESS OF BLOCK
    380	001044	062703 	000012 			ADD	#10.,R3		;DISPLACE BY ENTRY SIZE
    381	001050	010322 				MOV	R3,(R2)+	;SET ADDRESS OF NEXT BYTE
    382	001052	112122 			20$:	MOVB	(R1)+,(R2)+	;MOVE LINE
    383	001054	001376 				BNE	20$		;IF NE GO AGAIN
    384	001056	010077 	000002G		SEG2:	MOV	R0,@$DIRHD+2	; LINK NEW LAST TO OLD LAST
    385	001062	010067 	000002G			MOV	R0,$DIRHD+2	; SET NEW LAST
    386	001066					RETURN			;
    387	001070	012701 			SEG3:	MOV	(PC)+,R1	;SYNTAX ERROR
    388	001072	   000G	   000G			.BYTE	E$R37,S$V2	;FATAL-NO RETURN
    389	001074	000406 				BR	SDIRL1		;
    390
    391					;
    392					; SCAN PARSED DIRECTIVE LIST FOR DUPLICATE NAME
    393					;
    394
    395	001076				SDIRL:	CALL	$SCNL		; SCAN DIRECTIVE LIST FOR A MATCH
    396	001102	103001 				BCC	10$		;IF CC FOUND ONE-ERROR
    397	001104					RETURN			;
    398	001106	012701 			10$:	MOV	(PC)+,R1	;DUPLICATE NAME DEFINITION
    399	001110	   000G	   000G			.BYTE	E$R39,S$V2	;FATAL-NO RETURN
MLSG0	MACRO M1108  05-DEC-77 22:57  PAGE 3-7


    400	001112	012702 	000000G		SDIRL1:	MOV	#$LNDES,R2	;GET ADDRESS OF LINE DESCRIPTOR
    401	001116				SDIRL2:	CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    402
    403		000001 				.END
MLSG0	MACRO M1108  05-DEC-77 22:57  PAGE 3-8
SYMBOL TABLE

B.BBFS= 000010   	FD.DIR= 000010   	F.EOBB= 000032   	NB.SD1= 000400   	S$EGN = ****** GX
B.BFST= 000015   	FD.FTN= 000001   	F.ERR = 000052   	NB.SD2= 001000   	S$V2  = ****** GX
B.NXBD= 000012   	FD.INS= 000010   	F.FACC= 000043   	NB.SNM= 000040   	S.BFHD= 000020
B.VBN = 000004   	FD.PLC= 000004   	F.FFBY= 000014   	NB.STP= 000020   	S.FATT= 000016
CR    = 000015   	FD.RAH= 000001   	F.FNAM= 000110   	NB.SVR= 000010   	S.FDB = 000140
CS$ACC= ****** GX	FD.RAN= 000002   	F.FNB = 000102   	NB.TYP= 000002   	S.FNAM= 000006
CS$ALO= ****** GX	FD.REC= 000001   	F.FTYP= 000116   	NB.VER= 000001   	S.FNB = 000036
CS$GBL= ****** GX	FD.RWM= 000001   	F.FVER= 000120   	N.DID = 000024   	S.FNBW= 000017
CS$MEM= ****** GX	FD.SDI= 000020   	F.HIBK= 000004   	N.DVNM= 000032   	S.FNTY= 000004
CS$REL= ****** GX	FD.SQD= 000040   	F.LUN = 000042   	N.FID = 000000   	S.FTYP= 000002
CS$TYP= ****** GX	FD.TTY= 000004   	F.MBCT= 000054   	N.FNAM= 000006   	S.NFEN= 000020
DBAS    000000R     002	FD.WBH= 000002   	F.MBC1= 000055   	N.FTYP= 000014   	TMP     000000R
DBASE   000000R     003	FF    = 000014   	F.MBFG= 000056   	N.FVER= 000016   	VT    = 000013
END     000446R  	FO.APD= 000106   	F.NRBD= 000024   	N.NEXT= 000022   	$ALBLK= ****** GX
E$R10 = ****** GX	FO.MFY= 000002   	F.NREC= 000030   	N.STAT= 000020   	$CVTUC= ****** GX
E$R11 = ****** GX	FO.RD = 000001   	F.OVBS= 000030   	N.UNIT= 000034   	$DIRHD= ****** GX
E$R35 = ****** GX	FO.UPD= 000006   	F.RACC= 000016   	PAR$$$= 000067   	$ERMSG= ****** GX
E$R36 = ****** GX	FO.WRT= 000016   	F.RATT= 000001   	PSECT   000556R  	$INIPT= ****** GX
E$R37 = ****** GX	F$LG  = ****** GX	F.RCNM= 000034   	ROOT    000736R  	$LNBUF= ****** GX
E$R38 = ****** GX	F.ALOC= 000040   	F.RCTL= 000017   	R$NAME= ****** GX	$LNDES= ****** GX
E$R39 = ****** GX	F.BBFS= 000062   	F.RSIZ= 000002   	R$SWTH= ****** GX	$MLSG0  000012RG
E$R40 = ****** GX	F.BDB = 000070   	F.RTYP= 000000   	R$$11M= 000000   	$ODLPT= ****** GX
E$R41 = ****** GX	F.BGBC= 000057   	F.STBK= 000036   	R.FIX = 000001   	$PRFND= ****** GX
E$R42 = ****** GX	F.BKDN= 000026   	F.UNIT= 000136   	R.VAR = 000002   	$RP   = ****** GX
FA.APD= 000100   	F.BKDS= 000020   	F.URBD= 000020   	SBAS    000000R     004	$RR   = ****** GX
FA.CRE= 000010   	F.BKEF= 000050   	F.VBN = 000064   	SBASE   000000R     005	$RTDIR= ****** GX
FA.EXT= 000004   	F.BKP1= 000051   	F.VBSZ= 000060   	SDIRL   001076R  	$SCNL = ****** GX
FA.NSP= 000100   	F.BKST= 000024   	HT    = 000011   	SDIRL1  001112R  	$SETNB= ****** GX
FA.RD = 000001   	F.BKVB= 000064   	LF    = 000012   	SDIRL2  001116R  	$STRCB= ****** GX
FA.SHR= 000040   	F.CNTG= 000034   	LNG   = 000006   	SEG1    000762R  	$$    = 000001
FA.TMP= 000020   	F.DFNB= 000046   	N     = 000001   	SEG2    001056R  	.CLOSE= ****** G
FA.WRT= 000002   	F.DSPT= 000044   	NAME    000500R  	SEG3    001070R  	.GETSQ= ****** G
FCTR    000754R  	F.DVNM= 000134   	NB.DEV= 000200   	SPA   = 000040   	.OPFNB= ****** G
FD.BLK= 000010   	F.EFBK= 000010   	NB.DIR= 000100   	SW$CC = ****** GX	...GBL= 000000
FD.CCL= 000002   	F.EFN = 000050   	NB.NAM= 000004   	S$CTN = ****** GX	...TPC= 000140
FD.CR = 000002

. ABS.	000000	   000
      	001122	   001
DIRL0 	000036	   002
DIRL1 	000000	   003
SATL0 	000060	   004
SATL1 	000000	   005
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2650 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:36
[44,10]MLSG0,[44,20]MLSG0/-SP=[44,30]MACFLM.,FCSPR.,MLSG0.005
MLSG1	MACRO M1108  05-DEC-77 22:58  PAGE 3


      1						.TITLE	MLSG1
      2						.IDENT	/07/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1975,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.               ;**NEW**
      6					;                                                                               ;**-1
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 06
     20					;
     21					; D. N. CUTLER/C. MONIA 10-DEC-73
     22					;
     23					; MODIFICATIONS:                                                                ;**NEW**
     24					;                                                                               ;**NEW**
     25					; NO.		DATE		PROGRAMMER                                      ;**NEW**
     26					; ---		----		----------                                      ;**NEW**
     27					;                                                                               ;**NEW**
     28					; 033		07-JAN-75	C. MONIA                                        ;**NEW**
     29					; 039		22-MAR-75	C. MONIA
     30					;                                                                               ;**NEW**
     31					; PARSE THE OVERLAY DESCRIPTION
     32					;                                                                               ;**NEW**
     33					; MACRO LIBRARY CALLS
     34					;
     35
     36						.MCALL	CSI$1
     37
     38
     39					;
     40					; LOCAL MACROS
     41					;
     42					;                                                                               ;**-1
     43					; GENERATE OPERATOR TABLES
     44					;
     45					; GOPR OPR,VAL
     46					;
     47					; WHERE:
     48					;
     49					;	OPR=OPERATOR CHARACTER.
     50					;	VAL=OPERATOR VALUE.
     51					;
     52
     53						.MACRO	GOPR OPR,VAL
     54						.PSECT	OPRL
     55						.ASCII	/OPR/
     56						.PSECT	OVAL
     57						.BYTE	VAL
MLSG1	MACRO M1108  05-DEC-77 22:58  PAGE 3-1


     58						.PSECT
     59						.ENDM
     60
     61					;
     62					; LOCAL DATA
     63					;
     64					;
     65					; AUTOLOAD ENTRY POINT NAME
     66					;
     67
     68	000000	124375 	077530 		AUTO:	.RAD50	/$AUTO/		;
     69
     70
     71					;
     72					; CONTROL BYTE STRING
     73					;
     74
     75	000004	   133 	   074 	   044 	CNTRL:	.ASCII	/[<$09AZ /	;
	000007	   060 	   071 	   101
	000012	   132 	   040
     76
     77
     78					;
     79					; LAST ITEM TYPE
     80					;
     81
     82	000014				LITEM:	.BLKW	1		;
     83
     84					;
     85					;
     86					; OPERATOR TABLES
     87					;
     88	000000					.PSECT	OPRL
     89	000000				OBAS:				; REF LABEL
     90	000000					.PSECT	OVAL
     91	000000				OPRV:				; REF LABEL
     92	000000					GOPR	^/(/,L$PAR
     93	000016					GOPR	^/)/,R$PAR
     94	000016					GOPR	^/,/,C$OMA
     95	000016					GOPR	^/-/,D$ASH
     96	000016					GOPR	^/*/,S$TAR
     97
     98	000005					.PSECT	OPRL
     99	000005				OBASE:				; REF LABEL
    100	000016					.PSECT
    101
    102					;
    103					; TEMPORARY STORAGE
    104					;
    105
    106	000016				TMP:	.BLKW	5		;
    107
    108
    109					;
    110					;+
    111					; **-$MLSG1-PARSE THE SEGMENT DESCRIPTION
    112					;
MLSG1	MACRO M1108  05-DEC-77 22:58  PAGE 3-2


    113					; INPUTS:
    114					;
    115					;	OVERLAY DESCRIPTION READ BY $MLSG0
    116					;
    117					; OUTPUTS:
    118					;
    119					;	LINKED LIST OF ODL ITEM TYPES
    120					;
    121					;	THIS ROUTINE IS CALLED BY $MULSG TO PARSE THE
    122					; ODL. THE INPUT, TAKEN FROM DYNAMIC STORAGE, CONSISTS OF
    123					; EACH LINE IN THE DESCRIPTION WITH AN APPROPRIATE CODE
    124					; IDENTIFYING THE ASSOCIATED ODL DIRECTIVE. THE PARSING PHASE
    125					; RESULTS IN A LINKED LIST OF ITEMS LATER USED (BY $MULSG2)
    126					; TO GENERATE THE SEGMENT DESCRIPTORS.
    127					;
    128					;-
    129					;
    130
    131	000030				$MLSG1::			;
    132	000030	005067 	000000G			CLR	$ALVL		; CLEAR AUTOLOAD LEVEL COUNT
    133	000034	005067 	000000G			CLR	$AFLG		; CLEAR AUTOLOAD REQUIRED FLAG
    134	000040	012767 	000000G	177746 		MOV	#S$OS,LITEM	; SET LAST ITEM TO SOS
    135	000046	012700 	000000G			MOV	#$DSTK,R0	; GET ADDRESS OF DESCRIPTION STACK
    136	000052	010001 			10$:	MOV	R0,R1		;COPY HEADER ADDRESS
    137	000054	005020 				CLR	(R0)+		;CLEAR LINK TO FIRST
    138	000056	010120 				MOV	R1,(R0)+	;LAST POINTS TO FIRST INITIALLY
    139	000060	020027 	000000C			CMP	R0,#$DSTK+<N$PLVL*4> ; END OF LIST?
    140	000064	103772 				BLO	10$		;IF LO NO
    141	000066	012703 	000002G			MOV	#$DSTK+2,R3	; SET INITIAL DESCRIPTION STACK POINTER
    142	000072	012700 	000000G			MOV	#$SOSOP,R0	; GET ADDRESS OF SOS ENTRY
    143	000076	005010 				CLR	(R0)		;CLEAR LINK TO NEXT
    144	000100	010033 				MOV	R0,@(R3)+	;LINK NEW LAST TO OLD LAST
    145	000102	010043 				MOV	R0,-(R3)	;SET NEW LAST
    146	000104	012704 	000000G			MOV	#$TSTK,R4	; GET ADDRESS OF TEXT STACK
    147	000110	016700 	000000G			MOV	$RTDIR,R0	; GET POINTER TO ROOT SEGMENT DIRECTIVE
    148	000114	010044 				MOV	R0,-(R4)	;SET ADDRESS OF ROOT DIRECTIVE ENTRY
    149	000116	016044 	000000G			MOV	N$XT(R0),-(R4)	; SET ADDRESS OF ROOT DIRECTIVE ENTRY
    150	000122				ITMBEG:	CALL	ITEM		;GET NEXT ITEM
    151	000126	012705 	000014'			MOV	#LITEM,R5	;GET ADDRESS OF LAST ITEM
    152	000132	111502 				MOVB	(R5),R2		;GET LAST ITEM TYPE
    153	000134	006202 				ASR	R2		;CONVERT TO SHIFT COUNT
    154	000136	012701 	000001 			MOV	#1,R1		;SET INITIAL MASK WORD
    155
    156
    157						.IF	NDF	V1145
    158
    159	000142	005302 			10$:	DEC	R2		;DECREMENT SHIFT COUNT
    160	000144	002402 				BLT	20$		;IF LT DONE
    161	000146	006301 				ASL	R1		;SHIFT MASK
    162	000150	000774 				BR	10$		;
    163	000152				20$:				;REF LABEL
    164
    165						.ENDC
    166
    167
    168						.IF	DF	V1145
    169
MLSG1	MACRO M1108  05-DEC-77 22:58  PAGE 3-3


    170						ASH	R2,R1		;SHIFT MASK
    171
    172						.ENDC
    173
    174
    175	000152	116002 	000000G			MOVB	T$YP(R0),R2	; GET CURRENT ITEM TYPE
    176	000156	030162 	000000G			BIT	R1,$CBAS(R2)	; LEGAL CONSTRUCTION?
    177	000162	001446 				BEQ	ITMCM1		;IF EQ NO
    178	000164	000172 	000166'			JMP	@40$-2(R2)	;DISPATCH ON CURRENT ITEM
    179
    180					;
    181					; CURRENT ITEM DISPATCH VECTOR
    182					;
    183
    184	000170	000344'			40$:	.WORD	ITMEOS		;EOS
    185	000172	000212'				.WORD	ITMLPR		;LPAR
    186	000174	000250'				.WORD	ITMRPR		;RPAR
    187	000176	000314'				.WORD	ITMOP1		; COMA
    188	000200	000314'				.WORD	ITMOP1		;DASH
    189	000202	000336'				.WORD	ITMOP2		;STAR
    190	000204	000306'				.WORD	ITMOPA		;SCTN
    191	000206	000306'				.WORD	ITMOPA		;SEGN
    192	000210	000306'				.WORD	ITMOPA		;FILE
    193
    194					;
    195					; LPAR-LEFT PARENTHESIS
    196					;
    197
    198	000212	005767 	000000G		ITMLPR:	TST	$ALVL		; AUTOLOAD ENTRY NONZERO
    199	000216	001003 				BNE	10$		;IF NE YES
    200	000220	122715 	000000G			CMPB	#S$TAR,(R5)	; LAST ITEM STAR?
    201	000224	001002 				BNE	20$		;IF NE NO
    202	000226	005267 	000000G		10$:	INC	$ALVL		; INCEMENT AUTOLOAD LEVEL
    203	000232	022323 			20$:	CMP	(R3)+,(R3)+	;ADVANCE STACK LEVEL
    204	000234	020327 	000000C			CMP	R3,#$DSTK+<N$PLVL*4> ; STACK OVERFLOW?
    205	000240	103425 				BLO	ITMOP1		;IF LO NO
    206	000242	012701 				MOV	(PC)+,R1	;TOO MANY PARENTHESIS LEVELS
    207	000244	   000G	   000G			.BYTE	E$R45,S$V2	;FATAL-NO RETURN
    208	000246	000445 				BR	ITMES2		;
    209
    210					;
    211					; RPAR-RIGHT PARENTHESIS
    212					;
    213
    214	000250	010033 			ITMRPR:	MOV	R0,@(R3)+	;LINK ITEM TO CURRENT LIST
    215	000252	010043 				MOV	R0,-(R3)	;
    216	000254	005767 	000000G			TST	$ALVL		; AUTOLOAD LEVEL NON-ZERO?
    217	000260	001402 				BEQ	10$		;IF EQ NO
    218	000262	005367 	000000G			DEC	$ALVL		; DECREMENT AUTOLOAD LEVEL
    219	000266	024343 			10$:	CMP	-(R3),-(R3)	;REDUCE STACK LEVEL
    220	000270	020327 	000002G			CMP	R3,#$DSTK+2	; LEVEL OK?
    221	000274	103020 				BHIS	ITMOP2		;IF HIS YES
    222	000276	000427 				BR	ITMES1		;
    223
    224					;
    225					; SYNTAX ERROR EXIT
    226					;
MLSG1	MACRO M1108  05-DEC-77 22:58  PAGE 3-4


    227
    228	000300	012701 			ITMCM1:	MOV	(PC)+,R1	;SYNTAX ERROR
    229	000302	   000G	   000G			.BYTE	E$R37,S$V2	;FATAL-NO RETURN
    230	000304	000426 				BR	ITMES2		;
    231
    232					;
    233					; SCTN/SEGN/FILE-OPERAND
    234					;
    235
    236	000306				ITMOPA:				;++021
    237	000306	122715 	000000G			CMPB	#S$TAR,(R5)	; LAST ITEM STAR?
    238	000312	001403 				BEQ	ITMOP0		;IF EQ YES
    239	000314	005767 	000000G		ITMOP1:	TST	$ALVL		; AUTOLOAD LEVEL NON-ZERO?
    240	000320	001404 				BEQ	ITMOP3		;IF EQ NO
    241	000322	005260 	000000G		ITMOP0:	INC	T$YP(R0)	; SET AUTOLOAD BIT IN ITEM
    242	000326	010667 	000000G			MOV	SP,$AFLG	; SET AUTOLOAD FLAG
    243	000332	010033 			ITMOP3:	MOV	R0,@(R3)+	;LINK ITEM TO CURRENT LIST
    244	000334	010043 				MOV	R0,-(R3)	;
    245	000336	116015 	000000G		ITMOP2:	MOVB	T$YP(R0),(R5)	; SET LAST ITEM TYPE
    246	000342	000667 				BR	ITMBEG		;
    247
    248					;
    249					; EOS-END OF STATEMENT
    250					;
    251
    252	000344	010033 			ITMEOS:	MOV	R0,@(R3)+	;LINK ITEM TO CURRENT LIST
    253	000346	010043 				MOV	R0,-(R3)	;
    254	000350	020327 	000002G			CMP	R3,#$DSTK+2	; ZERO PARENTHESIS LEVEL
    255	000354	001404 				BEQ	ITMES3		; IF EQ YES
    256	000356	012701 			ITMES1:	MOV	(PC)+,R1	;UNBALANCED PARENTHESIS
    257	000360	   000G	   000G			.BYTE	E$R46,S$V2	;FATAL-NO RETURN
    258	000362	000167 	001010 		ITMES2:	JMP	FILNM2		;
    259	000366				ITMES3:				;
    260	000366					RETURN			;
    261
    262
    263
    264
    265					;
    266					; SUBROUTINE TO BYPASS LEADING OR TRAILING BLANKS AND HT'S
    267					;
    268
    269	000370				BYPASS:				;++033                                          ;**NEW**
    270	000370	105710 				TSTB	(R0)		;TERMINAL ZERO?                                 ;**-1
    271	000372	001403 				BEQ	5$		;IF EQ YES
    272	000374	122710 	000073 			CMPB	#';,(R0)	;COMMENT TERMINATOR?
    273	000400	001006 				BNE	10$		;IF NE NO
    274	000402	020427 	177774G		5$:	CMP	R4,#$TSTK-4	; ANY TO UNSTACK?
    275	000406	103003 				BHIS	10$		;IF HIS NO
    276	000410	022424 				CMP	(R4)+,(R4)+	;REMOVE ENTRY FROM TEXT STACK
    277	000412	011400 				MOV	(R4),R0		;GET ADDRESS OF NEXT BYTE
    278	000414	000765 				BR	BYPASS		;GO AGAIN
    279	000416	010014 			10$:	MOV	R0,(R4)		;SAVE ADDRESS OF NEXT BYTE
    280	000420					RETURN			;
    281
    282					;
    283					; SUBROUTINE TO GET NEXT ITEM FROM SEGMENT DESCRIPTION
MLSG1	MACRO M1108  05-DEC-77 22:58  PAGE 3-5


    284					;
    285					; INPUTS:
    286					;
    287					;	R4=ADDRESS OF TOP OF TEXT POINTER STACK.
    288					;
    289					; OUTPUTS:
    290					;
    291					;	R0=ADDRESS OF NEXT ITEM.
    292					;
    293
    294	000422	012700 	000000G		ITEM:	MOV	#$EOSOP,R0	; ASSUME EOS
    295	000426	105774 	000000 			TSTB	@(R4)		;END OF SEGMENT DESCRIPTION?
    296	000432	001455 				BEQ	40$		;IF EQ YES
    297	000434	122774 	000073 	000000 		CMPB	#';,@(R4)	;COMMENT ALSO ENDS DESCRIPTION
    298	000442	001451 				BEQ	40$		;IF EQ COMMENT TERMINATION
    299	000444	011400 				MOV	(R4),R0		;GET ADDRESS OF NEXT BYTE
    300	000446	012701 	000004'			MOV	#CNTRL,R1	;GET ADDRESS OF CONTROL BYTE STRING
    301	000452	122110 				CMPB	(R1)+,(R0)	;LEFT BRACKET?
    302	000454	001445 				BEQ	50$		;IF EQ YES
    303	000456	122110 				CMPB	(R1)+,(R0)	;LEFT ANGLE BRACKET?
    304	000460	001443 				BEQ	50$		;IF EQ YES
    305	000462	122110 				CMPB	(R1)+,(R0)	;"$"?
    306	000464	001441 				BEQ	50$		;IF EQ YES
    307	000466	122110 				CMPB	(R1)+,(R0)	;POSSIBLY NUMERIC?
    308	000470	101006 				BHI	10$		;IF HI NO
    309	000472	122110 				CMPB	(R1)+,(R0)	;NUMERIC?
    310	000474	103035 				BHIS	50$		;IF HIS YES
    311	000476	122110 				CMPB	(R1)+,(R0)	;POSSIBLY ALPHABETIC?
    312	000500	101002 				BHI	10$		;IF HI NO
    313	000502	121110 				CMPB	(R1),(R0)	;ALPHABETIC?
    314	000504	103031 				BHIS	50$		;IF HIS YES
    315
    316					;
    317					; OPERATOR PROCESSING
    318					;
    319
    320	000506	012705 	000005 		10$:	MOV	#OBASE-OBAS,R5	;GET NUMBER OF OPERATORS
    321	000512	112001 				MOVB	(R0)+,R1	;GET NEXT BYTE
    322	000514	120165 	177777'		20$:	CMPB	R1,OBAS-1(R5)	;OPERATOR MATCH?
    323	000520	001406 				BEQ	30$		;IF EQ YES
    324	000522					SOB	R5,20$		;REPEAT
    325	000526	012701 				MOV	(PC)+,R1	;ILLEGAL OPERATOR
    326	000530	   000G	   000G			.BYTE	E$R43,S$V2	;FATAL-NO RETURN
    327	000532	000167 	000640 			JMP	FILNM2		;
    328	000536				30$:	CALL	BYPASS		;BYPASS TRAILING BLANKS AND HT'S
    329	000542	012701 	000004 			MOV	#4,R1		;GET SIZE OF BLOCK NEEDED
    330	000546					CALL	$ALBLK		;ALLOCATE STORAGE
    331	000552	012760 	002000 	000000G		MOV	#4*400,T$YP(R0)	; SET SIZE OF ENTRY
    332	000560	116560 	177777'	000000G		MOVB	OPRV-1(R5),T$YP(R0) ; SET TYPE OF ENTRY
    333	000566				40$:	RETURN			;
    334
    335					;
    336					; OPERAND PROCESSING
    337					;
    338
    339	000570	012705 	000016'		50$:	MOV	#TMP,R5		;GET ADDRESS OF TEMP STORAGE
    340	000574	010046 				MOV	R0,-(SP)	;SAVE ADDRESS FOR POSSIBLE RESCAN
MLSG1	MACRO M1108  05-DEC-77 22:58  PAGE 3-6


    341	000576					CALL	$RP		;CONVERT OPERAND NAME
    342	000602	005300 				DEC	R0		;BACK UP TO TERMINATOR
    343	000604	024545 				CMP	-(R5),-(R5)	;POINT TO NAME
    344	000606	122710 	000072 			CMPB	#':,(R0)	;COLON TERMINATOR?
    345	000612	001462 				BEQ	FILNM		;IF EQ YES-FILE
    346	000614	122710 	000056 			CMPB	#'.,(R0)	;PERIOD TERMINATOR?
    347	000620	001457 				BEQ	FILNM		;IF EQ YES-FILE
    348	000622	122710 	000133 			CMPB	#'[,(R0)	;LEFT BRACKET TERMINATOR?
    349	000626	001454 				BEQ	FILNM		;IF EQ YES-FILE
    350	000630	122710 	000074 			CMPB	#'<,(R0)	;LEFT ANGLE BRACKET TERMINATOR?
    351	000634	001451 				BEQ	FILNM		;IF EQ YES-FILE
    352	000636	122710 	000057 			CMPB	#'/,(R0)	;SLASH?
    353	000642	001446 				BEQ	FILNM		;IF EQ YES-FILE
    354	000644	010001 				MOV	R0,R1		;COPY ADDRESS OF NEXT BYTE
    355	000646	161601 				SUB	(SP),R1		;CALCULATE LENGTH OF NAME
    356	000650	020127 	000007 			CMP	R1,#7		;POSSIBLE DIRECTIVE OR LABEL?
    357	000654	103041 				BHIS	FILNM		;IF HIS NO
    358	000656					CALL	$SCNL		; SCAN DIRECTIVE LIST FOR MATCH
    359	000662	103436 				BCS	FILNM		;IF CS NO FIND EM-FILE
    360	000664	005726 				TST	(SP)+		;CLEAN STACK
    361	000666					CALL	BYPASS		;BYPASS TRAILING BLANKS AND HT'S
    362	000672	105761 	000000G			TSTB	T$YP(R1)	; FACTOR DIRECTIVE
    363	000676	001415 				BEQ	70$		;IF EQ YES
    364	000700	010146 				MOV	R1,-(SP)	;SAVE ADDRESS OF ENTRY
    365	000702	116101 	000001G			MOVB	T$YP+1(R1),R1	; GET SIZE OF ENTRY
    366	000706	010146 				MOV	R1,-(SP)	;SAVE SIZE OF ENTRY
    367	000710					CALL	$ALBLK		;ALLOCATE STORAGE
    368	000714	010001 				MOV	R0,R1		;COPY ADDRESS OF BLOCK
    369	000716	012605 				MOV	(SP)+,R5	;RETRIEVE SIZE OF ENTRY
    370	000720	012602 				MOV	(SP)+,R2	;RETRIEVE ADDRESS OF ENTRY
    371	000722	112221 			60$:	MOVB	(R2)+,(R1)+	;COPY ENTRY
    372	000724					SOB	R5,60$		;REPEAT
    373	000730					RETURN			;
    374	000732	020427 	000000C		70$:	CMP	R4,#$TSTK-<N$SLVL*4>	; ANY MORE ROOM ON TEXT STACK ?
    375	000736	101404 				BLOS	80$		;IF LOS NO
    376	000740	010144 				MOV	R1,-(R4)	;STACK ENTRY ADDRESS
    377	000742	016144 	000000G			MOV	N$XT(R1),-(R4)		; STACK ADDRESS OF NEXT BYTE
    378	000746	000625 				BR	ITEM		;GO AGAIN
    379	000750	012701 			80$:	MOV	(PC)+,R1	;TOO MANY NESTED .SEG/.ROOT DIRECTIVES
    380	000752	   000G	   000G			.BYTE	E$R44,S$V2	;FATAL-NO RETURN
    381	000754	000167 	000416 			JMP	FILNM2		;
    382
    383					;
    384					; FILE OPERAND PROCESSING
    385					;
    386
    387	000760	012600 			FILNM:	MOV	(SP)+,R0	;RETRIEVE ADDRESS OF NEXT BYTE FOR RESCAN
    388	000762	012705 	000000G			MOV	#$LNBUF,R5	;GET ADDRESS OF LINE BUFFER
    389	000766	005046 				CLR	-(SP)		;CLEAR BRACKET COUNT
    390	000770	105710 			10$:	TSTB	(R0)		;ZERO BYTE?
    391	000772	001434 				BEQ	20$		;IF EQ YES
    392	000774	122710 	000055 			CMPB	#'-,(R0)	;DASH?
    393	001000	001431 				BEQ	20$		;IF EQ YES
    394	001002	122710 	000051 			CMPB	#'),(R0)	;RIGHT PARENTHESIS?
    395	001006	001426 				BEQ	20$		;IF EQ YES
    396	001010	122710 	000050 			CMPB	#'(,(R0)	;++039 LEFT PARENTHESES
    397	001014	001423 				BEQ	20$		;++039 IF EQ YES
MLSG1	MACRO M1108  05-DEC-77 22:58  PAGE 3-7


    398	001016	122710 	000052 			CMPB	#'*,(R0)	;++039 ASTERISK?
    399	001022	001420 				BEQ	20$		;++039 IF EQ YES
    400	001024	005716 				TST	(SP)		;IN BRACKETS?
    401	001026	001003 				BNE	13$		;IF NE YES
    402	001030	122710 	000054 			CMPB	#',,(R0)	;COMMA?
    403	001034	001413 				BEQ	20$		;IF EQ YES
    404	001036	005216 			13$:	INC	(SP)		;ASSUME LEFT BRACKET
    405	001040	122710 	000133 			CMPB	#'[,(R0)	;LEFT BRACKET?
    406	001044	001405 				BEQ	17$		;IF EQ YES
    407	001046	005316 				DEC	(SP)		;DECREMENT BRACKET COUNT
    408	001050	122710 	000135 			CMPB	#'],(R0)	;RIGHT BRACKET?
    409	001054	001001 				BNE	17$		;IF NE NO
    410	001056	005316 				DEC	(SP)		;DECREMENT BRACKET COUNT
    411	001060	112025 			17$:	MOVB	(R0)+,(R5)+	;MOVE BYTE TO LINE BUFFER
    412	001062	000742 				BR	10$		;CONTINUE SCAN
    413	001064	005726 			20$:	TST	(SP)+		;BALANCED BRACKETS?
    414	001066	001141 				BNE	40$		;IF NE NO
    415	001070					CALL	BYPASS		;BYPASS TRAILING BLANKS AND HT'S
    416	001074	012701 	000000G			MOV	#T$MSIZ,R1	;GET SIZE OF CSI BLOCK
    417	001100					CALL	$ALBLK		;ALLOCATE CSI BLOCK
    418	001104	162705 	000000G			SUB	#$LNBUF,R5	;CALCULATE LENGTH OF LINE SEGMENT
    419	001110					CSI$1	R0,#$LNBUF,R5	;ANALYZE SYNTAX
    420	001126	103521 				BCS	40$		;IF CS SYNTAX ERROR
    421	001130	010005 				MOV	R0,R5		;SAVE ADDRESS OF CSI BLOCK
    422	001132					CALL	$CLRMN		; INITIALIZE SWITCH VALUE LIST
    423	001136	016700 	000000G			MOV	$INIPT,R0	; GET INPUT FILE RECORD BLOCK
    424	001142	010501 				MOV	R5,R1		;SET ADDRESS OF CSI BLOCK
    425	001144					CALL	$SCANO		;SCAN FOR OUTPUT FILE
    426	001150	103510 				BCS	40$		;IF CS SYNTAX ERROR
    427	001152					CALL	$BLMNT		; BUILD MODULE NAME LIST IF LIBRARY FILE
    428	001156	012701 	000000C			MOV	#<S$V2*400!E$R78>,R1 ; ASSUME ERROR
    429	001162	103505 				BCS	FILNM2		; IF C/S INCORRECT MODULE SPECIFICATION
    430	001164	012700 	000000G			MOV	#$FRHD,R0	;GET ADDRESS OF FREE SPACE POOL LISTHEAD
    431	001170	012701 	000000G			MOV	#T$MSIZ,R1	;GET SIZE OF BLOCK  TO RELEASE
    432	001174	010502 				MOV	R5,R2		;SET ADDRESS OF BLOCK TO RELEASE
    433	001176					CALL	$RLCB		;RELEASE BLOCK
    434	001202	016700 	000000G			MOV	$INIPT,R0	; GET INPUT FILE RECORD BLOCK POINTER
    435	001206	016046 	000046 			MOV	F.DFNB(R0),-(SP) ; SAVE POINTER TO NAMEBLOCK
    436	001212	032760 	000000G	000000G		BIT	#SW$LB,R$SWTH(R0) ; LIBRARY FILE?
    437	001220	001403 				BEQ	30$		; IF EQ NO
    438	001222	012760 	000000G	000046 		MOV	#$LIBNB,F.DFNB(R0) ; REPLACE DEFAULT NAME BLOCK
    439	001230				30$:				;
    440	001230					CALL	$PRFND		;PARSE/FIND FILE
    441	001234	012660 	000046 			MOV	(SP)+,F.DFNB(R0) ; RESTORE DEFAULT NAMEBLOCK POINTER
    442	001240	016002 	000000G			MOV	R$NAME(R0),R2	;GET ADDRESS OF NAME STRING
    443	001244	012701 				MOV	(PC)+,R1	;ASSUME PARSE/FIND FAILURE
    444	001246	   000G	   000G			.BYTE	E$R57,S$V2	;FATAL-NO RETURN
    445	001250	103466 				BCS	FILNM3		;IF CS PARSE/FIND FAILURE
    446	001252	012701 	000034 			MOV	#28.,R1		; GET SIZE OF BLOCK NEEDED FOR ITEM
    447	001256					CALL	$ALBLK		;ALLOCATE STORAGE
    448	001262	010001 				MOV	R0,R1		;COPY ADDRESS OF BLOCK
    449	001264	005721 				TST	(R1)+		;POINT TO SECOND WORD
    450	001266	012721 	000000C			MOV	#<28.*400!F$ILE>,(R1)+ ; SET TYPE/SIZE
    451	001272	016721 	000000G			MOV	$LBMOD,(R1)+	; SET V/A OF LIBRARY MODULE LIST
    452	001276	016702 	000000G			MOV	$INIPT,R2	; GET INPUT FILE RECORD BLOCK POINTER
    453	001302	016221 	000000G			MOV	R$SWTH(R2),(R1)+;INSERT SWITCH WORD
    454	001306	012762 	000000G	000000G		MOV	#SW$CC,R$SWTH(R2) ; ASSUME CONCATENATED OBJECT MODULE
MLSG1	MACRO M1108  05-DEC-77 22:58  PAGE 3-8


    455	001314	062702 	000102 			ADD	#F.FNB,R2	;POINT TO FILE NAME BLOCK
    456	001320	016221 	000034 			MOV	N.UNIT(R2),(R1)+;INSERT UNIT NUMBER
    457	001324	016221 	000032 			MOV	N.DVNM(R2),(R1)+;INSERT DEVICE NAME
    458	001330	016221 	000006 			MOV	N.FNAM(R2),(R1)+;INSERT FILENAME
    459	001334	016221 	000010 			MOV	N.FNAM+2(R2),(R1)+;
    460	001340	016221 	000012 			MOV	N.FNAM+4(R2),(R1)+;
    461	001344	016221 	000014 			MOV	N.FTYP(R2),(R1)+;INSERT FILE TYPE
    462	001350	016221 	000016 			MOV	N.FVER(R2),(R1)+;INSERT FILE VERSION
    463	001354	016221 	000000 			MOV	N.FID(R2),(R1)+	;INSERT FILE ID
    464	001360	016221 	000002 			MOV	N.FID+2(R2),(R1)+;
    465	001364	016221 	000004 			MOV	N.FID+4(R2),(R1)+;
    466	001370					RETURN			;
    467	001372	012701 			40$:	MOV	(PC)+,R1	;SYNTAX ERROR
    468	001374	   000G	   000G			.BYTE	E$R37,S$V2	;FATAL-NO RETURN
    469	001376	012702 	000000G		FILNM2:	MOV	#$LNDES,R2	;GET ADDRESS OF LINE DESCRIPTOR
    470	001402	016400 	000002 			MOV	2(R4),R0	;GET ADDRESS OF PARSED DIRECTIVE
    471	001406	116012 	000001G			MOVB	T$YP+1(R0),(R2)	; GET SIZE OF ENTRY+LINE
    472	001412	162712 	000013 			SUB	#11.,(R2)	;SUBTRACT OUT SIZE OF ENTRY
    473	001416	062700 	000002G			ADD	#N$XT+2,R0	; CALCULATE ADDRESS OF LINE
    474	001422	010062 	000002 			MOV	R0,2(R2)	;SET ADDRESS OF LINE
    475	001426				FILNM3:	CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    476
    477		000001 				.END
MLSG1	MACRO M1108  05-DEC-77 22:58  PAGE 3-9
SYMBOL TABLE

AUTO    000000R  	FA.TMP= 000020   	F.EFN = 000050   	ITMRPR  000250R  	S.BFHD= 000020
BYPASS  000370R  	FA.WRT= 000002   	F.EOBB= 000032   	LF    = 000012   	S.FATT= 000016
B.BBFS= 000010   	FD.BLK= 000010   	F.ERR = 000052   	LITEM   000014R  	S.FDB = 000140
B.BFST= 000015   	FD.CCL= 000002   	F.FACC= 000043   	L$PAR = ****** GX	S.FNAM= 000006
B.NXBD= 000012   	FD.CR = 000002   	F.FFBY= 000014   	NB.DEV= 000200   	S.FNB = 000036
B.VBN = 000004   	FD.DIR= 000010   	F.FNAM= 000110   	NB.DIR= 000100   	S.FNBW= 000017
CNTRL   000004R  	FD.FTN= 000001   	F.FNB = 000102   	NB.NAM= 000004   	S.FNTY= 000004
CR    = 000015   	FD.INS= 000010   	F.FTYP= 000116   	NB.SD1= 000400   	S.FTYP= 000002
CS.DIF= 000002   	FD.PLC= 000004   	F.FVER= 000120   	NB.SD2= 001000   	S.NFEN= 000020
CS.DVF= 000004   	FD.RAH= 000001   	F.HIBK= 000004   	NB.SNM= 000040   	TMP     000016R
CS.EQU= 000040   	FD.RAN= 000002   	F.LUN = 000042   	NB.STP= 000020   	T$MSIZ= ****** GX
CS.INP= 000001   	FD.REC= 000001   	F.MBCT= 000054   	NB.SVR= 000010   	T$YP  = ****** GX
CS.MOR= 000020   	FD.RWM= 000001   	F.MBC1= 000055   	NB.TYP= 000002   	VT    = 000013
CS.NMF= 000001   	FD.SDI= 000020   	F.MBFG= 000056   	NB.VER= 000001   	$AFLG = ****** GX
CS.OUT= 000002   	FD.SQD= 000040   	F.NRBD= 000024   	N$PLVL= ****** GX	$ALBLK= ****** GX
CS.WLD= 000010   	FD.TTY= 000004   	F.NREC= 000030   	N$SLVL= ****** GX	$ALVL = ****** GX
C$OMA = ****** GX	FD.WBH= 000002   	F.OVBS= 000030   	N$XT  = ****** GX	$BLMNT= ****** GX
C.CMLD= 000002   	FF    = 000014   	F.RACC= 000016   	N.DID = 000024   	$CBAS = ****** GX
C.DEVD= 000006   	FILNM   000760R  	F.RATT= 000001   	N.DVNM= 000032   	$CLRMN= ****** GX
C.DIRD= 000012   	FILNM2  001376R  	F.RCNM= 000034   	N.FID = 000000   	$DSTK = ****** GX
C.DSDS= 000006   	FILNM3  001426R  	F.RCTL= 000017   	N.FNAM= 000006   	$EOSOP= ****** GX
C.FILD= 000016   	FO.APD= 000106   	F.RSIZ= 000002   	N.FTYP= 000014   	$ERMSG= ****** GX
C.MKW1= 000024   	FO.MFY= 000002   	F.RTYP= 000000   	N.FVER= 000016   	$FRHD = ****** GX
C.MKW2= 000026   	FO.RD = 000001   	F.STBK= 000036   	N.NEXT= 000022   	$INIPT= ****** GX
C.SIZE= 000054   	FO.UPD= 000006   	F.UNIT= 000136   	N.STAT= 000020   	$LBMOD= ****** GX
C.STAT= 000001   	FO.WRT= 000016   	F.URBD= 000020   	N.UNIT= 000034   	$LIBNB= ****** GX
C.SWAD= 000022   	F$ILE = ****** GX	F.VBN = 000064   	OBAS    000000R     002	$LNBUF= ****** GX
C.TYPR= 000000   	F.ALOC= 000040   	F.VBSZ= 000060   	OBASE   000005R     002	$LNDES= ****** GX
D$ASH = ****** GX	F.BBFS= 000062   	HT    = 000011   	OPRV    000000R     003	$MLSG1  000030RG
E$R37 = ****** GX	F.BDB = 000070   	ITEM    000422R  	PAR$$$= 000000   	$PRFND= ****** GX
E$R43 = ****** GX	F.BGBC= 000057   	ITMBEG  000122R  	R$NAME= ****** GX	$RLCB = ****** GX
E$R44 = ****** GX	F.BKDN= 000026   	ITMCM1  000300R  	R$PAR = ****** GX	$RP   = ****** GX
E$R45 = ****** GX	F.BKDS= 000020   	ITMEOS  000344R  	R$SWTH= ****** GX	$RTDIR= ****** GX
E$R46 = ****** GX	F.BKEF= 000050   	ITMES1  000356R  	R$$11M= 000000   	$SCANO= ****** GX
E$R57 = ****** GX	F.BKP1= 000051   	ITMES2  000362R  	R.FIX = 000001   	$SCNL = ****** GX
E$R78 = ****** GX	F.BKST= 000024   	ITMES3  000366R  	R.VAR = 000002   	$SOSOP= ****** GX
FA.APD= 000100   	F.BKVB= 000064   	ITMLPR  000212R  	SPA   = 000040   	$TSTK = ****** GX
FA.CRE= 000010   	F.CNTG= 000034   	ITMOPA  000306R  	SW$CC = ****** GX	$$    = 000001
FA.EXT= 000004   	F.DFNB= 000046   	ITMOP0  000322R  	SW$LB = ****** GX	.CSI1 = ****** G
FA.NSP= 000100   	F.DSPT= 000044   	ITMOP1  000314R  	S$OS  = ****** GX	...GBL= 000000
FA.RD = 000001   	F.DVNM= 000134   	ITMOP2  000336R  	S$TAR = ****** GX	...TPC= 000140
FA.SHR= 000040   	F.EFBK= 000010   	ITMOP3  000332R  	S$V2  = ****** GX

. ABS.	000000	   000
      	001432	   001
OPRL  	000005	   002
OVAL  	000005	   003
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2534 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:32
[44,10]MLSG1,[44,20]MLSG1/-SP=[44,30]MACFLM.,FCSPR.,MLSG1.007
MLSG2	MACRO M1108  05-DEC-77 22:58  PAGE 2


      1						.TITLE	MLSG2
      2						.IDENT	/05/                                                           ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 05                                                                   ;**NEW**
     20					;                                                                               ;**-1
     21					; D. N. CUTLER/C. MONIA 10-DEC-73
     22					;
     23					; BUILD THE SEGMENT DESCRIPTION FOR AN OVERLAYED TASK
     24					;
     25					; LOCAL DATA
     26					;
     27					; AUTOLOAD ENTRY POINT NAME
     28					;
     29
     30	000000	124375 	077530 		AUTO:	.RAD50	/$AUTO/		;
     31
     32					;
     33					; NAME OF POINTER TO IMPURE AREA IN OVERLAY RUNTIME ROUTINES
     34					;
     35
     36	000004	130477 	105571 		NOVLY:	.RAD50	/.NOVLY/	;                                               ;**NEW**
     37					                                                                                ;**-1
     38					;
     39					; TEMPORARY STORAGE
     40					;
     41
     42	000010				TMP:	.BLKW	5
     43
     44					;
     45					;+
     46					; **-MLSG2-BUILD SEGMENT DESCRIPTORS
     47					;
     48					; INPUTS:
     49					;
     50					;	PARSED SEGMENT DESCRIPTION BUILT BY $MLSG1
     51					;
     52					; OUTPUTS:
     53					;
     54					;	SEGMENT TABLES AND ELEMENT LIST FOR EACH SEGMENT
     55					;
     56					;
     57					;	THIS ROUTINE IS ENTERED FROM $MULSG TO CONSTRUCT THE
MLSG2	MACRO M1108  05-DEC-77 22:58  PAGE 2-1


     58					; ABOVE TABLES. THE SEGMENT DESCRIPTORS ARE LINKED AND ELEMENT
     59					; DESCRIPTORS STRUNG OFF EACH BRANCH. ANY .PSECTS SPECIFIED IN
     60					; THE ODL ARE ENTERED IN THE SECTION TABLE OF THE APPROPRIATE
     61					; SEGMENT.
     62					;-
     63					;
     64
     65	000022				$MLSG2::			;
     66	000022	012700 	000000G			MOV	#$DSTK,R0	; GET ADDRESS OF DESCRIPTION STACK
     67	000026	010001 			10$:	MOV	R0,R1		;COPY HEADER ADDRESS
     68	000030	005720 				TST	(R0)+		;POINT TO LAST
     69	000032	010120 				MOV	R1,(R0)+	;LAST POINTS TO FIRST INITIALLY
     70	000034	020027 	000000C			CMP	R0,#$DSTK+<N$PLVL*4> ; END OF LIST?
     71	000040	103772 				BLO	10$		;IF LO NO
     72	000042	012704 	000002G			MOV	#$DSTK+2,R4	; GET ADDRESS OF FIRST HEADER
     73	000046	011403 				MOV	(R4),R3		;GET ADDRESS OF NEXT ITEM
     74	000050	016701 	000000G			MOV	$RTSEG,R1	; GET VITUAL ADDRESS OF ROOT SEGMENT
     75	000054					CALL	$CVLOK		; CONVERT TO REAL, LOCK IN MEMORY
     76	000060					CALL	$WRMPG		; WRITE MARK PAGE
     77	000064					CALL	GNSEG		;GENERATE SEGMENT DESCRIPTORS
     78	000070	016701 	000000G			MOV	$CRVSG,R1	; GET VIRTUAL ADDRESS OF LAST SEGMENT
     79	000074					CALL	$WRMPG		; WRITE-MARK PAGE
     80	000100					CALL	$UNLPG		; UNLOCK PAGE
     81	000104	012705 	000000G			MOV	#$DIRHD,R5	; GET ADDRESS OF PARSED DIRECTIVE HEADER
     82	000110					CALL	RELEAS		;RELEASE MEMORY
     83	000114	012704 	000000G			MOV	#$DSTK,R4	; GET ADDRESS OF DESCRIPTION STACK
     84	000120	010405 			20$:	MOV	R4,R5		;SET HEADER ADDRESS
     85	000122					CALL	RELEAS		;RELEASE MEMORY
     86	000126	022424 				CMP	(R4)+,(R4)+	;ADJUST TO NEXT HEADER
     87	000130	020427 	000000C			CMP	R4,#$DSTK+<N$PLVL*4> ; END OF LIST?
     88	000134	103771 				BLO	20$		;IF LO NO
     89	000136	012705 	000004'			MOV	#NOVLY,R5	; POINT TO IMPURE AREA NAME                     ;**NEW**
     90	000142					CALL	25$		;INSERT IN SYMBOL TABLE                         ;**-1
     91	000146	005767 	000000G			TST	$AFLG		; AUTOLOAD SPECIFIED?
     92	000152	001440 				BEQ	30$		;IF EQ NO
     93	000154	012705 	000000'			MOV	#AUTO,R5	;POINT TO NAME OF AUTOLOAD ROUTINE
     94	000160	005267 	000000G		25$:	INC	$MSYMC		;INCREMENT MASTER UNDEFINED SYMBOL COUNT
     95	000164	012701 	000000G			MOV	#S$YLGH,R1	;GET SIZE OF BLOCK NEEDED
     96	000170					CALL	$ALVRT		; ALLOCATE VITUAL MEMORY                        ;**NEW**
     97	000174	012560 	000000G			MOV	(R5)+,S$YM(R0)	;INSERT NAME OF SYMBOL                          ;**-1
     98	000200	011560 	000002G			MOV	(R5),S$YM+2(R0)	;
     99	000204	112760 	000000G	000000G		MOVB	#SY$GBL,S$YFLG(R0);SET GLOBAL FLAG
    100	000212	010103 				MOV	R1,R3		; SAVE ENTRY ADDRESS                            ;**NEW**
    101	000214	016701 	000000G			MOV	$RTSEG,R1	; GET VIRTUAL ADDRESS OF ROOT SEG               ;**-1
    102	000220					CALL	$CVRL		; CONVERT TO REAL
    103	000224					CALL	$WRMPG		; WRITE-MARK PAGE
    104	000230	005260 	000000G			INC	S$GUND(R0)	; INCREMENT NUMBER OF UNDEFINED SYMBOLS         ;**NEW**
    105	000234	010100 				MOV	R1,R0		; COPY DESCRIPTOR VIRTUAL ADDRESS               ;**NEW**
    106	000236	062700 	000000C			ADD	#S$GSTB/2,R0	; POINT TO SYMBOL TABLE                         ;**NEW**
    107	000242	010301 				MOV	R3,R1		; GET VIRTUAL ADDRESS OF DESCRIPTOR             ;**NEW**
    108	000244					CALL	$SRCHI		;SEARCH FOR INSERT                              ;**-3
    109	000250					CALL	$ISYM		;INSERT SYMBOL
    110	000254				30$:	RETURN			;
    111
    112					;
    113					; SUBROUTINE TO GENERATE SEGMENT DESCRIPTORS
    114					;
MLSG2	MACRO M1108  05-DEC-77 22:58  PAGE 2-2


    115
    116	000256				GNSEG:				;
    117	000256	016701 	000000G			MOV	$CRVSG,R1	; GET VIRTUAL ADDRESS OF CURRENT SEGMENT
    118	000262					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    119	000266	010005 				MOV	R0,R5		; SET REAL ADDRESS OF CURRENT
    120	000270	010067 	000000G			MOV	R0,$CRSEG	; SET REAL ADDRESS OF CURRENT
    121	000274	011303 				MOV	(R3),R3		; GET ADDRESS OF NEXT ITEM TYPE
    122	000276	116302 	000000G			MOVB	T$YP(R3),R2	; GET ITEM TYPE
    123	000302	042702 	000001 			BIC	#1,R2		;CLEAR POSSIBLE AUTOLOAD BIT
    124	000306	000172 	000312'			JMP	@10$(R2)	;DISPATCH ON ITEM TYPE
    125
    126					;
    127					; ITEM TYPE DISPATCH VECTOR
    128					;
    129
    130	000312	000256'			10$:	.WORD	GNSEG		;SOS
    131	000314	000372'				.WORD	GNRPAR		;EOS
    132	000316	000336'				.WORD	GNLPAR		;LPAR
    133	000320	000372'				.WORD	GNRPAR		;RPAR
    134	000322	000374'				.WORD	GNCOMA		;COMA
    135	000324	000532'				.WORD	GNDASH		;DASH
    136	000326	000256'				.WORD	GNSEG		;STAR
    137	000330	000652'				.WORD	GNSCTN		;SCTN
    138	000332	001160'				.WORD	GNSEGN		;SEGN
    139	000334	001016'				.WORD	GNFILE		;FILE
    140
    141					;
    142					; LPAR-LEFT PARENTHESIS
    143					;
    144
    145	000336	032763 	000001 	000000G	GNLPAR:	BIT	#1,T$YP(R3)	; AUTOLOAD SPECIFIED?
    146	000344	001402 				BEQ	10$		;IF EQ NO
    147	000346	105265 	000001G			INCB	S$GSTS+1(R5)	;SET AUTOLOAD FLAG
    148	000352	011300 			10$:	MOV	(R3),R0		;GET ADDRESS OF NEXT ITEM
    149	000354	122760 	000000G	000000G		CMPB	#S$CTN,T$YP(R0)	; OPERAND?
    150	000362	101735 				BLOS	GNSEG		;IF LOS YES
    151	000364					CALL	GNLVL		;CHANGE LEVEL
    152	000370	000732 				BR	GNSEG		;
    153
    154					;
    155					; RPAR-RIGHT PARENTHESIS
    156					;
    157
    158	000372				GNRPAR:	RETURN			;
    159
    160					;
    161					; COMA-COMMA
    162					;
    163
    164	000374				GNCOMA:	CALL	$ALSGD		;ALLOCATE SEGMENT DESCRIPTOR
    165	000400	032763 	000001 	000000G		BIT	#1,T$YP(R3)	; AUTOLOAD BIT SET?
    166	000406	001402 				BEQ	10$		;IF EQ NO
    167	000410	105260 	000001G			INCB	S$GSTS+1(R0)	;SET SEGMENT AUTOLOAD
    168	000414				10$:				;
    169	000414	016546 	000000G			MOV	S$GNXT(R5),-(SP) ; GET LINK NEXT OF CURRENT
    170	000420	010165 	000000G			MOV	R1,S$GNXT(R5)	; SET NEW LINK NEXT
    171	000424	011660 	000000G			MOV	(SP),S$GNXT(R0)	; SET LINK NEXT OF NEW
MLSG2	MACRO M1108  05-DEC-77 22:58  PAGE 2-3


    172	000430	016560 	000000G	000000G		MOV	S$GDWN(R5),S$GDWN(R0) ;SET LINK DOWN OF NEW
    173	000436	016760 	000000G	000000G		MOV	$CRVSG,S$GPRV(R0) ; SET LINK TO PREVIOUS
    174	000444					CALL	$LCKPG		; LOCK NEW SEGMENT IN MEMORY
    175	000450	010067 	000000G			MOV	R0,$CRSEG	; SAVE REAL ADDRESS OF SEGMENT
    176	000454	010167 	000000G			MOV	R1,$CRVSG	; SAVE VIRTUAL ADDRESS OF SEGMENT
    177	000460	016001 	000000G			MOV	S$GPRV(R0),R1	; GET VIRTUAL ADDRESS OF PREVIOUS
    178	000464					CALL	$UNLPG		; UNLOCK PAGE
    179	000470	012601 				MOV	(SP)+,R1	; GET VIRTUAL ADDRESS OF LINK NEXT
    180	000472					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    181	000476					CALL	$WRMPG		; WRITE-MARK PAGE
    182	000502	016760 	000000G	000000G		MOV	$CRVSG,S$GPRV(R0) ; SET NEW LINK TO PREVIOUS
    183	000510	011301 				MOV	(R3),R1		;GET ADDRESS OF NEXT ITEM
    184	000512	122761 	000000G	000000G		CMPB	#S$CTN,T$YP(R1)	; OPERAND?
    185	000520	101656 				BLOS	GNSEG		;IF LOS YES
    186	000522					CALL	GNLVL		;CHANGE LEVEL
    187	000526	010146 				MOV	R1,-(SP)	; SAVE VIRTUAL ADDRESS OF CURRENT SEGMENT
    188	000530	000434 				BR	GND1		;
    189
    190					;
    191					; DASH-MINUS
    192					;
    193
    194	000532	011300 			GNDASH:	MOV	(R3),R0		;GET ADDRESS OF NEXT ITEM
    195	000534	122760 	000000G	000000G		CMPB	#S$CTN,T$YP(R0)	; OPERAND?
    196	000542	101645 				BLOS	GNSEG		;IF LOS YES
    197	000544					CALL	$ALSGD		;ALLOCATE SEGMENT DESCRIPTOR
    198	000550					CALL	$LCKPG		; LOCK NEW IN CORE
    199	000554	010165 	000000G			MOV	R1,S$GUP(R5)	; SET LINK UP OF CURRENT
    200	000560	016760 	000000G	000000G		MOV	$CRVSG,S$GDWN(R0) ; SET LINK DOWN OF NEW
    201	000566	010167 	000000G			MOV	R1,$CRVSG	; SET NEW CURRENT SEGMENT
    202	000572	016001 	000000G			MOV	S$GDWN(R0),R1	; GET VIRTUAL ADDRESS OF OLD
    203	000576					CALL	$WRMPG		; WRITE-MARK PAGE
    204	000602					CALL	$UNLPG		; UNLOCK PAGE BUFFER
    205	000606					CALL	GNLVL		;CHANGE LEVEL
    206	000612					CALL	$CVRL		; GET REAL ADDRESS OF CURRENT SEGMENT
    207	000616	016046 	000000G			MOV	S$GDWN(R0),-(SP) ; RESTORE CURRENT SEGMENT
    208	000622				GND1:				;
    209	000622	016701 	000000G			MOV	$CRVSG,R1	; GET VIRTUAL ADDRESS OF CURRENT SEG.
    210	000626					CALL	$UNLPG		; UNLOCK CURRENT
    211	000632	012601 				MOV	(SP)+,R1	; GET NEW CURRENT
    212	000634					CALL	$CVLOK		; CONVERT TO REAL, LOCK IN MEMORY
    213	000640					CALL	$WRMPG		; WRITE-MARK PAGE
    214	000644	010167 	000000G			MOV	R1,$CRVSG	; SET NEW CURRENT
    215	000650	000602 				BR	GNSEG		;
    216
    217					;
    218					; SCTN-SECTION NAME
    219					;
    220
    221	000652	010301 			GNSCTN:	MOV	R3,R1		;COPY ADDRESS OF ITEM
    222	000654	062701 	000000G			ADD	#L$AB,R1	; CALCULATE PROPER OFFSET
    223	000660	162701 	000000G			SUB	#S$YM,R1	;
    224	000664	010500 				MOV	R5,R0		;COPY ADDRESS OF CURRENT SEGMENT
    225	000666	062700 	000000G			ADD	#S$GCST,R0	;POINT TO SECTION TABLE
    226	000672					CALL	$SRCH		;SEARCH FOR SECTION NAME
    227	000676	103043 				BCC	20$		;IF CC ALREADY THERE
    228	000700	012701 	000000G			MOV	#C$SLGH,R1	;GET SIZE OF BLOCK NEEDED
MLSG2	MACRO M1108  05-DEC-77 22:58  PAGE 2-4


    229	000704					CALL	$ALVRT		; ALLOCATE VIRTUAL MEMORY                       ;**NEW**
    230	000710	016360 	000000G	000000G		MOV	L$AB(R3),S$YM(R0) ; INSERT SECTION NAME                         ;**-1
    231	000716	016360 	000002G	000002G		MOV	L$AB+2(R3),S$YM+2(R0) ;
    232	000724	116360 	000000G	000000G		MOVB	F$LG(R3),C$SFLG(R0) ; SET FLAG BYTE
    233	000732	142760 	000000G	000000G		BICB	#CS$MEM,C$SFLG(R0) ; CLEAR MEMORY FLAG(USED FOR AUTOLOAD)
    234	000740	012760 	000002 	000000G		MOV	#2,C$SBND(R0)	;SET DEFAULT BOUNDRY ALIGNMENT
    235	000746	032763 	000001 	000000G		BIT	#1,T$YP(R3)	; AUTOLOAD SPECIFIED?
    236	000754	001403 				BEQ	10$		;IF EQ NO
    237	000756	152760 	000000G	000000G		BISB	#CS$ATL,C$SFLG(R0) ; SET AUTOLOAD BIT
    238	000764				10$:				;                                               ;**NEW**
    239	000764	016700 	000000G			MOV	$CRVSG,R0	; GET VIRTUAL ADDRESS OF CURRENT SEGMENT        ;**NEW**
    240	000770	062700 	000000C			ADD	#S$GCST/2,R0	; POINT TO SECTION TABLE                        ;**NEW**
    241	000774					CALL	$SRCHI		;SEARCH FOR INSERT                              ;**-3
    242	001000	103002 				BCC	20$		;IF CC ALREADY DEFINED FOR SEGMENT
    243	001002					CALL	$ISYM		;INSERT SECTION
    244	001006	005765 	000000G		20$:	TST	S$GNME(R5)	;SEGMENT HAVE NAME YET?
    245	001012	001077 				BNE	GNSEG2		;IF NE YES
    246	001014	000470 				BR	GNSEG1		;GIVE IT NAME NOW
    247
    248					;
    249					; FILE-FILE NAME
    250					;
    251
    252	001016	012701 	000000G		GNFILE:	MOV	#E$LLGH,R1	;GET SIZE OF BLOCK NEEDED
    253	001022					CALL	$ALVRT		; ALLOCATE VIRTUAL MEMORY
    254	001026	010146 				MOV	R1,-(SP)	; SAVE VIRTUAL ADDRESS
    255	001030	005360 	000000G			DEC	E$LNUM(R0)	;SET HIGHEST SECTION NUMBER TO - 1
    256	001034	032763 	000001 	000000G		BIT	#1,T$YP(R3)	; AUTOLOAD SPECIFIED?
    257	001042	001403 				BEQ	10$		;IF EQ NO
    258	001044	052760 	000000G	000000G		BIS	#SW$AL,E$LSWT(R0);SET AUTOLOAD BIT
    259	001052	010001 			10$:	MOV	R0,R1		;COPY ENTRY ADDRESS
    260	001054	010302 				MOV	R3,R2		;COPY ENTRY ADDRESS
    261	001056	062701 	000000G			ADD	#E$LMND,R1	;POINT TO UNIT NUMBER
    262	001062	062702 	000000G			ADD	#L$AB,R2	; POINT TO MODULE NAME LIST ADDRESS             ;**NEW**
    263	001066	012260 	000002G			MOV	(R2)+,E$LIDT+2(R0) ; SET VIRTUAL ADDRESS OF MODULE NAME LIST    ;**NEW**
    264	001072	052260 	000000G			BIS	(R2)+,E$LSWT(R0);MERGE SWITCH WORD                              ;**-1
    265	001076	012746 	000012 			MOV	#10.,-(SP)	;SET LOOP COUNT
    266	001102	012221 			20$:	MOV	(R2)+,(R1)+	;MOVE ITEM TO ELEMENT DESCRIPTOR
    267	001104	005316 				DEC	(SP)		;DECREMENT LOOP COUNT
    268	001106	003375 				BGT	20$		;IF GT MORE TO MOVE
    269	001110	005726 				TST	(SP)+		;CLEAN STACK
    270	001112	016700 	000000G			MOV	$CRVSG,R0	; GET VIRTUAL ADDRESS OF SEGMENT DESCRIPTOR
    271	001116	062700 	000000C			ADD	#<S$GELT/2>,R0	; COMPUTE LISTHEAD VIRTUAL ADDRESS.
    272	001122	012601 				MOV	(SP)+,R1	; RESTORE VIRTUAL ADDRESS OF DESCRIPTOR
    273	001124	012702 	000000G			MOV	#E$LNXT,R2	; SET REAL LINK TO NEXT
    274	001130					CALL	$LNKVM		; LINK TO ELEMENT LIST
    275	001134	005765 	000000G			TST	S$GNME(R5)	;SEGMENT HAVE NAME?
    276	001140	001024 				BNE	GNSEG2		;IF NE YES
    277	001142	016365 	000014 	000000G		MOV	14(R3),S$GNME(R5) ; GIVE IT A NAME NOW                          ;**NEW**
    278	001150	016365 	000016 	000002G		MOV	16(R3),S$GNME+2(R5) ;                                           ;**NEW**
    279	001156	000415 				BR	GNSEG2		;                                               ;**-2
    280
    281					;
    282					; SEGN-SEGMENT NAME
    283					;
    284
    285	001160	032763 	000001 	000000G	GNSEGN:	BIT	#1,T$YP(R3)	; AUTOLOAD SPECIFIED?
MLSG2	MACRO M1108  05-DEC-77 22:58  PAGE 2-5


    286	001166	001403 				BEQ	GNSEG1		;IF EQ NO
    287	001170	112765 	000001 	000001G		MOVB	#1,S$GSTS+1(R5)	;SET AUTOLOAD FLAG
    288	001176	016365 	000000G	000000G	GNSEG1:	MOV	L$AB(R3),S$GNME(R5) ; SET SEGMENT NAME
    289	001204	016365 	000002G	000002G		MOV	L$AB+2(R3),S$GNME+2(R5) ;
    290	001212	000167 	177040 		GNSEG2:	JMP	GNSEG		;
    291
    292					;
    293					; SUBROUTINE TO CHANGE LEVLES
    294					;
    295
    296	001216	010314 			GNLVL:	MOV	R3,(R4)		;SAVE ADDRESS OF CURRENT ITEM
    297	001220	022424 				CMP	(R4)+,(R4)+	;ADVANCE LEVEL
    298	001222	011403 				MOV	(R4),R3		;GET ADDRESS OF CURRENT ITEM
    299	001224	016746 	000000G			MOV	$CRVSG,-(SP)	; SAVE CURRENT VIRTUAL SEGMENT ADDRESS
    300	001230					CALL	GNSEG		;RECURSE
    301	001234	012601 				MOV	(SP)+,R1	; RESTORE VIRTUAL ADDRESS OF SEGMENT
    302	001236	010314 				MOV	R3,(R4)		;SAVE ADDRESS OF CURRENT ITEM
    303	001240	024444 				CMP	-(R4),-(R4)	;REDUCE LEVEL
    304	001242	011403 				MOV	(R4),R3		;RETRIEVE ADDRESS OF CURRENT ITEM
    305	001244					RETURN			;
    306
    307					;
    308					; SUBROUTINE TO RELEASE MEMORY
    309					;
    310
    311	001246	011505 			RELEAS:	MOV	(R5),R5		;GET ADDRESS OF FIRST ENTRY
    312	001250	001412 				BEQ	20$		;IF EQ NONE TO RELEASE
    313	001252	010502 			10$:	MOV	R5,R2		;SET ADDRESS OF BLOCK TO RELEASE
    314	001254	116201 	000001G			MOVB	T$YP+1(R2),R1	; SET SIZE OF BLOCK
    315	001260	012700 	000000G			MOV	#$FRHD,R0	;GET ADDRESS OF FREE SPACE HEADER
    316	001264	011505 				MOV	(R5),R5		;GET ADDRESS OF NEXT ENTRY
    317	001266					CALL	$RLCB		;RELEASE BLOCK
    318	001272	005705 				TST	R5		;ANY MORE?
    319	001274	001366 				BNE	10$		;IF NE YES
    320	001276				20$:	RETURN			;
    321
    322		000001 				.END
MLSG2	MACRO M1108  05-DEC-77 22:58  PAGE 2-6
SYMBOL TABLE

AUTO    000000R  	GNDASH  000532R  	N$PLVL= ****** GX	S$GUND= ****** GX	$DIRHD= ****** GX
CR    = 000015   	GND1    000622R  	RELEAS  001246R  	S$GUP = ****** GX	$DSTK = ****** GX
CS$ATL= ****** GX	GNFILE  001016R  	R$$11M= 000000   	S$YFLG= ****** GX	$FRHD = ****** GX
CS$MEM= ****** GX	GNLPAR  000336R  	SPA   = 000040   	S$YLGH= ****** GX	$ISYM = ****** GX
C$SBND= ****** GX	GNLVL   001216R  	SW$AL = ****** GX	S$YM  = ****** GX	$LCKPG= ****** GX
C$SFLG= ****** GX	GNRPAR  000372R  	SY$GBL= ****** GX	TMP     000010R  	$LNKVM= ****** GX
C$SLGH= ****** GX	GNSCTN  000652R  	S$CTN = ****** GX	T$YP  = ****** GX	$MLSG2  000022RG
E$LIDT= ****** GX	GNSEG   000256R  	S$GCST= ****** GX	VT    = 000013   	$MSYMC= ****** GX
E$LLGH= ****** GX	GNSEGN  001160R  	S$GDWN= ****** GX	$AFLG = ****** GX	$RLCB = ****** GX
E$LMND= ****** GX	GNSEG1  001176R  	S$GELT= ****** GX	$ALSGD= ****** GX	$RTSEG= ****** GX
E$LNUM= ****** GX	GNSEG2  001212R  	S$GNME= ****** GX	$ALVRT= ****** GX	$SRCH = ****** GX
E$LNXT= ****** GX	HT    = 000011   	S$GNXT= ****** GX	$CRSEG= ****** GX	$SRCHI= ****** GX
E$LSWT= ****** GX	LF    = 000012   	S$GPRV= ****** GX	$CRVSG= ****** GX	$UNLPG= ****** GX
FF    = 000014   	L$AB  = ****** GX	S$GSTB= ****** GX	$CVLOK= ****** GX	$WRMPG= ****** GX
F$LG  = ****** GX	NOVLY   000004R  	S$GSTS= ****** GX	$CVRL = ****** GX	$$    = 000001
GNCOMA  000374R

. ABS.	000000	   000
      	001300	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  973 WORDS  ( 4 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:22
[44,10]MLSG2,[44,20]MLSG2/-SP=[44,30]MACFLM.,MLSG2.005
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3


      1						.TITLE	MPOUT
      2						.IDENT	/13/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1975,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 13
     20					;                                                                               ;**-1
     21					; D. N. CUTLER/C. MONIA 25-JAN-74
     22					;
     23					; MODIFICATIONS
     24					;
     25					; NO.		DATE		PROGRAMMER
     26					; ---		----		----------
     27					;
     28					; 021		25-JAN-74	C. MONIA
     29					; 034		07-JAN-75	C. MONIA
     30					; 036		14-JAN-75	C. MONIA                                        ;**NEW**
     31					; 039		22-MAR-75	C. MONIA
     32					;
     33					; MONITOR DEPENDENT LOAD MAP OUTPUT ROUTINES
     34					;
     35					; MACRO LIBRARY CALLS
     36					;
     37
     38						.MCALL	GTIM$S,PUT$S
     39
     40					;
     41					; LOCAL DATA
     42					;
     43
     44	000000	127402 	046324 		BLKNM:	.RAD50	/. BLK./	;NAME OF BLANK CONTROL SECTION
     45	000004				$MPFLG::.BLKW	1		;MAP BUFFER TRUE/FALSE FLAG
     46	000006	000356'			FMTVCT:	.WORD	FMT10		;SYMBOL OUTPUT FORMAT ADDR VECTOR
     47	000010	000376'				.WORD	FMT11		;
     48	000012	000431'				.WORD	FMT12		;
     49	000014	000477'				.WORD	FMT13		;
     50	000016				OPSW:				; OPTION SWITCH VECTOR
     51
     52						.IF	NDF	R$$11M
     53
     54						.WORD	SW$FP		;
     55						.WORD	SW$AB		;
     56						.WORD	SW$CP		;
     57						.WORD	SW$DS		;
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3-1


     58						.WORD	SW$FX		;
     59						.WORD	SW$DA		;
     60						.WORD	SW$PI		;
     61						.WORD	SW$PR		;
     62						.WORD	SW$TR		;
     63
     64						.IFF
     65
     66	000016	000000G				.WORD	SW$AC		;
     67	000020	000000G				.WORD	SW$EA		;
     68	000022	000000G				.WORD	SW$FP		;
     69	000024	000000G				.WORD	SW$CP		;
     70	000026	000000G				.WORD	SW$DA		;
     71	000030	000000G				.WORD	SW$NH		;
     72	000032	000000G				.WORD	SW$PI		;
     73	000034	000000G				.WORD	SW$PM		;++034
     74	000036	000000G				.WORD	SW$PR		;
     75	000040	000000G				.WORD	SW$TR		;
     76
     77						.ENDC
     78
     79		000012 			OPSWN=<.-OPSW>/2		;NUMBER OF OPTIONS
     80	000042				FMTSW:				;
     81
     82						.IF	NDF	R$$11M
     83
     84						.WORD	FMT26		;
     85						.WORD	FMT36		;
     86						.WORD	FMT25		;
     87						.WORD	FMT37		;
     88						.WORD	FMT27		;
     89						.WORD	FMT28		;
     90						.WORD	FMT29		;
     91						.WORD	FMT30		;
     92						.WORD	FMT34		;
     93						.WORD	FMT31		;
     94
     95						.IFF
     96
     97	000042	001363'				.WORD	FMT39		;
     98	000044	001360'				.WORD	FMT38		;
     99	000046	001172'				.WORD	FMT26		;
    100	000050	001167'				.WORD	FMT25		;
    101	000052	001175'				.WORD	FMT28		;
    102	000054	001366'				.WORD	FMT40		;
    103	000056	001200'				.WORD	FMT29		;
    104	000060	001371'				.WORD	FMT41		;++034
    105	000062	001203'				.WORD	FMT30		;
    106	000064	001304'				.WORD	FMT34		;
    107	000066	001206'				.WORD	FMT31		;
    108
    109						.ENDC
    110
    111	000070				SYMBF:	.BLKW	OPSWN*2		;++034 SYMBOL OUTPUT BUFFER
    112	000140				SYMPT:	.BLKW	1		;SYMBOL BUFFER POINTER
    113
    114	000000					.PSECT	MTXT$D,D,GBL
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3-2


    115
    116	000000	   052 	   052 	   052 	FMT1:	.ASCIZ	/*** ROOT SEGMENT: %2R%3N/;
	000003	   040 	   122 	   117
	000006	   117 	   124 	   040
	000011	   123 	   105 	   107
	000014	   115 	   105 	   116
	000017	   124 	   072 	   040
	000022	   045 	   062 	   122
	000025	   045 	   063 	   116
	000030	   000
    117	000031	   045 	   106 	   052 	FMT2:	.ASCIZ	/%F*** SEGMENT: %2R%3N/;
	000034	   052 	   052 	   040
	000037	   123 	   105 	   107
	000042	   115 	   105 	   116
	000045	   124 	   072 	   040
	000050	   045 	   062 	   122
	000053	   045 	   063 	   116
	000056	   000
    118	000057	   122 	   055 	   117 	FMT3:	.ASCIZ	/R-O MEM  LIMITS: %P %P %P%N/;
	000062	   040 	   115 	   105
	000065	   115 	   040 	   040
	000070	   114 	   111 	   115
	000073	   111 	   124 	   123
	000076	   072 	   040 	   045
	000101	   120 	   040 	   045
	000104	   120 	   040 	   045
	000107	   120 	   045 	   116
	000112	   000
    119	000113	   122 	   057 	   127 	FMT4:	.ASCIZ	*R/W MEM  LIMITS: %P %P %P%N*;
	000116	   040 	   115 	   105
	000121	   115 	   040 	   040
	000124	   114 	   111 	   115
	000127	   111 	   124 	   123
	000132	   072 	   040 	   045
	000135	   120 	   040 	   045
	000140	   120 	   040 	   045
	000143	   120 	   045 	   116
	000146	   000
    120	000147	   104 	   111 	   123 	FMT5:	.ASCIZ	/DISK BLK LIMITS: %P %P %P%N/;
	000152	   113 	   040 	   102
	000155	   114 	   113 	   040
	000160	   114 	   111 	   115
	000163	   111 	   124 	   123
	000166	   072 	   040 	   045
	000171	   120 	   040 	   045
	000174	   120 	   040 	   045
	000177	   120 	   045 	   116
	000202	   000
    121	000203	   117 	   104 	   124 	FMT6:	.ASCIZ	/ODT XFR ADDRESS: %P%N/;
	000206	   040 	   130 	   106
	000211	   122 	   040 	   101
	000214	   104 	   104 	   122
	000217	   105 	   123 	   123
	000222	   072 	   040 	   045
	000225	   120 	   045 	   116
	000230	   000
    122	000231	   120 	   122 	   107 	FMT7:	.ASCIZ	/PRG XFR ADDRESS: %P%N/;
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3-3


	000234	   040 	   130 	   106
	000237	   122 	   040 	   101
	000242	   104 	   104 	   122
	000245	   105 	   123 	   123
	000250	   072 	   040 	   045
	000253	   120 	   045 	   116
	000256	   000
    123	000257	   045 	   062 	   116 	FMT8:	.ASCIZ	/%2N*** FILE: %X  TITLE: %2R  IDENT: %2R%N/;
	000262	   052 	   052 	   052
	000265	   040 	   106 	   111
	000270	   114 	   105 	   072
	000273	   040 	   045 	   130
	000276	   040 	   040 	   124
	000301	   111 	   124 	   114
	000304	   105 	   072 	   040
	000307	   045 	   062 	   122
	000312	   040 	   040 	   111
	000315	   104 	   105 	   116
	000320	   124 	   072 	   040
	000323	   045 	   062 	   122
	000326	   045 	   116 	   000
    124	000331	   045 	   116 	   074 	FMT9:	.ASCIZ	/%N<%2R>: %P %P %P%2N/;
	000334	   045 	   062 	   122
	000337	   076 	   072 	   040
	000342	   045 	   120 	   040
	000345	   045 	   120 	   040
	000350	   045 	   120 	   045
	000353	   062 	   116 	   000
    125	000356	   040 	   040 	   040 	FMT10:	.ASCIZ	/    %2R %P%2A%N/;
	000361	   040 	   045 	   062
	000364	   122 	   040 	   045
	000367	   120 	   045 	   062
	000372	   101 	   045 	   116
	000375	   000
    126	000376	   040 	   040 	   040 	FMT11:	.ASCIZ	/    %2R %P%2A  %2R %P%2A%N/;
	000401	   040 	   045 	   062
	000404	   122 	   040 	   045
	000407	   120 	   045 	   062
	000412	   101 	   040 	   040
	000415	   045 	   062 	   122
	000420	   040 	   045 	   120
	000423	   045 	   062 	   101
	000426	   045 	   116 	   000
    127	000431	   040 	   040 	   040 	FMT12:	.ASCII	/    %2R %P%2A  %2R %P%2A  /;
	000434	   040 	   045 	   062
	000437	   122 	   040 	   045
	000442	   120 	   045 	   062
	000445	   101 	   040 	   040
	000450	   045 	   062 	   122
	000453	   040 	   045 	   120
	000456	   045 	   062 	   101
	000461	   040 	   040
    128	000463	   045 	   062 	   122 		.ASCIZ	/%2R %P%2A%N/	;
	000466	   040 	   045 	   120
	000471	   045 	   062 	   101
	000474	   045 	   116 	   000
    129	000477	   040 	   040 	   040 	FMT13:	.ASCII	/    %2R %P%2A  %2R %P%2A  /;
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3-4


	000502	   040 	   045 	   062
	000505	   122 	   040 	   045
	000510	   120 	   045 	   062
	000513	   101 	   040 	   040
	000516	   045 	   062 	   122
	000521	   040 	   045 	   120
	000524	   045 	   062 	   101
	000527	   040 	   040
    130	000531	   045 	   062 	   122 		.ASCIZ	/%2R %P%2A  %2R %P%2A%N/;
	000534	   040 	   045 	   120
	000537	   045 	   062 	   101
	000542	   040 	   040 	   045
	000545	   062 	   122 	   040
	000550	   045 	   120 	   045
	000553	   062 	   101 	   045
	000556	   116 	   000
    131	000560	   040 	   040 		FMT14:	.ASCII	/  /		;
    132	000562	   055 	   122 		FMT15:	.ASCII	/-R/		;
    133	000564	   045 	   106 	   106 	FMT16:	.ASCIZ	/%FFILE %X MEMORY ALLOCATION MAP%N/;
	000567	   111 	   114 	   105
	000572	   040 	   045 	   130
	000575	   040 	   115 	   105
	000600	   115 	   117 	   122
	000603	   131 	   040 	   101
	000606	   114 	   114 	   117
	000611	   103 	   101 	   124
	000614	   111 	   117 	   116
	000617	   040 	   115 	   101
	000622	   120 	   045 	   116
	000625	   000
    134	000626	   124 	   110 	   111 	FMT17:	.ASCIZ	/THIS ALLOCATION WAS DONE ON %Y%N/;
	000631	   123 	   040 	   101
	000634	   114 	   114 	   117
	000637	   103 	   101 	   124
	000642	   111 	   117 	   116
	000645	   040 	   127 	   101
	000650	   123 	   040 	   104
	000653	   117 	   116 	   105
	000656	   040 	   117 	   116
	000661	   040 	   045 	   131
	000664	   045 	   116 	   000
    135	000667	   101 	   124 	   040 	FMT19:	.ASCIZ	/AT %2Z BY TASK BUILDER VERSION %2R%4N/;
	000672	   045 	   062 	   132
	000675	   040 	   102 	   131
	000700	   040 	   124 	   101
	000703	   123 	   113 	   040
	000706	   102 	   125 	   111
	000711	   114 	   104 	   105
	000714	   122 	   040 	   126
	000717	   105 	   122 	   123
	000722	   111 	   117 	   116
	000725	   040 	   045 	   062
	000730	   122 	   045 	   064
	000733	   116 	   000
    136	000735	   123 	   124 	   101 	FMT20:	.ASCIZ	/STACK    LIMITS: %P %P %P%N/;
	000740	   103 	   113 	   040
	000743	   040 	   040 	   040
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3-5


	000746	   114 	   111 	   115
	000751	   111 	   124 	   123
	000754	   072 	   040 	   045
	000757	   120 	   040 	   045
	000762	   120 	   040 	   045
	000765	   120 	   045 	   116
	000770	   000
    137	000771	   045 	   064 	   116 	FMT21:	.ASCII	/%4N************%2N/;
	000774	   052 	   052 	   052
	000777	   052 	   052 	   052
	001002	   052 	   052 	   052
	001005	   052 	   052 	   052
	001010	   045 	   062 	   116
    138	001013	   125 	   116 	   104 		.ASCIZ	/UNDEFINED REFERENCES:%2N/;
	001016	   105 	   106 	   111
	001021	   116 	   105 	   104
	001024	   040 	   122 	   105
	001027	   106 	   105 	   122
	001032	   105 	   116 	   103
	001035	   105 	   123 	   072
	001040	   045 	   062 	   116
	001043	   000
    139	001044	   040 	   040 	   040 	FMT22:	.ASCIZ	/    %2R%N/	;
	001047	   040 	   045 	   062
	001052	   122 	   045 	   116
	001055	   000
    140	001056	   111 	   104 	   105 	FMT23:	.ASCIZ	/IDENTIFICATION : %2R%N/;
	001061	   116 	   124 	   111
	001064	   106 	   111 	   103
	001067	   101 	   124 	   111
	001072	   117 	   116 	   040
	001075	   072 	   040 	   045
	001100	   062 	   122 	   045
	001103	   116 	   000
    141	001105	   124 	   101 	   123 	FMT24:	.ASCII	/TASK ATTRIBUTES: /
	001110	   113 	   040 	   101
	001113	   124 	   124 	   122
	001116	   111 	   102 	   125
	001121	   124 	   105 	   123
	001124	   072 	   040
    142		000012 				.REPT	OPSWN
    143						.ASCII	/%VA/
    144						.ENDR
    145	001164	   045 	   116 	   000 		.ASCIZ	/%N/
    146	001167	   116 	   103 	   054 	FMT25:	.ASCII	/NC,/		;
    147	001172	   106 	   120 	   054 	FMT26:	.ASCII	/FP,/		;
    148
    149						.IF	NDF	R$$11M
    150
    151					FMT27:	.ASCII	/NF,/		;
    152
    153						.ENDC
    154
    155	001175	   104 	   101 	   054 	FMT28:	.ASCII	/DA,/		;
    156	001200	   120 	   111 	   054 	FMT29:	.ASCII	/PI,/		;
    157	001203	   120 	   122 	   054 	FMT30:	.ASCII	/PR,/		;
    158	001206	   040 			FMT31:	.ASCII	/ /		;
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3-6


    159	001207	   045 	   062 	   116 	FMT32:	.ASCIZ	/%2NPROGRAM SECTION ALLOCATION SYNOPSIS:%2N/;
	001212	   120 	   122 	   117
	001215	   107 	   122 	   101
	001220	   115 	   040 	   123
	001223	   105 	   103 	   124
	001226	   111 	   117 	   116
	001231	   040 	   101 	   114
	001234	   114 	   117 	   103
	001237	   101 	   124 	   111
	001242	   117 	   116 	   040
	001245	   123 	   131 	   116
	001250	   117 	   120 	   123
	001253	   111 	   123 	   072
	001256	   045 	   062 	   116
	001261	   000
    160	001262	   074 	   045 	   062 	FMT33:	.ASCIZ	/<%2R>: %P %P %P%N/;
	001265	   122 	   076 	   072
	001270	   040 	   045 	   120
	001273	   040 	   045 	   120
	001276	   040 	   045 	   120
	001301	   045 	   116 	   000
    161	001304	   124 	   122 	   054 	FMT34:	.ASCII	/TR,/		;
    162	001307	   076 	   076 	   076 	FMT35:	.ASCIZ	/>>>>>>>>>>>> UNDEFINED REFERENCE: %2R%2N/;
	001312	   076 	   076 	   076
	001315	   076 	   076 	   076
	001320	   076 	   076 	   076
	001323	   040 	   125 	   116
	001326	   104 	   105 	   106
	001331	   111 	   116 	   105
	001334	   104 	   040 	   122
	001337	   105 	   106 	   105
	001342	   122 	   105 	   116
	001345	   103 	   105 	   072
	001350	   040 	   045 	   062
	001353	   122 	   045 	   062
	001356	   116 	   000
    163
    164						.IF	NDF	R$$11M
    165
    166					FMT36:	.ASCII	/NA,/		;
    167					FMT37:	.ASCII	/ND,/		;
    168
    169						.IFF
    170
    171	001360	   105 	   101 	   054 	FMT38:	.ASCII	/EA,/		;
    172	001363	   101 	   103 	   054 	FMT39:	.ASCII	/AC,/		;
    173	001366	   116 	   110 	   054 	FMT40:	.ASCII	/NH,/		;
    174	001371	   120 	   115 	   054 	FMT41:	.ASCII	/PM,/		;++034
    175
    176						.ENDC
    177
    178
    179						.EVEN
    180
    181	000142					.PSECT
    182
    183					;+
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3-7


    184					; **-$MPELT-MAP ELEMENT
    185					;
    186					; THIS ROUTINE IS CALLED TO WRITE AN ELEMENT NAME INTO THE LOAD
    187					; MAP FILE.
    188					;
    189					; INPUTS:
    190					;
    191					;	$CRELM=ADDRESS OF CURRENT ELEMENT DESCRIPTOR.
    192					;
    193					; OUTPUTS:
    194					;
    195					;	ELEMENT NAME IS WRITTEN INTO THE LOAD MAP FILE.
    196					;-
    197
    198	000142	032767 	000000G	000000G	$MPELT::BIT	#LG$SH,$SWTCH	;SHORT MAP?
    199	000150	001401 				BEQ	10$		;IF EQ NO
    200	000152					RETURN			;
    201	000154				10$:	CALL	MPFSH		;FLUSH SYMBOL BUFFER
    202	000160	016701 	000000G			MOV	$INPPT,R1	;GET INPUT FILE RECORD BLOCK
    203	000164					CALL	MPFIL		;SET UP FILE NAME
    204	000170	016701 	000000G			MOV	$CRELM,R1	;GET ADDRESS OF ELEMENT DESCRIPTOR
    205	000174	016122 	000000G			MOV	E$LMOD(R1),(R2)+;INSERT MODULE NAME
    206	000200	016122 	000002G			MOV	E$LMOD+2(R1),(R2)+;
    207	000204	016122 	000000G			MOV	E$LIDT(R1),(R2)+;INSERT VERSION IDENTIFICATION
    208	000210	016122 	000002G			MOV	E$LIDT+2(R1),(R2)+;
    209	000214	012701 	000257'			MOV	#FMT8,R1	;GET ADDRESS OF FORMAT
    210	000220	000434 				BR	MPHDG1		;
    211
    212					;+
    213					; **-$MPHDG-MAP HEADING
    214					;
    215					; THIS ROUTINE IS CALLED TO WRITE A HEADING INTO THE LOAD MAP FILE.
    216					;
    217					; INPUTS:
    218					;
    219					;	$TSKPT=ADDRESS OF TASK IMAGE FILE RECORD BLOCK.
    220					;
    221					; OUTPUTS:
    222					;
    223					;	MAP HEADING IS WRITTEN INTO THE LOAD MAP FILE.
    224					;-
    225
    226	000222	012702 	000070'		$MPHDG::MOV	#SYMBF,R2	;GET ADDRESS OF SYMBOL BUFFER
    227	000226					CALL	MPTSK		; SETUP TASK NAME
    228	000232	012701 	000564'			MOV	#FMT16,R1	;GET ADDRESS OF FORMAT
    229	000236					CALL	MPOUT		;OUTPUT FIRST LINE OF HEADING
    230	000242	012702 	000000G			MOV	#$BLTIM,R2	;++036 GET ADDRESS OF TIME BUFFER               ;**NEW**
    231	000246					GTIM$S	R2		;GET TIME PARAMETERS                            ;**-2
    232	000256	012701 	000626'			MOV	#FMT17,R1	;GET ADDRESS OF FORMAT
    233	000262					CALL	MPOUT1		;OUTPUT SECOND LINE OF HEADING
    234	000266	016722 	000006G			MOV	$BLTIM+6,(R2)+	;++036 GET HOUR OF DAY                          ;**NEW**
    235	000272	016722 	000010G			MOV	$BLTIM+10,(R2)+	;++036 GET MINUTE OF HOUR                       ;**NEW**
    236	000276	016722 	000000G			MOV	$VERSN,(R2)+	;++039 SET VERSION NUMBER
    237	000302	016722 	000002G			MOV	$VERSN+2,(R2)+	;++039 ...
    238	000306	012701 	000667'			MOV	#FMT19,R1	;GET ADDRESS OF FORMAT
    239	000312	000167 	001252 		MPHDG1:	JMP	MPOUT		;
    240
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3-8


    241					;+
    242					; **-$MPSCT-MAP SECTION
    243					;
    244					; THIS ROUTINE IS CALLED TO WRITE A SECTION NAME INTO THE LOAD
    245					; MAP FILE.
    246					;
    247					; INPUTS:
    248					;
    249					;	R0=ADDRESS OF SECTION TABLE ENTRY.
    250					;	R1=ADDRESS OF GSD ENTRY.
    251					;
    252					; OUTPUTS:
    253					;
    254					;	SECTION NAME IS WRITTEN INTO THE LOAD MAP FILE.
    255					;
    256					;	**NOTE**
    257					;
    258					; PAGE BUFFER CONTAINING SYMBOL MAY BE DISPLACED
    259					;
    260					;-
    261
    262	000316	032767 	000000G	000000G	$MPSCT::BIT	#LG$SH,$SWTCH	;SHORT MAP?
    263	000324	001052 				BNE	30$		;IF NE YES
    264	000326	010146 				MOV	R1,-(SP)	; SAVE ADDRESS OF GSD ENTRY
    265	000330	010046 				MOV	R0,-(SP)	; SAVE SECTION ENTRY ADDRESS
    266	000332					CALL	MPFSH		; FLUSH SMBOL BUFFER
    267	000336	011600 				MOV	(SP),R0		; RETRIEVE ENTRY ADDRESS
    268	000340	010216 				MOV	R2,(SP)		; SAVE BUFFER ADDRESS
    269	000342	132760 	000000G	000000G		BITB	#CS$IND,C$SFLG(R0);INDIRECT ENTRY?
    270	000350	001404 				BEQ	10$		;IF EQ NO
    271	000352	016001 	000000G			MOV	C$SBSE(R0),R1	; GET VIRTUAL ADDRESS OF REAL ENTRY
    272	000356					CALL	$CVRL		; CONVERT TO READ ADDRESS
    273	000362				10$:				;
    274	000362	012602 				MOV	(SP)+,R2	; RETRIEVE ADDRESS OF BUFFER
    275	000364	012601 				MOV	(SP)+,R1	; RETRIEVE ADDRESS OF GSD ENTRY
    276	000366					CALL	MPCHK		; CHECK SECTION NAME
    277	000372	016012 	000000G			MOV	C$SCUR(R0),(R2)	;GET CURRENT SECTION BASE
    278	000376	012222 				MOV	(R2)+,(R2)+	;COPY SECTION BASE ADDRESS
    279	000400	016112 	000000G			MOV	C$SBSE(R1),(R2)	;INSERT LENGTH OF SECTION
    280	000404					CALL	MPCAL		;CALCULATE ENDING ADDRESS AND RELOCATE
    281	000410	012701 	000331'			MOV	#FMT9,R1	;GET ADDRESS OF FORMAT
    282	000414	026767 	000000G	177446 		CMP	$ABSNM,SYMBF	;ABS SECTION?
    283	000422	001411 				BEQ	20$		;IF EQ YES
    284	000424	026727 	177440 			CMP	SYMBF,(PC)+	;BLANK CONTROL SECTION?
    285	000430	127402 				.RAD50	/. B/		;
    286	000432	001003 				BNE	15$		;IF NE NO
    287	000434	005767 	177440 			TST	SYMBF+10	;ZERO LENGTH?
    288	000440	001402 				BEQ	20$		;IF EQ YES
    289	000442	000167 	001122 		15$:	JMP	MPOUT		;OUTPUT SECTION NAME
    290	000446	105267 	177333 		20$:	INCB	$MPFLG+1	;SET ABS SECTION WAITING FLAG
    291	000452				30$:	RETURN			;
    292
    293					;+
    294					; **-$MPSEG-MAP SEGMENT
    295					;
    296					; THIS ROUTINE IS CALLED TO WRITE A SEGMENT NAME INTO THE LOAD
    297					; MAP FILE.
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3-9


    298					;
    299					; INPUTS:
    300					;
    301					;	$CRSEG=ADDRESS OF CURRENT SEGMENT DESCRIPTOR.
    302					;
    303					; OUTPUTS:
    304					;
    305					;	SEGMENT NAME IS WRITTEN INTO THE LOAD MAP FILE.
    306					;-
    307
    308	000454				$MPSEG::SAVRG			;SAVE NONVOLITILE REGISTERS
    309	000460					CALL	MPFSH		;FLUSH SYMBOL BUFFER
    310	000464	016700 	000000G			MOV	$CRSEG,R0	;GET ADDRESS OF CURRENT SEGMENT
    311	000470	016022 	000000G			MOV	S$GNME(R0),(R2)+;INSERT SEGMENT NAME
    312	000474	016012 	000002G			MOV	S$GNME+2(R0),(R2);
    313	000500	012701 	000031'			MOV	#FMT2,R1	; GET ADDRESS OF FORMAT
    314	000504	026767 	000000G	000000G		CMP	$CRVSG,$RTSEG	; CURRENT ROOT?
    315	000512	001005 				BNE	10$		; IF NE NO
    316	000514	012701 	000000'			MOV	#FMT1,R1	; GET ALTERNATE FORMAT ADDRESS
    317	000520	016767 	000000G	000000G		MOV	$OFFST,$BEGRW	; SET BEGINNING OF RW MEMORY
    318	000526				10$:	CALL	MPOUT		;OUTPUT SEGMENT NAME
    319	000532	012701 	000113'			MOV	#FMT4,R1	; GET ADDRESS OF FORMAT
    320	000536	016722 	000000G			MOV	$BEGRW,(R2)+	;INSERT BEGINNING OF RW AREA
    321	000542	016712 	000000G			MOV	$ENDRW,(R2)	;INSERT END OF RW AREA
    322	000546	021262 	177776 			CMP	(R2),-2(R2)	;++021 ANY LENGTH ?
    323	000552	001005 				BNE	15$		;++021 IF NE YES
    324	000554	005722 				TST	(R2)+		;++021 POINT TO LENGTH
    325	000556	005012 				CLR	(R2)		;++021 CLEAR LENGTH
    326	000560					CALL	MPOUT		;++021 OUTPUT CORE LIMITS
    327	000564	000402 				BR	17$		;++021
    328	000566				15$:				;++021
    329	000566					CALL	MPEDT		;++021 OUTPUT CORE LIMITS
    330	000572				17$:				;
    331	000572	026767 	000000G	000000G		CMP	$CRVSG,$RTSEG	; CURRENT ROOT?
    332	000600	001034 				BNE	25$		;IF NE NO
    333	000602	026767 	000000G	000000G		CMP	$ENDRO,$ENDRW	; ANY RO AREA
    334	000610	001410 				BEQ	20$		;IF EQ NO
    335	000612	016722 	000000G			MOV	$BEGRO,(R2)+	;INSERT BEGINNING OF RO AREA
    336	000616	016712 	000000G			MOV	$ENDRO,(R2)	;
    337	000622	012701 	000057'			MOV	#FMT3,R1	;GET ADDRESS OF FORMAT
    338	000626					CALL	MPEDT		;OUTPUT RO CORE LIMITS
    339	000632	005767 	000000G		20$:	TST	$STACK		;ANY STACK SPECIFIED?
    340	000636	001415 				BEQ	25$		;IF EQ NO
    341	000640	016712 	000000G			MOV	$BEGRW,(R2)	;SET BASE ADDRESS OF STACK
    342	000644	066712 	000000G			.IIF   DF  R$$11M, ADD	$HDSIZ,(R2)	; INCLUDE HEADER
    343	000650	012212 				MOV	(R2)+,(R2)	;COPY BASE ADDRESS
    344	000652	005322 				DEC	(R2)+		;BACK OFF BY ONE
    345	000654	016712 	000000G			MOV	$STACK,(R2)	;SET LENGTH OF STACK
    346	000660	061242 				ADD	(R2),-(R2)	;ADD LENGTH TO ENDING ADDRESS
    347	000662	012701 	000735'			MOV	#FMT20,R1	;GET ADDRESS OF FORMAT
    348	000666					CALL	MPOUT		;OUTPUT STACK LIMITS
    349	000672	032767 	000000G	000000G	25$:	BIT	#TS$KF,$SWTCH	;TASK IMAGE FILE SPECIFIED?
    350	000700	001434 				BEQ	30$		;IF EQ NO
    351	000702	012746 	001500'			MOV	#MPEDT,-(SP)	;++021 PUSH ADDRESS OF OUTPUT ROUTINE
    352	000706	016701 	000000G			MOV	$CRSEG,R1	;GET ADDRESS OF CURRENT SEGMENT
    353	000712	016112 	000000G			MOV	S$GBLK(R1),(R2)	;INSERT STARTING DISK BLOCK NUMBER
    354	000716	012212 				MOV	(R2)+,(R2)	;COPY BLOCK NUMBER
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3-10


    355	000720	016100 	000000G			MOV	S$GRW(R1),R0	;GET LENGTH OF RW AREA
    356	000724	066100 	000000G			ADD	S$GRO(R1),R0	;ADD LENGTH OF RO AREA
    357	000730	000241 				CLC			;CLEAR CARRY FOR DIVIDE BY 2
    358	000732	001005 				BNE	27$		;++021 IF NE SEGMENT HAS LENGTH
    359	000734	012716 	001570'			MOV	#MPOUT,(SP)	;++021 REPLACE ADDRESS OF FORMATTER
    360	000740	005722 				TST	(R2)+		;++021 POINT TO LENGTH
    361	000742	005012 				CLR	(R2)		;++021 CLEAR LENGTH
    362	000744	000407 				BR	28$		;++021 OUTPUT DISK BLOCK LIMITS
    363	000746				27$:				;++021
    364	000746	006000 				ROR	R0		;CONVERT LENGTH TO WORDS
    365	000750	062700 	000377 			ADD	#377,R0		;ROUND TO NEXT BLOCK
    366	000754	105000 				CLRB	R0		;CLEAR LOW BYTE
    367	000756	000300 				SWAB	R0		;DIVIDE BY 256. WORDS
    368	000760	005300 				DEC	R0		;BACK OFF BY ONE
    369	000762	060012 				ADD	R0,(R2)		;CALCULATE ENDING BLOCK NUMBER
    370	000764				28$:				;
    371	000764	012701 	000147'			MOV	#FMT5,R1	;GET ADDRESS OF FORAMT
    372	000770					CALL	@(SP)+		;++021 CALL EDIT ROUTINE
    373	000772				30$:				;
    374	000772	026767 	000000G	000000G		CMP	$CRVSG,$RTSEG	; CURRENT ROOT?
    375	001000	001113 				BNE	100$		;IF NE NO
    376	001002	012702 	000000G			MOV	#$IDENT,R2	;GET ADDR OF PROGRAM IDENTIFICATION
    377	001006	012701 	001056'			MOV	#FMT23,R1	;GET ADDRESS OF FORMAT
    378	001012					CALL	MPOUT1		;OUTPUT PRG IDENTIFICATION
    379	001016	012702 	000000G			MOV	#$ODTAD,R2	;GET ODT VECTOR ADDRESS
    380	001022	022712 	000001 			CMP	#1,(R2)		;ODT SPECIFIED?
    381	001026	001404 				BEQ	40$		;IF EQ NO
    382	001030	012701 	000203'			MOV	#FMT6,R1	;GET ADDRESS OF FORMAT
    383	001034					CALL	MPOUT1		;OUTPUT ODT TRANSFER ADDRESS
    384	001040	012702 	000000G		40$:	MOV	#$XFRAD,R2	;GET PRG VECTOR ADDRESS
    385	001044	022712 	000001 			CMP	#1,(R2)		;PRG SPECIFIED?
    386	001050	001404 				BEQ	50$		;IF EQ NO
    387	001052	012701 	000231'			MOV	#FMT7,R1	;GET ADDRESS OF FORMAT
    388	001056					CALL	MPOUT1		;OUTPUT PRG XFR ADDRESS
    389	001062				50$:				;
    390	001062	016701 	000000G			MOV	$TSKNM,R1	; GET ADDRESS OF TASK NAME BLOCK
    391	001066	001405 				BEQ	51$		; IF EQ NO TASK FILE
    392	001070					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    393	001074	016001 	000000G			MOV	E$LSWT(R0),R1	; GET TASK FILE SWITCH WORD
    394	001100	000411 				BR	52$		;
    395	001102				51$:				;
    396	001102	016701 	000000G			MOV	$STBNM,R1	; GET ADDRESS OF STB FILE NAME BLOCK
    397	001106	001450 				BEQ	100$		; IF EQ NO STB FILE
    398	001110					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    399	001114	016001 	000000G			MOV	E$LSWT(R0),R1	; GET STB FILE SWITCH WORD
    400	001120	042701 	000000C			BIC	#^C<SW$PI!SW$NH>,R1 ; ISOLATE /PI, /NH SWITCHES
    401	001124				52$:				;
    402	001124	001441 				BEQ	100$		; IF EQ NO OPTIONS SELECTED
    403	001126	012705 	000016'			MOV	#OPSW,R5	;GET ADDRESS OF SWITCH VECTOR
    404	001132	012704 	000042'			MOV	#FMTSW,R4	;GET ADDRESS OF FORMAT VECTOR
    405	001136	012703 	000012 			MOV	#OPSWN,R3	;GET REPEAT COUNT
    406	001142	012702 	000070'			MOV	#SYMBF,R2	;GET ADDRESS OF SYMBOL BUFFER
    407
    408						.IF	DF	R$$11M
    409
    410	001146	032701 	000000G			BIT	#SW$AC,R1	;++021 'ACP' TASK
    411	001152	001402 				BEQ	60$		;++021 IF EQ NO
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3-11


    412	001154	052701 	000000G			BIS	#SW$PR,R1	;++021 SET '/PR' SWITCH
    413
    414						.ENDC
    415
    416	001160	032501 			60$:	BIT	(R5)+,R1	;OPTION SELECTED?
    417	001162	001403 				BEQ	70$		;IF EQ NO
    418	001164	012722 	000003 			MOV	#3,(R2)+	;SET COUNT WORD
    419	001170	011422 				MOV	(R4),(R2)+	;SET ADDRESS OF FORMAT
    420	001172	005724 			70$:	TST	(R4)+		;ADJUST TO NEXT FORMAT
    421	001174					SOB	R3,60$		;REPEAT
    422	001200	005362 	177774 			DEC	-4(R2)		;DECREMENT COUNT OF LAST
    423	001204	012701 	001105'			MOV	#FMT24,R1	;GET ADDRESS OF FORMAT
    424	001210	020227 	000140'		80$:	CMP	R2,#SYMBF+<2*2*OPSWN>;FILL BUFFER YET?
    425	001214	103003 				BHIS	90$		;IF HIS YES
    426	001216	005022 				CLR	(R2)+		;CLEAR COUNT
    427	001220	011422 				MOV	(R4),(R2)+	;SET ADDRESS OF FORMAT
    428	001222	000772 				BR	80$		;GO AGAIN
    429	001224				90$:	CALL	MPOUT		;OUTPUT OPTIONS
    430	001230	012701 	001207'		100$:	MOV	#FMT32,R1	;GET ADDRESS OF FORMAT
    431	001234					CALL	MPOUT		;OUTPUT SYNOPSIS HEADING
    432	001240	016700 	000000G			MOV	$CRSEG,R0	;GET ADDRESS OF CURRENT SEGMENT
    433	001244	032767 	000000G	000000G		BIT	#SE$QA,$SWTCH	;SEQUENCE ALLOCATION?
    434	001252	001404 				BEQ	105$		;IF EQ NO
    435	001254	062700 	000000G			ADD	#S$GSEQ,R0	;POINT TO SEQUENCE LISTHEAD
    436	001260	010046 				MOV	R0,-(SP)	;SET ADDRESS OF FIRST LINK WORD
    437	001262	000404 				BR	110$		;
    438	001264	062700 	000000G		105$:	ADD	#S$GCST,R0	;POINT TO SECTION TABLE
    439	001270	012746 	000000G			MOV	#$ISED,-(SP)	;SET ADDRESS OF SYMBOL EDIT ROUTINE
    440	001274	032767 	000000G	000000G	110$:	BIT	#SE$QA,$SWTCH	;SEQUENCE ALLOCATION?
    441	001302	001410 				BEQ	120$		;IF EQ NO
    442	001304	013600 				MOV	@(SP)+,R0	;GET ADDRESS OF NEXT ENTRY
    443	001306	001434 				BEQ	140$		;IF EQ DONE
    444	001310	010046 				MOV	R0,-(SP)	;SET ADDRESS OF NEXT LINK WORD
    445	001312	016001 	000002 			MOV	2(R0),R1	; GET VA OF SECTION TABLE ENTRY
    446	001316					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    447	001322	000402 				BR	130$		;
    448	001324				120$:	CALL	@(SP)+		;GET NEXT SYMBOL
    449	001326	103424 				BCS	140$		;IF CS DONE
    450	001330	132760 	000000G	000000G	130$:	BITB	#CS$IND,C$SFLG(R0);INDIRECT REFERENCE?
    451	001336	001356 				BNE	110$		;IF NE YES
    452	001340	012702 	000070'			MOV	#SYMBF,R2	;GET ADDRESS OF SYMBOL BUFFER
    453	001344					CALL	MPCHK		;CHECK SECTION NAME
    454	001350	016012 	000000G			MOV	C$SBSE(R0),(R2)	;SET BASE ADDRESS OF SECTION
    455	001354	012222 				MOV	(R2)+,(R2)+	;COPY BASE ADDRESS
    456	001356	016012 	000000G			MOV	C$SLTH(R0),(R2)	;SET LENGTH OF SECTION
    457	001362					CALL	MPCAL		;CALCULATE ENDING ADDRESS AND RELOCATE
    458	001366	012701 	001262'			MOV	#FMT33,R1	;GET ADDRESS OF FORMAT
    459	001372					CALL	MPOUT		;OUTPUT SECTION INFO
    460	001376	000736 				BR	110$		;GO AGAIN
    461	001400				140$:	RETURN			;
    462
    463					;
    464					; CALCULATE ENDING ADDRESS AND RELOCATE
    465					;
    466
    467	001402	001402 			MPCAL:	BEQ	10$		;IF EQ ZERO LENGTH
    468	001404	061242 				ADD	(R2),-(R2)	;ADD LENGTH TO BASE ADDRESS
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3-12


    469	001406	005322 				DEC	(R2)+		;BACK OFF TO REAL ENDING ADDRESS
    470	001410	132760 	000000G	000000G	10$:	BITB	#CS$REL,C$SFLG(R0);ABS SECTION?
    471	001416	001410 				BEQ	20$		;IF EQ YES
    472	001420	132760 	000000G	000000G		BITB	#CS$LIB,C$SFLG(R0);LIB SECTION?
    473	001426	001004 				BNE	20$		;IF NE YES
    474	001430	066742 	000000G			ADD	$OFFST,-(R2)	;RELOCATE ENDING ADDRESS
    475	001434	066742 	000000G			ADD	$OFFST,-(R2)	;RELOCATE BASE ADDRESS
    476	001440				20$:	RETURN			;
    477
    478					;
    479					; CHECK FOR BLANK SECTION NAME
    480					;
    481
    482	001442	016022 	000000G		MPCHK:	MOV	S$YM(R0),(R2)+	;INSERT FIRST HALF OF SYMBOL
    483	001446	016022 	000002G			MOV	S$YM+2(R0),(R2)+;INSERT SECOND HALF OF SYMBOL
    484	001452	001011 				BNE	10$		;IF NE SECOND HALF NONZERO
    485	001454	005762 	177774 			TST	-4(R2)		;TEST FIRST HALF
    486	001460	001006 				BNE	10$		;IF NE LEAVE AS IS
    487	001462	016762 	176312 	177774 		MOV	BLKNM,-4(R2)	;SET DEFAULT BLANK SECTION NAME
    488	001470	016762 	176306 	177776 		MOV	BLKNM+2,-2(R2)	;
    489	001476				10$:	RETURN			;
    490
    491					;
    492					; EDIT SIZE
    493					;
    494
    495	001500	012212 			MPEDT:	MOV	(R2)+,(R2)	;COPY ENDING ADDRESS
    496	001502	166212 	177774 			SUB	-4(R2),(R2)	;SUBTRACT STARTING ADDRESS
    497	001506	005212 				INC	(R2)		;INCREMENT TO MAKE LENGTH
    498	001510	000427 				BR	MPOUT		;
    499
    500					;
    501					; SET UP FILE NAME IN BUFFER
    502					;
    503
    504	001512	062701 	000102 		MPFIL:	ADD	#F.FNB,R1	;POINT TO FILE NAME BLOCK
    505	001516	016122 	000006 			MOV	N.FNAM(R1),(R2)+;SET FILENAME
    506	001522	016122 	000010 			MOV	N.FNAM+2(R1),(R2)+;
    507	001526	016122 	000012 			MOV	N.FNAM+4(R1),(R2)+;
    508	001532	016122 	000014 			MOV	N.FTYP(R1),(R2)+;SET FILE TYPE
    509	001536	016122 	000016 			MOV	N.FVER(R1),(R2)+;SET FILE VERSION
    510	001542					RETURN			;
    511
    512					;
    513					; FLUSH SYMBOL BUFFER
    514					;
    515
    516	001544	012702 	000070'		MPFSH:	MOV	#SYMBF,R2	;ASSUME BUFFER EMPTY
    517	001550	116701 	176230 			MOVB	$MPFLG,R1	;GET BUFFER FLAG VALUE
    518	001554	001003 				BNE	10$		;IF NE BUFFER FULL
    519	001556	005067 	176222 			CLR	$MPFLG		;MAKE SURE FLAG IS CLEAR
    520	001562					RETURN			;
    521	001564	016101 	000004'		10$:	MOV	FMTVCT-2(R1),R1	;GET ADDRESS OF FORMAT
    522
    523					;
    524					; MAP OUTPUT ROUTINE
    525					;
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3-13


    526
    527	001570	012702 	000070'		MPOUT:	MOV	#SYMBF,R2	;GET ADDRESS OF ARGUMENT BLOCK
    528	001574	012700 	000000G		MPOUT1:	MOV	#$OUTBF,R0	;GET ADDRESS OF OUTPUT BUFFER
    529	001600					CALL	$EDMSG		;EDIT OUTPUT MESSAGE
    530	001604	016700 	000000G			MOV	$MAPPT,R0	;GET MAP FILE RECORD BLOCK
    531	001610					PUT$S	R0,#$OUTBF,R1	; OUTPUT RECORD
    532	001626	103006 				BCC	30$		;IF CC OKAY
    533	001630	016002 	000000G			MOV	R$NAME(R0),R2	;GET ADDRESS OF NAME STRING
    534	001634	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
    535	001636	   000G	   000G			.BYTE	E$R25,S$V2	;FATAL-NO RETURN
    536	001640					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    537	001644	005067 	176134 		30$:	CLR	$MPFLG		;SET MAP FLAG TO "FALSE"
    538	001650	012702 	000070'			MOV	#SYMBF,R2	;RETURN ADDRESS OF SYMBOL BUFFER
    539	001654					RETURN			;
    540
    541					;
    542					; SETUP TASK NAME IN BUFFER
    543					;
    544
    545	001656				MPTSK:				;
    546	001656	010246 				MOV	R2,-(SP)	; SAVE PARAMETER BLOCK ADDRESS
    547	001660	016701 	000000G			MOV	$TSKNM,R1	; GET ADDRESS OF TASK NAME BLOCK
    548	001664	001413 				BEQ	10$		; IF EQ NO TASK FILE
    549	001666					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    550	001672	062700 	000004G			ADD	#E$LMND+4,R0	; STEP PAST DEVICE AND UNIT
    551	001676	011602 				MOV	(SP),R2		; RESTORE PARAMETER BLOCK ADDRESS
    552	001700	012022 				MOV	(R0)+,(R2)+	; SETUP FILE NAME
    553	001702	012022 				MOV	(R0)+,(R2)+	;
    554	001704	012022 				MOV	(R0)+,(R2)+	;
    555	001706	012022 				MOV	(R0)+,(R2)+	; SETUP FILE TYPE
    556	001710	012022 				MOV	(R0)+,(R2)+	; SETUP FILE VERSION NUMBER
    557	001712	000405 				BR	30$		;
    558	001714				10$:				;
    559	001714	012701 	000005 			MOV	#5,R1		; SET LOOP COUNT
    560	001720				20$:				;
    561	001720	005022 				CLR	(R2)+		; CLEAR TASK FILE NAME
    562	001722					SOB	R1,20$		;
    563	001726				30$:				;
    564	001726	005726 				TST	(SP)+		; CLEAN STACK
    565	001730					RETURN			;
    566
    567					;+
    568					; **-$MPSYM-MAP SYMBOL
    569					;
    570					; THIS ROUTINE IS CALLED TO WRITE A SYMBOL NAME INTO THE LOAD
    571					; MAP FILE.
    572					;
    573					; INPUTS:
    574					;
    575					;	R0=ADDRESS OF SYMBOL DESCRIPTOR.
    576					;
    577					; OUTPUTS:
    578					;
    579					;	SYMBOL IS WRITTEN INTO THE LOAD MAP FILE.
    580					;-
    581
    582	001732	032767 	000000G	000000G	$MPSYM::BIT	#LG$SH,$SWTCH	;SHORT MAP?
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3-14


    583	001740	001066 				BNE	30$		;IF NE YES
    584	001742	012701 	000331'			MOV	#FMT9,R1	;GET ADDRESS OF FORMAT
    585	001746	105767 	176033 			TSTB	$MPFLG+1	;ABS SECTION WAITING?
    586	001752	001404 				BEQ	5$		;IF EQ NO
    587	001754	010046 				MOV	R0,-(SP)	;SAVE SYMBOL DESCRIPTOR ADDRESS
    588	001756					CALL	MPOUT		;OUTPUT SECTION NAME
    589	001762	012600 				MOV	(SP)+,R0	;RETRIEVE SYMBOL DESCRIPTOR ADDRESS
    590	001764	012702 	000070'		5$:	MOV	#SYMBF,R2	;ASSUME BUFFER EMPTY
    591	001770	005767 	176010 			TST	$MPFLG		;ANYTHING IN BUFFER?
    592	001774	001402 				BEQ	10$		;IF EQ NO
    593	001776	016702 	176136 			MOV	SYMPT,R2	;GET CURRENT BUFFER POINTER
    594	002002	016022 	000000G		10$:	MOV	S$YM(R0),(R2)+	;INSERT SYMBOL NAME
    595	002006	016022 	000002G			MOV	S$YM+2(R0),(R2)+;
    596	002012	016022 	000000G			MOV	S$YVAL(R0),(R2)+;INSERT SYMBOL VALUE
    597	002016	012722 	000560'			MOV	#FMT14,(R2)+	;ASSUME ABS SYMBOL
    598	002022	016001 	000000G			MOV	S$YCMT(R0),R1	;GET SECTION ENTRY ADDRESS
    599	002026	010246 				MOV	R2,-(SP)	; SAVE BUFFER POINTER
    600	002030					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    601	002034	012602 				MOV	(SP)+,R2	; RESTORE POINTER
    602	002036	132760 	000000G	000000G		BITB	#CS$REL,C$SFLG(R0) ; ABS SECTION?
    603	002044	001412 				BEQ	20$		;IF EQ YES
    604	002046	012742 	000562'			MOV	#FMT15,-(R2)	;SET REL SUFFIX POINTER
    605	002052	132760 	000000G	000000G		BITB	#CS$LIB,C$SFLG(R0) ; LIB. SECTION?
    606	002060	001003 				BNE	15$		;IF NE YES
    607	002062	066742 	000000G			ADD	$OFFST,-(R2)	;ADD OFFSET BIAS
    608	002066	005722 				TST	(R2)+		;ADJUST R2
    609	002070	005722 			15$:	TST	(R2)+		;ADJUST R2
    610	002072	062767 	000002 	175704 	20$:	ADD	#2,$MPFLG	;UPDATE MAP BUFFER FLAG
    611	002100	010267 	176034 			MOV	R2,SYMPT	;SET NEW BUFFER POINTER
    612	002104	020227 	000130'			CMP	R2,#SYMBF+32.	;END OF BUFFER?
    613	002110	103402 				BLO	30$		;IF LO NO
    614	002112					CALL	MPFSH		;FLUSH SYMBOL BUFFER
    615	002116				30$:	RETURN			;
    616
    617					;+
    618					; **-$MPUND-MAP UNDEFINED SYMBOLS
    619					;
    620					; THIS ROUTINE IS CALLED AT THE END OF THE PHASE 5 PROCESSING OF A SEG-
    621					; MENT TO OUTPUT A LIST OF UNDEFINED SYMBOLS IF ANY EXIST.
    622					;
    623					; INPUTS:
    624					;
    625					;	$CRSEG=ADDRESS OF CURRENT SEGMENT DESCRIPTOR.
    626					;
    627					; OUTPUTS:
    628					;
    629					;	LIST OF UNDEFINED SYMBOLS IS WRITTEN INTO THE LOAD MAP FILE.
    630					;-
    631
    632	002120				$MPUND::CALL	MPFSH		;FLUSH SYMBOL BUFFER
    633	002124	016700 	000000G			MOV	$CRSEG,R0	;GET ADDRESS OF CURRENT SEGMENT
    634	002130	005760 	000000G			TST	S$GUND(R0)	;ANY UNDEFINED SYMBOLS?
    635	002134	001433 				BEQ	20$		;IF EQ NONE
    636	002136	012701 	000771'			MOV	#FMT21,R1	;GET ADDRESS OF FORMAT
    637	002142					CALL	MPOUT		;OUTPUT HEADING
    638	002146	016700 	000000G			MOV	$CRSEG,R0	;GET ADDRESS OF CURRENT SEGMENT
    639	002152	062700 	000000G			ADD	#S$GSTB,R0	;POINT TO SYMBOL TABLE
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3-15


    640	002156	012746 	000000G			MOV	#$ISED,-(SP)	;SET ADDRESS OF SYMBOL EDIT ROUTINE
    641	002162				10$:	CALL	@(SP)+		;GET NEXT SYMBOL
    642	002164	103417 				BCS	20$		;IF CS DONE
    643	002166	132760 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R0);SYMBOL DEFINED?
    644	002174	001372 				BNE	10$		;IF NE YES-BYPASS
    645	002176	016067 	000000G	175664 		MOV	S$YM(R0),SYMBF	;SET SYMBOL NAME
    646	002204	016067 	000002G	175660 		MOV	S$YM+2(R0),SYMBF+2;
    647	002212	012701 	001044'			MOV	#FMT22,R1	;GET ADDRESS OF FORMAT
    648	002216					CALL	MPOUT		;OUTPUT SYMBOL
    649	002222	000757 				BR	10$		;GO AGAIN
    650	002224				20$:	RETURN			;
    651
    652					;+
    653					; **-$MPUSY-UNDEFINED SYMBOL REFERENCE
    654					;
    655					; THIS ROUTINE IS CALLED TO OUTPUT AN UNDEFINED SYMBOL REFERENCE FOR
    656					; A MODULE.
    657					;
    658					; INPUTS:
    659					;
    660					; 	R0=ADDRESS OF SYMBOL DESCRIPTOR.
    661					;
    662					; OUTPUTS:
    663					;
    664					;	UNDEFINED SYMBOL REFERENCE IS WRITTEN INTO MAP FILE.
    665					;-
    666
    667	002226	010046 			$MPUSY::MOV	R0,-(SP)	;SAVE ENTRY ADDRESS
    668	002230	012701 	000331'			MOV	#FMT9,R1	;GET ADDRESS OF FORMAT
    669	002234	105767 	175545 			TSTB	$MPFLG+1	;ABS SECTION WAITING?
    670	002240	001402 				BEQ	10$		;IF EQ NO
    671	002242					CALL	MPOUT		;OUTPUT SECTION NAME
    672	002246				10$:	CALL	MPFSH		;FLUSH ANY SYMBOLS IN BUFFER
    673	002252	012600 				MOV	(SP)+,R0	;RETRIEVE ENTRY ADDRESS
    674	002254	016022 	000000G			MOV	S$YM(R0),(R2)+	;INSERT SYMBOL NAME
    675	002260	016012 	000002G			MOV	S$YM+2(R0),(R2)	;
    676	002264	012701 	001307'			MOV	#FMT35,R1	;GET ADDRESS OF FORMAT
    677	002270					CALL	MPOUT		;OUTPUT UNDEFINED SYMBOL REFERENCE
    678	002274					RETURN			;
    679
    680		000001 				.END
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3-16
SYMBOL TABLE

BLKNM   000000R  	FMT16   000564R     002	F.EOBB= 000032   	NB.SD2= 001000   	S.FATT= 000016
B.BBFS= 000010   	FMT17   000626R     002	F.ERR = 000052   	NB.SNM= 000040   	S.FDB = 000140
B.BFST= 000015   	FMT19   000667R     002	F.FACC= 000043   	NB.STP= 000020   	S.FNAM= 000006
B.NXBD= 000012   	FMT2    000031R     002	F.FFBY= 000014   	NB.SVR= 000010   	S.FNB = 000036
B.VBN = 000004   	FMT20   000735R     002	F.FNAM= 000110   	NB.TYP= 000002   	S.FNBW= 000017
CR    = 000015   	FMT21   000771R     002	F.FNB = 000102   	NB.VER= 000001   	S.FNTY= 000004
CS$IND= ****** GX	FMT22   001044R     002	F.FTYP= 000116   	N.DID = 000024   	S.FTYP= 000002
CS$LIB= ****** GX	FMT23   001056R     002	F.FVER= 000120   	N.DVNM= 000032   	S.NFEN= 000020
CS$REL= ****** GX	FMT24   001105R     002	F.HIBK= 000004   	N.FID = 000000   	TS$KF = ****** GX
C$SBSE= ****** GX	FMT25   001167R     002	F.LUN = 000042   	N.FNAM= 000006   	VT    = 000013
C$SCUR= ****** GX	FMT26   001172R     002	F.MBCT= 000054   	N.FTYP= 000014   	$ABSNM= ****** GX
C$SFLG= ****** GX	FMT28   001175R     002	F.MBC1= 000055   	N.FVER= 000016   	$BEGRO= ****** GX
C$SLTH= ****** GX	FMT29   001200R     002	F.MBFG= 000056   	N.NEXT= 000022   	$BEGRW= ****** GX
E$LIDT= ****** GX	FMT3    000057R     002	F.NRBD= 000024   	N.STAT= 000020   	$BLTIM= ****** GX
E$LMND= ****** GX	FMT30   001203R     002	F.NREC= 000030   	N.UNIT= 000034   	$CRELM= ****** GX
E$LMOD= ****** GX	FMT31   001206R     002	F.OVBS= 000030   	OPSW    000016R  	$CRSEG= ****** GX
E$LSWT= ****** GX	FMT32   001207R     002	F.RACC= 000016   	OPSWN = 000012   	$CRVSG= ****** GX
E$R25 = ****** GX	FMT33   001262R     002	F.RATT= 000001   	PAR$$$= 000000   	$CVRL = ****** GX
FA.APD= 000100   	FMT34   001304R     002	F.RCNM= 000034   	R$NAME= ****** GX	$EDMSG= ****** GX
FA.CRE= 000010   	FMT35   001307R     002	F.RCTL= 000017   	R$$11M= 000000   	$ENDRO= ****** GX
FA.EXT= 000004   	FMT38   001360R     002	F.RSIZ= 000002   	R.FIX = 000001   	$ENDRW= ****** GX
FA.NSP= 000100   	FMT39   001363R     002	F.RTYP= 000000   	R.VAR = 000002   	$ERMSG= ****** GX
FA.RD = 000001   	FMT4    000113R     002	F.STBK= 000036   	SE$QA = ****** GX	$HDSIZ= ****** GX
FA.SHR= 000040   	FMT40   001366R     002	F.UNIT= 000136   	SPA   = 000040   	$IDENT= ****** GX
FA.TMP= 000020   	FMT41   001371R     002	F.URBD= 000020   	SW$AC = ****** GX	$INPPT= ****** GX
FA.WRT= 000002   	FMT5    000147R     002	F.VBN = 000064   	SW$CP = ****** GX	$ISED = ****** GX
FD.BLK= 000010   	FMT6    000203R     002	F.VBSZ= 000060   	SW$DA = ****** GX	$MAPPT= ****** GX
FD.CCL= 000002   	FMT7    000231R     002	G.TICP= 000016   	SW$EA = ****** GX	$MPELT  000142RG
FD.CR = 000002   	FMT8    000257R     002	G.TICT= 000014   	SW$FP = ****** GX	$MPFLG  000004RG
FD.DIR= 000010   	FMT9    000331R     002	G.TIDA= 000004   	SW$NH = ****** GX	$MPHDG  000222RG
FD.FTN= 000001   	FO.APD= 000106   	G.TIHR= 000006   	SW$PI = ****** GX	$MPSCT  000316RG
FD.INS= 000010   	FO.MFY= 000002   	G.TIMI= 000010   	SW$PM = ****** GX	$MPSEG  000454RG
FD.PLC= 000004   	FO.RD = 000001   	G.TIMO= 000002   	SW$PR = ****** GX	$MPSYM  001732RG
FD.RAH= 000001   	FO.UPD= 000006   	G.TISC= 000012   	SW$TR = ****** GX	$MPUND  002120RG
FD.RAN= 000002   	FO.WRT= 000016   	G.TIYR= 000000   	SYMBF   000070R  	$MPUSY  002226RG
FD.REC= 000001   	F.ALOC= 000040   	HT    = 000011   	SYMPT   000140R  	$ODTAD= ****** GX
FD.RWM= 000001   	F.BBFS= 000062   	LF    = 000012   	SY$DEF= ****** GX	$OFFST= ****** GX
FD.SDI= 000020   	F.BDB = 000070   	LG$SH = ****** GX	S$GBLK= ****** GX	$OUTBF= ****** GX
FD.SQD= 000040   	F.BGBC= 000057   	MPCAL   001402R  	S$GCST= ****** GX	$RTSEG= ****** GX
FD.TTY= 000004   	F.BKDN= 000026   	MPCHK   001442R  	S$GNME= ****** GX	$SAVRG= ****** GX
FD.WBH= 000002   	F.BKDS= 000020   	MPEDT   001500R  	S$GRO = ****** GX	$STACK= ****** GX
FF    = 000014   	F.BKEF= 000050   	MPFIL   001512R  	S$GRW = ****** GX	$STBNM= ****** GX
FMTSW   000042R  	F.BKP1= 000051   	MPFSH   001544R  	S$GSEQ= ****** GX	$SWTCH= ****** GX
FMTVCT  000006R  	F.BKST= 000024   	MPHDG1  000312R  	S$GSTB= ****** GX	$TSKNM= ****** GX
FMT1    000000R     002	F.BKVB= 000064   	MPOUT   001570R  	S$GUND= ****** GX	$VERSN= ****** GX
FMT10   000356R     002	F.CNTG= 000034   	MPOUT1  001574R  	S$V2  = ****** GX	$XFRAD= ****** GX
FMT11   000376R     002	F.DFNB= 000046   	MPTSK   001656R  	S$YCMT= ****** GX	$$    = 000001
FMT12   000431R     002	F.DSPT= 000044   	NB.DEV= 000200   	S$YFLG= ****** GX	$$$OST= 000020
FMT13   000477R     002	F.DVNM= 000134   	NB.DIR= 000100   	S$YM  = ****** GX	.PUTSQ= ****** G
FMT14   000560R     002	F.EFBK= 000010   	NB.NAM= 000004   	S$YVAL= ****** GX	...GBL= 000000
FMT15   000562R     002	F.EFN = 000050   	NB.SD1= 000400   	S.BFHD= 000020   	...TPC= 000140

. ABS.	000000	   000
      	002276	   001
MTXT$D	001374	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  3041 WORDS  ( 12 PAGES)
MPOUT	MACRO M1108  05-DEC-77 22:59  PAGE 3-17
SYMBOL TABLE

DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:00:53
[44,10]MPOUT,[44,20]MPOUT/-SP=[44,30]MACFLM.,FCSPR.,MPOUT.013
MRKDL	MACRO M1108  05-DEC-77 22:59  PAGE 2


      1						.TITLE	MRKDL
      2						.IDENT	/X00/
      3
      4					;
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					;
      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     12					;
     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     15					; EQUIPMENT CORPORATION.
     16					;
     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     19					;
     20					; VERSION X00
     21					;
     22					; C. MONIA 08-APR-74
     23					;
     24					; SUBROUTINE TO MARK A FILE FOR DELETE
     25					;
     26					;+
     27					; **-$MRKDL-MARK FILE FOR DELETE
     28					;
     29					; INPUTS:
     30					;
     31					;	R0=FDB ADDRESS
     32					;
     33					; OUTPUTS:
     34					;
     35					;	SPECIFIED FILE IS MARKED FOR DELETION UPON CLOSE
     36					;-
     37
     38	000000				$MRKDL::			;
     39	000000					CALLR	.MRKDL		; MARK FILE FOR DELETE
     40
     41		000001 				.END
MRKDL	MACRO M1108  05-DEC-77 22:59  PAGE 2-1
SYMBOL TABLE

CR    = 000015   	HT    = 000011   	R$$11M= 000000   	VT    = 000013   	.MRKDL= ****** GX
FF    = 000014   	LF    = 000012   	SPA   = 000040   	$MRKDL  000000RG

. ABS.	000000	   000
      	000004	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  512 WORDS  ( 2 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:04
[44,10]MRKDL,[44,20]MRKDL/-SP=[44,30]MACFLM.,MRKDL.X00
MRKPG	MACRO M1108  05-DEC-77 23:00  PAGE 2


      1						.TITLE	MRKPG
      2						.IDENT	/00/
      3
      4					;
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     17					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 00
     20					;
     21					; C. MONIA 22-FEB-74
     22					;
     23					; ROUTINES TO SET/CLEAR PAGE STATUS BITS
     24					;
     25					;+
     26					; **-$LCKPG-LOCK A PAGE IN MEMORY
     27					; **-$UNLPG-UNLOCK A PAGE FROM MEMORY
     28					; **-$WRMPG-MARK PAGE AS WRITTEN INTO
     29					;
     30					; INPUTS:
     31					;
     32					;	R1=VIRTUAL ADDRESS
     33					;
     34					; OUTPUTS:
     35					;
     36					;	C-CLEAR: PAGE WAS MARKED AS REQUESTED
     37					;
     38					;	C-SET: PAGE NOT RESIDENT
     39					;
     40					; ALL REGISTER CONTENTS ARE PRESERVED
     41					;-
     42
     43	000000				$LCKPG::			;
     44	000000					SAVVR			; SAVE VOLATILE REGISTERS
     45	000004					CALL	$FNDPG		; FIND SPECIFIED PAGE
     46	000010	103402 				BCS	10$		; IF C/S PAGE NOT IN MEMORY
     47	000012	105260 	000000G			INCB	P$GLOK(R0)	; INCREMENT LOCK COUNT
     48	000016				10$:				;
     49	000016					RETURN			;
     50
     51	000020				$UNLPG::			;
     52	000020					SAVVR			; SAVE VOLATILE REGISTERS
     53	000024					CALL	$FNDPG		; FIND SPECIFIED PAGE
     54	000030	103402 				BCS	10$		; IF C/S PAGE NOT IN MEMORY
     55	000032	105360 	000000G			DECB	P$GLOK(R0)	; DECREMENT LOCK COUNT
     56	000036				10$:				;
     57	000036					RETURN			;
MRKPG	MACRO M1108  05-DEC-77 23:00  PAGE 2-1


     58
     59	000040				$WRMPG::			;
     60	000040					SAVVR			;
     61	000044					CALL	$FNDPG		; FIND SPECIFIED PAGE
     62	000050	103403 				BCS	10$		; IF C/S NOT RESIDENT
     63	000052	152760 	000000G	000000G		BISB	#PG$WRT,P$GSTS(R0) ; WRITE-MARK PAGE
     64	000060				10$:				;
     65	000060					RETURN			;
     66
     67		000001 				.END
MRKPG	MACRO M1108  05-DEC-77 23:00  PAGE 2-2
SYMBOL TABLE

CR    = 000015   	PG$WRT= ****** GX	R$$11M= 000000   	$FNDPG= ****** GX	$UNLPG  000020RG
FF    = 000014   	P$GLOK= ****** GX	SPA   = 000040   	$LCKPG  000000RG 	$WRMPG  000040RG
HT    = 000011   	P$GSTS= ****** GX	VT    = 000013   	$SAVVR= ****** GX	$$    = 000001
LF    = 000012

. ABS.	000000	   000
      	000062	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  577 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
[44,10]MRKPG,[44,20]MRKPG/-SP=[44,30]MACFLM.,MRKPG.000
MULSG                          	MACRO M1108  05-DEC-77 23:00  PAGE 2


      1						.TITLE	MULSG                                                           ;**NEW**
      2						.IDENT	/06/                                                           ;**NEW**
      3					                                                                                ;**NEW**
      4					;                                                                               ;**NEW**
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.               ;**NEW**
      6					;                                                                               ;**NEW**
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE               ;**NEW**
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION                ;**NEW**
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT                ;**NEW**
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.                               ;**NEW**
     11					;                                                                               ;**NEW**
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT                ;**NEW**
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL                ;**NEW**
     14					; EQUIPMENT CORPORATION.                                                        ;**NEW**
     15					;                                                                               ;**NEW**
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY                ;**NEW**
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.                 ;**NEW**
     18					;                                                                               ;**NEW**
     19					; VERSION 06                                                                   ;**NEW**
     20					;                                                                               ;**NEW**
     21					; D. N. CUTLER/C. MONIA 12-DEC-73                                               ;**NEW**
     22					;                                                                               ;**NEW**
     23					; MODIFICATIONS:                                                                ;**NEW**
     24					;                                                                               ;**NEW**
     25					; NO.		DATE		PROGRAMMER                                      ;**NEW**
     26					; ---		----		----------                                      ;**NEW**
     27					;                                                                               ;**NEW**
     28					; 021		11-JAN-74	C. MONIA                                        ;**NEW**
     29					;                                                                               ;**NEW**
     30					; GENERATE SEGMENT DESCRIPTORS FOR MULTI-SEGMENT TASK                           ;**NEW**
     31					;                                                                               ;**NEW**
     32					; EQUATED SYMBOLS                                                               ;**NEW**
     33					;                                                                               ;**NEW**
     34					; PARSED DIRECTIVE OFFSET DEFINITIONS                                           ;**NEW**
     35					;                                                                               ;**NEW**
     36					                                                                                ;**NEW**
     37		000002 			T$YP==2				; OFFSET-TYPE OF ENTRY                          ;**NEW**
     38		000004 			L$AB==4				; OFFSET-LABEL OF ENTRY                         ;**NEW**
     39		000010 			N$XT==10			; OFFSET-NEXT BYTE ADDRESS                      ;**NEW**
     40		000010 			F$LG==N$XT			; OFFSET-CONTROL SECTION FLAGS                  ;**NEW**
     41					                                                                                ;**NEW**
     42					;                                                                               ;**NEW**
     43					; ITEM TYPES                                                                    ;**NEW**
     44					;                                                                               ;**NEW**
     45					                                                                                ;**NEW**
     46		000000 			S$OS==0				; START OF STATEMENT                            ;**NEW**
     47		000002 			E$OS==2				; END OF STATEMENT                              ;**NEW**
     48		000004 			L$PAR==4			; LEFT PARENTHESIS                              ;**NEW**
     49		000006 			R$PAR==6			; RIGHT PARENTHESIS                             ;**NEW**
     50		000010 			C$OMA==10			; COMMA                                         ;**NEW**
     51		000012 			D$ASH==12			; MINUS SIGN                                    ;**NEW**
     52		000014 			S$TAR==14			; ASTERISK                                      ;**NEW**
     53		000016 			S$CTN==16			; CONTROL SECTION NAME                          ;**NEW**
     54		000020 			S$EGN==20			; SEGMENT NAME                                  ;**NEW**
     55		000022 			F$ILE==22			; ELEMENT FILE                                  ;**NEW**
     56					                                                                                ;**NEW**
     57					;                                                                               ;**NEW**
MULSG                          	MACRO M1108  05-DEC-77 23:00  PAGE 2-1


     58					; NUMBER OF NESTED PARENTHESIS LEVELS ALLOWED                                   ;**NEW**
     59					;                                                                               ;**NEW**
     60					                                                                                ;**NEW**
     61		000040 			N$PLVL==32.			;                                               ;**NEW**
     62					                                                                                ;**NEW**
     63					;                                                                               ;**NEW**
     64					; NUMBER OF SEGMENT DESCRIPTION NAME LEVELS ALLOWED                             ;**NEW**
     65					;                                                                               ;**NEW**
     66					                                                                                ;**NEW**
     67		000040 			N$SLVL==32.			;                                               ;**NEW**
     68					                                                                                ;**NEW**
     69					;                                                                               ;**NEW**
     70					; LOCAL MACROS                                                                  ;**NEW**
     71					;                                                                               ;**NEW**
     72					; GENERATE LEGAL CONSTRUCTION MACTRIX                                           ;**NEW**
     73					;                                                                               ;**NEW**
     74					; GCON TYPE,^/A/                                                                ;**NEW**
     75					;                                                                               ;**NEW**
     76					; WHERE:                                                                        ;**NEW**
     77					;                                                                               ;**NEW**
     78					;	TYPE=ITEM TYPE                                                          ;**NEW**
     79					;                                                                               ;**NEW**
     80					;	A=LEGAL PRECEDING ITEM TYPES                                            ;**NEW**
     81					;                                                                               ;**NEW**
     82					                                                                                ;**NEW**
     83						.MACRO	GCON	TYPE,A                                                  ;**NEW**
     84						.PSECT	CMAT.D,D,GBL                                                    ;**NEW**
     85					.=$CBAS+TYPE                                                                    ;**NEW**
     86					MASK=0                                                                          ;**NEW**
     87						.IF	NB, <A>                                                         ;**NEW**
     88						.IRP	X,<A>                                                           ;**NEW**
     89					N=1                                                                             ;**NEW**
     90						.REPT	X/2                                                             ;**NEW**
     91					N=N*2                                                                           ;**NEW**
     92						.ENDR                                                                   ;**NEW**
     93					MASK=MASK!N                                                                     ;**NEW**
     94						.ENDM                                                                   ;**NEW**
     95						.ENDC                                                                   ;**NEW**
     96						.WORD	MASK                                                            ;**NEW**
     97						.PSECT                                                                  ;**NEW**
     98						.ENDM                                                                   ;**NEW**
     99					                                                                                ;**NEW**
    100					;                                                                               ;**NEW**
    101					; LOCAL DATA                                                                    ;**NEW**
    102					;                                                                               ;**NEW**
    103					; AUTOLOAD LEVEL COUNT                                                          ;**NEW**
    104					;                                                                               ;**NEW**
    105					                                                                                ;**NEW**
    106	000000				$ALVL::	.BLKW	1		;                                               ;**NEW**
    107					                                                                                ;**NEW**
    108					;                                                                               ;**NEW**
    109					; AUTOLOAD REQUIRED FLAG                                                        ;**NEW**
    110					;                                                                               ;**NEW**
    111					                                                                                ;**NEW**
    112	000002				$AFLG::	.BLKW	1		;                                               ;**NEW**
    113					                                                                                ;**NEW**
    114					;                                                                               ;**NEW**
MULSG                          	MACRO M1108  05-DEC-77 23:00  PAGE 2-2


    115					; LEGAL CONSTRUCTION MATRIX                                                     ;**NEW**
    116					;                                                                               ;**NEW**
    117					; THE MATRIX IS AN N-WORD BY N-BIT ARRAY . WHERE N =ITEM TYPE/2.                ;**NEW**
    118					; THE ARRAY IS USED IN 'MLSG1' TO VERIFY THAT EACH LINE OF ODL INPUT IS         ;**NEW**
    119					; OF THE PROPER SYNTAX.                                                         ;**NEW**
    120					;                                                                               ;**NEW**
    121					                                                                                ;**NEW**
    122	000000					.PSECT	CMAT.D,D,GBL                                                    ;**NEW**
    123	000000				$CBAS::				; REF LABEL                                     ;**NEW**
    124	000000					GCON	S$OS                                                            ;**NEW**
    125	000004					GCON	E$OS,^/R$PAR,S$CTN,S$EGN,F$ILE/                                 ;**NEW**
    126	000004					GCON	L$PAR,^/S$OS,L$PAR,C$OMA,D$ASH,S$TAR/                           ;**NEW**
    127	000004					GCON	R$PAR,^/R$PAR,S$CTN,S$EGN,F$ILE/                                ;**NEW**
    128	000004					GCON	C$OMA,^/R$PAR,S$CTN,S$EGN,F$ILE/                                ;**NEW**
    129	000004					GCON	D$ASH,^/S$CTN,S$EGN,F$ILE/                                      ;**NEW**
    130	000004					GCON	S$TAR,^/S$OS,L$PAR,C$OMA,D$ASH/                                 ;**NEW**
    131	000004					GCON	S$CTN,^/S$OS,L$PAR,C$OMA,D$ASH,S$TAR/                           ;**NEW**
    132	000004					GCON	S$EGN,^/S$OS,L$PAR,C$OMA,D$ASH,S$TAR/                           ;**NEW**
    133	000004					GCON	F$ILE,^/S$OS,L$PAR,C$OMA,D$ASH,S$TAR/                           ;**NEW**
    134					                                                                                ;**NEW**
    135					;                                                                               ;**NEW**
    136					; PARSED DIRECTIVE LISTHEAD                                                     ;**NEW**
    137					;                                                                               ;**NEW**
    138					                                                                                ;**NEW**
    139	000004				$DIRHD::.BLKW	2		;                                               ;**NEW**
    140					                                                                                ;**NEW**
    141					;                                                                               ;**NEW**
    142					; SEGMENT DESCRIPTION STACK                                                     ;**NEW**
    143					;                                                                               ;**NEW**
    144					; EACH ENTRY IN THIS STACK IS A LISTHEAD CONSISTING OF TWO WORDS.               ;**NEW**
    145					; THE LISTHEADS ARE USED TO COLLECT THE SEGMENT DESCRIPTION FOR                 ;**NEW**
    146					; EACH PARENTHESIS LEVEL.                                                       ;**NEW**
    147					;                                                                               ;**NEW**
    148					                                                                                ;**NEW**
    149	000010				$DSTK::	.BLKW	N$PLVL*2                                                        ;**NEW**
    150					                                                                                ;**NEW**
    151					;                                                                               ;**NEW**
    152					; LAST ITEM OPERATOR ENTRY                                                      ;**NEW**
    153					;                                                                               ;**NEW**
    154					                                                                                ;**NEW**
    155	000210	000000 			$EOSOP::.WORD	0		; LINK TO NEXT IS ALWAYS ZERO                   ;**NEW**
    156	000212	   002 	   000 			.BYTE	E$OS,0		;                                               ;**NEW**
    157					                                                                                ;**NEW**
    158					;                                                                               ;**NEW**
    159					; SOS OPERATOR ENTRY                                                            ;**NEW**
    160					;                                                                               ;**NEW**
    161					                                                                                ;**NEW**
    162	000214				$SOSOP::.BLKW	1		;                                               ;**NEW**
    163	000216	   000 	   000 			.BYTE	S$OS,0		;                                               ;**NEW**
    164					                                                                                ;**NEW**
    165					;                                                                               ;**NEW**
    166					; ROOT SEGMENT PARSED DIRECTIVE POINTER.                                        ;**NEW**
    167					;                                                                               ;**NEW**
    168					                                                                                ;**NEW**
    169	000220				$RTDIR::.BLKW	1		;                                               ;**NEW**
    170					                                                                                ;**NEW**
    171					;                                                                               ;**NEW**
MULSG                          	MACRO M1108  05-DEC-77 23:00  PAGE 2-3


    172					                                                                                ;**NEW**
    173					                                                                                ;**NEW**
    174					                                                                                ;**NEW**
    175					;                                                                               ;**NEW**
    176					; TEXT POINTER STACK                                                            ;**NEW**
    177					;                                                                               ;**NEW**
    178					                                                                                ;**NEW**
    179						.BLKW	N$SLVL*2	;                                               ;**NEW**
    180	000422				$TSTK::				; REF LABEL                                     ;**NEW**
    181					                                                                                ;**NEW**
    182					;                                                                               ;**NEW**
    183					;+                                                                              ;**NEW**
    184					; **-$MULSG-CREATE MULTISEGMENT DESCRIPTION                                     ;**NEW**
    185					;                                                                               ;**NEW**
    186					; INPUTS:                                                                       ;**NEW**
    187					;                                                                               ;**NEW**
    188					;	THE ODL FILE.                                                           ;**NEW**
    189					;                                                                               ;**NEW**
    190					; OUTPUTS:                                                                      ;**NEW**
    191					;                                                                               ;**NEW**
    192					;	THE SEGMMENT TABLES AND ELEMENT LISTS DESCRIBING                        ;**NEW**
    193					; A MULTI-SEGMENT TASK ARE BUILT IN DYNAMIC STORAGE.                            ;**NEW**
    194					;                                                                               ;**NEW**
    195					;	CREATION OF THE SEGMENT TABLES FROM THE ODL INPUT                       ;**NEW**
    196					; IS A THREE STEP PROCESS. IN STEP 1 THE ODL FILE IS READ                       ;**NEW**
    197					; ONE LINE AT A TIME AND RETAINED IN DYNAMIC STORAGE AFTER                      ;**NEW**
    198					; VERIFYING CORRECT LINE FORMAT. IN STEP TWO THE ENTIRE                         ;**NEW**
    199					; ODL IS PARSED INCLUDING A 'PARSE/FIND' ON EACH INPUT FILE.                    ;**NEW**
    200					; CONSTRUCTION OF THE SEGMENT TABLES AND ELEMENT DESCRIPTORS                    ;**NEW**
    201					; IS DONE IN PHASE THREE.                                                       ;**NEW**
    202					;                                                                               ;**NEW**
    203					;	THE ODL ROUTINES CONSIST OF THE FOLLOWING PRINCIPLE                     ;**NEW**
    204					; MODULES:                                                                      ;**NEW**
    205					;                                                                               ;**NEW**
    206					;	MULSG:	TOP LEVEL CALLS, COMMON DATA AND SUBROUTINES                    ;**NEW**
    207					;	MLSG0:	READ THE ODL AND VERFIFY LINE FORMAT                            ;**NEW**
    208					;	MLSG1:	PARSE THE SEGMENT DESCRIPTION                                   ;**NEW**
    209					;	MLSG2:	CREATE THE SEGMENT TABLES                                       ;**NEW**
    210					;                                                                               ;**NEW**
    211					;-                                                                              ;**NEW**
    212					;                                                                               ;**NEW**
    213					                                                                                ;**NEW**
    214	000422				$MULSG::			;                                               ;**NEW**
    215	000422					SAVRG			; SAVE NON-VOLATILE REGISTERS                   ;**NEW**
    216	000426					CALL	$MLSG0		; READ ODL FILE, BUILD PARSED SEGMENT DESCRIPTOR;**NEW**
    217	000432					CALL	$MLSG1		; PARSE SEGMENT DESCRIPTION                     ;**NEW**
    218	000436					CALLR	$MLSG2		; GENERATE SEGMENT TABLES, EXIT                 ;**NEW**
    219					                                                                                ;**NEW**
    220					;                                                                               ;**NEW**
    221					; COMMON SUBROUTINE TO SCAN PARSED DIRECTIVE LIST FOR A MATCH                   ;**NEW**
    222					;                                                                               ;**NEW**
    223					; THE PARSED DIRECTIVE LIST POINTED TO BY '$DIRHD' IS SCANNED FOR               ;**NEW**
    224					; A LABEL MATCH.                                                                ;**NEW**
    225					;                                                                               ;**NEW**
    226					;                                                                               ;**NEW**
    227					; INPUTS:                                                                       ;**NEW**
    228					;                                                                               ;**NEW**
MULSG                          	MACRO M1108  05-DEC-77 23:00  PAGE 2-4


    229					;	R5: POINTS TO TWO-WORD RADIX 50 NAME                                    ;**NEW**
    230					;                                                                               ;**NEW**
    231					; OUTPUTS:                                                                      ;**NEW**
    232					;                                                                               ;**NEW**
    233					;	C-SET: MATCHING LABEL NOT FOUND                                         ;**NEW**
    234					;	C-CLEAR: MATCHING LABEL FOUND                                           ;**NEW**
    235					;                                                                               ;**NEW**
    236					                                                                                ;**NEW**
    237	000442				$SCNL::				;                                               ;**NEW**
    238	000442	012701 	000004'			MOV	#$DIRHD,R1	; GET ADDRESS OF LISTHEAD                       ;**NEW**
    239	000446	011101 			10$:	MOV	(R1),R1		;GET ADDRESS OF NEXT ENTRY                      ;**-1120
    240	000450	000261 				SEC			;ASSUME NO MORE
    241	000452	001407 				BEQ	20$		;IF EQ YES DONE
    242	000454	021561 	000004 			CMP	(R5),L$AB(R1)	; FIRST HALF MATCH?                             ;**NEW**
    243	000460	001372 				BNE	10$		;IF NE NO                                       ;**-1
    244	000462	026561 	000002 	000006 		CMP	2(R5),L$AB+2(R1) ; SECOND HALF MATCH?                           ;**NEW**
    245	000470	001366 				BNE	10$		;IF NE NO                                       ;**-1
    246	000472				20$:	RETURN			;
    247					                                                                                ;**-4
    248		000001 				.END
MULSG                          	MACRO M1108  05-DEC-77 23:00  PAGE 2-5
SYMBOL TABLE

CR    = 000015   	L$AB  = 000004 G 	R$$11M= 000000   	$AFLG   000002RG 	$MLSG2= ****** GX
C$OMA = 000010 G 	L$PAR = 000004 G 	SPA   = 000040   	$ALVL   000000RG 	$MULSG  000422RG
D$ASH = 000012 G 	MASK  = 000165   	S$CTN = 000016 G 	$CBAS   000000RG    002	$RTDIR  000220RG
E$OS  = 000002 G 	N     = 000100   	S$EGN = 000020 G 	$DIRHD  000004RG 	$SAVRG= ****** GX
FF    = 000014   	N$PLVL= 000040 G 	S$OS  = 000000 G 	$DSTK   000010RG 	$SCNL   000442RG
F$ILE = 000022 G 	N$SLVL= 000040 G 	S$TAR = 000014 G 	$EOSOP  000210RG 	$SOSOP  000214RG
F$LG  = 000010 G 	N$XT  = 000010 G 	T$YP  = 000002 G 	$MLSG0= ****** GX	$TSTK   000422RG
HT    = 000011   	R$PAR = 000006 G 	VT    = 000013   	$MLSG1= ****** GX	$$    = 000001
LF    = 000012

. ABS.	000000	   000
      	000474	   001
CMAT.D	000024	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1714 WORDS  ( 7 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:30
[44,10]MULSG,[44,20]MULSG/-SP=[44,30]MACFLM.,MULSG.006
NXTFL	MACRO M1108  05-DEC-77 23:00  PAGE 2


      1						.TITLE	NXTFL
      2						.IDENT	/05/                                                           ;**NEW**
      3					;                                                                               ;**-1
      4					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      5					;
      6					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      7					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      8					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
      9					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     10					;
     11					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     12					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     13					; EQUIPMENT CORPORATION.
     14					;
     15					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     16					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     17					;
     18					; VERSION 05                                                                   ;**NEW**
     19					;                                                                               ;**-2
     20					; D. N. CUTLER/C. MONIA	21-JAN-74
     21					;+
     22					; **-$NXTFL-GET NEXT INPUT FILE
     23					;
     24					; THIS ROUTINE IS CALLED TO GET THE NEXT INPUT FILE SPECIFICATION AND
     25					; PLACE IT IN THE OBJECT FILE RECORD BLOCK. IF $MRFLG IS NONZERO, THEN
     26					; THE SCANNING ROUTINE IS CALLED IMMEDIATELY. ELSE THE NEXT COMMAND IN-
     27					; PUT LINE IS READ AND THEN THE SCANNING ROUTINE IS CALLED.
     28					;
     29					; INPUTS:
     30					;
     31					;	R5=ADDRESS OF TEMP BUFFER.
     32					;
     33					; OUTPUTS:
     34					;
     35					;	C=1 IS COMMAND INPUT IS FINISHED.
     36					;	C=0 IF NEXT INPUT FILE HAS BEEN OBTAINED.
     37					;-
     38
     39	000000	005767 	000000G		$NXTFL::TST	$MRFLG		;ANY MORE FILES?
     40	000004	001412 				BEQ	10$		;IF EQ YES
     41	000006				5$:	CALL	$GTCML		;GET NEXT COMMAND INPUT LINE
     42	000012	103432 				BCS	20$		;IF CS LOGICAL EOF
     43	000014	010501 				MOV	R5,R1		;GET ADDRESS OF TEMP BUFFER
     44	000016					CALL	$SYNTX$		;ANALYZE SYNTAX
     45	000022	103766 				BCS	$NXTFL		;IF CS SYNTAX ERROR
     46	000024	012767 	000000G	000000G		MOV	#$SCANO,$SCANR	;SET ADDRESS OF SCANNING ROUTINE
     47	000032				10$:				;                                               ;**NEW**
     48	000032					CALL	$CLRMN		; INITIALIZE LIBRARY MODULE NAME LIST           ;**NEW**
     49	000036	016700 	000000G			MOV	$INIPT,R0	; GET RECORD BLOCK ADDRESS                      ;**NEW**
     50	000042	010501 				MOV	R5,R1		;GET ADDRESS OF TEMP BUFFER                     ;**-1
     51	000044					CALL	@$SCANR		;CALL SCANNING ROUTINE
     52	000050	010067 	000000G			MOV	R0,$MRFLG	;SAVE MORE FILES FLAG
     53	000054	103751 				BCS	$NXTFL		;IF CS BYPASS NULL FILE
     54	000056					CALL	$BLMNT		; BUILD MODULE NAME LIST                        ;**NEW**
     55	000062	103006 				BCC	20$		; IF C/C OK                                     ;**NEW**
     56	000064	012702 	000000G			MOV	#$LNDES,R2	; GET ADDRESS OF COMMAND LINE BUFFER            ;**NEW**
     57	000070	012701 	000000C			MOV	#<S$V2*400!E$R78>,R1 ; GET ERROR/SEVERITY                       ;**NEW**
NXTFL	MACRO M1108  05-DEC-77 23:00  PAGE 2-1


     58	000074					CALL	$ERMSG		; FATAL, NORETURN                               ;**NEW**
     59	000100				20$:	RETURN			;
     60
     61		000001 				.END
NXTFL	MACRO M1108  05-DEC-77 23:00  PAGE 2-2
SYMBOL TABLE

CR    = 000015   	R$$11M= 000000   	$BLMNT= ****** GX	$INIPT= ****** GX	$SCANO= ****** GX
E$R78 = ****** GX	SPA   = 000040   	$CLRMN= ****** GX	$LNDES= ****** GX	$SCANR= ****** GX
FF    = 000014   	S$V2  = ****** GX	$ERMSG= ****** GX	$MRFLG= ****** GX	$SYNTX= ****** GX
HT    = 000011   	VT    = 000013   	$GTCML= ****** GX	$NXTFL  000000RG 	$$    = 000001
LF    = 000012

. ABS.	000000	   000
      	000102	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  647 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:07
[44,10]NXTFL,[44,20]NXTFL/-SP=[44,30]MACFLM.,NXTFL.005
PCTRL	MACRO M1108  05-DEC-77 23:00  PAGE 2


      1						.TITLE	PCTRL
      2						.IDENT	/02/                                                           ;**NEW**
      3					                                                                                ;**NEW**
      4					;                                                                               ;**NEW**
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.               ;**NEW**
      6					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.               ;**NEW**
      7					;                                                                               ;**NEW**
      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE               ;**NEW**
      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION                ;**NEW**
     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT                ;**NEW**
     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.                               ;**NEW**
     12					;                                                                               ;**NEW**
     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT                ;**NEW**
     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL                ;**NEW**
     15					; EQUIPMENT CORPORATION.                                                        ;**NEW**
     16					;                                                                               ;**NEW**
     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY                ;**NEW**
     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.                 ;**NEW**
     19					;                                                                               ;**NEW**
     20					; VERSION 02                                                                   ;**NEW**
     21					;                                                                               ;**NEW**
     22					; D. N. CUTLER/C. MONIA	18-MAR-74                                               ;**NEW**
     23					;                                                                               ;**NEW**
     24					; PHASE CONTROL ROUTINE                                                         ;**-13
     25					;
     26					;+                                                                              ;**-13
     27					; **-$PCTRL-PHASE CONTROL
     28					;
     29					; THIS ROUTINE IS CALLED TO CONTROL THE PROCESSING OF ALL SEG-
     30					; MENTS IN ALL PHASES. AS EACH SEGMENT IS CONSIDERED, A PHASE
     31					; DEPENDENT ROUTINE IS CALLED.
     32					;
     33					; INPUTS:
     34					;
     35					;	R0=ADDRESS OF PHASE DEPENDENT ROUTINE.
     36					;
     37					; OUTPUTS:
     38					;
     39					;	$CRSEG=REAL ADDRESS OF CURRENT SEGMENT DESCRIPTOR                       ;**NEW**
     40					;	$CRVSG=VIRTUAL ADDRESS OF SEGMENT DESCRIPTOR                            ;**NEW**
     41					;                                                                               ;**NEW**
     42					; THE PAGE CONTAINING THE DESCRIPTOR IS LOCKED IN MEMORY AND UNLOCKED           ;**NEW**
     43					; ON RETURN FROM THE CALLED ROUTINE.                                            ;**NEW**
     44					;                                                                               ;**NEW**
     45					;-                                                                              ;**-1
     46
     47	000000				$PCTRL::SAVRG			; SAVE NON VOLATILE REGISTERS                   ;**NEW**
     48	000004	010005 				MOV	R0,R5		; SAVE SUBROUTINE ADDRESS                       ;**NEW**
     49	000006	005046 				CLR	-(SP)		; SET ZERO SENTINEL WORD                        ;**NEW**
     50	000010	016746 	000000G			MOV	$RTSEG,-(SP)	; PUSH VIRTUAL ADDRESS OF ROOT                  ;**NEW**
     51	000014				10$:				;                                               ;**NEW**
     52	000014	011646 				MOV	(SP),-(SP)	; SET SENTINEL AT THIS LEVEL                    ;**NEW**
     53	000016				20$:				;                                               ;**NEW**
     54	000016	011601 				MOV	(SP),R1		; GET VIRTUAL ADDRESS OF CURRENT                ;**NEW**
     55	000020					CALL	$CVLOK		; CONVERT TO REAL ADDRESS, LOCK IN MEMORY       ;**NEW**
     56	000024	010067 	000000G			MOV	R0,$CRSEG	; SAVE REAL ADDRESS OF CURRENT                  ;**NEW**
     57	000030	010167 	000000G			MOV	R1,$CRVSG	; SAVE VIRTUAL ADDRESS OF CURRENT               ;**NEW**
PCTRL	MACRO M1108  05-DEC-77 23:00  PAGE 2-1


     58	000034					CALL	(R5)		; CALL SUBROUTINE                               ;**NEW**
     59	000036	011601 				MOV	(SP),R1		; GET VIRTUAL ADDRESS OF CURRENT                ;**NEW**
     60	000040					CALL	$CVRL		; CONVERT TO REAL ADDRESS                       ;**NEW**
     61	000044					CALL	$UNLPG		; UNLOCK PAGE                                   ;**NEW**
     62	000050	016046 	000000G			MOV	S$GUP(R0),-(SP)	; PUSH LINK-UP                                  ;**NEW**
     63	000054	001357 				BNE	10$		; IF NE HAVE LINK UP                            ;**NEW**
     64	000056	005726 				TST	(SP)+		; REMOVE ZERO WORD                              ;**NEW**
     65	000060				30$:				;                                               ;**NEW**
     66	000060	016016 	000000G			MOV	S$GNXT(R0),(SP) ; REPLACE TOS WITH LINK-NEXT                    ;**NEW**
     67	000064	021666 	000002 			CMP	(SP),2(SP)	; CHECK TOS AGAINST SENTINEL                    ;**NEW**
     68	000070	001352 				BNE	20$		; IN NE, VALID LINK-NEXT                        ;**NEW**
     69	000072	022626 				CMP	(SP)+,(SP)+	; DONE ALL ENTRIES AT THIS LEVEL                ;**NEW**
     70	000074	011601 				MOV	(SP),R1		; GET VIRTUAL ADDRESS OF OLD CURRENT            ;**NEW**
     71	000076	001403 				BEQ	40$		; IF EQ DONE                                    ;**NEW**
     72	000100					CALL	$CVRL		; CONVERT TO REAL ADDRESS	                ;**NEW**
     73	000104	000765 				BR	30$		; SCAN ENTRIES AT NEXT LOWEST LEVEL             ;**NEW**
     74	000106				40$:				;                                               ;**NEW**
     75	000106	005726 				TST	(SP)+		; POP ZERO SENTINEL WORD                        ;**NEW**
     76	000110					RETURN			;                                               ;**NEW**
     77					                                                                                ;**-45
     78		000001 				.END
PCTRL	MACRO M1108  05-DEC-77 23:00  PAGE 2-2
SYMBOL TABLE

CR    = 000015   	R$$11M= 000000   	VT    = 000013   	$CVRL = ****** GX	$SAVRG= ****** GX
FF    = 000014   	SPA   = 000040   	$CRSEG= ****** GX	$PCTRL  000000RG 	$UNLPG= ****** GX
HT    = 000011   	S$GNXT= ****** GX	$CRVSG= ****** GX	$RTSEG= ****** GX	$$    = 000001
LF    = 000012   	S$GUP = ****** GX	$CVLOK= ****** GX

. ABS.	000000	   000
      	000112	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  587 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:08
[44,10]PCTRL,[44,20]PCTRL/-SP=[44,30]MACFLM.,PCTRL.002
PRCER	MACRO M1108  05-DEC-77 23:01  PAGE 3


      1						.TITLE	PRCER
      2						.IDENT	/00/
      3
      4					;
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 00
     20					;
     21					; C. MONIA 18-APR-74
     22					;
     23					; ERROR MESSAGE PROCESSING
     24					;
     25					; LOCAL DATA
     26					;
     27
     28	000000					.PSECT	ETXT$D,D,GBL
     29
     30	000000	   124 	   113 	   102 	DIAG:	.ASCIZ	/TKB -- *DIAG*-/ ; DIAGNOSTIC PREFIX
	000003	   040 	   055 	   055
	000006	   040 	   052 	   104
	000011	   111 	   101 	   107
	000014	   052 	   055 	   000
     31	000017	   124 	   113 	   102 	FATAL:	.ASCIZ	/TKB -- *FATAL*-/ ; FATAL PREFIX
	000022	   040 	   055 	   055
	000025	   040 	   052 	   106
	000030	   101 	   124 	   101
	000033	   114 	   052 	   055
	000036	   000
     32
     33						.IF	DF	S$$MSG
     34
     35					SUFF:	.ASCIZ	/%2N/		; STANDARD SUFFIX
     36
     37						.ENDC
     38
     39
     40	000000					.PSECT
     41
     42					;+
     43					; **-$PRCER-PROCESS ERROR MESSAGE
     44					;
     45					; INPUTS:
     46					;
     47					;	R1=ERROR/SEVERITY
     48					;	R2=PARAMETER BLOCK ADDRESS
PRCER	MACRO M1108  05-DEC-77 23:01  PAGE 3-1


     49					;
     50					; OUTPUTS:
     51					;
     52					;	R0=ADDRESS OF OUTPUT BUFFER ($OUTBF)
     53					;	R1=ADDRESS OF BUFFER CONTAINING UNFORMATTED MESSAGE($TBUF)
     54					;	R2=PARAMETER BLOCK ADDRESS
     55					;	R3=SEVERITY CODE
     56					;
     57					;	THIS ROUTINE IS CALLED BY THE ERROR MESSAGE HANDLER ($ERMSG)
     58					; TO MOVE UNFORMATTED ERROR TEXT FROM THE CO-TREE TO THE ROOT FOR
     59					; SUBSEQUENT OUTPUT VIA LUN 2. THE MESSAGE TO BE FORMATTED CON-
     60					; TAINS AN APPROPRIATE PREFIX DEPENDANT ON THE SEVERITY CODE.
     61					;-
     62
     63	000000				$PRCER::			;
     64	000000	005003 				CLR	R3		; CLEAR SEVERITY
     65	000002	005004 				CLR	R4		; CLEAR ERROR NUMBER
     66	000004	150104 				BISB	R1,R4		; ISOLATE ERROR NUMBER
     67	000006	000301 				SWAB	R1		; POSITION SEVERITY TO LOW BYTE
     68	000010	150103 				BISB	R1,R3		; COPY SEVERITY CODE
     69	000012	020427 	000000G			CMP	R4,#E$RMAX	; LEGAL ERROR CODE
     70	000016	101003 				BHI	10$		; IF HI NO
     71	000020	020327 	000000G			CMP	R3,#S$V2	; LEGAL SEVERITY?
     72	000024	101413 				BLOS	20$		; IF LOS YES
     73	000026				10$:				;
     74	000026	012700 	000004G			MOV	#$ARGBK+4,R0	; GET ADDRESS IN ARGUMENT BLOCK
     75	000032	016610 	000012 			MOV	12(SP),(R0)	; SAVE ADDRESS OF CALLER
     76	000036	010240 				MOV	R2,-(R0)	; STORE ARGUMENT BLOCK ADDRESS
     77	000040	000301 				SWAB	R1		; REPOSITION ERROR/SEVERITY CODE
     78	000042	010140 				MOV	R1,-(R0)	; STORE SEVERITY CODE
     79	000044	010002 				MOV	R0,R2		; SET NEW PARAMETER BLOCK ADDRESS
     80	000046	012701 	000000C			MOV	#<S$V2*400!E$R5>,R1 ; GET NEW ERROR/SEVERITY
     81	000052	000752 				BR	$PRCER		; GO AGAIN
     82	000054				20$:				;
     83	000054	016705 	000000G			MOV	$CMIPT,R5	; GET COMMAND INPUT RECORD BLOCK
     84	000060	132765 	000004 	000017 		BITB	#FD.TTY,F.RCTL(R5) ; TTY DEVICE?
     85	000066	001001 				BNE	30$		; IF NE YES
     86	000070	005203 				INC	R3		; INCREMENT SEVERITY
     87	000072				30$:				;
     88	000072	012700 	000000'			MOV	#DIAG,R0	; ASSUME DIAGNOSTIC MESSAGE
     89	000076	020327 	000000G			CMP	R3,#S$V2	; DIAGNOSTIC?
     90	000102	103402 				BLO	40$		; IF LO YES
     91	000104	012700 	000017'			MOV	#FATAL,R0	; GET FATAL PREFIX
     92	000110				40$:				;
     93	000110	012701 	000000G			MOV	#$TBUF,R1	; SET INPUT BUFFER ADDRESS
     94	000114				50$:				;
     95	000114	112021 				MOVB	(R0)+,(R1)+	; MOVE PREFIX
     96	000116	001376 				BNE	50$		;
     97	000120	105741 				TSTB	-(R1)		; BACKUP TO LAST BYTE
     98
     99						.IF	DF	S$$MSG
    100
    101						CALL	CVDG		; CONVERT ERROR NUMBER TO ASCII
    102						MOVB	R5,(R1)+	; MOVE TO TEXT BUFFER
    103						SWAB	R5		; GET HIGH BYTE
    104						MOVB	R5,(R1)+	; MOVE TO TEXT BUFFER
    105						MOVB	#' ,(R1)+	; FORMAT WITH SPACES
PRCER	MACRO M1108  05-DEC-77 23:01  PAGE 3-2


    106						MOVB	#' ,(R1)+	;
    107
    108						.IFF
    109
    110	000122	012746 	000000G			MOV	#$LM1,-(SP)	; SET TO LOAD TEXT SET 1
    111	000126	020427 	000000G			CMP	R4,#M$SG1	; MESSAGE IN GROUP 1?
    112	000132	101402 				BLOS	55$		; IF LOS YES
    113	000134	012716 	000000G			MOV	#$LM2,(SP)	; REPLACE SUBROUTINE ADDRESS
    114	000140				55$:				;
    115	000140					CALL	@(SP)+		; LOAD TEXT
    116
    117						.ENDC
    118
    119	000142	006304 				ASL	R4		; CONVERT MESSAGE NUMBER TO WORD INDEX
    120	000144	016400 	000000G			MOV	$MSG(R4),R0	; GET POINTER TO UNFORMATTED STRING
    121	000150				60$:				;
    122	000150	112021 				MOVB	(R0)+,(R1)+	; MOVE MESSAGE PROPER
    123	000152	001376 				BNE	60$		;
    124
    125						.IF	DF	S$$MSG
    126
    127						TSTB	-(R1)		; BACKUP TEXT POINTER
    128						MOV	#SUFF,R0	; POINT TO SUFFIX STRING
    129					70$:				;
    130						MOVB	(R0)+,(R1)+	; INSERT SUFFIX
    131						BNE	70$		;
    132
    133						.ENDC
    134
    135	000154	012700 	000000G			MOV	#$OUTBF,R0	; SET ADDRESS OF OUTPUT BUFFER
    136	000160	012701 	000000G			MOV	#$TBUF,R1	; SET ADDRESS OF INPUT
    137	000164					RETURN			;
    138
    139
    140						.IF	DF	S$$MSG
    141
    142
    143					;
    144					; SUBROUTINE TO CONVERT ERROR NUMBER TO TWO-DIGIT ASCII
    145					;
    146
    147					CVDG:				;
    148						SAVVR			; SAVE VOLATILE REGISTERS
    149
    150						.IF	DF	V1145
    151
    152						MOV	R4,R1		; GET ERROR NUMBER
    153						CLR	R0		; CLEAR HIGH PART OF DIVIDEND
    154						DIV	#10.,R0		; DIVIDE BY TEN
    155
    156						.IFF
    157
    158						MOV	R4,R0		; GET ERROR NUMBER
    159						MOV	#10.,R1		; SET DIVISOR
    160						CALL	$DIV		; DIVIDE BY TEN
    161
    162						.ENDC
PRCER	MACRO M1108  05-DEC-77 23:01  PAGE 3-3


    163
    164						SWAB	R1		; POSITION REMAINDER
    165						BIS	R1,R0		; COMBINE WITH DIVIDEND
    166						BIS	#"00,R0		; INSERT ASCII OFFSET
    167						MOV	R0,R5		; SAVE RESULT
    168						RETURN
    169
    170						.ENDC
    171
    172		000001 				.END
PRCER	MACRO M1108  05-DEC-77 23:01  PAGE 3-4
SYMBOL TABLE

B.BBFS= 000010   	FD.REC= 000001   	F.EFBK= 000010   	F.URBD= 000020   	R.FIX = 000001
B.BFST= 000015   	FD.RWM= 000001   	F.EFN = 000050   	F.VBN = 000064   	R.VAR = 000002
B.NXBD= 000012   	FD.SDI= 000020   	F.EOBB= 000032   	F.VBSZ= 000060   	SPA   = 000040
B.VBN = 000004   	FD.SQD= 000040   	F.ERR = 000052   	HT    = 000011   	S$V2  = ****** GX
CR    = 000015   	FD.TTY= 000004   	F.FACC= 000043   	LF    = 000012   	S.BFHD= 000020
DIAG    000000R     002	FD.WBH= 000002   	F.FFBY= 000014   	M$SG1 = ****** GX	S.FATT= 000016
E$RMAX= ****** GX	FF    = 000014   	F.FNAM= 000110   	NB.DEV= 000200   	S.FDB = 000140
E$R5  = ****** GX	FO.APD= 000106   	F.FNB = 000102   	NB.DIR= 000100   	S.FNAM= 000006
FATAL   000017R     002	FO.MFY= 000002   	F.FTYP= 000116   	NB.NAM= 000004   	S.FNB = 000036
FA.APD= 000100   	FO.RD = 000001   	F.FVER= 000120   	NB.SD1= 000400   	S.FNBW= 000017
FA.CRE= 000010   	FO.UPD= 000006   	F.HIBK= 000004   	NB.SD2= 001000   	S.FNTY= 000004
FA.EXT= 000004   	FO.WRT= 000016   	F.LUN = 000042   	NB.SNM= 000040   	S.FTYP= 000002
FA.NSP= 000100   	F.ALOC= 000040   	F.MBCT= 000054   	NB.STP= 000020   	S.NFEN= 000020
FA.RD = 000001   	F.BBFS= 000062   	F.MBC1= 000055   	NB.SVR= 000010   	VT    = 000013
FA.SHR= 000040   	F.BDB = 000070   	F.MBFG= 000056   	NB.TYP= 000002   	$ARGBK= ****** GX
FA.TMP= 000020   	F.BGBC= 000057   	F.NRBD= 000024   	NB.VER= 000001   	$CMIPT= ****** GX
FA.WRT= 000002   	F.BKDN= 000026   	F.NREC= 000030   	N.DID = 000024   	$LM1  = ****** GX
FD.BLK= 000010   	F.BKDS= 000020   	F.OVBS= 000030   	N.DVNM= 000032   	$LM2  = ****** GX
FD.CCL= 000002   	F.BKEF= 000050   	F.RACC= 000016   	N.FID = 000000   	$MSG  = ****** GX
FD.CR = 000002   	F.BKP1= 000051   	F.RATT= 000001   	N.FNAM= 000006   	$OUTBF= ****** GX
FD.DIR= 000010   	F.BKST= 000024   	F.RCNM= 000034   	N.FTYP= 000014   	$PRCER  000000RG
FD.FTN= 000001   	F.BKVB= 000064   	F.RCTL= 000017   	N.FVER= 000016   	$TBUF = ****** GX
FD.INS= 000010   	F.CNTG= 000034   	F.RSIZ= 000002   	N.NEXT= 000022   	$$    = 000001
FD.PLC= 000004   	F.DFNB= 000046   	F.RTYP= 000000   	N.STAT= 000020   	...GBL= 000000
FD.RAH= 000001   	F.DSPT= 000044   	F.STBK= 000036   	N.UNIT= 000034   	...TPC= 000140
FD.RAN= 000002   	F.DVNM= 000134   	F.UNIT= 000136   	R$$11M= 000000

. ABS.	000000	   000
      	000166	   001
ETXT$D	000037	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2018 WORDS  ( 8 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:16
[44,10]PRCER,[44,20]PRCER/-SP=[44,30]MACFLM.,FCSPR.,PRCER.000
PRFND	MACRO M1108  05-DEC-77 23:01  PAGE 3


      1						.TITLE	PRFND
      2						.IDENT	/02/                                                           ;**NEW**
      3					                                                                                ;**NEW**
      4					;                                                                               ;**NEW**
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.               ;**NEW**
      6					;                                                                               ;**NEW**
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE               ;**NEW**
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION               ;**NEW**
      9					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT               ;**NEW**
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.                               ;**NEW**
     11					;                                                                               ;**NEW**
     12					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT               ;**NEW**
     13					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL               ;**NEW**
     14					; EQUIPMENT CORPORATION.                                                        ;**NEW**
     15					;                                                                               ;**NEW**
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY               ;**NEW**
     17					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.               ;**NEW**
     18					;                                                                               ;**NEW**
     19					;                                                                               ;**NEW**
     20					; VERSION 02                                                                   ;**NEW**
     21					;                                                                               ;**NEW**
     22					; D. N. CUTLER/C. MONIA	21-JAN-74                                               ;**NEW**
     23					;+                                                                              ;**-13
     24					; **-$PARSE-PARSE FILE NAME                                                     ;**NEW**
     25					; **-$PRFND-PARSE-FIND FILE
     26					;
     27					; THIS ROUTINE IS CALLED TO PARSE A DEVICE/FILE NAME STRING AND THEN
     28					; FIND THE FILE ON THE SPECIFIED DEVICE.
     29					;
     30					; INPUTS:
     31					;
     32					;	R0=ADDRESS OF RECORD BLOCK.
     33					;
     34					; OUTPUTS:
     35					;
     36					;	C=1 IF PARSE OR FIND FAILURE.
     37					;	C=0 IF NAME STRING SUCESSFULLY PARSED AND FILE IS FOUND.
     38					;
     39					;	IN EITHER CASE R0 IS RETURNED AS THE ADDRESS OF THE RECORD BLOCK.
     40					;-
     41
     42	000000				$PRFND::			;                                               ;**NEW**
     43	000000					SAVRG			; SAVE NON-VOLATILE REGISTERS                   ;**NEW**
     44	000004					CALL	PARSE		; PARSE FILE/DEVICE NAME STRING                 ;**NEW**
     45	000010	103402 				BCS	10$		; IF C/S LEAVE NOW                              ;**NEW**
     46	000012					CALL	.FIND		; ELSE FIND FILE                                ;**NEW**
     47	000016				10$:	RETURN			;                                               ;**NEW**
     48					                                                                                ;**NEW**
     49					;                                                                               ;**NEW**
     50					; PARSE FILE/DEVICE NAME STRING                                                 ;**NEW**
     51					;                                                                               ;**NEW**
     52					                                                                                ;**NEW**
     53	000020				$PARSE::			;                                               ;**NEW**
     54	000020					SAVRG			; SAVE NON-VOLATILE REGISTERS                   ;**NEW**
     55	000024				PARSE:				; REF. LABEL                                    ;**NEW**
     56	000024	010001 				MOV	R0,R1		; COPY RECORD BLOCK ADDRESS                     ;**NEW**
     57	000026	062701 	000102 			ADD	#F.FNB,R1	; POINT TO FILE NAME BLOCK                      ;**NEW**
PRFND	MACRO M1108  05-DEC-77 23:01  PAGE 3-1


     58	000032	016002 	000044 			MOV	F.DSPT(R0),R2	; GET DATA SET DESCRIPTOR ADDRESS               ;**NEW**
     59	000036	016003 	000046 			MOV	F.DFNB(R0),R3	; GET ADDRESS OF DEFAULT NAME                   ;**NEW**
     60	000042					CALLR	.PARSE		; PARSE FILE/DEVICE NAME STRING                 ;**NEW**
     61					                                                                                ;**-9
     62		000001 				.END
PRFND	MACRO M1108  05-DEC-77 23:01  PAGE 3-2
SYMBOL TABLE

B.BBFS= 000010   	FD.SQD= 000040   	F.EFN = 000050   	F.UNIT= 000136   	N.UNIT= 000034
B.BFST= 000015   	FD.TTY= 000004   	F.EOBB= 000032   	F.URBD= 000020   	PARSE   000024R
B.NXBD= 000012   	FD.WBH= 000002   	F.ERR = 000052   	F.VBN = 000064   	R$$11M= 000000
B.VBN = 000004   	FF    = 000014   	F.FACC= 000043   	F.VBSZ= 000060   	R.FIX = 000001
CR    = 000015   	FO.APD= 000106   	F.FFBY= 000014   	HT    = 000011   	R.VAR = 000002
FA.APD= 000100   	FO.MFY= 000002   	F.FNAM= 000110   	LF    = 000012   	SPA   = 000040
FA.CRE= 000010   	FO.RD = 000001   	F.FNB = 000102   	NB.DEV= 000200   	S.BFHD= 000020
FA.EXT= 000004   	FO.UPD= 000006   	F.FTYP= 000116   	NB.DIR= 000100   	S.FATT= 000016
FA.NSP= 000100   	FO.WRT= 000016   	F.FVER= 000120   	NB.NAM= 000004   	S.FDB = 000140
FA.RD = 000001   	F.ALOC= 000040   	F.HIBK= 000004   	NB.SD1= 000400   	S.FNAM= 000006
FA.SHR= 000040   	F.BBFS= 000062   	F.LUN = 000042   	NB.SD2= 001000   	S.FNB = 000036
FA.TMP= 000020   	F.BDB = 000070   	F.MBCT= 000054   	NB.SNM= 000040   	S.FNBW= 000017
FA.WRT= 000002   	F.BGBC= 000057   	F.MBC1= 000055   	NB.STP= 000020   	S.FNTY= 000004
FD.BLK= 000010   	F.BKDN= 000026   	F.MBFG= 000056   	NB.SVR= 000010   	S.FTYP= 000002
FD.CCL= 000002   	F.BKDS= 000020   	F.NRBD= 000024   	NB.TYP= 000002   	S.NFEN= 000020
FD.CR = 000002   	F.BKEF= 000050   	F.NREC= 000030   	NB.VER= 000001   	VT    = 000013
FD.DIR= 000010   	F.BKP1= 000051   	F.OVBS= 000030   	N.DID = 000024   	$PARSE  000020RG
FD.FTN= 000001   	F.BKST= 000024   	F.RACC= 000016   	N.DVNM= 000032   	$PRFND  000000RG
FD.INS= 000010   	F.BKVB= 000064   	F.RATT= 000001   	N.FID = 000000   	$SAVRG= ****** GX
FD.PLC= 000004   	F.CNTG= 000034   	F.RCNM= 000034   	N.FNAM= 000006   	$$    = 000001
FD.RAH= 000001   	F.DFNB= 000046   	F.RCTL= 000017   	N.FTYP= 000014   	.FIND = ****** GX
FD.RAN= 000002   	F.DSPT= 000044   	F.RSIZ= 000002   	N.FVER= 000016   	.PARSE= ****** GX
FD.REC= 000001   	F.DVNM= 000134   	F.RTYP= 000000   	N.NEXT= 000022   	...GBL= 000000
FD.RWM= 000001   	F.EFBK= 000010   	F.STBK= 000036   	N.STAT= 000020   	...TPC= 000140
FD.SDI= 000020

. ABS.	000000	   000
      	000046	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1902 WORDS  ( 8 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:15
[44,10]PRFND,[44,20]PRFND/-SP=[44,30]MACFLM.,FCSPR.,PRFND.002
P2LBR	MACRO M1108  05-DEC-77 23:01  PAGE 3


      1						.TITLE	P2LBR
      2						.IDENT	/04/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 04                                                                    ;**NEW**
     20					;                                                                               ;**-1
     21					;
     22					; D. N. CUTLER/C. MONIA 19-DEC-73
     23					;
     24					;
     25					; MODIFICATIONS
     26					;
     27					; NO.		DATE		PROGRAMMER
     28					; ---		----		----------
     29					;
     30					; 003		04-AUG-73	C. MONIA
     31					; 017		26-OCT-73	C. MONIA
     32					;
     33					;
     34					;
     35					; PHASE 2 RESIDENT LIBRARY REQUEST PROCESSING
     36					;
     37					; MACRO LIBRARY CALLS
     38					;
     39
     40						.MCALL	CLOSE$,GET$S,NMBLK$,OFNB$R
     41
     42					;
     43					; LOCAL DATA
     44					;
     45					; LIBRARY DATA SET DESCRIPTOR
     46					;
     47
     48	000000	000000 			LBRDS:	.WORD	0		; NO DEVICE
     49	000002	000000 				.WORD	0		;
     50	000004	000005 				.WORD	LBRDRE-LBRDR	; DIRECTORY NAME
     51	000006	000014'				.WORD	LBRDR		;
     52	000010	000000 				.WORD	0		; NO FILE NAME
     53	000012	000000 				.WORD	0		;
     54	000014	   133 	   061 	   054 	LBRDR:	.ASCII	/[1,1]/		; DIRECTORY NAME
	000017	   061 	   135
     55	000021				LBRDRE:				; REF LABEL
     56						.EVEN
P2LBR	MACRO M1108  05-DEC-77 23:01  PAGE 3-1


     57
     58					;
     59					; LIBRARY NAME BLOCK
     60					;
     61
     62	000022				LBRNB:	NMBLK$	,,,SY
     63
     64					;
     65					; STB FILE TYPE
     66					;
     67
     68	000060	074742 			STB:	.RAD50	/STB/
     69
     70					;
     71					; TSK FILE TYPE
     72					;
     73
     74	000062	100003 			TSK:	.RAD50	/TSK/
     75
     76					;
     77					; MODULE FUNCTION-DETAILS
     78					;
     79					;+
     80					;
     81					; **-$LIBR-PROCESS RESIDENT LIBRARY/COMMON REQUESTS
     82					;
     83					; INPUTS:
     84					;
     85					;	R3:	NUMBER OF OPTION PARAMETERS SPECIFIED
     86					;	R5:	POINTER TO START OF OPTION DATA ($PARM)
     87					;
     88					; OUTPUTS:
     89					;
     90					;	THE RESIDENT LIBRARY LIST IS BUILT.
     91					;	ELEMENT DESCRIPTORS FOR EACH REFERENCED LIBRARY
     92					;	ARE LINKED TO THE ELEMENT LISTHEAD FOR
     93					;	THE ROOT SEGMENT.
     94					;
     95					;
     96					;	BEFORE A RESIDENT LIBRARY CAN BE LINKED
     97					; TO A TASK, THE FOLLOWING CRITIERIA MUST BE MET:
     98					;
     99					;	(A) 'TSK' AND 'STB' FILES MUST EXIST UNDER
    100					;		UIC [1,1] ON DEVICE 'SY0',
    101					;
    102					;	(B)	THE LIBRARY NAME MUST BE UNIQUE,
    103					;
    104					;	(C)	THE AREA OF MEMORY ALLOCATED TO THE
    105					;		LIBRARY MUST NOT INTERSECT MEMORY ALLOCATED
    106					;		TO OTHER LIBRARIES OR TO THE TASK ITSELF,
    107					;
    108					;	(D)	THE TOTAL NUMBER OF REFERENCED LIBRARIES MUST BE
    109					;		THREE OR LESS (7 OR LESS RSX-11D)
    110					;
    111					;	IF ANY OF THE ABOVE TESTS FAIL, THE
    112					;	REQUEST IS REJECTED.
    113					;-
P2LBR	MACRO M1108  05-DEC-77 23:01  PAGE 3-2


    114					;
    115
    116						.IF	DF	R$$11M
    117
    118	000064				$LIBR::				;
    119	000064					SAVVR			; SAVE VOLATILE REGISTERS
    120	000070	016700 	000000G			MOV	$INIPT,R0	; GET POINTER TO FDB
    121	000074					CALL	$STRCB		; SETUP FDB
    122	000100	010304 				MOV	R3,R4		; SAVE NUMBER OF PARAMETERS
    123	000102	012703 	000000C			MOV	#<S$V1*400!E$R66>,R3 ; FETCH ERROR/SEVERITY
    124	000106	032767 	000000G	000000G		BIT	#SW$NH,$TKSW	; BUILDING LIBRARY                              ;**NEW**
    125	000114	001404 				BEQ	7$		; IF EQ NO                                      ;**NEW**
    126	000116	032767 	000000G	000000G		BIT	#SW$PI,$TKSW	; LIBRARY PIC ?                                 ;**NEW**
    127	000124	001044 				BNE	10$		; IF NE YES, NO LIBRARY REFERENCES ALLOWED      ;**NEW**
    128	000126				7$:				;                                               ;**-8
    129	000126	012703 	000000C			MOV	#<S$V1*400!E$R63>,R3 ; FETCH ERRROR/SEVERITY
    130	000132	012702 	000000G			MOV	#LD$ACC,R2	; ASSUME R/W INTENT                             ;**-1
    131	000136	022525 				CMP	(R5)+,(R5)+	; POINT TO ACCESS TYPE                          ;**NEW**
    132	000140	022715 				CMP	(PC)+,(R5)	; CHECK ACCESS INTENT                           ;**NEW**
    133	000142	072030 				.RAD50	/RW /		;                                               ;**-1
    134	000144	001404 				BEQ	8$		; IF EQ OK                                      ;**NEW**
    135	000146	005002 				CLR	R2		; ASSUME R/O                                    ;**-1
    136	000150	022715 				CMP	(PC)+,(R5)	; CHECK FOR RO INTENT                           ;**NEW**
    137	000152	071330 				.RAD50	/RO /		;                                               ;**-1
    138	000154	001030 				BNE	10$		; IF NE ERROR                                   ;**NEW**
    139	000156				8$:				;                                               ;**NEW**
    140	000156	024545 				CMP	-(R5),-(R5)	; RESET PARAMETER LIST POINTER                  ;**NEW**
    141	000160	012703 	000000C			MOV	#<S$V1*400!E$R67>,R3 ; ASSUME BAD APR RESERVATION               ;**NEW**
    142	000164	020427 	000003 			CMP	R4,#3		; APR REQUESTED?                                ;**NEW**
    143	000170	103424 				BLO	20$		; IF LO NO                                      ;**NEW**
    144	000172	032767 	000000G	000000G		BIT	#MP$SY,$SWTCH	; MAPPED SYSTEM  ?                              ;**NEW**
    145	000200	001416 				BEQ	10$		; IF EQ NO, APR CAN'T BE RESERVED               ;**NEW**
    146	000202	016501 	000010 			MOV	10(R5),R1	; GET APR NUMBER                                ;**NEW**
    147	000206	020127 	000007 			CMP	R1,#7		; LEGAL APR?                                    ;**NEW**
    148	000212	101011 				BHI	10$		; IF HI NO                                      ;**NEW**
    149	000214	052702 	000000G			BIS	#LD$RSV,R2	; SET APR RESERVATION FLAG                      ;**NEW**
    150	000220	006201 				ASR	R1		; CONVERT TO ADDRESS                            ;**NEW**
    151	000222	006001 				ROR	R1		;                                               ;**NEW**
    152	000224	006001 				ROR	R1		;                                               ;**NEW**
    153	000226	006001 				ROR	R1		;                                               ;**NEW**
    154	000230	010165 	177776G			MOV	R1,L$DSA-2(R5)	; SET STARTING ADDRESS                          ;**NEW**
    155	000234	000402 				BR	20$		;                                               ;**NEW**
    156	000236				10$:                                                                            ;**-1
    157	000236	000167 	000270 			JMP	LBERR		; ELSE ERROR
    158	000242				20$:
    159	000242	012705 	177776G			MOV	#$PARM-2,R5	; SET R5 TO MATCH OFFSETS
    160	000246	010265 	000000G			MOV	R2,L$DFLG(R5)	; SET LIBRARY FLAGS
    161	000252	016767 	177604 	177556 		MOV	TSK,LBRNB+N.FTYP ; SET FILE TYPE
    162	000260	012704 	000000G			MOV	#$PARM,R4	; POINT TO PARAMETER LIST
    163	000264					CALL	FNDLF		; FIND LIBRARY FILE
    164	000270					OFNB$R	R0		; OPEN LIBRARY IMAGE
    165	000302	103413 				BCS	22$		; IF C/S OPEN FAILURE                           ;**NEW**
    166	000304	112760 	000001 	000000 		MOVB	#R.FIX,F.RTYP(R0) ; SET FIXED LENGTH RECORD TYPE                ;**-1
    167	000312	012760 	001000 	000002 		MOV	#512.,F.RSIZ(R0) ; SET RECORD SIZE
    168	000320	112760 	000004 	000016 		MOVB	#FD.PLC,F.RACC(R0) ; SET GET/PUT MODE, PARTIAL LOCATE
    169	000326					GET$S	R0		; READ FIRST RECORD
    170	000332				22$:				;                                               ;**NEW**
P2LBR	MACRO M1108  05-DEC-77 23:01  PAGE 3-3


    171	000332	012703 	000000C			MOV	#<S$V1*400!E$R68>,R3 ; GET ERROR/SEVERITY                       ;**NEW**
    172	000336	103473 				BCS	LBERR0		; IF C/S, ERROR READING FILE                    ;**-1
    173	000340	016004 	000026 			MOV	F.NRBD+2(R0),R4	; POINT TO RECORD BUFFER
    174	000344	012703 	000000C			MOV	#<S$V1*400!E$R80>,R3 ; ASSUME INCORRECT TASK IMAGE FORMAT       ;**NEW**
    175	000350	032764 	000000G	000000G		BIT	#TS$NHD,L$BFLG(R4) ; IMAGE HAVE HEADER?                         ;**NEW**
    176	000356	001463 				BEQ	LBERR0		; IF EQ YES, ERROR                              ;**NEW**
    177	000360	032765 	000000G	000000G		BIT	#LD$RSV,L$DFLG(R5) ; APR RESERVED?                              ;**NEW**
    178	000366	001003 				BNE	25$		; IF NE YES                                     ;**NEW**
    179	000370	016465 	000000G	000000G		MOV	L$BSA(R4),L$DSA(R5) ; SETUP RELOCATION BIAS                     ;**NEW**
    180	000376				25$:				;                                               ;**NEW**
    181	000376	016465 	000000G	000000G		MOV	L$BLDZ(R4),L$DLTH(R5) ; SET LIBRARY SIZE                        ;**-1
    182	000404	032764 	000000G	000000G		BIT	#TS$PIC,L$BFLG(R4) ; PIC LIBRARY
    183	000412	001403 				BEQ	30$		; IF EQ NO
    184	000414	052765 	000000G	000000G		BIS	#LD$REL,L$DFLG(R5) ;SET PIC FLAG
    185	000422				30$:				;
    186	000422	062704 	000000G			ADD	#L$BDAT,R4	; POINT TO DATE
    187	000426	062705 	000000G			ADD	#L$DDAT,R5	;
    188	000432	012425 				MOV	(R4)+,(R5)+	; GET DATE
    189	000434	012425 				MOV	(R4)+,(R5)+	;
    190	000436	012425 				MOV	(R4)+,(R5)+	;
    191
    192					;
    193					; NOW COPY ALL LIBRARY REFERENCES
    194					;
    195
    196	000440	012705 	000000C			MOV	#$PARM+L$DFLG,R5 ; POINT TO FIRST FREE ENTRY
    197	000444	012703 	000003 			MOV	#3,R3		; MAXIMUM OF THREE REFERENCES ALLOWED
    198	000450				40$:				;
    199	000450	012702 	000000G			MOV	#L$DSA,R2	; SET NUMBER OF BYTES -2 TO COPY
    200	000454	012425 				MOV	(R4)+,(R5)+	; COPY FIRST WORD OF ENTRY
    201	000456	001003 				BNE	50$		; IF NE, ENTRY PRESENT
    202	000460	060204 				ADD	R2,R4		; ENTRY NOT PRESENT, SKIP TO NEXT
    203	000462	005745 				TST	-(R5)		; BACK UP POINTER
    204	000464	000412 				BR	60$		;
    205	000466				50$:				;
    206	000466	112425 				MOVB	(R4)+,(R5)+	; COPY REMAINDER OF ENTRY
    207	000470					SOB	R2,50$		; LOOP UNTIL FINISHED
    208	000474	032765 	000000G	177776 		BIT	#LD$REL,-2(R5)	; LINKED TO PIC LIBRARY?                        ;**NEW**
    209	000502	001403 				BEQ	60$		; IF EQ NO                                      ;**NEW**
    210	000504	052765 	000000G	177776 		BIS	#LD$RSV,-2(R5) ; FIX LIBRARY IN ADDRESS SPACE                   ;**NEW**
    211	000512				60$:				;
    212	000512					SOB	R3,40$		; LOOP FOR ALL ENTRIES
    213	000516	005015 				CLR	(R5)		; MARK END OF LIST
    214	000520					CLOSE$	R0		; CLOSE LIBRARY FILE
    215	000524	000404 				BR	LIBR1		; PROCESS LIBRARY LIST
    216	000526				LBERR0: 			;
    217	000526					CLOSE$	R0		; CLOSE LIBRARY FILE
    218	000532				LBERR:				;
    219	000532	000167 	000000G			JMP	$P2OPE		; REPORT ERROR
    220
    221					;
    222					; VERIFY PRESENCE OF STB FILE FOR EACH LIBRARY AND
    223					; CREATE APPROPRIATE LIST ENTRIES
    224					;
    225
    226	000536				LIBR1:				;
    227	000536	012704 	000000G			MOV	#$PARM,R4	; POINT TO LIBRARY NAME
P2LBR	MACRO M1108  05-DEC-77 23:01  PAGE 3-4


    228	000542	016767 	177312 	177266 		MOV	STB,LBRNB+N.FTYP ; SET DEFAULT TYPE TO 'STB'
    229	000550				10$:				;
    230	000550	005714 				TST	(R4)		; PROCESSED ENTIRE LIST?
    231	000552	001001 				BNE	20$		; IF NE NO
    232	000554					RETURN			; YES, EXIT
    233	000556				20$:				;
    234	000556					CALL	FNDLF		; FIND LIBRARY STB FILE
    235	000562	026727 	000004G	000003 		CMP	$LBRHD+4,#3	; CHECK NO. OF LIBRARY REFERENCES
    236	000570	000261 				SEC			; ASSUME ERROR                                  ;**NEW**
    237	000572	002053 				BGE	90$		; IF GE ERROR, TOO MANY REFERENCES              ;**NEW**
    238	000574				30$:				;                                               ;**-1
    239	000574	162704 	000006 			SUB	#6,R4		; ADJUST POINTER TO MATCH OFFSETS
    240	000600	012700 	000640'			MOV	#60$,R0		; SET DISPATCH TABLE ADDRESS                    ;**NEW**
    241	000604	012703 	000000C			MOV	#<S$V1*400!E$R71>,R3 ; ASSUME INVALID APR RESERVATION           ;**NEW**
    242	000610	016401 	000000G			MOV	L$DFLG(R4),R1	; GET LIBRARY FLAGS                             ;**NEW**
    243	000614	032701 	000000G			BIT	#LD$RSV,R1	; APR RESERVED?                                 ;**NEW**
    244	000620	001401 				BEQ	40$		; IF EQ NO                                      ;**NEW**
    245	000622	022020 				CMP	(R0)+,(R0)+	; INCREASE TABLE ADDRESS                        ;**NEW**
    246	000624				40$:				;                                               ;**NEW**
    247	000624	032701 	000000G			BIT	#LD$REL,R1	; RELOCATABLE LIBRARY?                          ;**NEW**
    248	000630	001401 				BEQ	50$		; IF EQ NO                                      ;**NEW**
    249	000632	005720 				TST	(R0)+		; INCREMENT TABLE ADDRESS                       ;**NEW**
    250	000634				50$:				;                                               ;**NEW**
    251	000634	000170 	000000 			JMP	@(R0)		; DISPATCH ON FLAGS                             ;**NEW**
    252	000640				60$:				;                                               ;**NEW**
    253	000640	000670'				.WORD	80$		; ADDRESS BOUND CHECK                           ;**NEW**
    254	000642	000650'				.WORD	70$		; ADDRESS BOUND CHECK IF NONMAPPED              ;**NEW**
    255	000644	000000G				.WORD	$P2OPE		; RESERVED,ABS=ERROR                            ;**NEW**
    256	000646	000670'				.WORD	80$		; ADDRESS BOUND CHECK IF APR RESERVED           ;**NEW**
    257	000650				70$:				;                                               ;**NEW**
    258	000650	005002 				CLR	R2		; ASSUME MAPPED SYSTEM                          ;**NEW**
    259	000652	032767 	000000G	000000G		BIT	#MP$SY,$SWTCH	; TARGET MAPPED?                                ;**NEW**
    260	000660	001014 				BNE	85$		; IF NE YES, BYPASS BOUND CHECK FOR PIC LIBR.   ;**NEW**
    261	000662	052764 	000000G	000000G		BIS	#LD$RSV,L$DFLG(R4) ; SET APR RESERVED FLAG                      ;**NEW**
    262	000670				80$:				;                                               ;**NEW**
    263	000670	012703 	000000C			MOV	#<S$V1*400!E$R80>,R3 ; ASSUME INCORRECT ALIGNMENT               ;**NEW**
    264	000674	016401 	000000G			MOV	L$DSA(R4),R1	; GET STARTING ADDRESS                          ;**NEW**
    265	000700	036701 	000000G			BIT	$ADBND,R1	; CHECK ADDRESS BOUND                           ;**NEW**
    266	000704	001114 				BNE	FNDLF1		; IF NE BAD ALIGNMENT                           ;**NEW**
    267	000706	016402 	000000G			MOV	L$DLTH(R4),R2	; GET LENGTH OF LIBRARY                         ;**NEW**
    268	000712				85$:				;                                               ;**NEW**
    269	000712	010400 				MOV	R4,R0		; GET ENTRY ADDRESS                             ;**NEW**
    270	000714	005720 				TST	(R0)+		; POINT TO NAME                                 ;**NEW**
    271	000716					CALL	$VLBMP		; CHECK MAPPING                                 ;**NEW**
    272	000722				90$:				;                                               ;**NEW**
    273	000722	012703 	000000C			MOV	#<S$V1*400!E$R61>,R3 ; ASSUME ALLOCATION CONFLICT               ;**NEW**
    274	000726	103503 				BCS	FNDLF1		; IF C/S ERROR                                  ;**NEW**
    275	000730				100$:				;                                               ;**NEW**
    276	000730	012701 	000000G			MOV	#L$DLGH,R1	; GET LENGTH OF LIBRARY ENTRY                   ;**NEW**
    277	000734					CALL	$ALBLK		; ALLOCATE MEMORY                               ;**NEW**
    278	000740	012703 	000004G			MOV	#$LBRHD+4,R3	; GET ADDRESS OF NO. OF LIBRARIES               ;**NEW**
    279	000744	005213 				INC	(R3)		; INCREMENT NO. OF REQUESTS                     ;**-13
    280	000746	010053 				MOV	R0,@-(R3)	; LINK NEW ENTRY TO OLD LAST.
    281	000750	010013 				MOV	R0,(R3)		; SET THIS ENTRY AS LAST
    282	000752	022024 				CMP	(R0)+,(R4)+	; BYPASS LINK WORD FOR COPY                     ;**-2
    283	000754	012701 	000000G			MOV	#L$DFLG,R1	; SET BYTE COUNT
    284	000760				130$:				;                                               ;**NEW**
P2LBR	MACRO M1108  05-DEC-77 23:01  PAGE 3-5


    285	000760	112420 				MOVB	(R4)+,(R0)+	; COPY BLOCK                                    ;**-1
    286	000762					SOB	R1,130$		;                                               ;**NEW**
    287	000766					CALL	$ALEL1		; ALLOCATE LARGE ELEMENT DESCRIPTOR.            ;**-1
    288	000772					CALL	$LCKPG		; LOCK PAGE IN MEMORY                           ;**NEW**
    289	000776	011360 	000000G			MOV	(R3),E$LLGH(R0)	; SET BACK POINTER TO LIBRARY LIST
    290	001002	012760 	000000G	000000G		MOV	#SW$RL,E$LSWT(R0); SET LIBRARY SWITCH
    291	001010	010146 				MOV	R1,-(SP)	; SAVE VIRTUAL ADDRESS OF DESCRIPTOR            ;**NEW**
    292	001012	010001 				MOV	R0,R1		; SAVE REAL ADDRESS                             ;**NEW**
    293	001014					CALL	$GTRT		; GET REAL ADDRESS OF ROOT SEGMENT              ;**NEW**
    294	001020	062700 	000000G			ADD	#S$GELT,R0	; POINT TO ELEMENT DESCRIPTOR LISTHEAD          ;**NEW**
    295	001024	012061 	000000G			MOV	(R0)+,E$LNXT(R1) ; COPY ADDRESS OF FIRST ELEMENT                ;**NEW**
    296	001030	001001 				BNE	140$		; IF NE, LIST NOT EMPTY                         ;**NEW**
    297	001032	011610 				MOV	(SP),(R0)	; ELSE SET THIS ELEMENT AS LAST ALSO            ;**NEW**
    298	001034				140$:				;                                               ;**NEW**
    299	001034	011640 				MOV	(SP),-(R0)	; SET ELEMENT AS FIRST                          ;**NEW**
    300	001036	012601 				MOV	(SP)+,R1	; GET ADDRESS OF DESCRIPTOR                     ;**NEW**
    301	001040					CALL	$UNLPG		; UNLOCK PAGE                                   ;**NEW**
    302	001044	000641 				BR	10$		; PROCESS REMAINDER OF LIST.                    ;**-7
    303
    304						.IFF
    305
    306					$LIBR::				;
    307						SAVVR			;++003 SAVE VOLATILE REGISTERS
    308						MOV	R3,R4		;++003 SAVE NUMBER OF PARAMETERS
    309						MOV	$TSKPT,R0	;++003 GET TASK IMAGE RECORD BLOCK
    310						MOV	(PC)+,R3	;++003 ASSUME BUILDING PIC LIBRARY
    311						.BYTE	E$R66,S$V1	;++003 DIAGNOSTIC
    312					;++003
    313						BIT	#SW$PI,R$SWTH(R0) ;++003 CURRENTLY BUILDING PIC LIBRARY?
    314						BNE	7$		;++003 YES -- LIBRARY REFERENCES ILLEGAL
    315					5$:
    316						CMP	(R5)+,(R5)+	;++003 POINT TO ACCESS TYPE
    317						MOV	(PC)+,R3	;++003 ASSUME INVALID ACCESS REQUESTED
    318						.BYTE	E$R63,S$V1	;++003 DIAGNOSTIC
    319						MOV	#LD$ACC,R2	;++003 ASSUME R/W ACCESS REQUESTED
    320						CMP	(PC)+,(R5)	;++003 R/W?
    321						.RAD50	/RW /		;++003
    322						BEQ	10$		;++003 IF .EQ. - YES
    323						CLR	R2		;++003 ASSUME R/O
    324						CMP	(PC)+,(R5)	;++003 R/O?
    325						.RAD50	/RO /		;++003
    326						BEQ	10$		;++003 IF .EQ. - OK
    327					7$:
    328						JMP	LBERR		;++003 ELSE INVALID ACCESS - ERROR
    329					10$:
    330						MOV	#PARM-2,R5	;++003 SET R5 SO OFFSETS MATCH
    331						CMP	R4,#2		;++003 APR RESERVATION REQUESTED
    332						BEQ	20$		;++003 IF EQUAL - NO
    333						MOV	(PC)+,R3	;++003 ASSUME ILLEGAL RESERVATION
    334						.BYTE	E$R67,S$V1	;++003 DIAGNOSTIC
    335						CMP	12(R5),#7	;++003 APR 7 IS HIGHEST LEGAL APR
    336						BHI	7$		;++017 IF HI ERROR
    337						MOV	12(R5),L$DAPR(R5) ;++003 SET APR NUMBER
    338						BEQ	7$		;++017 APR 0 ILLEGAL
    339						BIS	#LD$RSV,R2	;++003 SET APR RESERVATION FLAG
    340					20$:
    341						MOV	R2,L$DFLG(R5)	;++003 SETUP FLAG WORD
P2LBR	MACRO M1108  05-DEC-77 23:01  PAGE 3-6


    342						MOV	#LBRNB,R0	;++003 GET ADDRESS OF DEFAULT NAME BLOCK
    343						ADD	#N.FTYP,R0	;++003 POINT TO DEFAULT FILE TYPE
    344						MOV	(PC)+,(R0)	;++003 SET DEFAULT FILE TYPE TO '.TSK'
    345						.RAD50	/TSK/		;++003
    346						MOV	#PARM,R4	;++003 POINT TO LIBRARY NAME
    347						CALL	FNDLF		;++003 FIND LIBRARY FILE
    348						OPEN$R	R0		;++003 OPEN LIBRARY FILE
    349						BCS	7$		;++017 IF CS OPEN FAILURE
    350						MOVB	#1,F.RTYP(R0)	;++003 SET FIXED LENGTH RECORD TYPE.
    351						MOV	#512.,F.RSIZ(R0)	;++003 SET RECORD SIZE.
    352						BISB	#2,F.RACC(R0)	;++003 SET FOR RANDOM ACCESS
    353						GET$	R0		;++003 GET FIRST RECORD BLOCK
    354						MOV	(PC)+,R3	;++003 ASSUME I/O ERROR
    355						.BYTE	E$R69,S$V1	;++003 DIAGNOSTIC
    356						BCS	LBERR0		;++003 IF CS - I/O ERROR
    357						MOV	F.NRBD+2(R0),R4	;++003 GET ADDRESS OF RECORD BUFFER
    358					;++003
    359					;++003  EXTRACT PERTINENT INFORMATION FROM LABEL TO BUILD FIRST LIBRARY REFERENC
    360					;++003
    361						MOV	L$BLDZ(R4),L$DLTH(R5) ;++003 GET LOAD SIZE
    362						BIT	#1,L$BPIC(R4)	;++003 PIC LIBRARY?
    363						BEQ	25$		;++003 NO
    364						BIS	#LD$REL,L$DFLG(R5) ;++003 YES--SET PIC FLAG
    365					25$:
    366						ADD	#L$BDAT,R4	;++003 POINT TO DATE
    367						ADD	#L$DDAT,R5	;++003
    368						MOV	(R4)+,(R5)+	;++003 GET DATE
    369						MOV	(R4)+,(R5)+	;++003
    370						MOV	(R4)+,(R5) 	;++003 R4 NOW POINTS TO LIB ENTIRES
    371					;++003
    372						MOV	#PARM,R5	;++003 RESET R5
    373						ADD	#L$DFLG,R5	;++003 NOW POINT TO FIRST FREE ENTRY
    374						MOV	#7,R3		;++003 SET LOOP COUNT
    375					30$:
    376						MOV	#L$DAPR,R2	;++003 SET COUNT OF WORDS TO MOVE
    377						MOV	(R4)+,(R5)+	;++003 COPY FIRST WORD OF ENTRY
    378						BNE	40$		;++003 TEST IF ENTRY EXISTS
    379						ADD	R2,R4		;++003 NO, SKIP TO NEXT
    380						TST	-(R5)		;++003 RESET BUFFER POINTER
    381						BR	50$		;++003 CONTINUE
    382					40$:
    383						MOVB	(R4)+,(R5)+	;++003 COPY REMAINDER OF ENTRY
    384						SOB	R2,40$		;++003 LOOP UNTIL DONE
    385						BIT	#$LD$REL,-2(R5)	;++017 SEE IF PIC
    386						BEQ	50$		;++017 IF EQ NO
    387						BIS	#LD$RSV,-2(R5)	;++003 FIX THIS LIBRARY IN TASK SPACE
    388					50$:	SOB	R3,30$		;++003 LOOP FOR ALL ENTRIES
    389						CLR	@R5		;++003 MARK END-OF-LIST
    390					;++003
    391						MOV	#4,F.RCNM+2(R0) ;++003 SETUP TO LOOK AT HEADER
    392						GET$	R0		;++003 GET HEADER
    393						MOV	(PC)+,R3	;++003 ASSUME I/O ERROR
    394						.BYTE	E$R69,S$V1	;++003 DIAGNOSTIC
    395						BCS	LBERR0		;++003 EXIT ON ERROR
    396						MOV	#PARM-2,R5	;++003 RESET TO FIRST ENTRY - MATCH OFFSETS
    397						MOV	F.NRBD+2(R0),R4	;++003 GET POINTER TO HEADER
    398						SUB	#H$DFLP,R4	;++003 MATCH OFFSETS
P2LBR	MACRO M1108  05-DEC-77 23:01  PAGE 3-7


    399						SUB	H$DSIZ(R4),L$DLTH(R5) ;++003 COMPUTE LENGTH
    400						BIT	#LD$RSV,L$DFLG(R5) ;++003 WAS AN APR RESERVED?
    401						BNE	80$		;++003 YES - DON'T USE HEADER APR
    402						ADD	#H$DPDR,R4	;++003 POINT TO PDR REG. SET
    403						MOV	#10,R2		;++003 CHECK ALL 8
    404						MOV	(PC)+,R3	;++003 ASSUME INVALID APR
    405						.BYTE	E$R71,S$V1	;++003 DIAGNOSTIC
    406					60$:
    407						TST	(R4)+		;++003 THIS REGISTER USED
    408						BNE	70$		;++003 YES
    409						SOB	R2,60$		;++003 LOOP UNTIL DONE
    410						BR	LBERR0		;++003 ILLEGAL APR IF FALL-THRU
    411					70$:
    412						SUB	#10,R2		;++003 CONVERT COUNT TO APR#
    413						NEG	R2		;++003
    414						MOV	R2,L$DAPR(R5)	;++003 SET APR #
    415					80$:
    416						CLOSE$	R0		;++003 DONE WITH 'TSK' FILE
    417						BICB	#2,F.RACC(R0)	;++003 RESET RANDOM ACCESS BIT.
    418						BR	LIBR1		;++003 BUILD LIBRARY ENTRIES
    419					;++003
    420					LBERR0:				;++003 ERROR EXIT
    421						CLOSE$	R0		;++003 CLOSE LIBRARY FILE
    422						BICB	#2,F.RACC(R0)
    423					LBERR:	JMP	P2OPTE		;++003 ERROR ROUTINE
    424					;++003
    425					;++003  THE FOLLOWING CODE WILL:
    426					;++003 	(A) VERIFY THAT EACH REFERENCED LIBRARY HAS AN STB FILE
    427					;++003 	(B) CHECK FOR STORAGE CONFLICTS
    428					;++003 	(C) BUILD THE LIBRARY LIST
    429					;++003
    430					LIBR1:
    431						MOV	#PARM,R4	;++003 POINT TO LIBRARY NAME
    432						MOV	#LBRNB,R0	;++003 ADDRESS OF DEFAULT NAME BLOCK
    433						ADD	#N.FTYP,R0	;++003 POINT TO DEFAULT FILE TYPE
    434						MOV	(PC)+,(R0)	;++003 SET DEFAULT TYPE
    435						.RAD50	/STB/
    436					10$:
    437						TST	@R4		;++003 CHECHED ALL CANDIDATES
    438						BNE	12$		;++003 NO - CONTINUE
    439						RETURN			;++003 ELSE EXIT
    440					12$:
    441						CALL	FNDLF		;++003 FIND STB FILE
    442						SUB	#6,R4		;++004 SET BUFFER POINTER TO MATCH OFFSETS
    443						CMP	$LBRHD+4,#7	;++003 CHECK FOR TOO MANY REFERENCES
    444						BLT	15$		;++003
    445						JMP	160$		;++003 MEMORY CONFLICT
    446					15$:
    447						MOV	(PC)+,R3	;++003 ASSUME INVALID APR RESERVATION
    448						.BYTE	E$R71,S$V1	;++003 DIAGNOSTIC
    449						MOV	L$DFLG(R4),R1	;++003 FETCH FLAGS
    450						CLR	R2		;++003 CLEAR JUMP TABLE INDEX
    451						BIT	#LD$RSV,R1	;++003 APR RESERVATION REQUESTED?
    452						BEQ	20$		;++003 NO
    453						CMP	(R2)+,(R2)+	;++003 YES-SET INDEX
    454					20$:
    455						BIT	#LD$REL,R1	;++003 RELOCATABLE LIBRARY?
P2LBR	MACRO M1108  05-DEC-77 23:01  PAGE 3-8


    456						BEQ	30$		;++003 NO
    457						TST	(R2)+		;++003 YES - SET INDEX
    458					30$:
    459						JMP	@40$(R2)	;++003 DISPATCH ON INDEX
    460					40$:	.WORD	50$		;++003 MEMORY CONFLICT CHECK
    461						.WORD	60$		;++003 BYPASS CHECK IF PIC
    462						.WORD	P2OPTE		;++003 APR REQUESTED FOR ABS. LIBRARY
    463						.WORD	50$		;++003 MEMORY CONFLICT CHECK
    464					50$:
    465						MOV	L$DAPR(R4),R2	;++003 GET APR NUMBER
    466						SWAB	R2		;++003 COMPUTE STARTING ADDRESS/64
    467						ASR	R2		;++003
    468						MOV	R2,R3		;++003 COPY STARTING ADDRESS
    469						ADD	L$DLTH(R4),R3	;++003 COMPUTE ENDING ADDRESS +1
    470						MOV	$TSKPT,R0	;++003 GET TASK RECORD POINTER
    471						BIT	#SW$PR,R$SWTH(R0) ;++003 TASK PRIVELEGED ?
    472						BEQ	60$		;++003 IF .EQ -NO
    473						CMP	R3,#1000	;++003 SEE IF CONFLICT
    474						BHI	160$		;++003 ERROR IF HIGH
    475					;++003
    476					;++003  NOW CHECK IF MEMORY REQUIREMENTS FOR THIS LIBRARY
    477					;++003  CONFLICT WITH PREVIOUSLY SPECIFIED LIBRARIES.
    478					;++003
    479					60$:
    480						CLR	-(SP)		;++003 CLEAR LENGTH ACCUMULATION
    481						MOV	$LBRHD,R0	;++003 GET FIRST LIBRARY ENTRY
    482						BR	75$		;++003 BEGIN SCAN
    483					70$:
    484						MOV	L$DNXT(R0),R0	;++003 GET ADDRESS OF NEXT ENTRY
    485					75$:
    486						BEQ	120$		;++003 IF EQUAL-DONE WITH SCAN
    487						ADD	L$DLTH(R0),@SP	;++003 ACCUMULATE LENGTH
    488					;++003
    489						CMP	L$DNME(R0),L$DNME(R4) ;++003 NAMES MATCH?
    490						BNE	80$		;++003 NO
    491						CMP	L$DNME+2(R0),L$DNME+2(R4) ;++003 CHECK SECOND HALF OF NAME
    492						BEQ	150$		;++003 SAME NAME-MEMORY CONFLICT
    493					80$:
    494						MOV	L$DFLG(R0),R5	;++003 GET CURRENT ENTRY FLAGS
    495						MOV	L$DFLG(R4),R1	;++003 NEW ENTRY
    496						BIT	#LD$RSV,R5	;++003 CURRENT ENTRY HAVE RESERVED APR
    497						BNE	90$		;++003 YES-CHECK NEW ENTRY
    498						BIT	#LD$REL,R5	;++003 CHECK ENTRY ABS.
    499						BNE	70$		;++003 NO
    500					90$:	BIT	#LD$RSV,R1	;++003 NEW ENTRY HAVE RESERVED APR ?
    501						BNE	100$		;++003 YES CHECK FOR CONFLICT
    502						BIT	#LD$REL,R1	;++003 NO - NEW ENTRY ABS?
    503						BNE	70$		;++003 NO -CHECK NEXT ENTRY ON LIST
    504					100$:
    505						MOV	L$DAPR(R0),R1	;++003 GET APR --  CURRENT ENTRY
    506						SWAB	R1		;++003 GET STARTING ADDRESS/64
    507						ASR	R1		;++003
    508						CMP	R2,R1		;++003 CHECK LOW ADDRESSES
    509						BHIS	110$		;++003 NEW ENTRY ABOVE OLD
    510						CMP	R3,R1		;++003 CHECK HIGH ADDRESS OF NEW VS LOW
    511						BHI	150$		;++003 IF HI - MEMORY CONFLICT
    512						BR	70$		;++004 NEW ENTRY ENTIRELY BELOW - OK
P2LBR	MACRO M1108  05-DEC-77 23:01  PAGE 3-9


    513					110$:
    514						ADD	L$DLTH(R0),R1	;++003 CALCULATE END ADDRESS+1
    515						CMP	R2,R1		;++003 CHECK LOW VS. HIGH
    516						BLO	150$		;++003 IF LOW-MEMORY CONFLICT
    517						BR	70$		;++003 ELSE CHECK NEXT ENTRY
    518					120$:
    519						ADD	L$DLTH(R4),(SP)	;++003 ACCUMULATE LENGTH
    520						CMP	(SP)+,#<28.*1024.>/32. ;++009 WITHIN RANGE ?
    521						BHI	160$		;++003 IF HI-NO
    522					;++003
    523					;++003  INSERT NEW ENTRY IN LIST
    524					;++003
    525						MOV	#L$DLGH,R1	;++003 GET SIZE OF LIBRARY LIST ENTRY
    526						CALL	$ALBLK		;++003 ALLOCATE STORAGE
    527						MOV	#$LBRHD+4,R3	;++003 GET ADDRESS OF NO. OF LIBRARY REQUESTS
    528						INC	@R3		;++003 INCREMENT NO. OF REQUESTS
    529						MOV	R0,@-(R3)	;++003 LINK NEW ENTRY TO OLD LAST
    530						MOV	R0,(R3)		;++003 SET THIS ENTRY AS LAST
    531						CMP	(R0)+,(R4)+	;++003 STEP OVER LINK WORD FOR COPY
    532						MOV	#L$DFLG,R1	;++003 SET NUMBER OF BYTES TO MOVE
    533					130$:	MOVB	(R4)+,(R0)+	;++003 MOVE BLOCK
    534						SOB	R1,130$		;++003 REPEAT
    535						CALL	$ALEL1		;++003 ALLOCATE LARGE ELEMENT DESCRIPTOR
    536						MOV	(R3),E$LLGH(R0)	;++003 SET BACK POINTER TO LIBRARY LIST ENTRY
    537						MOV	#SW$RL,E$LSWT(R0) ;++003 SET LIBRARY SWITCH
    538						MOV	$RTSEG,R3	;++003 FETCH ADDRESS OF ROOT SEGMENT
    539						ADD	#S$GELT,R3	;++003 POINT TO ELEMENT LISTHEAD
    540						MOV	(R3)+,E$LNXT(R0) ;++003 LINK OLD FIRST TO NEW FIRST
    541						BNE	140$		;++003 THIS ENTRY ALSO LAST?
    542						MOV	R0,(R3)		;++003 YES - SET AS LAST ENTRY
    543					140$:
    544						MOV	R0,-(R3)	;++003 MARK THIS ENTRY AS FIRST
    545						JMP	10$		;++003 GO AGAIN
    546					150$:	TST	(SP)+		;++003 FIX STACK
    547					160$:	MOV	(PC)+,R3	;++003 MEMORY CONFLICT
    548						.BYTE	E$R61,S$V1	;++003 DIAGNOSTIC
    549						BR	FNDLF1		;++003
    550
    551						.ENDC
    552
    553					;
    554					; SUBROUTINE TO FIND LIBRARY FILE (TSK OR STB)
    555					;
    556
    557	001046				FNDLF:				;
    558	001046	016700 	000000G			MOV	$INIPT,R0	; GET INPUT FILE RECORD BLOCK
    559	001052	016046 	000044 			MOV	F.DSPT(R0),-(SP);SAVE DATA SET DESCRIPTOR ADDRESS
    560	001056	012760 	000000'	000044 		MOV	#LBRDS,F.DSPT(R0);SET LIBRARY DATA SET DESCRIPTOR
    561	001064	016046 	000046 			MOV	F.DFNB(R0),-(SP);SAVE DEFAULT NAME BLOCK ADDRESS
    562	001070	012701 	000022'			MOV	#LBRNB,R1	;GET ADDRESS OF LIBRARY DEFAULT NAME BLOCK
    563	001074	010160 	000046 			MOV	R1,F.DFNB(R0)	;SET LIBRARY DEFAULT NAME BLOCK ADDRESS
    564	001100	012461 	000006 			MOV	(R4)+,N.FNAM(R1);INSERT NAME OF LIBRARY
    565	001104	012461 	000010 			MOV	(R4)+,N.FNAM+2(R1);
    566	001110					CALL	$PRFND		;FIND FILE
    567	001114	012660 	000046 			MOV	(SP)+,F.DFNB(R0);RESTORE DEFAULT NAME BLOCK ADDRESS
    568	001120	012660 	000044 			MOV	(SP)+,F.DSPT(R0);RESTORE DATA SET DESCRIPTOR ADDRESS
    569	001124	012703 				MOV	(PC)+,R3	;ASSUME FIND FAILURE
P2LBR	MACRO M1108  05-DEC-77 23:01  PAGE 3-10


    570	001126	   000G	   000G			.BYTE	E$R62,S$V1	;DIAGNOSTIC
    571	001130	103401 				BCS	10$		;IF CS FIND FAILURE
    572	001132					RETURN			;
    573	001134	005726 			10$:	TST	(SP)+		;CLEAN STACK
    574	001136	000167 	000000G		FNDLF1:	JMP	$P2OPE		;
    575
    576		000001 				.END
P2LBR	MACRO M1108  05-DEC-77 23:01  PAGE 3-11
SYMBOL TABLE

B.BBFS= 000010   	FD.TTY= 000004   	F.MBCT= 000054   	L$DLTH= ****** GX	S.FNAM= 000006
B.BFST= 000015   	FD.WBH= 000002   	F.MBC1= 000055   	L$DSA = ****** GX	S.FNB = 000036
B.NXBD= 000012   	FF    = 000014   	F.MBFG= 000056   	MP$SY = ****** GX	S.FNBW= 000017
B.VBN = 000004   	FNDLF   001046R  	F.NRBD= 000024   	NB.DEV= 000200   	S.FNTY= 000004
CR    = 000015   	FNDLF1  001136R  	F.NREC= 000030   	NB.DIR= 000100   	S.FTYP= 000002
E$LLGH= ****** GX	FO.APD= 000106   	F.OVBS= 000030   	NB.NAM= 000004   	S.NFEN= 000020
E$LNXT= ****** GX	FO.MFY= 000002   	F.RACC= 000016   	NB.SD1= 000400   	TSK     000062R
E$LSWT= ****** GX	FO.RD = 000001   	F.RATT= 000001   	NB.SD2= 001000   	TS$NHD= ****** GX
E$R61 = ****** GX	FO.UPD= 000006   	F.RCNM= 000034   	NB.SNM= 000040   	TS$PIC= ****** GX
E$R62 = ****** GX	FO.WRT= 000016   	F.RCTL= 000017   	NB.STP= 000020   	VT    = 000013
E$R63 = ****** GX	F.ALOC= 000040   	F.RSIZ= 000002   	NB.SVR= 000010   	$ADBND= ****** GX
E$R66 = ****** GX	F.BBFS= 000062   	F.RTYP= 000000   	NB.TYP= 000002   	$ALBLK= ****** GX
E$R67 = ****** GX	F.BDB = 000070   	F.STBK= 000036   	NB.VER= 000001   	$ALEL1= ****** GX
E$R68 = ****** GX	F.BGBC= 000057   	F.UNIT= 000136   	N.DID = 000024   	$GTRT = ****** GX
E$R71 = ****** GX	F.BKDN= 000026   	F.URBD= 000020   	N.DVNM= 000032   	$INIPT= ****** GX
E$R80 = ****** GX	F.BKDS= 000020   	F.VBN = 000064   	N.FID = 000000   	$LBRHD= ****** GX
FA.APD= 000100   	F.BKEF= 000050   	F.VBSZ= 000060   	N.FNAM= 000006   	$LCKPG= ****** GX
FA.CRE= 000010   	F.BKP1= 000051   	HT    = 000011   	N.FTYP= 000014   	$LIBR   000064RG
FA.EXT= 000004   	F.BKST= 000024   	LBERR   000532R  	N.FVER= 000016   	$PARM = ****** GX
FA.NSP= 000100   	F.BKVB= 000064   	LBERR0  000526R  	N.NEXT= 000022   	$PRFND= ****** GX
FA.RD = 000001   	F.CNTG= 000034   	LBRDR   000014R  	N.STAT= 000020   	$P2OPE= ****** GX
FA.SHR= 000040   	F.DFNB= 000046   	LBRDRE  000021R  	N.UNIT= 000034   	$SAVVR= ****** GX
FA.TMP= 000020   	F.DSPT= 000044   	LBRDS   000000R  	PAR$$$= 000000   	$STRCB= ****** GX
FA.WRT= 000002   	F.DVNM= 000134   	LBRNB   000022R  	R$$11M= 000000   	$SWTCH= ****** GX
FD.BLK= 000010   	F.EFBK= 000010   	LD$ACC= ****** GX	R.FIX = 000001   	$TKSW = ****** GX
FD.CCL= 000002   	F.EFN = 000050   	LD$REL= ****** GX	R.VAR = 000002   	$UNLPG= ****** GX
FD.CR = 000002   	F.EOBB= 000032   	LD$RSV= ****** GX	SPA   = 000040   	$VLBMP= ****** GX
FD.DIR= 000010   	F.ERR = 000052   	LF    = 000012   	STB     000060R  	$$    = 000001
FD.FTN= 000001   	F.FACC= 000043   	LIBR1   000536R  	SW$NH = ****** GX	.CLOSE= ****** G
FD.INS= 000010   	F.FFBY= 000014   	L$BDAT= ****** GX	SW$PI = ****** GX	.GETSQ= ****** G
FD.PLC= 000004   	F.FNAM= 000110   	L$BFLG= ****** GX	SW$RL = ****** GX	.OPFNB= ****** G
FD.RAH= 000001   	F.FNB = 000102   	L$BLDZ= ****** GX	S$GELT= ****** GX	...GBL= 000000
FD.RAN= 000002   	F.FTYP= 000116   	L$BSA = ****** GX	S$V1  = ****** GX	...PC1= 000000
FD.REC= 000001   	F.FVER= 000120   	L$DDAT= ****** GX	S.BFHD= 000020   	...PC2= 000036R
FD.RWM= 000001   	F.HIBK= 000004   	L$DFLG= ****** GX	S.FATT= 000016   	...PC3= 000000
FD.SDI= 000020   	F.LUN = 000042   	L$DLGH= ****** GX	S.FDB = 000140   	...TPC= 000140
FD.SQD= 000040

. ABS.	000000	   000
      	001142	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2891 WORDS  ( 12 PAGES)
DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:00:36
[44,10]P2LBR,[44,20]P2LBR/-SP=[44,30]MACFLM.,FCSPR.,P2LBR.004
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3


      1						.TITLE	P2OPT
      2						.IDENT	/16/
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					; COPYRIGHT   1975,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					;
      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     12					;
     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     15					; EQUIPMENT CORPORATION.
     16					;
     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     19					;
     20					; VERSION 16
     21					;                                                                               ;**-1
     22					; D.N. CUTLER 6-NOV-72
     23					;
     24					; PHASE 2 OPTION PROCESSING
     25					;
     26					; MODIFICATIONS:
     27					;
     28					; NO.		DATE		PROGRAMMER
     29					; ---		---		----------
     30					;
     31					; 040		24-APR-75	C. MONIA
     32					; 041		15-MAY-75	C. MONIA
     33					;
     34					;
     35					; EQUATED SYMBOLS
     36					;
     37					; DEFAULT PARAMETERS
     38					;
     39
     40		000004 			DFAFL=4				;DEFAULT ACTIVE FILES
     41		000024 			DFPOL=20.			;DEFAULT POOL USAGE
     42		001000 			DFSTK=256.*2			;DEFAULT STACK SIZE
     43		000006 			DFUNT=6				; DEFAULT NUMBER OF LOGICAL UNITS               ;**NEW**
     44					                                                                                ;**-11
     45					;
     46					; MULTI-PARAMETER TRUE/FALSE DEFINITIONS
     47					;
     48
     49		000000 			F=0				;NO MULTI PARAMETER CONSTRUCTION ALLOWED
     50		000001 			T=1				;MULTI PARAMETER CONSTRUCTION IS ALLOWED
     51
     52					;
     53					; MEMORY ALLOCATION FLAGS
     54					;
     55
     56		000001 			EX$TSK==000001			;++041 EXTEND TASK KEYWORD LAST INVOKED
     57		000002 			PA$RT==000002			;++041 PARTITION KEYWORD LAST INVOKED
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-1


     58
     59
     60
     61					;
     62					; LOCAL MACROS
     63					;
     64					; DEFINE OPTION
     65					;
     66					; DFO	KW,MA,MS,A
     67					;
     68					; WHERE:
     69					;
     70					;	KW=A 1 TO 6 CHARACTER OPTION IDENTIFIER KEYWORD AND SUBROUTINE
     71					;		ADDRESS. THE SUBROUTINE IS CALLED AFTER THE PARAMETERS
     72					;		HAVE BEEN PARSED.
     73					;	MA=MINIMUM NUMBER OF PARAMETERS REQUIRED.
     74					;	MS=MULTI-PARAMETER T/F SWITCH.
     75					;	A=ADDRESS OF THE CONVERSION ROUTINES FOR THE ARGUMENTS. THIS
     76					;		ARGUMENT IS ASSUMED TO HAVE THE CONSTRUCTION <A,...,Z>.
     77					;
     78
     79						.MACRO	DFO KW,MA,MS,A
     80						.PSECT	ARGBLK, D,GBL
     81					$$=.
     82					NN=0
     83						.IRP	X,<A>
     84					NN=NN+1
     85						.WORD	X
     86						.ENDM
     87						.PSECT	OPTBLK,D,GBL
     88					MM=.
     89					K$EY==.-MM
     90						.WORD	0
     91						.WORD	0
     92					.=MM
     93						.RAD50	/KW/
     94					.=MM+4
     95					M$IN==.-MM
     96					M$AX==.-MM+1
     97						.BYTE	MA,NN
     98					A$RG==.-MM
     99						.WORD	$$+MS
    100					S$UB==.-MM
    101						.WORD	KW
    102					L$NG==.-MM
    103						.PSECT	OPCD$I,I,GBL
    104						.ENDM
    105
    106					;
    107					; LOCAL DATA
    108					;
    109					;
    110					; ADDRESS BOUND
    111					;
    112
    113	000000				$ADBND::.BLKW	1		;
    114
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-2


    115					;
    116					; HIGH ADDRESS LIMIT
    117					;
    118
    119	000002				$ADLIM::.BLKW	1		;
    120
    121					;
    122					; MEMORY ALLOCATION FLAGS WORD
    123					;
    124
    125	000004				$MEMFL::.BLKW	1		;
    126
    127					                                                                                ;**NEW**
    128					;                                                                               ;**NEW**
    129					; MAXIMUM LUN ASSIGNMENT                                                        ;**NEW**
    130					;                                                                               ;**NEW**
    131					                                                                                ;**NEW**
    132	000006				$MXASG::.BLKW	1		;                                               ;**NEW**
    133					                                                                                ;**NEW**
    134
    135					;
    136					; TASK FILE SWITCHES
    137					;
    138
    139	000010				$TKSW::	.BLKW	1		;
    140
    141	000000					.PSECT	OPTBLK ,D,GBL
    142
    143	000000				$KWRD::				; REF LABEL
    144	000012					.PSECT
    145
    146					;
    147					; PARAMETER DATA
    148					;
    149
    150	000012				$NUMP::	.BLKW	1		; NUMBER OF PARAMETERS
    151	000014	126401 	057057 		IOBSCT:	.RAD50	/$$IOB1/	;MAX LENGTH SECTION NAME
    152	000020	126407 	006617 		OBFSCT:	.RAD50	/$$OBF1/	; FORTRAN OTS FORMATTING BUFFER SECTION         ;**NEW**
    153
    154					;
    155					; PARAMETER STORAGE
    156					;
    157
    158	000024				SCTNAM:	.BLKW	2		; RADIX 50 SECTION NAME                         ;**NEW**
    159	000030				$PARM::				;
    160
    161						.IF	NDF	R$$11M
    162
    163						.BLKW	65.
    164
    165						.IFF
    166
    167						.BLKW	33.
    168
    169						.ENDC
    170
    171	000132	000026 			OPMDS:	.WORD	OPMSE-OPMSG	;OPTION SOLICITATION MESSAGE DESCRIPTOR
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-3


    172	000134	000136'				.WORD	OPMSG		;
    173	000136	   015 	   012 	   105 	OPMSG:	.ASCII	<15><12>/ENTER OPTIONS:/;
	000141	   116 	   124 	   105
	000144	   122 	   040 	   117
	000147	   120 	   124 	   111
	000152	   117 	   116 	   123
	000155	   072
    174	000156	   015 	   012 	   124 		.ASCII	<15><12>/TKB>/	;                                               ;**NEW**
	000161	   113 	   102 	   076
    175	000164				OPMSE:				; REF LABEL                                     ;**NEW**
    176						.EVEN                                                                   ;**-16
    177
    178					;+
    179					; **-$P2OPT-PHASE 2 OPTION PROCESSING
    180					;
    181					; THIS ROUTINE IS CALLED AT THE END OF PHASE 1 TO READ AND PROCESS
    182					; OPTION INPUT. DEFAULTS ARE ESTABLISHED AND THEN OPTIONS ARE
    183					; PROCESSED.
    184					;
    185					; INPUTS:
    186					;
    187					;	NONE.
    188					;
    189					; OUTPUTS:
    190					;
    191					;	DEFAULTS ARE ESTABLISHED AND OPTIONS ARE PROCESSED.
    192					;-
    193
    194	000164				$P2OPT::SAVRG			;SAVE NONVOLITILE REGISTERS
    195
    196					;
    197					; SET DEFAULTS
    198					;
    199
    200	000170	005000 				CLR	R0		;++041 SET FOR DEFAULT PARTITION
    201	000172					CALL	$GTPPR		;++041 GET NAME OF DEFAULT PARTITION
    202	000176	012767 	000004 	000000G		MOV	#DFAFL,$ACTFL	;SET DEFAULT ACTIVE FILES
    203	000204	005067 	000000G			CLR	$FSIZI		; CLEAR FILE SIZE INDICATOR                     ;**NEW**
    204	000210	012767 	000006 	000000G		MOV	#DFUNT,$NUNIT	;SET DEFAULT NUMBER OF UNITS
    205	000216	005067 	000000G			.IIF	DF	R$$11M, CLR	$HGHAD	; CLEAR ADDRESS LIMIT
    206	000222	005067 	000000G			CLR	$LBEXT		;++041 CLEAR TASK EXTENSION SIZE
    207	000226	005067 	177552 			CLR	$MEMFL		;++041 CLEAR MEMORY ALLOCATION FLAG
    208	000232	005067 	177550 			CLR	$MXASG		; CLEAR MAXIMUM ASSIGNED LUN                    ;**NEW**
    209	000236	005067 	000000G			CLR	$ODTSZ		;CLEAR SIZE OF ODT AND TASK VECTORS
    210	000242	005067 	000000G			CLR	$ODTV		;CLEAR ODT VECTOR SYMBOL
    211	000246	005067 	000000G			CLR	$OFFST		;CLEAR OFFSET BIAS
    212						.IIF  NDF  R$$11M, MOV	#DFPOL,$POOL	; SET DEFAULT POOL USEAGE
    213	000252	005067 	000000G			CLR	$PRIOR		;CLEAR PRIORITY
    214	000256	005067 	000000G			CLR	$TNAME		;CLEAR TASK NAME
    215	000262	005067 	000002G			CLR	$TNAME+2	;
    216	000266	005067 	000000G			.IIF 	DF	R$$11M,	CLR	$TSKSZ	; CLEAR VECTOR SIZE
    217	000272	005067 	000000G			CLR	$TSKV		;CLEAR TSK VECTOR SYMBOL
    218	000276	012767 	001000 	000000G		MOV	#DFSTK,$STACK	;SET DEFAULT STACK SIZE
    219	000304	016700 	000000G			MOV	.FSRPT,R0	;++40 GET ADDRESS OF FILE STORAGE REGION 2
    220	000310	016067 	000000G	000000G		MOV	A.OWUI(R0),$TKUIC ;++040 SET TASK UIC
    221	000316	005067 	000000G			CLR	$PATHD		;INITIALIZE PATCH LISTHEAD
    222	000322	012767 	000000G	000002G		MOV	#$PATHD,$PATHD+2;LAST POINTS TO FIRST FOR EMPTY LIST
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-4


    223	000330	012700 	000000G			MOV	#$LBRHD,R0	; GET LIBRARY LISTHEAD ADDRESS
    224	000334	010001 				MOV	R0,R1		; COPY LISTHEAD ADDRESS
    225	000336	005020 				CLR	(R0)+		; CLEAR FIRST WORD OF LISTHEAD
    226	000340	010120 				MOV	R1,(R0)+	; LAST POINTS TO FIRST INITIALLY
    227	000342	005010 				CLR	(R0)		; CLEAR NUMBER OF ENTRIES
    228	000344	016701 	000000G			MOV	$TSKNM,R1	; GET V/A OF TASK FILE NAMEBLOCK
    229	000350					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    230	000354	016067 	000000G	177426 		MOV	E$LSWT(R0),$TKSW ; SAVE TASK FILE SWITCHES
    231	000362	012767 	000077 	177410 		MOV	#77,$ADBND	; ASSUME NON-MAPPED SYSTEM, SET ADDRESS BOUND
    232	000370	012767 	157777 	177404 		MOV	#157777,$ADLIM	; SET HIGH ADDRESS LIMIT
    233	000376	032767 	000000G	000000G		BIT	#MP$SY,$SWTCH	; SYSTEM MAPPED?
    234	000404	001406 				BEQ	5$		; IF EQ NO
    235	000406	012767 	017777 	177364 		MOV	#17777,$ADBND	; SET 4K ADDRESS BOUND
    236	000414	012767 	177777 	177360 		MOV	#177777,$ADLIM	; SET 32K-1 HIGH ADDRESS LIMIT
    237					                                                                                ;**-1
    238					;
    239					; INITIALIZE LUN ASSIGNMENT LISTHEAD                                            ;**NEW**
    240					;                                                                               ;**-1
    241
    242	000422				5$:				;                                               ;**NEW**
    243	000422	012700 	000000G			MOV	#$LUNHD,R0	;GET ADDRESS OF ASSIGNMENT LISTHEAD
    244	000426	010001 				MOV	R0,R1		;COPY ADDRESS
    245	000430	005020 				CLR	(R0)+		;CLEAR LINK TO FIRST
    246	000432	010110 				MOV	R1,(R0)		;LAST POINTS TO FIRST INITIALLY
    247	000434	032767 	000000G	000000G		BIT	#EN$DR,$SWTCH	; ACCEPT OPTIONS?                               ;**-11
    248	000442	001024 				BNE	70$		; IF NE, NO
    249	000444				40$:				;
    250	000444	012767 	000132'	000000G		MOV	#OPMDS,$CMFLG	; SET ADDRESS OF PROMPT DESCRIPTOR
    251	000452				50$:				;
    252	000452					CALL	$GTCML		; READ A COMMAND LINE
    253	000456	103416 				BCS	70$		; IF C/S LOGICAL EOF
    254	000460	005067 	000000G			CLR	$CMFLG		; REVERT TO DEFAULT PROMPT
    255	000464	112702 	000041 			MOVB	#'!,R2		; SET KEYWORD STATUS
    256	000470	012700 	000000G			MOV	#$LNBUF,R0	; SET BUFFER ADDRESS
    257	000474				60$:				;
    258	000474					CALL	$P2PRS		; PARSE KEYWORD INPUT
    259	000500	103764 				BCS	50$		; IF C/S SYNTAX ERROR OR END OF LINE
    260	000502	010446 				MOV	R4,-(SP)	; SAVE OPTION BLOCK ADDRESS
    261	000504					CALL	@S$UB(R4)	; CALL OPTION PROCESSOR
    262	000510	012604 				MOV	(SP)+,R4	; RESTORE OPTION BLOCK ADDRESS
    263	000512	000770 				BR	60$		; GO AGAIN
    264	000514				70$:				;
    265	000514					CALLR	$P2POP		; PERFORM POST-OPTION PROCESSING
    266
    267
    268	000000					.PSECT	OPCD$I,I,GBL
    269
    270					;
    271					; CONVERT SYMBOL WITH OFFSET VALUE
    272					;
    273
    274	000000				SYM:	CALL	$RR		;GET SYMBOL
    275	000004	005300 				DEC	R0		;BACK UP TO TERMINATOR
    276	000006					CALL	$OT		;GET OFFSET
    277	000012					RETURN			;
    278					                                                                                ;**NEW**
    279					;                                                                               ;**NEW**
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-5


    280					; ABORT TASK BUILD                                                              ;**NEW**
    281					;                                                                               ;**NEW**
    282					                                                                                ;**NEW**
    283	000014					DFO	ABORT,1,T,$DC                                                   ;**NEW**
    284					                                                                                ;**NEW**
    285	000014				ABORT:				;                                               ;**NEW**
    286	000014	012703 	000000C			MOV	#<S$V2*400!E$R83>,R3 ; GET USER ABORT MESSAGE                   ;**NEW**
    287	000020	000167 	000546'			JMP	$P2OPE		; RESTART TKB                                   ;**NEW**
    288
    289					;
    290					; ABSOLUTE PATCH
    291					;
    292
    293	000024					DFO	ABSPAT,3,T,^/$RR,$OT,$OT,$OT,$OT,$OT,$OT,$OT,$OT,$OT/
    294
    295	000024				ABSPAT:	SAVVR			;SAVE VOLITILE REGISTERS
    296	000030	010301 				MOV	R3,R1		;CALCULATE SIZE OF BLOCK NEEDED
    297	000032	006301 				ASL	R1		;CONVERT TO BYTES
    298	000034	062701 	000012 			ADD	#6+4,R1		;ALLOW FOR EXTRA STORAGE
    299	000040					CALL	$ALBLK		;ALLOCATE STORAGE
    300	000044	005004 				CLR	R4		;SET TYPE TO ABS PATCH
    301	000046	005303 				DEC	R3		;DECREMENT WORD COUNT
    302	000050	000537 				BR	GBLPT1		;
    303
    304					;
    305					; ACTIVE FILES
    306					;
    307
    308	000052					DFO	ACTFIL,1,F,$DC
    309
    310	000052				ACTFIL:				;
    311	000052	011567 	000000G			MOV	(R5),$ACTFL	;SET NUMBER OF ACTIVE FILES
    312	000056					RETURN			;
    313
    314
    315					;
    316					; DEVICE ASSIGNMENT
    317					;
    318
    319	000060					DFO	ASG,2,T,^/$DV,$DC,$DC,$DC,$DC,$DC,$DC,$DC,$DC/
    320
    321	000060				ASG:	SAVVR			;SAVE VOLITILE REGISTERS
    322	000064	010500 				MOV	R5,R0		;COPY PARAMETER LIST ADDRESS
    323	000066	022020 				CMP	(R0)+,(R0)+	;POINT TO FIRST LUN NUMBER
    324	000070	005303 				DEC	R3		;CALCULATE NUMBER OF LUNS
    325	000072	010301 				MOV	R3,R1		;SET LOOP COUNT
    326	000074	005710 			10$:	TST	(R0)		;ZERO LUN NUMBER?
    327	000076	001436 				BEQ	30$		;IF EQ YES
    328	000100	021067 	000000G			CMP	(R0),$NUNIT	; LEGAL UNIT?                                   ;**NEW**
    329	000104	101033 				BHI	30$		;IF HI NO                                       ;**-1
    330	000106	022067 	000006'			CMP	(R0)+,$MXASG	; NEW MAX LUN?                                  ;**NEW**
    331	000112	101403 				BLOS	15$		; IF LOS NO                                     ;**NEW**
    332	000114	016067 	177776 	000006'		MOV	-2(R0),$MXASG	; SET NEW MAX                                   ;**NEW**
    333	000122				15$:				;                                               ;**NEW**
    334	000122					SOB	R1,10$		;REPEAT
    335	000126	010301 				MOV	R3,R1		;COPY NUMBER OF LUNS
    336	000130	006301 				ASL	R1		;CONVERT TO BYTES
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-6


    337	000132	062701 	000006 			ADD	#6,R1		;ALLOW FOR LINK AND DEVICE INFO
    338	000136					CALL	$ALBLK		;ALLOCATE STORAGE
    339	000142	010077 	000002G			MOV	R0,@$LUNHD+2	;LINK NEW TO OLD LAST
    340	000146	010067 	000002G			MOV	R0,$LUNHD+2	;SET NEW LAST
    341	000152	005720 				TST	(R0)+		;POINT TO DEVICE NAME
    342	000154	012520 				MOV	(R5)+,(R0)+	;INSERT DEVICE NAME
    343	000156	012501 				MOV	(R5)+,R1	;GET PHYSICAL UNIT
    344	000160	110120 				MOVB	R1,(R0)+	;INSERT PHYSICAL UNIT
    345	000162	110320 				MOVB	R3,(R0)+	;INSERT NUMBER OF LUN ASSIGNMENTS
    346	000164	012520 			20$:	MOV	(R5)+,(R0)+	;INSERT LUN NUMBERS
    347	000166					SOB	R3,20$		;REPEAT
    348	000172					RETURN			;
    349	000174	012703 			30$:	MOV	(PC)+,R3	;ILLEGAL LUN NUMBER
    350	000176	   000G	   000G			.BYTE	E$R48,S$V1	;DIAGNOSTIC
    351	000200	000167 	000546'			JMP	$P2OPE
    352
    353						.IF	NDF	R$$11M
    354
    355					;
    356					; BASE/TOP ADDRESS
    357					;
    358
    359						DFO	BASE,1,F,$DC
    360						DFO	TOP,1,F,$DC
    361
    362					TOP:	NEG	R3		;SET TOP FLAG
    363					BASE:	BIT	#3,(R5)		;4K BOUNDRY?
    364						BNE	20$		;IF NE NO
    365						CMP	(R5),#28.	;LEGAL 4K BOUNDRY?
    366						BHI	20$		;IF HI NO
    367						TST	R3		;TOP OR BASE?
    368						BPL	10$		;IF PL BASE
    369						NEG	(R5)		;MAKE NEGATIVE FOR TOP
    370					10$:	MOV	(R5),$OFFST	;SET OFFSET BIAS
    371						RETURN			;
    372					20$:	MOV	(PC)+,R3	;ILLEGAL BASE/TOP VALUE
    373						.BYTE	E$R51,S$V1	;DIAGNOSTIC
    374						JMP	$P2OPE
    375
    376						.ENDC
    377					                                                                                ;**NEW**
    378					;                                                                               ;**NEW**
    379					; SET MINIMUM DISK ALLOCATION FOR TASK FILE                                     ;**NEW**
    380					;                                                                               ;**NEW**
    381					                                                                                ;**NEW**
    382	000204					DFO	CORSIZ	1,F,$DC                                                 ;**NEW**
    383					                                                                                ;**NEW**
    384	000204				CORSIZ:				;                                               ;**NEW**
    385	000204	021527 	000200 			CMP	(R5),#128.	; REASONABLE ALLOCATION                         ;**NEW**
    386	000210	101005 				BHI	10$		; IF HI NO                                      ;**NEW**
    387	000212	006315 				ASL	(R5)		; CONVERT K TO DISK BLOCKS                      ;**NEW**
    388	000214	006315 				ASL	(R5)		;                                               ;**NEW**
    389	000216	011567 	000000G			MOV	(R5),$FSIZI	; SET MINIMUM DISK ALLOCATION                   ;**NEW**
    390	000222					RETURN			;                                               ;**NEW**
    391	000224				10$:				;                                               ;**NEW**
    392	000224	012703 	000000C			MOV	#<S$V1*400!E$R84>,R3 ; DISK IMAGE ALLOCATION TOO LARGE          ;**NEW**
    393	000230	000167 	000546'			JMP	$P2OPE		;                                               ;**NEW**
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-7


    394
    395					;
    396					; ESTABLISH TASK EXTEND SIZE
    397					;
    398
    399	000234					DFO	EXTTSK	1,F,$DC
    400
    401	000234				EXTTSK:				;++041
    402	000234	032767 	000000G	000000G		BIT	#MP$SY,$SWTCH	;++041 TASK MAPPED?
    403	000242	001426 				BEQ	10$		;++041 IF EQ NO IGNORE KEYWORD
    404	000244	012767 	000001 	000004'		MOV	#EX$TSK,$MEMFL	;++041 SET EXTEND FLAG
    405	000252	005067 	000000G			CLR	$PARSZ		;++041 SET PARTITION SIZE TO ZERO
    406	000256	005067 	000000G			CLR	$HGHAD		;++041 SET HIGH ADDRESS BOUND TO ZERO
    407	000262	012767 	001777 	000000G		MOV	#1777,$LBEXT	;++041 FORCE EXTEND ERROR IF INVALID SIZE
    408	000270	062715 	000037 			ADD	#37,(R5)	;++041 ROUND INCREMENT TO 32 W BOUNDRY
    409	000274	103411 				BCS	10$		;++041 IF C/S ERROR
    410	000276	042715 	000037 			BIC	#37,(R5)	;++041 ...
    411	000302	006115 				ROL	(R5)		;++041 CONVERT TO NUMBER OF 32W BLOCKS
    412	000304	006115 				ROL	(R5)		;++041 ...
    413	000306	006115 				ROL	(R5)		;++041 ...
    414	000310	106115 				ROLB	(R5)		;++041 ...
    415	000312	000315 				SWAB	(R5)		;++041 ...
    416	000314	011567 	000000G			MOV	(R5),$LBEXT	;++041 SAVE EXTEND SIZE
    417	000320				10$:				;++041
    418	000320					RETURN			;++041
    419
    420					                                                                                ;**NEW**
    421
    422					;
    423					; GLOBAL SYMBOL PATCH
    424					;
    425
    426	000322					DFO	GBLPAT,3,T,^/$RR,SYM,$OT,$OT,$OT,$OT,$OT,$OT,$OT,$OT/
    427
    428	000322				GBLPAT:	SAVVR			;SAVE VOLITILE REGISTERS
    429	000326	010301 				MOV	R3,R1		;CALCULATE SIZE OF BLOCK NEEDED
    430	000330	006301 				ASL	R1		;CONVERT TO BYTES
    431	000332	062701 	000016 			ADD	#6+4+4,R1	;ALLOW FOR EXTRA STORAGE
    432	000336					CALL	$ALBLK		;ALLOCATE STORAGE
    433	000342	012704 	000002 			MOV	#2,R4		;SET TYPE TO GLOBAL
    434	000346	005203 				INC	R3		;INCREMENT WORD COUNT
    435	000350	010077 	000002G		GBLPT1:	MOV	R0,@$PATHD+2	;LINK NEW LAST TO OLD LAST
    436	000354	010067 	000002G			MOV	R0,$PATHD+2	;SET NEW LAST
    437	000360	005720 				TST	(R0)+		;POINT TO NUMBER OF PARAMETERS
    438	000362	016710 	000012'			MOV	$NUMP,(R0)	; INSERT NUMBER OF PARAMETERS
    439	000366	162720 	000002 			SUB	#2,(R0)+	;ADJUST TO NUM PATCH VALUES
    440	000372	012520 				MOV	(R5)+,(R0)+	;INSERT SEGMENT NAME
    441	000374	012520 				MOV	(R5)+,(R0)+	;
    442	000376	010420 				MOV	R4,(R0)+	;INSERT TYPE OF ENTRY
    443	000400	012520 			10$:	MOV	(R5)+,(R0)+	;MOVE PARAMETERS
    444	000402					SOB	R3,10$		;REPEAT
    445	000406					RETURN			;
    446
    447					;
    448					; EXTEND CONTROL SECTION LENGTH
    449					;
    450
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-8


    451	000410					DFO	EXTSCT,2,T,^/$RR,$OT/
    452	000410					DFO	FMTBUF,1,F,$DC                                                  ;**NEW**
    453	000410					DFO	MAXBUF,1,F,$DC
    454
    455					                                                                                ;**NEW**
    456	000410				FMTBUF:				;                                               ;**NEW**
    457	000410					SAVVR			; SAVE THE VOLATILE REGISTERS                   ;**NEW**
    458	000414	012701 	000024'			MOV	#OBFSCT+4,R1	; POINT TO SECTION NAME PLUS OFFSET             ;**NEW**
    459	000420	000404 				BR	MXBUF1		;                                               ;**NEW**
    460					                                                                                ;**NEW**
    461	000422				MAXBUF:				;                                               ;**NEW**
    462	000422					SAVVR			; SAVE THE VOLATILE REGISTERS                   ;**NEW**
    463	000426	012701 	000020'			MOV	#IOBSCT+4,R1	; POINT TO NAME OF SECTION PLUS OFFSET          ;**NEW**
    464	000432				MXBUF1:				;                                               ;**NEW**
    465	000432	014145 				MOV	-(R1),-(R5)	; MOVE NAME TO SECTION STORAGE                  ;**NEW**
    466	000434	014145 				MOV	-(R1),-(R5)	;                                               ;**NEW**
    467	000436	000402 				BR	EXTSC1		; EXTEND SECTION LENGTH                         ;**NEW**
    468	000440				EXTSCT:	SAVVR			;SAVE VOLITILE REGISTERS                        ;**-1
    469	000444				EXTSC1:				;                                               ;**NEW**
    470	000444	010501 				MOV	R5,R1		;GET ADDRESS OF SECTION NAME
    471	000446	162701 	000000G			SUB	#S$YM,R1	;CALCULATE PROPER OFFSET
    472	000452	012700 	000000G			MOV	#$SCTHD,R0	;GET ADDRESS OF EXTEND LISTHEAD
    473	000456					CALL	$SRCHR		; SEARCH FOR SECTION NAME
    474	000462	103020 				BCC	10$		;IF CC ALREADY THERE-CHANGE DEFINITION
    475	000464	012701 	000002G			MOV	#C$SBSE+2,R1	;GET SIZE OF BLOCK NEEDED
    476	000470					CALL	$ALBLK		;ALLOCATE STORAGE
    477	000474	012560 	000000G			MOV	(R5)+,S$YM(R0)	;INSERT SECTION NAME
    478	000500	012560 	000002G			MOV	(R5)+,S$YM+2(R0);
    479	000504	011560 	000000G			MOV	(R5),C$SBSE(R0)	;SET SECTION EXTENSION LENGTH
    480	000510	010001 				MOV	R0,R1		;COPY ADDRESS OF SECTION ENTRY
    481	000512	012700 	000000G			MOV	#$SCTHD,R0	;GET ADDRESS OF EXTEND LISTHEAD
    482	000516					CALL	$ISYMR		; INSERT EXTENSION
    483	000522	000403 				BR	20$		;
    484	000524	016560 	000004 	000000G	10$:	MOV	4(R5),C$SBSE(R0);REDEFINE EXTENSION LENGTH
    485	000532				20$:	RETURN			;
    486
    487					;
    488					; GLOBAL SYMBOL DEFINITION
    489					;
    490
    491	000534					DFO	GBLDEF,2,T,^/$RR,$OT/
    492
    493	000534				$GBLDF::			; REF LABEL
    494	000534				GBLDEF:	SAVVR			;SAVE VOLITILE REGISTERS
    495	000540	010501 				MOV	R5,R1		;GET ADDRESS OF SYMBOL
    496	000542	162701 	000000G			SUB	#S$YM,R1	;CALCULATE PROPER OFFSET
    497	000546					CALL	$GTRT		; GET REAL ADDRESS OF ROOT
    498	000552	062700 	000000G			ADD	#S$GSTB,R0	;POINT TO SYMBOL TABLE
    499	000556					CALL	$SRCH		;SEARCH FOR SYMBOL
    500	000562	103034 				BCC	10$		;IF CC ALREADY THERE-CHANGE DEFINITION
    501	000564	012701 	000000G			MOV	#S$YLGH,R1	;GET SIZE OF BLOCK NEEDED
    502	000570					CALL	$ALVRT		; ALLOCATE VIRTUAL STORAGE
    503	000574	012560 	000000G			MOV	(R5)+,S$YM(R0)	;INSERT SYMBOL
    504	000600	012560 	000002G			MOV	(R5)+,S$YM+2(R0);
    505	000604	152760 	000000G	000000G		BISB	#SY$DEF,S$YFLG(R0);SET SYMBOL DEFINITION BIT
    506	000612	152760 	000000G	000000G		BISB	#SY$GBL,S$YFLG(R0);SET GLOBAL SYMBOL
    507	000620	011560 	000000G			MOV	(R5),S$YVAL(R0)	;SET SYMBOL VALUE
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-9


    508	000624	016760 	000000G	000000G		MOV	$ASCT,S$YCMT(R0) ; SET SECTION ENTRY ADDRESS
    509	000632	016700 	000000G			MOV	$RTSEG,R0	; GET VIRTUAL ADDRESS OF ROOT
    510	000636	062700 	000000C			ADD	#S$GSTB/2,R0	; POINT TO SYMBOL TABLE LISTHEAD
    511	000642					CALL	$SRCHI		;SEARCH FOR SYMBOL INSERTION
    512	000646					CALL	$ISYM		;INSERT SYMBOL IN TABLE
    513	000652	000405 				BR	20$		;
    514	000654	016560 	000004 	000000G	10$:	MOV	4(R5),S$YVAL(R0);REDEFINE SYMBOL VALUE
    515	000662					CALL	$WRMPG		; WRITE-MARK PAGE
    516	000666				20$:	RETURN			;
    517
    518	000520					.PSECT
    519
    520					;
    521					; RESIDENT LIBRARY AND COMMON BLOCKS
    522					;
    523
    524	000520					DFO	COMMON,2,T,^/$RR,$RP,$DC/
    525	000670					DFO	LIBR,2,T,^/$RR,$RP,$DC/
    526
    527	000520					.PSECT
    528	000520				LIBR:				;
    529	000520				COMMON:				;
    530	000520					CALLR	$LIBR		; PROCESS RESIDENT LIBRARY REQUEST
    531
    532	000670					.PSECT	OPCD$I,I,GBL
    533
    534
    535					;
    536					; ODT SST VECTOR
    537					;
    538
    539	000670					DFO	ODTV,2,F,^/$RR,$DC/
    540
    541	000670	022525 			ODTV:	CMP	(R5)+,(R5)+	;POINT TO VECTOR SIZE
    542	000672	005715 				TST	(R5)		;ANY SIZE SPECIFIED?
    543	000674	001412 				BEQ	10$		;IF EQ NO
    544	000676	021527 	000040 			CMP	(R5),#32.	;LEGAL SIZE?
    545	000702	103007 				BHIS	10$		;IF HIS NO
    546						.IIF NDF R$$11M, MOVB	(R5),$ODTSZ ; SET VECTOR SIZE
    547	000704	011567 	000000G			.IIF DF	R$$11M,	MOV	(R5),$ODTSZ ; SET VECTOR SIZE
    548	000710	014567 	000002G			MOV	-(R5),$ODTV+2	;SET GLOBAL SYMBOL
    549	000714	014567 	000000G			MOV	-(R5),$ODTV	;
    550	000720					RETURN			;
    551	000722	000167 	000330 		10$:	JMP	TSKV1		;ILLEGAL VECTOR SIZE
    552
    553					;
    554					; PARTITION NAME
    555					;
    556
    557						.IIF NDF R$$11M,	DFO	PAR,1,F,$RR
    558	000726					.IIF DF R$$11M,		DFO	PAR,1,T,^/$RR,$OT,$OT/                  ;**NEW**
    559					                                                                                ;**-1
    560	000726				PAR:				;
    561
    562						.IF	NDF	R$$11M
    563
    564						MOV	(R5)+,$PNAME	; INSERT PARTITION NAME
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-10


    565						MOV	(R5)+,$PNAME+2 	;
    566						RETURN			;
    567
    568						.IFF
    569
    570	000726					SAVVR			; SAVE VOLATILE REGISTERS
    571	000732	010500 				MOV	R5,R0		; COPY OPTION BLOCK POINTER
    572	000734	020327 	000002 			CMP	R3,#2		; CHECK NO. OF ARGUMENTS
    573	000740	001477 				BEQ	30$		; ERROR, SIZE NOT SPECIFIED
    574	000742	003004 				BGT	10$		; HAVE BOTH SIZE AND LENGTH
    575	000744					CALL	$GTPPR		; GET PARTITION PARAMETERS
    576	000750	103476 				BCS	40$		; IF C/S PARTITION NON-EXISTENT
    577	000752	000417 				BR	20$		; CHECK MAPPING
    578	000754				10$:				;
    579	000754	022020 				CMP	(R0)+,(R0)+	; POINT TO BASE ADDRESS
    580	000756	012001 				MOV	(R0)+,R1	; GET BASE ADDRESS
    581	000760	032701 	000077 			BIT	#77,R1		; ON 32W BOUND?
    582	000764	001065 				BNE	30$		; IF NE NO
    583	000766	011002 				MOV	(R0),R2		; GET LENGTH
    584	000770	032702 	000077 			BIT	#77,R2		; SIZE MUST BE MULTIPLE OF 32 W
    585	000774	001061 				BNE	30$		; ELSE ERROR
    586	000776	000302 				SWAB	R2		; CONVERT LENGTH TO 32W BLOCKS
    587	001000	106002 				RORB	R2		;
    588	001002	006102 				ROL	R2		;
    589	001004	006102 				ROL	R2		;
    590	001006	006102 				ROL	R2		;
    591	001010	010500 				MOV	R5,R0		; POINT TO PARTITION NAME
    592	001012				20$:				;
    593	001012	032767 	000000G	000000G		BIT	#MP$SY,$SWTCH	;++041 MAPPED SYSTEM?
    594	001020	001002 				BNE	21$		;++041 IF NE YES
    595	001022	005702 				TST	R2		;++041 PARTITION HAVE LENGTH?
    596	001024	001450 				BEQ	40$		;++041 IF EQ NO ERROR
    597	001026				21$:				;++041
    598	001026	010267 	000000G			MOV	R2,$PARSZ	; SET PARTITION SIZE
    599	001032	036701 	000000'			BIT	$ADBND,R1	; ADDRESS BOUND OK?
    600	001036	001043 				BNE	40$		; IF NE NO
    601	001040	005701 				TST	R1		; CHECK LOW ADDRESS BOUND
    602	001042	001410 				BEQ	22$		; IF EQ OK
    603	001044	032767 	000000G	000000G		BIT	#MP$SY,$SWTCH	; TARGET SYSTEM MAPPED?
    604	001052	001404 				BEQ	22$		; IF EQ NO OK
    605	001054	032767 	000000G	000010'		BIT	#SW$NH,$TKSW	; TASK HAVE HEADER?
    606	001062	001431 				BEQ	40$		; IF EQ YES ERROR
    607	001064				22$:				;
    608	001064					CALL	$VTKMP		; VERIFY MAPPING
    609	001070	103426 				BCS	40$		; IF C/S ERROR
    610	001072	020267 	000002'			CMP	R2,$ADLIM	; HIGH ADDRESS LIMIT OK?
    611	001076	101404 				BLOS	25$		; IF LOS YES
    612	001100	032767 	000000G	000010'		BIT	#SW$NH,$TKSW	; BUILDING LIBRARY ?
    613	001106	001417 				BEQ	40$		; IF EQ NO
    614	001110				25$:				;
    615	001110	012067 	000000G			MOV	(R0)+,$PNAME	; SET PARTITION NAME
    616	001114	012067 	000002G			MOV	(R0)+,$PNAME+2	;
    617	001120	010167 	000000G			MOV	R1,$OFFST	; SET OFFSET
    618	001124	010267 	000000G			MOV	R2,$HGHAD	; HIGH ADDRESS BOUND
    619	001130	012767 	000002 	000004'		MOV	#PA$RT,$MEMFL	;++041 SET EXPLICIT PARTITION  FLAG
    620	001136					RETURN			;
    621	001140				30$:				;
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-11


    622	001140	012703 	000000C			MOV	#<S$V1*400!E$R64>,R3 ; FETCH ERROR/SEVERITY
    623	001144	000402 				BR	50$		;
    624	001146				40$:				;
    625	001146	012703 	000000C			MOV	#<S$V1*400!E$R82>,R3 ; INVALID PARTITION SPECIFIED
    626	001152				50$:				;
    627	001152	000167 	000546'			JMP	$P2OPE		;
    628
    629						.ENDC
    630
    631						.IF	NDF	R$$11M
    632
    633					;
    634					; POOL USAGE
    635					;
    636
    637						DFO	POOL,1,F,$DC
    638
    639					POOL:	CMP	(R5),#512.	;REASONABLE NUMBER?
    640						BHI	10$		;IF HI NO
    641						TST	(R5)		;ZERO IS BAD ALSO
    642						BEQ	10$		;IF EQ NO NO
    643						MOV	(R5),$POOL	;SET POOL USAGE
    644						RETURN			;
    645					10$:	MOV	(PC)+,R3	;ILLEGAL POOL USAGE NUMBER
    646						.BYTE	E$R52,S$V1	;DIAGNOSTIC
    647						JMP	$P2OPE		;
    648
    649						.ENDC
    650
    651					;
    652					; DEFAULT PRIORITY
    653					;
    654
    655	001156					DFO	PRI,1,F,$DC
    656
    657	001156	021527 	000372 		PRI:	CMP	(R5),#250.	;LEGAL PRIORITY?
    658	001162	101003 				BHI	10$		;IF HI NO
    659	001164	011567 	000000G			MOV	(R5),$PRIOR	;SET DEFAULT PRIORITY
    660	001170					RETURN			;
    661	001172	012703 			10$:	MOV	(PC)+,R3	;ILLEGAL PRIORITY
    662	001174	   000G	   000G			.BYTE	E$R53,S$V1	;DIAGNOSTIC
    663	001176	000167 	000546'			JMP	$P2OPE		;
    664
    665					;
    666					; STACK SIZE ALLOCATION
    667					;
    668
    669	001202					DFO	STACK,1,F,$DC
    670
    671	001202	006315 			STACK:	ASL	(R5)		;CONVERT SIZE TO BYTES
    672	001204	011567 	000000G			MOV	(R5),$STACK	;SET STACK SIZE
    673	001210					RETURN			;
    674
    675					;
    676					; TASK NAME
    677					;
    678
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-12


    679	001212					DFO	TASK,1,F,$RR
    680
    681	001212	012567 	000000G		TASK:	MOV	(R5)+,$TNAME	;SET TASK NAME
    682	001216	011567 	000002G			MOV	(R5),$TNAME+2	;
    683	001222					RETURN			;
    684
    685					;
    686					; TASK SST VECTOR
    687					;
    688
    689	001224					DFO	TSKV,2,F,^/$RR,$DC/
    690
    691	001224	022525 			TSKV:	CMP	(R5)+,(R5)+	;POINT TO VECTOR SIZE
    692	001226	005715 				TST	(R5)		;ANY SIZE SPECIFIED?
    693	001230	001412 				BEQ	TSKV1		;IF EQ NO
    694	001232	021527 	000040 			CMP	(R5),#32.	;LEGAL SIZE?
    695	001236	103007 				BHIS	TSKV1		;IF HIS NO
    696						.IIF  NDF  R$$11M, MOVB	(R5),$TSKSZ ; SET VECTOR SIZE
    697	001240	011567 	000000G			.IIF   DF R$$11M, MOV	(R5),$TSKSZ ; SET VECTOR SIZE
    698	001244	014567 	000002G			MOV	-(R5),$TSKV+2	;SET GLOBAL SYMBOL
    699	001250	014567 	000000G			MOV	-(R5),$TSKV	;
    700	001254					RETURN			;
    701	001256	012703 			TSKV1:	MOV	(PC)+,R3	;ILLEGAL SST VECTOR SIZE
    702	001260	   000G	   000G			.BYTE	E$R54,S$V1	;DIAGNOSTIC
    703	001262	000167 	000546'			JMP	$P2OPE		;
    704
    705					;
    706					; TASK UIC
    707					;
    708
    709	001266					DFO	UIC,1,F,UCVT
    710
    711	001266	011567 	000000G		UIC:	MOV	(R5),$TKUIC	;SET TASK UIC
    712	001272					RETURN			;
    713
    714					;
    715					; UIC CONVERSION ROUTINE
    716					;
    717
    718	001274	122720 	000133 		UCVT:	CMPB	#'[,(R0)+	;LEFT BRACKET?
    719	001300	001025 				BNE	10$		;IF NE NO-SYNTAX ERROR
    720	001302					CALL	20$		;CONVERT PROJECT NUMBER
    721	001306	122702 	000054 			CMPB	#',,R2		;TERMINAL COMMA?
    722	001312	001020 				BNE	10$		;IF NE NO-SYNTAX ERROR
    723	001314	105745 				TSTB	-(R5)		;PROJECT TOO BIG?
    724	001316	001016 				BNE	10$		;IF NE YES-SYNTAX ERROR
    725	001320	114546 				MOVB	-(R5),-(SP)	;SAVE PROJECT NUMBER
    726	001322					CALL	20$		;CONVERT PROGRAMMER NUMBER
    727	001326	012601 				MOV	(SP)+,R1	;RETRIEVE PROJECT NUMBER
    728	001330	122702 	000135 			CMPB	#'],R2		;RIGHT BRACKET?
    729	001334	001007 				BNE	10$		;IF NE NO-SYNTAX ERROR
    730	001336	105745 				TSTB	-(R5)		;PROGRAMMER TOO BIG?
    731	001340	001005 				BNE	10$		;IF NE YES-SYNTAX ERROR
    732	001342	110125 				MOVB	R1,(R5)+	;INSERT PROJECT NUMBER
    733	001344					CALL	$SETNB		;BYPASS LEADING BLANKS AND HT'S
    734	001350	112002 				MOVB	(R0)+,R2	;GET TERMINAL BYTE
    735	001352					RETURN			;
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-13


    736	001354	005726 			10$:	TST	(SP)+		;REMOVE RETURN FROM STACK
    737	001356	012702 	000000G			MOV	#$LNDES,R2	;GET ADDRESS OF LINE DESCRIPTOR
    738	001362	012701 				MOV	(PC)+,R1	;SYNTAX ERROR
    739	001364	   000G	   000G			.BYTE	E$R30,S$V1	;DIAGNOSTIC
    740	001366					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    741	001372	000261 				SEC			;
    742	001374					RETURN			; GO AGAIN
    743	001376	010046 			20$:	MOV	R0,-(SP)	;SAVE NEXT BYTE ADDRESS FOR POSSIBLE RESCAN
    744	001400					CALL	$OT		;CONVERT OCTAL
    745	001404	122702 	000056 			CMPB	#'.,R2		;TERMINAL PERIOD?
    746	001410	001007 				BNE	30$		;IF NE NO
    747	001412	011600 				MOV	(SP),R0		;RETRIEVE NEXT BYTE ADDRESS
    748	001414	005745 				TST	-(R5)		;BACK UP PARAMETER POINTER
    749	001416					CALL	$DC		;CONVERT DECIMAL
    750	001422					CALL	$SETNB		;SET NONBLANK
    751	001426	112002 				MOVB	(R0)+,R2	;GET TERMINAL BYTE
    752	001430	005726 			30$:	TST	(SP)+		;CLEAN STACK
    753	001432					RETURN			;
    754
    755					;
    756					; LOGICAL UNIT USAGE
    757					;
    758
    759	001434					DFO	UNITS,1,F,$DC
    760
    761	001434				UNITS:				;                                               ;**NEW**
    762	001434	021567 	000006'			CMP	(R5),$MXASG	; LESS THAN MAX LUN ASSIGNMENT?                 ;**NEW**
    763	001440	103406 				BLO	10$		;IF LO YES                                      ;**-1
    764	001442	021527 	000372 			CMP	(R5),#250.	;REASONABLE NUMBER OF UNITS?
    765	001446	101003 				BHI	10$		;IF HI NO
    766	001450	011567 	000000G			MOV	(R5),$NUNIT	;SET NEW NUMBER OF UNITS
    767	001454					RETURN			;
    768	001456	012703 			10$:	MOV	(PC)+,R3	;ILLEGAL NUMBER OF UNITS
    769	001460	   000G	   000G			.BYTE	E$R49,S$V1	;DIAGNOSTIC
    770	001462	000167 	000546'			JMP	$P2OPE		;
    771
    772	000524					.PSECT
    773
    774					;
    775					; COMMON SUBROUTINES
    776					;
    777					;+
    778					; **-$GTRT-CONVERT VIRTUAL ADDRESS OF ROOT SEGMENT TO REAL ADDRESS
    779					;
    780					;	THIS ROUTINE IS CALLED TO CONVERT THE ROOT SEGMENT VIRTUAL ADDRESS
    781					;	TO AN ADDRESS IN REAL MEMORY. THE PAGE BUFFER CONTAINING THE
    782					;	SEGMENT DESCRIPTOR IS WRITE-MARKED.
    783					;
    784					;
    785					; INPUTS:
    786					;
    787					;	$RTSEG = VIRTUAL ADDRESS OF ROOT SEGMENT DESCRIPTOR
    788					;
    789					; OUTPUTS:
    790					;
    791					;	R0 = REAL ADDRESS OF DESCRIPTOR
    792					;	PAGE BUFFER IS WRITE-MARKED
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-14


    793					;
    794					; THE CONTENTS OF R1 ARE PRESERVED
    795					;-
    796
    797	000524				$GTRT::				;
    798	000524	010146 				MOV	R1,-(SP)	; SAVE R1
    799	000526	016701 	000000G			MOV	$RTSEG,R1	; GET VIRTUAL ADDRESS OF DESCRIPTOR
    800	000532					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    801	000536					CALL	$WRMPG		; WRITE MARK PAGE
    802	000542	012601 				MOV	(SP)+,R1	; RESTORE R1
    803	000544					RETURN			;
    804					;
    805					;
    806					;
    807					;+
    808					; **-$P2OPE - PARAMETER ROUTINE ERROR EXIT
    809					;
    810					; INPUTS:
    811					;
    812					;	R3:	ERROR/SEVERITY CODE
    813					;
    814					; OUTPUTS:
    815					;
    816					; 	NONE
    817					;
    818					;-
    819					;
    820
    821	000546				$P2OPE::			;
    822	000546					SAVVR			; SAVE VOLATILE REGISTERS
    823	000552	010301 				MOV	R3,R1		;SET ERROR/SEVERITY
    824	000554	012702 	000000G			MOV	#$LNDES,R2	;GET ADDRESS OF LINE DESCRIPTOR
    825	000560					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    826	000564					RETURN			;
    827
    828
    829						.IF	DF	R$$11M
    830
    831					;
    832					; SUBROUTINES TO CHECK FOR INTERSECTING PARTITIONS
    833					;
    834					;+
    835					; **-$VTKMP - VERITY TASK AREA DOES NOT INTERSECT LIBRARIES
    836					;
    837					; **-$VLBMP - VERIFY LIBRARY DOES NOT INTERSECT OTHER LIBRARIES
    838					;		OR TASK PARTITION
    839					;
    840					; INPUTS:
    841					;
    842					;	R0:	ADDRESS OF 2-WORD, RADIX 50 PARTITION NAME
    843					;		OR RESIDENT LIBRARY NAME
    844					;	R1:	LOW MEMORY LIMIT
    845					;	R2:	LENGTH IN 32W BLOCKS OR 0
    846					;		IF R2=0 CHECKS ARE RESTRICTED TO SEARCH
    847					;		FOR PARTITION OR LIBRARY HAVING DUPLICATE
    848					;		NAME.
    849					;
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-15


    850					; OUTPUTS:
    851					;
    852					;	C-CLEAR: NO MEMORY CONFLICT
    853					;	C-SET:	BOUNDARIES OVERLAP, NAME CONFLICT, HIGH ADDRESS
    854					;		BOUND EXCEEDS 32K-1
    855					;
    856					;	R2:	HIGH ADDRESS BOUND OR 0 FOR NAME CHECK ONLY
    857					;
    858					; R0,R1 ARE UNCHANGED
    859					;
    860					;-
    861					;
    862					;
    863
    864						.ENABL	LSB
    865
    866	000566				$VTKMP::			;
    867	000566					SAVRG			; SAVE NON-VOLATILE REGISTERS
    868	000572					CALL	40$		; COMPUTE HIGH ADDRESS BOUND
    869	000576	000422 				BR	10$		;
    870	000600				$VLBMP::			;
    871	000600					SAVRG			; SAVE NON-VOLATILE REGISTERS
    872	000604					CALL	40$		; COMPUTE HIGH ADDRESS BOUND
    873	000610	016705 	000000G			MOV	$HGHAD,R5	; GET HIGH ADDRESS BOUND
    874	000614	001413 				BEQ	10$		; IF EQ PARTITION NOT SPECIFIED
    875	000616	016704 	000000G			MOV	$OFFST,R4	; GET RELOCATION BASE
    876	000622					CALL	50$		; CHECK ADDRESS LIMITS
    877	000626	021067 	000000G			CMP	(R0),$PNAME	; CHECK FOR NAME MATCH
    878	000632	001004 				BNE	10$		; IF NE NO MATCH
    879	000634	026067 	000002 	000002G		CMP	2(R0),$PNAME+2	; CHECK SECOND HALF OF NAME
    880	000642	001462 				BEQ	70$		; IF EQ ERROR
    881	000644				10$:				;
    882	000644	012703 	000000C			MOV	#<$LBRHD-L$DNXT>,R3 ; GET LISTHEAD ADDRESS MINUS OFFSET
    883	000650				20$:				;
    884	000650	016303 	000000G			MOV	L$DNXT(R3),R3	; GET ADDRESS OF NEXT ENTRY
    885	000654	001457 				BEQ	80$		; IF EQ CHECKED AGAINST ALL ENTRIES
    886	000656	021063 	000000G			CMP	(R0),L$DNME(R3)	; CHECK FIRST HALF OF NAME
    887	000662	001004 				BNE	30$		; IF NE NO MATCH
    888	000664	026063 	000002 	000002G		CMP	2(R0),L$DNME+2(R3) ; CHECK SECOND HALF OF NAME
    889	000672	001446 				BEQ	70$		; IF EQ -ERROR
    890	000674				30$:				;
    891	000674	032763 	000000G	000000G		BIT	#LD$RSV,L$DFLG(R3) ; APR RESERVED?
    892	000702	001004 				BNE	35$		; IF NE YES
    893	000704	032763 	000000G	000000G		BIT	#LD$REL,L$DFLG(R3) ; ABS LIBRARY?
    894	000712	001356 				BNE	20$		; IF NE NO
    895	000714				35$:				;
    896	000714	016304 	000000G			MOV	L$DSA(R3),R4	; GET STARTING ADDRESS
    897	000720	016305 	000000G			MOV	L$DLTH(R3),R5	; GET LENGTH
    898	000724	000305 				SWAB	R5		; CONVERT TO BYTES
    899	000726	106005 				RORB	R5		;
    900	000730	006005 				ROR	R5		;
    901	000732	006005 				ROR	R5		;
    902	000734	005305 				DEC	R5		; BACK OFF BY ONE
    903	000736	060405 				ADD	R4,R5		; COMPUTE HIGH ADDRESS BOUND
    904	000740					CALL	50$		; ADDRESS CHECK
    905	000744	000741 				BR	20$		; GO AGAIN
    906	000746				40$:				;
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-16


    907	000746	005702 				TST	R2		; NAME-CHECK ONLY
    908	000750	001422 				BEQ	90$		; IF EQ YES
    909	000752	000302 				SWAB	R2		; COMPUTE TASK UPPER BOUND
    910	000754	106002 				RORB	R2		;
    911	000756	006002 				ROR	R2		;
    912	000760	006002 				ROR	R2		;
    913	000762	005302 				DEC	R2		; BACK OFF BY ONE
    914	000764	060102 				ADD	R1,R2		; COMPUTE HIGH ADDRESS LIMIT
    915	000766	103407 				BCS	60$		; IF C/S ERROR
    916	000770	000412 				BR	90$		;
    917	000772				50$:				;
    918	000772	005702 				TST	R2		; NAME-CHECK ONLY?
    919	000774	001410 				BEQ	90$		; IF EQ YES
    920	000776	020204 				CMP	R2,R4		; CHECK END VS LOW
    921	001000	103406 				BLO	90$		; IF LO OK
    922	001002	020105 				CMP	R1,R5		; CHECK START VS. HIGH
    923	001004	101004 				BHI	90$		; IF HI, ENTIRELY ABOVE - OK.
    924	001006				60$:				;
    925	001006	005726 				TST	(SP)+		; REMOVE RETURN
    926	001010				70$:				;
    927	001010	000261 				SEC			; ERROR
    928	001012	000401 				BR	90$		;
    929	001014				80$:				;
    930	001014	000241 				CLC			; SUCCESS
    931	001016				90$:				;
    932	001016					RETURN			;
    933
    934						.DSABL	LSB
    935
    936						.ENDC
    937
    938	000322					.PSECT	OPTBLK
    939	000322				$KWRDE::			; REF LABEL
    940	001020					.PSECT
    941
    942		000001 				.END
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-17
SYMBOL TABLE

ABORT   000014R     003	FD.SDI= 000020   	F.VBSZ= 000060   	R.FIX = 000001   	$ISYM = ****** GX
ABSPAT  000024R     003	FD.SQD= 000040   	GBLDEF  000534R     003	R.VAR = 000002   	$ISYMR= ****** GX
ACTFIL  000052R     003	FD.TTY= 000004   	GBLPAT  000322R     003	SCTNAM  000024R  	$KWRD   000000RG    002
ASG     000060R     003	FD.WBH= 000002   	GBLPT1  000350R     003	SPA   = 000040   	$KWRDE  000322RG    002
A$RG  = 000006 G 	FF    = 000014   	HT    = 000011   	STACK   001202R     003	$LBEXT= ****** GX
A.OWUI= ****** GX	FMTBUF  000410R     003	IOBSCT  000014R  	SW$NH = ****** GX	$LBRHD= ****** GX
B.BBFS= 000010   	FO.APD= 000106   	K$EY  = 000000 G 	SYM     000000R     003	$LIBR = ****** GX
B.BFST= 000015   	FO.MFY= 000002   	LD$REL= ****** GX	SY$DEF= ****** GX	$LNBUF= ****** GX
B.NXBD= 000012   	FO.RD = 000001   	LD$RSV= ****** GX	SY$GBL= ****** GX	$LNDES= ****** GX
B.VBN = 000004   	FO.UPD= 000006   	LF    = 000012   	S$GSTB= ****** GX	$LUNHD= ****** GX
COMMON  000520R  	FO.WRT= 000016   	LIBR    000520R  	S$UB  = 000010 G 	$MEMFL  000004RG
CORSIZ  000204R     003	F.ALOC= 000040   	L$DFLG= ****** GX	S$V1  = ****** GX	$MXASG  000006RG
CR    = 000015   	F.BBFS= 000062   	L$DLTH= ****** GX	S$V2  = ****** GX	$NUMP   000012RG
C$SBSE= ****** GX	F.BDB = 000070   	L$DNME= ****** GX	S$YCMT= ****** GX	$NUNIT= ****** GX
DFAFL = 000004   	F.BGBC= 000057   	L$DNXT= ****** GX	S$YFLG= ****** GX	$ODTSZ= ****** GX
DFPOL = 000024   	F.BKDN= 000026   	L$DSA = ****** GX	S$YLGH= ****** GX	$ODTV = ****** GX
DFSTK = 001000   	F.BKDS= 000020   	L$NG  = 000012 G 	S$YM  = ****** GX	$OFFST= ****** GX
DFUNT = 000006   	F.BKEF= 000050   	MAXBUF  000422R     003	S$YVAL= ****** GX	$OT   = ****** GX
EN$DR = ****** GX	F.BKP1= 000051   	MM    = 000310R     002	S.BFHD= 000020   	$PARM   000030RG
EXTSCT  000440R     003	F.BKST= 000024   	MP$SY = ****** GX	S.FATT= 000016   	$PARSZ= ****** GX
EXTSC1  000444R     003	F.BKVB= 000064   	MXBUF1  000432R     003	S.FDB = 000140   	$PATHD= ****** GX
EXTTSK  000234R     003	F.CNTG= 000034   	M$AX  = 000005 G 	S.FNAM= 000006   	$PNAME= ****** GX
EX$TSK= 000001 G 	F.DFNB= 000046   	M$IN  = 000004 G 	S.FNB = 000036   	$PRIOR= ****** GX
E$LSWT= ****** GX	F.DSPT= 000044   	NB.DEV= 000200   	S.FNBW= 000017   	$P2OPE  000546RG
E$R30 = ****** GX	F.DVNM= 000134   	NB.DIR= 000100   	S.FNTY= 000004   	$P2OPT  000164RG
E$R48 = ****** GX	F.EFBK= 000010   	NB.NAM= 000004   	S.FTYP= 000002   	$P2POP= ****** GX
E$R49 = ****** GX	F.EFN = 000050   	NB.SD1= 000400   	S.NFEN= 000020   	$P2PRS= ****** GX
E$R53 = ****** GX	F.EOBB= 000032   	NB.SD2= 001000   	T     = 000001   	$RP   = ****** GX
E$R54 = ****** GX	F.ERR = 000052   	NB.SNM= 000040   	TASK    001212R     003	$RR   = ****** GX
E$R64 = ****** GX	F.FACC= 000043   	NB.STP= 000020   	TSKV    001224R     003	$RTSEG= ****** GX
E$R82 = ****** GX	F.FFBY= 000014   	NB.SVR= 000010   	TSKV1   001256R     003	$SAVRG= ****** GX
E$R83 = ****** GX	F.FNAM= 000110   	NB.TYP= 000002   	UCVT    001274R     003	$SAVVR= ****** GX
E$R84 = ****** GX	F.FNB = 000102   	NB.VER= 000001   	UIC     001266R     003	$SCTHD= ****** GX
F     = 000000   	F.FTYP= 000116   	NN    = 000001   	UNITS   001434R     003	$SETNB= ****** GX
FA.APD= 000100   	F.FVER= 000120   	N.DID = 000024   	VT    = 000013   	$SRCH = ****** GX
FA.CRE= 000010   	F.HIBK= 000004   	N.DVNM= 000032   	$ACTFL= ****** GX	$SRCHI= ****** GX
FA.EXT= 000004   	F.LUN = 000042   	N.FID = 000000   	$ADBND  000000RG 	$SRCHR= ****** GX
FA.NSP= 000100   	F.MBCT= 000054   	N.FNAM= 000006   	$ADLIM  000002RG 	$STACK= ****** GX
FA.RD = 000001   	F.MBC1= 000055   	N.FTYP= 000014   	$ALBLK= ****** GX	$SWTCH= ****** GX
FA.SHR= 000040   	F.MBFG= 000056   	N.FVER= 000016   	$ALVRT= ****** GX	$TKSW   000010RG
FA.TMP= 000020   	F.NRBD= 000024   	N.NEXT= 000022   	$ASCT = ****** GX	$TKUIC= ****** GX
FA.WRT= 000002   	F.NREC= 000030   	N.STAT= 000020   	$CMFLG= ****** GX	$TNAME= ****** GX
FD.BLK= 000010   	F.OVBS= 000030   	N.UNIT= 000034   	$CVRL = ****** GX	$TSKNM= ****** GX
FD.CCL= 000002   	F.RACC= 000016   	OBFSCT  000020R  	$DC   = ****** GX	$TSKSZ= ****** GX
FD.CR = 000002   	F.RATT= 000001   	ODTV    000670R     003	$DV   = ****** GX	$TSKV = ****** GX
FD.DIR= 000010   	F.RCNM= 000034   	OPMDS   000132R  	$ERMSG= ****** GX	$VLBMP  000600RG
FD.FTN= 000001   	F.RCTL= 000017   	OPMSE   000164R  	$FSIZI= ****** GX	$VTKMP  000566RG
FD.INS= 000010   	F.RSIZ= 000002   	OPMSG   000136R  	$GBLDF  000534RG    003	$WRMPG= ****** GX
FD.PLC= 000004   	F.RTYP= 000000   	PAR     000726R     003	$GTCML= ****** GX	$$    = 000001
FD.RAH= 000001   	F.STBK= 000036   	PA$RT = 000002 G 	$GTPPR= ****** GX	.FSRPT= ****** GX
FD.RAN= 000002   	F.UNIT= 000136   	PRI     001156R     003	$GTRT   000524RG 	...GBL= 000000
FD.REC= 000001   	F.URBD= 000020   	R$$11M= 000000   	$HGHAD= ****** GX	...TPC= 000140
FD.RWM= 000001   	F.VBN = 000064

. ABS.	000000	   000
      	001020	   001
OPTBLK	000322	   002
P2OPT	MACRO M1108  05-DEC-77 23:02  PAGE 3-18
SYMBOL TABLE

OPCD$I	001466	   003
ARGBLK	000162	   004
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2886 WORDS  ( 12 PAGES)
DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:01:05
[44,10]P2OPT,[44,20]P2OPT/-SP=[44,30]MACFLM.,FCSPR.,P2OPT.016
P2POP	MACRO M1108  05-DEC-77 23:03  PAGE 2


      1						.TITLE	P2POP
      2						.IDENT	/05/
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					; COPYRIGHT   1975,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      8					;
      9					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
     10					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     11					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     12					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     13					;
     14					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     15					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     16					; EQUIPMENT CORPORATION.
     17					;
     18					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     19					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     20					;
     21					; VERSION 05
     22					;                                                                               ;**-1
     23					; C. MONIA 26-MAR-74
     24					;
     25					; MODIFICATIONS:
     26					;
     27					; NO.		DATE		PROGRAMMER
     28					; ---		----		----------
     29					;
     30					; 039		22-MAR-75	C. MONIA
     31					; 041		15-MAY-75	C. MONIA
     32					;
     33					;
     34					; POST-OPTION PROCESSING
     35					;
     36					; LOCAL MACROS
     37					;
     38					; CREATE DEFAULT GLOBAL DEFINITION
     39					;
     40					; GBLDF	SYM,VAL
     41					;
     42					; WHERE:
     43					;
     44					;	SYM=1 TO 6 CHARACTER SYMBOL NAME
     45					;	VAL=UNRELOCATED SYMBOL VALUE
     46					;
     47
     48						.MACRO	GBLDF	SYM,VAL
     49						.PSECT	GBLD$D,D
     50						.WORD	0
     51					NN=.
     52					.=.-4
     53						.RAD50	/SYM/
     54					.=NN
     55						.WORD	VAL
     56						.WORD	0
     57						.PSECT
P2POP	MACRO M1108  05-DEC-77 23:03  PAGE 2-1


     58						.ENDM
     59
     60					;
     61					; LOCAL DATA
     62					;
     63
     64						.IF	DF	R$$11M
     65
     66					;
     67					; APR ALLOCATION BITMAP TABLE
     68					;
     69
     70		000002 				.RADIX	2
     71
     72	000000	   001 			APRMP:	.BYTE	00000001	;
     73	000001	   003 				.BYTE	00000011	;
     74	000002	   007 				.BYTE	00000111	;
     75	000003	   017 				.BYTE	00001111	;
     76	000004	   037 				.BYTE	00011111	;
     77	000005	   077 				.BYTE	00111111	;
     78	000006	   177 				.BYTE	01111111	;
     79	000007	   377 				.BYTE	11111111	;
     80
     81						.EVEN
     82
     83		000010 				.RADIX	8.
     84
     85						.ENDC
     86
     87					;
     88					; PRE-DEFINED GLOBAL SYMBOLS FOR LOW CORE STORAGE
     89					;
     90
     91	000000					.PSECT	GBLD$D,D
     92
     93	000000	000000 			GBLTB:	.WORD	0		; DUMMY ZERO WORD AT START OF TABLE
     94
     95	000010					.PSECT
     96
     97						.IF	DF	R$$11M
     98
     99	000010					GBLDF	$DSW,H$DSW	; DIRECTIVE STATUS WORD
    100	000010					GBLDF	.FSRPT,H$FSR	; FILE STORAGE REGION VECTOR
    101	000010					GBLDF	$OTSV,H$FOT	; FORTRAN IMPURE AREA VECTOR
    102	000010					GBLDF	N.OVPT,H$OVLY	; OVERLAY RUNTIME SYSTEM VECTOR
    103
    104						.ENDC
    105
    106					;
    107					; HIGH ADDRESS LIMIT
    108					;
    109
    110	000010				HGHAD:	.BLKW	1		;
    111
    112					;+
    113					; **-$P2POP-PERFORM POST-OPTION PROCESSING
    114					;
P2POP	MACRO M1108  05-DEC-77 23:03  PAGE 2-2


    115					; THIS ROUTINE IS CALLED AFTER ALL OPTIONS HAVE BEEN ENTERED TO
    116					; CREATE DEFINITIONS FOR LOW-CORE CELLS IN THE TASK HEADER AND
    117					; MAP LIBRARIES IN THE TASKS ADDRESSING SPACE
    118					;
    119					; INPUTS:
    120					;	NONE
    121					;
    122					; OUTPUTS:
    123					;	NONE
    124					;
    125					;-
    126
    127	000012				$P2POP::			;
    128	000012	012700 	000000'			MOV	#GBLTB,R0	; GET ADDRESS OF DEFINITION LIST
    129	000016				10$:				;
    130	000016	012705 	000000G			MOV	#$PARM,R5	; GET ADDRESS TO STORE DEFINITION
    131	000022	010504 				MOV	R5,R4		; COPY ADDRESS
    132	000024	012024 				MOV	(R0)+,(R4)+	; COPY ENTRY
    133	000026	001405 				BEQ	20$		; IF EQ DONE
    134	000030	012024 				MOV	(R0)+,(R4)+	;
    135	000032	012014 				MOV	(R0)+,(R4)	;
    136	000034					CALL	$GBLDF		; ENTER DEFINITION IN SYMBOL TABLE
    137	000040	000766 				BR	10$		; GO AGAIN
    138
    139					;
    140					; MAKE DEFAULT DEVICE ASSIGNMENTS
    141					;
    142
    143	000042				20$:				;
    144	000042	012700 	000000G			MOV	#$LUNHD,R0	; GET ADDRESS OF ASSIGNMENT LISTHEAD
    145	000046	012701 	000000G			MOV	#$DFASG,R1	; GET DEFAULT ASSIGNMENT LIST
    146	000052	012102 				MOV	(R1)+,R2	; GET NUMBER OF ASSIGNMENTS
    147	000054				22$:				;
    148	000054	005302 				DEC	R2		; DECREMENT ASSIGNMENT COUNT
    149	000056	002413 				BLT	26$		; IF LT DONE
    150	000060	026167 	000006 	000000G		CMP	6(R1),$NUNIT	; LUN WITHIN RANGE?
    151	000066	101004 				BHI	24$		; IF HI NO
    152	000070	012011 				MOV	(R0)+,(R1)	; DISPLACE OLD FIRST IN LIST
    153	000072	001001 				BNE	23$		; IF NE LIST NOT EMPTY
    154	000074	010110 				MOV	R1,(R0)		; SET THIS AS ENTRY AS LAST IN LIST
    155	000076				23$:				;
    156	000076	010140 				MOV	R1,-(R0)	; SET NEW FIRST
    157	000100				24$:				;
    158	000100	062701 	000010 			ADD	#10,R1		; ADVANCE TO NEXT ASSIGNMENT
    159	000104	000763 				BR	22$		;
    160	000106				26$:				;
    161
    162						.IF	NDF	R$$11M
    163
    164						RETURN			;
    165
    166						.IFF
    167
    168					;
    169					; ASSIGN THE DEFAULT PARTITION IF NECESSARY AND
    170					; ALLOCATE APRS IF THE TARGET SYSTEM IS MAPPED.
    171					;
P2POP	MACRO M1108  05-DEC-77 23:03  PAGE 2-3


    172
    173	000106	012767 	177700 	177674 		MOV	#177700,HGHAD	;++041 SET HIGH ADDRESS BOUND TO MAX.
    174	000114	016701 	000000G			MOV	$OFFST,R1	; GET BASE ADDRESS
    175	000120	016702 	000000G			MOV	$HGHAD,R2	; GET HIGH ADDRESS LIMIT
    176	000124	032767 	000000G	000000G		BIT	#PA$RT,$MEMFL	;++041 EXPLICIT PARTITION SPECIFIED?
    177	000132	001050 				BNE	60$		;++041 IF NE YES
    178	000134	032767 	000000G	000000G		BIT	#EX$TSK,$MEMFL	;++041 TASK EXTENSION SPECIFIED?
    179	000142	001044 				BNE	60$		;++041 IF NE YES
    180	000144	005000 				CLR	R0		; ELSE REQUEST DEFAULT
    181	000146					CALL	$GTPPR		; GET BASE ADDRESS, LENGTH
    182	000152	103004 				BCC	30$		; IF C/C OK
    183	000154	012701 	000000C			MOV	#<S$V2*400!E$R70>,R1 ; ERROR, RUNNING ON 'FOREIGN' SYSTEM
    184	000160	010602 				MOV	SP,R2		; SET DUMMY PARAMETER BLOCK ADDRESS
    185	000162	000432 				BR	50$		;
    186	000164				30$:				;
    187	000164	032767 	000000G	000000G		BIT	#MP$SY,$SWTCH	;++041 MAPPED SYSTEM?
    188	000172	001002 				BNE	35$		;++041 IF NE YES
    189	000174	005702 				TST	R2		;++041 SYSTEM CONTROLLED PARTITION?
    190	000176	001420 				BEQ	40$		;++041 IF EQ YES ERROR
    191	000200				35$:				;++041
    192	000200	010267 	000000G			MOV	R2,$PARSZ	;++041 SET PARTITION SIZE
    193	000204					CALL	$VTKMP		;++041 VERIFY NO DUPLICATE NAME
    194	000210	103413 				BCS	40$		;++041 IF C/S DUPLICATE NAME
    195	000212	036701 	000000G			BIT	$ADBND,R1	; TEST ADDRESS ALIGNMENT
    196	000216	001010 				BNE	40$		; IF NE INCORRECT BOUND
    197	000220	020267 	000000G			CMP	R2,$ADLIM	; CHECK ADDRESS LIMITS
    198	000224	101005 				BHI	40$		; IF HI ERROR
    199	000226	010167 	000000G			MOV	R1,$OFFST	; SET BASE ADDDRESS
    200	000232	010267 	000000G			MOV	R2,$HGHAD	; SET HIGH ADDRESS BOUND
    201	000236	000406 				BR	60$		;
    202	000240				40$:				;
    203	000240	012701 	000000C			MOV	#<S$V2*400!E$R81>,R1 ; GET ERROR/SEVERITY
    204	000244	012702 	000000G			MOV	#$PNAME,R2	; POINT TO PARTITION NAME
    205	000250				50$:				;
    206	000250					CALL	$ERMSG		; OUTPUT ERROR, NO RETURN
    207	000254				60$:				;
    208	000254	032767 	000000G	000000G		BIT	#MP$SY,$SWTCH	; MAPPED SYSTEM ?
    209	000262	001434 				BEQ	100$		; IF EQ NO, SET RELOCATION BIAS FOR LIBS
    210	000264	005005 				CLR	R5		; CLEAR APR MAPPING REGISTER
    211	000266	032767 	000000G	000000G		BIT	#SW$NH,$TKSW	; BUILDING LIBRARY?
    212	000274	001022 				BNE	80$		; IF NE YES
    213	000276	005701 				TST	R1		; TASK START AT ZERO?
    214	000300	001357 				BNE	40$		; IF NE NO, ERROR
    215	000302	032767 	000000C	000000G		BIT	#<SW$PR!SW$AC>,$TKSW ; TASK PRIVELEGED?
    216	000310	001414 				BEQ	80$		; IF EQ NO
    217	000312	152705 	000217 			BISB	#217,R5		; RESERVE PRIVELEGED APR SET
    218	000316	012767 	100000 	000000G		MOV	#100000,$OFFST	; ESTABLISH 16K RELOCATION BIAS
    219	000324	020227 	057777 			CMP	R2,#<60000-1>	; PARTITION SIZE .LE. 12K
    220	000330	101343 				BHI	40$		; IF HI NO ERROR
    221	000332	062702 	100000 			ADD	#100000,R2	; OFFSET HIGH BOUND FOR PRIVELEGED MAPPING      ;**NEW**
    222	000336	010267 	000000G			MOV	R2,$HGHAD	; RESET HIGH ADDRESS BOUND                      ;**NEW**
    223	000342				80$:				;                                               ;**-7
    224	000342					CALL	CVAPR		; CONVERT R2 HIGH LIMIT TO NUMBER OF APRS
    225	000346	156205 	000000'			BISB	APRMP(R2),R5	; RESERVE ALL TASK APRS
    226	000352	000400 				BR	100$		;
    227
    228					;
P2POP	MACRO M1108  05-DEC-77 23:03  PAGE 2-4


    229					; NOW ALLOCATE APRS TO ALL REFERENCED LIBRARIES
    230					;
    231
    232	000354				100$:				;
    233	000354	012704 	177776 			MOV	#-2,R4		; SET FLAG FOR RESERVED/ABS ALLOCATION
    234	000360					CALL	APRAL		; ALLOCATE APRS
    235	000364	005404 				NEG	R4		; SET FLAG FOR PIC ALLOCATION
    236	000366				APRAL:				;
    237	000366	005046 				CLR	-(SP)		; ALLOCATE STACK FOR LIBRARY ENTRY ADDRESS
    238	000370	005046 				CLR	-(SP)		; ALLOCATE SPACE FOR LIBRARY SIZE
    239	000372	012700 	000000C			MOV	#<$LBRHD-L$DNXT>,R0 ; GET LISTHEAD ADDRESS MINUS OFFSET
    240	000376				10$:				;
    241	000376	016000 	000000G			MOV	L$DNXT(R0),R0	; GET NEXT ENTRY
    242	000402	001465 				BEQ	80$		; IF EQ DONE WITH ALLOCATION
    243	000404	032760 	000000G	000000G		BIT	#LD$RSV,L$DFLG(R0) ; APR RESERVED ?
    244	000412	000164 	000420'			JMP	20$(R4)		; BRANCH ON CONDITION CODES
    245	000416	001022 				BNE	50$		; IF NE CHECK APRS
    246	000420	000401 			20$:	BR	30$		; CHECK IF LIBRARY ABSOLUTE
    247	000422	001365 				BNE	10$		; BYPASS, ALREADY RESERVED
    248	000424				30$:				;
    249	000424	032760 	000000G	000000G		BIT	#LD$REL,L$DFLG(R0) ; RELOCATABLE LIBRARY ?
    250	000432	000164 	000440'			JMP	40$(R4)		; DISPATCH ON CONDITION CODES
    251	000436	001412 				BEQ	50$		; CHECK APRS FOR ABS LIBRARY
    252	000440	000756 			40$:	BR	10$		; DEFER PIC ALLOCATION
    253	000442	001755 				BEQ	10$		; IF EQ BYPASS ABS LIBRARY
    254	000444	026016 	000000G			CMP	L$DLTH(R0),(SP)	; THIS LIBRARY MAX?
    255	000450	103752 				BLO	10$		; IF LO NO
    256	000452	016016 	000000G			MOV	L$DLTH(R0),(SP)	; SET NEW MAX
    257	000456	010066 	000002 			MOV	R0,2(SP)	; SAVE ENTRY ADDRESS
    258	000462	000745 				BR	10$		; GET NEXT ENTRY
    259	000464				50$:				;
    260	000464	016001 	000000G			MOV	L$DSA(R0),R1	; GET STARTING ADDRESS
    261	000470	032767 	000000G	000000G		BIT	#MP$SY,$SWTCH	; TARGET SYSTEM MAPPED?
    262	000476	001471 				BEQ	115$		; IF EQ NO
    263	000500	010102 				MOV	R1,R2		; SET STARTING ADDRESS
    264	000502					CALL	CVAPR		; CONVERT TO APR NUMBER
    265	000506	010201 				MOV	R2,R1		; SAVE APR
    266	000510	016002 	000000G			MOV	L$DLTH(R0),R2	; GET LENGTH
    267	000514	001401 				BEQ	55$		;++039 IF EQ LIBRARY HAS ZERO LENGTH
    268	000516	005302 				DEC	R2		;++039 BACK OFF LENGTH BY ONE
    269	000520				55$:				;++039
    270	000520	006302 				ASL	R2		; CONVERT TO NUMBER OF APRS
    271	000522	105002 				CLRB	R2		;
    272	000524	000302 				SWAB	R2		;
    273	000526	116202 	000000'			MOVB	APRMP(R2),R2	; GET APR MAPPING
    274	000532				60$:				;
    275	000532	005301 				DEC	R1		; DECREMENT APR NUMBER
    276	000534	002403 				BLT	70$		; IF LT MAP POSITIONED FOR TEST
    277	000536	106302 				ASLB	R2		; SHIFT MAP
    278	000540	103470 				BCS	130$		; IF C/S NO ROOM FOR LIBRARY
    279	000542	000773 				BR	60$		; GO AGAIN
    280	000544				70$:				;
    281	000544	016001 	000000G			MOV	L$DSA(R0),R1	; GET STARTING ADDRESS
    282	000550	130205 				BITB	R2,R5		; APRS AVAILABLE ?
    283	000552	001063 				BNE	130$		; IF NE NO
    284	000554	000441 				BR	110$		; RESERVE APRS
    285	000556				80$:				;
P2POP	MACRO M1108  05-DEC-77 23:03  PAGE 2-5


    286	000556	012602 				MOV	(SP)+,R2	; RETRIEVE LENGTH OF MAX PIC
    287	000560	012600 				MOV	(SP)+,R0	; RETRIEVE ADDRESS OF MAX.
    288	000562	000164 	000570'			JMP	90$(R4)		; DISPATCH ON COND. CODES
    289	000566	000463 				BR	POPEX		; EXIT
    290	000570	000240 			90$:	NOP			;
    291	000572	001461 				BEQ	POPEX		; ALLOCATED ALL LIBS., EXIT
    292	000574	052760 	000000G	000000G		BIS	#LD$RSV,L$DFLG(R0) ; SET APR RESERVED STATUS
    293	000602	005702 				TST	R2		;++039 LIBRARY HAVE LENGTH?
    294	000604	001401 				BEQ	92$		;++039 IF EQ NO
    295	000606	005302 				DEC	R2		;++039 BACK OFF LENGTH BY ONE
    296	000610				92$:				;++039
    297	000610	006302 				ASL	R2		; CONVERT LENGTH TO NUMBER OF APRS
    298	000612	105002 				CLRB	R2		;
    299	000614	000302 				SWAB	R2		; C MUST BE CLEAR
    300	000616	005001 				CLR	R1		; SET INITIAL APR
    301	000620	116202 	000000'			MOVB	APRMP(R2),R2	; GET APR MAPPING
    302	000624	100403 				BMI	100$		; IF MI AT TOP OF MEMORY
    303	000626				95$:				;
    304	000626	005201 				INC	R1		; INCREMENT APR NUMBER
    305	000630	106102 				ROLB	R2		; ROTATE MAP
    306	000632	100375 				BPL	95$		; IF PL GO AGAIN
    307	000634				100$:				;
    308	000634	130205 				BITB	R2,R5		; THIS APR SET ALLOCATED ?
    309	000636	001404 				BEQ	105$		; IF EQ NO
    310	000640	106002 				RORB	R2		; SHIFT MAP
    311	000642	103427 				BCS	130$		; IF C/S NO ROOM
    312	000644	005301 				DEC	R1		; DECREMENT APR
    313	000646	000772 				BR	100$		; GO AGAIN
    314	000650				105$:				;
    315	000650	006201 				ASR	R1		; CONVERT APR TO 4K ADDRESS
    316	000652	006001 				ROR	R1		;
    317	000654	006001 				ROR	R1		;
    318	000656	006001 				ROR	R1		;
    319	000660				110$:				;
    320	000660	150205 				BISB	R2,R5		; ALLOCATE APRS
    321	000662				115$:				;
    322	000662	020167 	177122 			CMP	R1,HGHAD	;++041 THIS ADDRESS LOWEST?
    323	000666	103002 				BHIS	117$		;++041 IF HIS NO
    324	000670	010167 	177114 			MOV	R1,HGHAD	;++041 SET NEW UPPER LIMIT
    325	000674				117$:				;++041
    326	000674	010160 	000000G			MOV	R1,L$DBSE(R0)	; SET BASE ADDRESS
    327	000700	010160 	000000G			MOV	R1,L$DCUR(R0)	; SET CURRENT BASE
    328	000704	010160 	000000G			MOV	R1,L$DSA(R0)	; SET STARTING ADDRESS
    329	000710	000164 	000716'			JMP	120$(R4)	; DISPATCH OF FLAG
    330	000714	000630 				BR	10$		; GET NEXT ENTRY
    331	000716	000240 			120$:	NOP			;
    332	000720	000622 				BR	APRAL		; SCAN FOR NEXT PIC ALLOCATION
    333	000722				130$:				;
    334	000722	010002 				MOV	R0,R2		; COPY ENTRY ADDRESS
    335	000724	005722 				TST	(R2)+		; POINT TO LIBRARY NAME
    336	000726	012701 	000000C			MOV	#<S$V2*400!E$R65>,R1 ; GET ERROR/SEVERITY
    337	000732					CALL	$ERMSG		; FATAL-NO RETURN
    338	000736				POPEX:				;
    339	000736	032767 	000000G	000000G		BIT	#EX$TSK,$MEMFL	;++041 EXTEND TASK IMAGE?
    340	000744	001003 				BNE	10$		;++041 IF NE YES
    341	000746	005767 	000000G			TST	$PARSZ		;++041 SYSTEM CONTROLLED PARTITION?
    342	000752	001003 				BNE	20$		;++041 IF NE NO
P2POP	MACRO M1108  05-DEC-77 23:03  PAGE 2-6


    343	000754				10$:				;++041
    344	000754	016767 	177030 	000000G		MOV	HGHAD,$HGHAD	;++041 RESET HIGH ADDRESS LIMIT
    345	000762				20$:				;++041
    346	000762					RETURN			;
    347
    348					;
    349					; CONVERT ADDRESS IN R2 TO APR NUMBER
    350					;
    351
    352	000764				CVAPR:				;
    353	000764	042702 	017777 			BIC	#17777,R2	; TRUNCATE TO 4K
    354	000770	006302 				ASL	R2		; BIT 15 TO C
    355	000772	006102 				ROL	R2		; BITS 15 - 13 TO 2 - 0
    356	000774	006102 				ROL	R2		;
    357	000776	006102 				ROL	R2		;
    358	001000					RETURN			;
    359
    360						.ENDC
    361
    362		000001 				.END
P2POP	MACRO M1108  05-DEC-77 23:03  PAGE 2-7
SYMBOL TABLE

APRAL   000366R  	H$DSW = ****** GX	L$DNXT= ****** GX	S$V2  = ****** GX	$MEMFL= ****** GX
APRMP   000000R  	H$FOT = ****** GX	L$DSA = ****** GX	VT    = 000013   	$NUNIT= ****** GX
CR    = 000015   	H$FSR = ****** GX	MP$SY = ****** GX	$ADBND= ****** GX	$OFFST= ****** GX
CVAPR   000764R  	H$OVLY= ****** GX	NN    = 000026R     002	$ADLIM= ****** GX	$PARM = ****** GX
EX$TSK= ****** GX	LD$REL= ****** GX	PA$RT = ****** GX	$DFASG= ****** GX	$PARSZ= ****** GX
E$R65 = ****** GX	LD$RSV= ****** GX	POPEX   000736R  	$ERMSG= ****** GX	$PNAME= ****** GX
E$R70 = ****** GX	LF    = 000012   	R$$11M= 000000   	$GBLDF= ****** GX	$P2POP  000012RG
E$R81 = ****** GX	L$DBSE= ****** GX	SPA   = 000040   	$GTPPR= ****** GX	$SWTCH= ****** GX
FF    = 000014   	L$DCUR= ****** GX	SW$AC = ****** GX	$HGHAD= ****** GX	$TKSW = ****** GX
GBLTB   000000R     002	L$DFLG= ****** GX	SW$NH = ****** GX	$LBRHD= ****** GX	$VTKMP= ****** GX
HGHAD   000010R  	L$DLTH= ****** GX	SW$PR = ****** GX	$LUNHD= ****** GX	$$    = 000001
HT    = 000011

. ABS.	000000	   000
      	001002	   001
GBLD$D	000032	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1049 WORDS  ( 5 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:15
[44,10]P2POP,[44,20]P2POP/-SP=[44,30]MACFLM.,P2POP.005
P2PRS                          	MACRO M1108  05-DEC-77 23:03  PAGE 2


      1						.TITLE	P2PRS                                                           ;**NEW**
      2						.IDENT	/01/                                                           ;**NEW**
      3					                                                                                ;**NEW**
      4					;                                                                               ;**NEW**
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.               ;**NEW**
      6					;                                                                               ;**NEW**
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE               ;**NEW**
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION                ;**NEW**
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT                ;**NEW**
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.                               ;**NEW**
     11					;                                                                               ;**NEW**
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT                ;**NEW**
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL                ;**NEW**
     14					; EQUIPMENT CORPORATION.                                                        ;**NEW**
     15					;                                                                               ;**NEW**
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY                ;**NEW**
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.                 ;**NEW**
     18					;                                                                               ;**NEW**
     19					; VERSION 01                                                                   ;**NEW**
     20					;                                                                               ;**NEW**
     21					; D.N. CUTLER/C. MONIA 27-DEC-73                                                ;**NEW**
     22					;                                                                               ;**NEW**
     23					; PARSE PHASE TWO OPTION INPUTS                                                 ;**NEW**
     24					;                                                                               ;**NEW**
     25					;+                                                                              ;**NEW**
     26					; **-$P2PRS-PARSE OPTION INPUTS                                                 ;**NEW**
     27					;                                                                               ;**NEW**
     28					; INPUTS:                                                                       ;**NEW**
     29					;                                                                               ;**NEW**
     30					;	R0:	ADDRESS OF NEXT BYTE TO PROCESS                                 ;**NEW**
     31					;	R2:	LAST BYTE PROCESSED **                                          ;**NEW**
     32					;	R4:	ADDRESS OF LAST OPTION BLOCK PROCESSED                          ;**NEW**
     33					;                                                                               ;**NEW**
     34					; OUTPUTS:                                                                      ;**NEW**
     35					;                                                                               ;**NEW**
     36					;	C-CLEAR: OPTION INPUT FOUND AND SATISFACTORILY PARSED                   ;**NEW**
     37					;	R0:	 ADDRESS OF NEXT BYTE AFTER OPTION TERMINATOR                   ;**NEW**
     38					;	R2:	 BYTE TERMINATING OPTION SPECIFICATION                          ;**NEW**
     39					;	R4:	 ADDRESS OF CORRESPONDING OPTION BLOCK                          ;**NEW**
     40					;	R5:	 ADDRESS OF PARAMETER STORAGE                                   ;**NEW**
     41					;                                                                               ;**NEW**
     42					;	C-SET:   END OF LINE OR SYNTAX ERROR DETECTED                           ;**NEW**
     43					;                                                                               ;**NEW**
     44					; ** R2 IS LOADED WITH THE CHARACTER "!" WHEN PROCESSING                        ;**NEW**
     45					;    A NEW LINE OF KEYWORD INPUT.                                               ;**NEW**
     46					;-                                                                              ;**NEW**
     47					;                                                                               ;**NEW**
     48					                                                                                ;**NEW**
     49	000000				$P2PRS::			;                                               ;**NEW**
     50	000000	005702 				TST	R2		; END OF LINE?                                  ;**NEW**
     51	000002	001547 				BEQ	120$		; IF EQ YES                                     ;**NEW**
     52	000004	122702 	000073 			CMPB	#';,R2		; COMMENT TERMINATOR?                           ;**NEW**
     53	000010	001544 				BEQ	120$		; IF EQ YES                                     ;**NEW**
     54	000012	122702 	000041 			CMPB	#'!,R2		; KEYWORD DELIMITER?                            ;**NEW**
     55	000016	001036 				BNE	40$		; IF NE NO                                      ;**NEW**
     56	000020				10$:				;                                               ;**NEW**
     57	000020					CALL	$SETNB		; BYPASS LEADING BLANKS AND HT'S                ;**NEW**
P2PRS                          	MACRO M1108  05-DEC-77 23:03  PAGE 2-1


     58	000024	122710 	000073 			CMPB	#';,(R0)	;COMMENT DELIMITER?                             ;**-269
     59	000030	001534 				BEQ	120$		; IF EQ YES                                     ;**NEW**
     60	000032	012705 	000000G			MOV	#$PARM,R5	; GET ADDRESS OF PARAMETER STORAGE              ;**NEW**
     61	000036					CALL	$RP		;CONVERT KEYWORD                                ;**-2
     62	000042	122702 	000075 			CMPB	#'=,R2		;TERMINATED PROPERLY?
     63	000046	001067 				BNE	60$		;IF NE SYNTAX ERROR
     64	000050	024545 				CMP	-(R5),-(R5)	;POINT TO KEYWORD
     65	000052	012704 	000000G			MOV	#$KWRD,R4	; GET ADDRESS OF OPTION CONTROL BLOCKS          ;**NEW**
     66	000056				30$:				;                                               ;**NEW**
     67	000056	021564 	000000G			CMP	(R5),K$EY(R4)	; KEYWORD MATCH                                 ;**NEW**
     68	000062	001004 				BNE	35$		;IF NE NO                                       ;**-2
     69	000064	026564 	000002 	000002G		CMP	2(R5),K$EY+2(R4) ; KEY MATCH?                                   ;**NEW**
     70	000072	001410 				BEQ	40$		;IF EQ YES                                      ;**-1
     71	000074				35$:				;                                               ;**NEW**
     72	000074	062704 	000000G			ADD	#L$NG,R4	; INREMENT TO NEXT BLOCK                        ;**NEW**
     73	000100	020427 	000000G			CMP	R4,#$KWRDE	; ANY MORE CONTROL BLOCKS                       ;**NEW**
     74	000104	103764 				BLO	30$		;IF LO YES                                      ;**-2
     75	000106	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
     76	000110	   000G	   000G			.BYTE	E$R29,S$V1	;
     77	000112	000470 				BR	100$		;
     78	000114				40$:				;                                               ;**NEW**
     79	000114	005067 	000000G			CLR	$NUMP		; CLEAR NUMBER OF PARAMETERS                    ;**NEW**
     80	000120	005002 				CLR	R2		;ASSUME NO MORE PARAMETERS                      ;**-1
     81	000122	105710 				TSTB	(R0)		;ANY MORE PARAMETERS?
     82	000124	001455 				BEQ	90$		;IF EQ NO
     83	000126	122710 	000073 			CMPB	#';,(R0)	;COMMENT DELIMITER?
     84	000132	001452 				BEQ	90$		;IF EQ YES
     85	000134	016403 	000000G			MOV	A$RG(R4),R3	; GET ADDRESS OF ARGUMENT BLOCK                 ;**NEW**
     86	000140	042703 	000001 			BIC	#1,R3		;CLEAR LOW BIT                                  ;**-1
     87	000144	012705 	000000G			MOV	#$PARM,R5	; GET ADDRESS OF PARAMETER STORAGE              ;**NEW**
     88	000150				50$:				;                                               ;**NEW**
     89	000150	005267 	000000G			INC	$NUMP		; INCREMENT NUMBER OF PARAMETERS                ;**NEW**
     90	000154	126764 	000000G	000000G		CMPB	$NUMP,M$AX(R4)	; TOO MANY PARAMETERS?                          ;**NEW**
     91	000162	003024 				BGT	70$		;IF GT YES                                      ;**-3
     92	000164					CALL	$SETNB		;BYPASS LEADING BLANKS AND HT'S
     93	000170					CALL	@(R3)+		;CONVERT PARAMETER
     94	000172	122702 	000054 			CMPB	#',,R2		;COMMA TERMINATOR?
     95	000176	001421 				BEQ	80$		;IF EQ YES
     96	000200	122702 	000041 			CMPB	#'!,R2		;KEYWORD DELIMITER?
     97	000204	001425 				BEQ	90$		;IF EQ YES
     98	000206	005702 				TST	R2		;ZERO BYTE?
     99	000210	001423 				BEQ	90$		;IF EQ YES
    100	000212	122702 	000073 			CMPB	#';,R2		;COMMENT DELIMITER?
    101	000216	001420 				BEQ	90$		;IF EQ YES
    102	000220	122702 	000072 			CMPB	#':,R2		;COLON TERMINATOR?
    103	000224	001751 				BEQ	50$		;IF EQ YES
    104	000226	012701 			60$:	MOV	(PC)+,R1	;GET ERROR/SEVERITY
    105	000230	   000G	   000G			.BYTE	E$R30,S$V1	;
    106	000232	000420 				BR	100$		;
    107	000234	012701 			70$:	MOV	(PC)+,R1	;GET ERROR/SEVERITY
    108	000236	   000G	   000G			.BYTE	E$R31,S$V1	;
    109	000240	000415 				BR	100$		;
    110	000242				80$:				;                                               ;**NEW**
    111	000242	032764 	000001 	000000G		BIT	#1,A$RG(R4)	; MULTI-SETS ALLOWED?                           ;**NEW**
    112	000250	001003 				BNE	90$		;IF NE YES                                      ;**-1
    113	000252	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
    114	000254	   000G	   000G			.BYTE	E$R32,S$V1	;
P2PRS                          	MACRO M1108  05-DEC-77 23:03  PAGE 2-2


    115	000256	000406 				BR	100$		;
    116	000260				90$:				;                                               ;**NEW**
    117	000260	126764 	000000G	000000G		CMPB	$NUMP,M$IN(R4)	; ENOUGH PARAMETERS                             ;**NEW**
    118	000266	002007 				BGE	110$		;IF GE YES                                      ;**-1
    119	000270	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
    120	000272	   000G	   000G			.BYTE	E$R33,S$V1	;
    121	000274	012702 	000000G		100$:	MOV	#$LNDES,R2	;GET ADDRESS OF LINE DESCRIPTOR
    122	000300					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    123	000304	000406 				BR	120$		; TERMINATE SCAN                                ;**NEW**
    124	000306				110$:				;                                               ;**NEW**
    125	000306	012705 	000000G			MOV	#$PARM,R5	; GET ADDRESS OF PARAMETER STORAGE              ;**NEW**
    126	000312	016703 	000000G			MOV	$NUMP,R3	; GET NUMBER OF PARAMETERS                      ;**NEW**
    127	000316	000241 				CLC			; SET SUCCESS                                   ;**NEW**
    128	000320	000401 				BR	130$		; EXIT                                          ;**NEW**
    129	000322				120$:				;                                               ;**NEW**
    130	000322	000261 				SEC			; SET ERROR FLAG                                ;**NEW**
    131	000324				130$:				;                                               ;**NEW**
    132	000324					RETURN			;                                               ;**NEW**
    133					                                                                                ;**-714
    134		000001 				.END
P2PRS                          	MACRO M1108  05-DEC-77 23:03  PAGE 2-3
SYMBOL TABLE

A$RG  = ****** GX	E$R33 = ****** GX	M$AX  = ****** GX	$ERMSG= ****** GX	$PARM = ****** GX
CR    = 000015   	FF    = 000014   	M$IN  = ****** GX	$KWRD = ****** GX	$P2PRS  000000RG
E$R29 = ****** GX	HT    = 000011   	R$$11M= 000000   	$KWRDE= ****** GX	$RP   = ****** GX
E$R30 = ****** GX	K$EY  = ****** GX	SPA   = 000040   	$LNDES= ****** GX	$SETNB= ****** GX
E$R31 = ****** GX	LF    = 000012   	S$V1  = ****** GX	$NUMP = ****** GX	$$    = 000001
E$R32 = ****** GX	L$NG  = ****** GX	VT    = 000013

. ABS.	000000	   000
      	000326	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  697 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:09
[44,10]P2PRS,[44,20]P2PRS/-SP=[44,30]MACFLM.,P2PRS.001
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3


      1						.TITLE	P3MDS
      2						.IDENT	/19/
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1975,  DIGITAL EQUIPMENT CORP.,  MAYNARD,   MASS.                 ;**NEW**
      6					;                                                                               ;**-2
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 19
     20					;                                                                               ;**-1
     21					; D.N. CUTLER/C. MONIA 15-JAN-74
     22					;
     23					;
     24					;
     25					; MODIFICATIONS
     26					;
     27					; NO.		DATE		PROGRAMMER
     28					; ---		----		----------
     29					;
     30					; 008		16-AUG-73	C. MONIA
     31					; 015		02-OCT-73	C. MONIA
     32					; 016		26-OCT-73	C. MONIA
     33					; 021		15-JAN-74	C. MONIA
     34					; 032		03-JAN-75	C. MONIA                                        ;**NEW**
     35					; 042		29-JUL-75	C. MONIA
     36					;
     37					;
     38					;
     39					;
     40					; PHASE 3 MODULE SCAN
     41					;
     42					; EQUATED SYMBOLS
     43					;
     44
     45		000026 			EPALO=26			;NUMBER EPT ENTRIES ALLOCATED
     46		000030 			EPAVL=30			;NUMBER EPT ENTRIES AVAILABLE
     47		000024 			EPSTR=24			;STARTING BLOCK NUMBER OF EPT
     48		000036 			MNALO=36			; NUMBER OF MNT ENTRIES ALLOCATED
     49		000040 			MNAVL=40			; NUMBER OF MNT ENTRIES AVAILABLE
     50		000034 			MNSTR=34			; STARTING BLOCK NUMBER OF MNT
     51
     52					;
     53					; MACRO LIBRARY CALLS
     54					;
     55
     56						.MCALL	BDOFF$,CLOSE$,GET$S,OFNB$R
     57
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-1


     58					;
     59					; DEFINE FCS BUFFER OFFSETS LOCALLY
     60					;
     61
     62	000000				 	BDOFF$	DEF$L
     63
     64
     65					;
     66					; LOCAL DATA
     67					;
     68
     69	000000				ALSW:	.BLKW	1		; LIBRARY ELEMENT AUTOLOAD SWITCH
     70	000002	001170'			BFEND:	.WORD	BFBAS+<<BFLST-BFBAS>&^C<777>>-10 ; ADDRESS OF LAST EPT ENTRY
     71	000004				BFTOP:	.BLKW	1		;ADDRESS OF ACTUAL LAST ENTRY IN SEARCH BUFFER
     72	000006	000001 			BKPBF:	.WORD	<BFLST-BFBAS>&^C<777>/512. ; BLOCKS PER SEARCH BUFFER
     73	000010				CRSCT:	.BLKW	10.		; CURRENT SECTION DATA
     74	000034				CRVSC:	.BLKW	1		; VIRTUAL ADDRESS OF CURRENT SECTION
     75	000036				CRVEL:	.BLKW	1		; VIRTUAL ADDRESS OF PARENT MODULE
     76	000040				EPBLK:	.BLKW	1		;STARTING VIRTUAL BLOCK OF EPT
     77	000042				EPHBK:	.BLKW	1		;HIGHEST BLOCK IN EPT PLUS 1
     78	000044				EPNUM:	.BLKW	1		;NUMBER OF EPT ENTRIES
     79	000046				LBRBF:	.BLKW	1		;CURRENT SEARCH BUFFER NUMBER
     80	000050				LBMOD:	.BLKW	17.		; LIBRARY MODULE LIST
     81	000112	125257 	003340 		LOADNM:	.RAD50	/$LOAD/		; MANUAL LOAD SUBROUTINE NAME
     82	000116				MODN:	.BLKW	1		; FIRST HALF OF MODULE NAME (ADJ. TO LCLSYM)
     83	000120				LCLSYM:	.BLKW	8.		;LOCAL SYMBOL DESCRIPTOR
     84	000140				SRCDR:	.BLKW	1		;++015 LIBRARY SEARCH DIRECTION FLAG
     85	000142				SLSW:	.BLKW	1		;++008 SELECTIVE SYMBOL EXTRACTION FLAG
     86	000144				SRCPF:	.BLKW	1		;SEARCH PATH FLAG
     87	000146				SRVSG:	.BLKW	1		; VIRTUAL ADDRESS OF SEARCH SEGMENT
     88	000150				SYDEF:	.BLKW	1		;SYMBOL DEFINITION FLAG
     89	000152				SYENT:	.BLKW	1		;SYMBOL ENTRY ADDRESS
     90	000154				SYFLG:	.BLKW	1		; CURRENT SYMBOL FLAGS
     91
     92					;
     93					; LIBRARY EPT TABLE SEARCH BUFFER
     94					;
     95
     96						.IF	NDF	R$$11M
     97
     98						.PSECT	$$LBR1,OVR
     99					BFBAS:	.BLKW	256.		;MINIMUM OF ONE SEARCH BUFFER BLOCK
    100						.PSECT	$$LBR2
    101					BFLST:				;REF LABEL
    102
    103					;
    104					; PHASE THREE FCS BLOCK BUFFER
    105					;
    106
    107						.PSECT	P3B$D,D,GBL
    108
    109					P3BF:	.WORD	P3BFE-P3BF-2
    110						.BLKB	S.BFHD+512.
    111
    112						.PSECT	P3B$E,D,GBL
    113
    114					 P3BFE:				; REF LABEL
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-2


    115
    116						.IFF
    117
    118
    119					;
    120					; PHASE THREE FCS BLOCK BUFFER AND LIBRARY SEARCH BUFFER
    121					;
    122
    123	000156	001020 			P3BF:	.WORD	P3BFE-P3BF-2	; BUFFER LENGTH
    124						.BLKB	S.BFHD		; FCS BUFFER HEADER
    125	000200				BFBAS:	.BLKW	256.		; LIBRARY SEARCH BUFFER AND FCS BLOCK BUFFER
    126	001200				BFLST:				; REF LABEL
    127	001200				P3BFE:				; REF LABEL
    128
    129						.ENDC
    130
    131	001200					.PSECT
    132
    133						.EVEN
    134
    135					;+
    136					; **-$P3MDS-PHASE 3 MODULE SCAN
    137					;
    138					; THIS ROUTINE IS CALLED TO DO THE PHASE 3 MODULE SCAN OF ALL SEG-
    139					; MENTS IN THE ALLOCATION. AS EACH SEGMENT IS CONSIDERED, THE ELE-
    140					; MENT LIST IS SCANNED. THE SCAN STARTS WITH THE FIRST ELEMENT IN
    141					; THE LIST AND CONTINUES TO THE END OF THE LIST. AS EACH ELEMENT
    142					; IS CONSIDERED, THE SECTION AND SYMBOL TABLES OF THE SEGMENT ARE UP-
    143					; DATED. THE ELEMENT MODULE NAME IS RESOLVED AND THE ELEMENT SECT-
    144					; ION MAPPING TABLE IS CONSTRUCTED.
    145					;
    146					; INPUTS:
    147					;
    148					;	NONE.
    149					;
    150					; OUTPUTS:
    151					;
    152					;	NONE.
    153					;-
    154
    155	001200				$P3MDS::			;
    156	001200	016700 	000000G			MOV	$INPPT,R0	; GET INPUT RECORD BLOCK POINTER
    157	001204	012760 	000156'	000000G		MOV	#P3BF,R$BLKB(R0) ; SET FCS BLOCK BUFFER POINTER
    158	001212	005070 	000000G			CLR	@R$NMBK(R0)	; NO NAMEBLOCK TO SETUP
    159	001216					CALL	$STRCB		; SET RECORD BLOCK RESIDENT
    160	001222	012767 	177774G	000000G		MOV	#S$ZSEG-4,$SZSEG ; SET RESIDENT SEGMENT DESCRIPTOR SIZE
    161	001230	012700 	001546'			MOV	#P3MDS,R0	;GET ADDRESS OF PHASE CONTROL ROUTINE
    162	001234					CALL	$PCTRL		;CALL PHASE CONTROL ROUTINE
    163	001240	005767 	000000G			TST	$MSYMC		;ANY UNDEFINED SYMBOLS?
    164	001244	001415 				BEQ	20$		;IF EQ NO
    165	001246	005767 	000000G			TST	$LIBNM		; DID LIBRARY PARSE/FIND SUCCEED?
    166	001252	001405 				BEQ	10$		; IF EQ NO, COMPLAIN NOW
    167	001254	012700 	001312'			MOV	#P3LBS,R0	;GET ADDRESS OF PHASE CONTROL ROUTINE
    168	001260					CALL	$PCTRL		;CALL PHASE CONTROL ROUTINE
    169	001264	000405 				BR	20$		;
    170	001266				10$:				;
    171	001266	005002 				CLR	R2		; SET DUMMY PARAMETER BLOCK ADDRESS
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-3


    172	001270	012701 	000000C			MOV	#<S$V0*400!E$R74>,R1 ; GET ERROR/SEVERITY
    173	001274					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    174	001300				20$:				;
    175	001300	016700 	000000G			MOV	$INPPT,R0	; GET RECORD BLOCK POINTER
    176	001304	005060 	000000G			CLR	R$BLKB(R0)	; CLEAR BLOCK BUFFER POINTER
    177	001310					RETURN			;
    178
    179					;
    180					; SYSTEM LIBRARY SEARCH
    181					;
    182					; THIS ROUTINE IS CALLED FOR EACH SEGMENT IN THE ALOCATION.
    183					;
    184
    185	001312				P3LBS:	SAVRG			;SAVE NONVOLITILE REGISTERS
    186	001316	016701 	000000G			MOV	$CRVSG,R1	; GET VIRTUAL ADDRESS OF SEGMENT
    187	001322					CALL	$WRMPG		; WRITE-MARK PAGE
    188	001326	016705 	000000G			MOV	$CRSEG,R5	;GET ADDRESS OF CURRENT SEGMENT
    189	001332	005765 	000000G			TST	S$GUND(R5)	;ANY UNDEFINED SYMBOLS?
    190	001336	001474 				BEQ	10$		;IF EQ NO
    191	001340	016701 	000000G			MOV	$LIBNM,R1	; GET VIRTUAL ADDRESS OF LIBRARY DESCRIPTOR
    192	001344					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    193	001350					CALL	$LCKPG		; LOCK PAGE IN MEMORY
    194	001354	010046 				MOV	R0,-(SP)	; SAVE REAL ADDRESS OF DESCRIPTOR
    195	001356	016701 	000000G			MOV	$INPPT,R1	; GET RECORD BLOCK POINTER
    196	001362	010104 				MOV	R1,R4		; SAVE NAMEBLOCK POINTER
    197	001364					CALL	$STFNB		; SETUP FILE NAMEBLOCK
    198	001370					OFNB$R	R4		; OPEN LIBRARY FILE
    199	001404	103452 				BCS	20$		;IF CS OPEN FAILURE
    200	001406	012701 	000000G			MOV	#E$LLGH,R1	; SET DESCRIPTOR LENGTH
    201	001412	010103 				MOV	R1,R3		; SAVE LENGTH
    202	001414					CALL	$ALVRT		; ALLOCATE VIRTUAL MEMORY
    203	001420					CALL	$LCKPG		; LOCK PAGE IN CORE
    204	001424	010004 				MOV	R0,R4		; SAVE REAL ADDRESS OF CURRENT ELEMENT
    205	001426	010467 	000000G			MOV	R4,$CRELM	; SET ADDRESS OF CURRENT ELEMENT
    206	001432	010167 	000000G			MOV	R1,$CRVEL	; SET VIRTUAL ADDRESS OF CURRENT ELEMENT
    207	001436	016700 	000000G			MOV	$CRVSG,R0	; GET VIRTUAL ADDRESS OF SEGMENT
    208	001442	062700 	000000C			ADD	#<S$GELT/2>,R0	; POINT TO ELEMENT LISTHEAD
    209	001446	012702 	000000G			MOV	#E$LNXT,R2	; GET OFFSET TO NEXT
    210	001452					CALL	$LNKVM		; LINK ITEM TO ELEMENT LIST
    211	001456	010400 				MOV	R4,R0		; GET REAL ADDRESS OF DESCRIPTOR
    212	001460	012601 				MOV	(SP)+,R1	; GET REAL ADDRESS OF LIBRARY NAMEBLOCK
    213	001462				5$:				;
    214	001462	112120 				MOVB	(R1)+,(R0)+	; COPY BLOCK
    215	001464					SOB	R3,5$		;
    216	001470	016701 	000000G			MOV	$LIBNM,R1	; GET VIRTUAL ADDRESS OF DESCRIPTOR
    217	001474					CALL	$UNLPG		; UNLOCK PAGE
    218	001500	005067 	176436 			CLR	SLSW		;++008 CLEAR SELECTIVE SEARCH FLAG
    219	001504					CALL	LBSRC		; SEARCH LIBRARY
    220	001510					CLOSE$	$INPPT		; CLOSE LIBRARY FILE
    221	001520	016501 	000002G			MOV	S$GELT+2(R5),R1	; GET VIRTUAL ADDRESS OF LIBRARY ELEMENT
    222	001524					CALL	$UNLPG		; UNLOCK PAGE FROM MEMORY
    223	001530				10$:	RETURN			;
    224	001532	016002 	000000G		20$:	MOV	R$NAME(R0),R2	;GET ADDRESS OF NAME STRING
    225	001536	012701 				MOV	(PC)+,R1	;OPEN FAILURE
    226	001540	   000G	   000G			.BYTE	E$R11,S$V2	;FATAL-NO RETURN
    227	001542					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    228
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-4


    229					;
    230					; MODULE SCAN
    231					;
    232					; THIS ROUTINE IS CALLED FOR EACH SEGMENT IN THE ALLOCATION.
    233					;
    234
    235	001546				P3MDS:	SAVRG			;SAVE NONVOLITILE REGISTERS
    236	001552	016701 	000000G			MOV	$CRVSG,R1	; GET VIRTUAL ADDRESS OF SEGMENT
    237	001556					CALL	$WRMPG		; WRITE MARK PAGE
    238	001562	016705 	000000G			MOV	$CRSEG,R5	;GET ADDR OF CURRENT SEGMENT
    239	001566	012746 	000000G			MOV	#$STINP,-(SP)	;SET ADDRESS OF INPUT SET UP ROUTINE
    240	001572				10$:	CALL	@(SP)+		;SET UP NEXT INPUT FILE
    241	001574	103001 				BCC	20$		;IF CC GOT ONE
    242	001576					RETURN			;
    243	001600	016704 	000000G		20$:	MOV	$CRELM,R4	;GET ADDRESS OF ELEMENT DESCRIPTOR
    244	001604	032764 	000000G	000000G		BIT	#SW$LB,E$LSWT(R4);LIBRARY FILE?
    245	001612	001041 				BNE	40$		;IF NE YES
    246	001614	032764 	000000G	000000G		BIT	#SW$CC,E$LSWT(R4);CONCATENATED FILE?
    247	001622	001432 				BEQ	30$		;IF EQ NO
    248	001624	016701 	000000G			MOV	$CRVEL,R1	; GET VIRTUAL ADDRESS OF DESCRIPTOR
    249	001630	010167 	176202 			MOV	R1,CRVEL	; SAVE VIRTUAL ADDRESS
    250	001634					CALL	$WRMPG		; WRITE-MARK THIS PAGE
    251	001640					CALL	ACMOD		;ALLOCATE CONCATENATED MODULE DESCRIPTOR
    252	001644					CALL	$LCKPG		; LOCK PAGE IN MEMORY
    253	001650	010164 	000000G			MOV	R1,E$LMOD(R4)	; SET LINK TO FIRST MODULE
    254	001654	010167 	000000G			MOV	R1,$CRVEL	; SET VIRTUAL ADDRESS OF CURRENT ELEMENT
    255	001660	010004 				MOV	R0,R4		;SET ADDRESS OF CURRENT DESCRIPTOR
    256	001662	016701 	176150 			MOV	CRVEL,R1	; GET VIRTUAL ADDRESS OF PARENT ELEMENT
    257	001666					CALL	$UNLPG		; FREE UP THE PAGE BUFFER
    258	001672					CALL	PRCELM		; PROCESS THE ELEMENT
    259	001676	016701 	176134 			MOV	CRVEL,R1	; RETRIEVE VIRTUAL ADDRESS OF PARENT
    260	001702					CALL	$CVLOK		; RESTORE PAGE STATE
    261	001706	000731 				BR	10$		;
    262	001710				30$:	CALL	PRCELM		;PROCESS ELEMENT
    263	001714	000726 				BR	10$		;
    264
    265					;
    266					; LIBRARY FILE
    267					;
    268
    269	001716				40$:				;++008
    270	001716	005067 	176220 			CLR	SLSW		;++008 ASSUME ALL SYMBOLS WANTED
    271	001722	032764 	000000G	000000G		BIT	#SW$SS,E$LSWT(R4) ;++008 NOW TEST FOR SURE
    272	001730	001403 				BEQ	50$		;++008 YES -- ALL SET
    273	001732	012767 	000000G	176202 		MOV	#SW$SS,SLSW	;++008 NO -- SET SELECTIVE EXTRACTION SWITCH
    274	001740				50$:
    275	001740					CALL	LBSRC		;++008 SEARCH LIBRARY
    276	001744	000712 				BR	10$		;
    277
    278					;
    279					; LIBRARY FILE SEARCH ROUTINE
    280					;
    281
    282	001746				LBSRC:				;
    283	001746	016701 	000000G			MOV	$CRVEL,R1	; GET VIRTUAL ADDRESS OF LIBRARY ELEMENT
    284	001752	062701 	000000C			ADD	#<E$LMOD-E$LNXT>/2,R1 ; CALCULATE VIRTUAL ADDRESS OF FIRST LINK
    285	001756	010167 	000000G			MOV	R1,$CRVEL	; RESET VIRTUAL ELEMENT ADDRESS
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-5


    286	001762	010167 	176050 			MOV	R1,CRVEL	; SAVE VIRTUAL ADDRESS OF PARENT ELEMENT
    287	001766					CALL	$UNLPG		; FREE UP THE PAGE BUFFER
    288	001772					CALL	LBSR		; SEARCH LIBRARY
    289	001776	016701 	176034 			MOV	CRVEL,R1	; RETRIEVE VIRTUAL ADDRESS OF PARENT
    290	002002					CALLR	$CVLOK		; RESTORE PAGE STATE, EXIT
    291
    292					;
    293					; SEARCH LIBRARY
    294					;
    295
    296	002006				LBSR:				;
    297	002006	012701 	000001 			MOV	#1,R1		;SET NUMBER OF FIRST RECORD TO READ
    298	002012					CALL	LBSRD		;SET FOR LIBRARY SEARCH READ
    299	002016	103455 				BCS	20$		; IF C/S ERROR POSITIONING FILE
    300	002020					GET$S	R0		; READ HEADER RECORD
    301	002024	103452 				BCS	20$		;IF CS I/O ERROR
    302	002026	016001 	000026 			MOV	F.NRBD+2(R0),R1	;GET ADDRESS OF RECORD BUFFER
    303	002032	005764 	000002G			TST	E$LIDT+2(R4)	; SEARCHING ON MODULE NAMES?
    304	002036	001402 				BEQ	5$		; IF EQ NO
    305	002040	062701 	000010 			ADD	#<MNSTR-EPSTR>,R1 ; OFFSET TO MNT PARAMETERS
    306	002044				5$:				;
    307	002044	016167 	000024 	175766 		MOV	EPSTR(R1),EPBLK	;SET STARTING BLOCK OF EPT
    308	002052	016102 	000026 			MOV	EPALO(R1),R2	;GET NUMBER OF EPT ENTRIES ALLOCATED
    309	002056	166102 	000030 			SUB	EPAVL(R1),R2	;SUBTRACT OUT NUMBER AVAILABLE
    310	002062	001423 				BEQ	10$		;IF EQ NO ENTRIES IN LIBRARY
    311	002064	010267 	175754 			MOV	R2,EPNUM	;SET NUMBER OF EPT ENTRIES IN LIBRARY
    312	002070	062702 	000077 			ADD	#63.,R2		;ROUND UP TO NEXT BLOCK OF EPT
    313
    314
    315						.IF DF	V1145
    316
    317						ASH	#-6,R2		;CALCULATE NUMBER OF BLOCKS IN EPT
    318
    319						.IFF
    320
    321		000006 				.REPT	6
    322						ASR	R2		;CALCULATE NUMBER OF BLOCKS IN EPT
    323						.ENDR
    324
    325						.ENDC
    326
    327
    328	002110	066702 	175724 			ADD	EPBLK,R2	;CALCULATE HIGHEST BLOCK IN EPT PLUS 1
    329	002114	010267 	175722 			MOV	R2,EPHBK	;SET HIGHEST BLOCK IN EPT
    330	002120	012702 	000001 			MOV	#1,R2		;SET TO READ FIRST BUFFER FROM EPT
    331	002124					CALL	LBRD		;READ FIRST BUFFER
    332	002130	103020 				BCC	LBSRC1		;IF CC OKAY
    333	002132				10$:	CALL	LBFRD		;RESET FOR FILE READ
    334	002136	012701 	000000C			MOV	#<S$V2*400!E$R79>,R1 ; ASSUME LIBRARY MODULE REQUEST
    335	002142	005764 	000002G			TST	E$LIDT+2(R4)	; SEARCHING ON MODULE NAMES?
    336	002146	001005 				BNE	30$		; IF NE YES
    337	002150					RETURN			;
    338	002152				20$:	CALL	LBFRD		;RESET FOR FILE READ
    339	002156	012701 	000000C			MOV	#<S$V2*400!E$R10>,R1 ; I/O ERROR
    340	002162				30$:				;
    341	002162	016002 	000000G			MOV	R$NAME(R0),R2	; GET ADDRESS OF NAME STRING
    342	002166					CALL	$ERMSG		; OUTPUT ERROR MESSAGE, NO RETURN
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-6


    343
    344					;
    345					; SEARCH FOR UNDEFINED SYMBOLS IN EPT OR REQUESTED MODULES
    346					; IN MNT
    347					;
    348
    349	002172				LBSRC1:				;
    350	002172	005067 	175602 			CLR	ALSW		; CLEAR AUTOLOAD SWITCH
    351	002176	016401 	000002G			MOV	E$LIDT+2(R4),R1	; GET VIRTUAL ADDRESS OF MODULE LIST
    352	002202	001445 				BEQ	30$		; IF EQ SEARCH FOR UNDEFINED SYMBOLS
    353	002204					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    354	002210	012701 	000050'			MOV	#LBMOD,R1	; GET ADDRESS OF LOCAL STORE
    355	002214	010146 				MOV	R1,-(SP)	; SAVE ADDRESS
    356	002216				10$:				;
    357	002216	012021 				MOV	(R0)+,(R1)+	; TRANSFER LIST TO LOCAL STORE
    358	002220	001402 				BEQ	20$		; IF EQ HAVE ALL OF LIST
    359	002222	012021 				MOV	(R0)+,(R1)+	; MOVE SECOND HALF OF NAME
    360	002224	000774 				BR	10$		;
    361	002226				20$:				;
    362	002226	012600 				MOV	(SP)+,R0	; GET MODULE NAME LIST POINTER
    363	002230	012067 	175664 			MOV	(R0)+,LCLSYM	; SETUP LOCAL SYMBOL DESCRIPTOR
    364	002234	001530 				BEQ	50$		; IF EQ DONE WITH LIST
    365	002236	012067 	175660 			MOV	(R0)+,LCLSYM+2	; SET SECOND HALF OF MODULE NAME
    366	002242	010046 				MOV	R0,-(SP)	; SAVE LIST POINTER
    367	002244					CALL	LBSRC2		; SEARCH LIBRARY
    368	002250	103006 				BCC	25$		; IF C/C FOUND MODULE
    369	002252	012701 	000000C			MOV	#<S$V2*400!E$R77>,R1 ; GET ERROR/SEVERITY
    370	002256	012702 	000120'			MOV	#LCLSYM,R2	; POINT TO MODULE NAME
    371	002262					CALL	$ERMSG		; FATAL, NO RETURN
    372	002266				25$:				;
    373	002266	012701 	000000C			MOV	#^C<SW$AL!SW$DA>,R1 ;++032 GET COMPLEMENT OF DEBUG AND AUTOLOAD ;**NEW**
    374	002272	016700 	000000G			MOV	$INPPT,R0	; GET RECORD BLOCK POINTER                      ;**-1
    375	002276	016000 	000000G			MOV	R$SWTH(R0),R0	;++032 GET FILE SWITCH WORD                     ;**NEW**
    376	002302	040100 				BIC	R1,R0		;++032 CLEAR ALL BUT AUTOLOAD AND DEBUG         ;**NEW**
    377	002304	010067 	175470 			MOV	R0,ALSW		;++032 SAVE SWITCHES                            ;**NEW**
    378	002310					CALL	LBSRC3		; PROCESS MODULE                                ;**-4
    379	002314	000744 				BR	20$		; GO AGAIN                                      ;**-1
    380	002316				30$:				;
    381	002316	005765 	000000G			TST	S$GUND(R5)	; ANY UNDEFINED SYMBOLS
    382	002322	001475 				BEQ	50$		; IF EQ NO
    383	002324	010500 				MOV	R5,R0		;++042 GET ADDRESS OF SEGMENT DESCRIPTOR
    384	002326	062700 	000000G			ADD	#S$GSTB,R0	;++042 POINT TO SYMBOL TABLE
    385	002332	012746 	000000G			MOV	#$ISED,-(SP)	;++042 PUSH ADDRESS OF SYMBOL EDIT ROUTINE
    386	002336				32$:				;++042
    387	002336					CALL	@(SP)+		;++042 GET NEXT SYMBOL
    388	002340	103412 				BCS	35$		;++042 IF C/S  DONE
    389	002342	132760 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R0) ;++042 DEFINITION?
    390	002350	001372 				BNE	32$		;++042 IF NE YES
    391	002352	142760 	000000G	000000G		BICB	#SY$NLB,S$YFLG(R0) ;++042 CLEAR NOT-IN-LIBRARY FLAG
    392	002360					CALL	$WRMPG		;++042 WRITE-MARK THE PAGE
    393	002364	000764 				BR	32$		;++042 GO AGAIN
    394	002366				35$:				;++042
    395	002366	005765 	000000G			TST	S$GUND(R5)	;++042 ANY UNDEFINED SYMBOLS
    396	002372	001451 				BEQ	50$		;++042 IF EQ NO
    397	002374	010500 				MOV	R5,R0		; GET REAL ADDRESS OF SEGMENT
    398	002376	062700 	000000G			ADD	#S$GSTB,R0	; POINT TO SYMBOL TABLE
    399	002402	012746 	000000G			MOV	#$ISED,-(SP)	; SET ADDRESS OF SYMBOL EDIT ROUTINE
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-7


    400	002406				40$:				;
    401	002406					CALL	@(SP)+		; GET NEXT SYMBOL
    402	002410	103442 				BCS	50$		; IF C/S DONE
    403	002412	132760 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R0) ; FIND DEFINITION
    404	002420	001372 				BNE	40$		; IF NE YES
    405	002422	132760 	000000G	000000G		BITB	#SY$NLB,S$YFLG(R0) ;++042 SYMBOL IN LIBRARY?
    406	002430	001366 				BNE	40$		;++042 IF NE NO
    407	002432	016067 	000000G	175460 		MOV	S$YM(R0),LCLSYM	; SETUP LOCAL DESCRIPTOR WITH SYMBOL
    408	002440	016067 	000002G	175454 		MOV	S$YM+2(R0),LCLSYM+2 ;
    409	002446	010146 				MOV	R1,-(SP)	;++042 SAVE VIRTUAL ADDRESS OF SYMBOL
    410	002450					CALL	LBSRC2		; SEARCH LIBRARY
    411	002454	012601 				MOV	(SP)+,R1	;++042 RESTORE VIRTUAL ADDRESS OF SYMBOL
    412	002456	005500 				ADC	R0		; COMBINE NOT-FOUND, NOT-IN-LIBRARY FLAGS
    413	002460	103415 				BCS	45$		; IF C/S NO MORE MATCHES ARE POSSIBLE
    414	002462	001410 				BEQ	43$		;++042 IF EQ FOUND IN LIBRARY
    415	002464					CALL	$CVRL		;++042 CONVERT TO REAL ADDRESS
    416	002470	152760 	000000G	000000G		BISB	#SY$NLB,S$YFLG(R0) ;++042 SET NOT-IN-LIBRARY FLAG
    417	002476					CALL	$WRMPG		;++042 WRITE-MARK PAGE
    418	002502	000741 				BR	40$		;++042 GO AGAIN
    419	002504				43$:				;++042
    420	002504	005726 				TST	(SP)+		; CLEAN STACK
    421	002506					CALL	LBSRC3		; PROCESS ELEMENT
    422	002512	000725 				BR	35$		; GO AGAIN
    423	002514				45$:				;
    424	002514	005726 				TST	(SP)+		; CLEAN STACK
    425	002516				50$:				;
    426	002516					CALLR	LBFRD		; RESET FOR LIBRARY FILE READ
    427
    428					;
    429					; SEARCH LIBRARY FILE FOR MODULE NAME OR SYMBOL
    430					;
    431					; INPUTS:
    432					;
    433					;	LCLSYM,LCLSYM+2 CONTAIN REQUESTED NAME
    434					;
    435					;
    436					; OUTPUTS:
    437					;
    438					;	C-BIT SET=NAME NOT IN LIBRARY
    439					;	R0=0 MORE MATCHES POSSIBLE
    440					;	R0=-1 NO MORE MATCHES ARE POSSIBLE
    441					;
    442					;	C-BIT CLEAR=FOUND MATCH IN EPT OR MNT
    443					;	R0=0
    444					;	R3=POINTER TO EPT OR MNT ENTRY
    445					;
    446
    447	002522				LBSRC2:				;
    448	002522	010446 				MOV	R4,-(SP)	; SAVE R4 AND R5
    449	002524	010546 				MOV	R5,-(SP)	;
    450	002526	005046 				CLR	-(SP)		; SET MORE-SYMBOLS INDICATOR
    451	002530	005067 	175404 			CLR	SRCDR		;++015 CLEAR SEARCH DIRECTION FLAG
    452	002534	012700 	000200'		40$:	MOV	#BFBAS,R0	;GET BASE ADDRESS OF SEARCH BUFFER
    453	002540	010001 				MOV	R0,R1		;COPY BASE ADDRESS
    454	002542	042700 	177770 			BIC	#177770,R0	;CLEAR EXCESS BITS
    455	002546	026711 	175346 			CMP	LCLSYM,(R1)	;SYMBOL LOWER THAN BUFFER?
    456	002552	101014 				BHI	50$		;IF HI NO
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-8


    457	002554	103404 				BLO	45$		;IF LO READ BUFFER BACKWARD
    458	002556	026761 	175340 	000002 		CMP	LCLSYM+2,2(R1)	;SYMBOL LOWER THAN BUFFER?
    459	002564	103007 				BHIS	50$		;IF HIS NO
    460	002566				45$:
    461	002566	005367 	175346 			DEC	SRCDR		;++015 DECREMENT FLAG FOR BACKWARD SEARCH
    462	002572	002057 				BGE	110$		;++015 LAST SEARCHED FORWARD, NOT IN LIBRARY.
    463	002574					CALL	LBRDB		; READ BUFFER BACKWARD IN FILE
    464	002600	103454 				BCS	110$		;IF CS NO BACKWARD BUFFER
    465	002602	000754 				BR	40$		;TRY AGAIN
    466	002604	016702 	175174 		50$:	MOV	BFTOP,R2	;GET ADDRESS OF TOP ENTRY IN BUFFER
    467	002610	026712 	175304 			CMP	LCLSYM,(R2)	;LOWER THAN TOP OF BUFFER?
    468	002614	103414 				BLO	60$		;IF LO YES
    469	002616	101004 				BHI	55$		;IF HI NO
    470	002620	026762 	175276 	000002 		CMP	LCLSYM+2,2(R2)	;LOWER THAN TOP OF BUFFER?
    471	002626	101407 				BLOS	60$		;IF LOS YES
    472	002630				55$:
    473	002630	005267 	175304 			INC	SRCDR		;++015 INCREMENT FLAG FOR FORWARD SEARCH
    474	002634	003436 				BLE	110$		;++015 LAST SEARCHED BACKWARD, NOT THERE
    475	002636					CALL	LBRDF		; READ BUFFER FORWARD IN FILE
    476	002642	103432 				BCS	100$		;IF CS NO MORE MATCHES ARE POSSIBLE
    477	002644	000733 				BR	40$		;TRY AGAIN
    478	002646	010103 			60$:	MOV	R1,R3		;CALCULATE TRAIL INDEX HALFWAY IN BUFFER
    479	002650	060203 				ADD	R2,R3		;
    480	002652	006003 				ROR	R3		;HALVE RESULT
    481	002654	042703 	000007 			BIC	#7,R3		;CLEAR LOW BITS
    482	002660	050003 				BIS	R0,R3		;SET PROPER OFFSET BITS
    483	002662	021367 	175232 			CMP	(R3),LCLSYM	;FIRST HALF MATCH?
    484	002666	101012 				BHI	80$		;IF HI LOWER UPPER LIMIT
    485	002670	103405 				BLO	70$		;IF LO RAISE LOWER LIMIT
    486	002672	026367 	000002 	175222 		CMP	2(R3),LCLSYM+2	;SECOND HALF MATCH?
    487	002700	001415 				BEQ	120$		;IF EQ YES
    488	002702	101004 				BHI	80$		;IF HI LOWER UPPER LIMIT
    489	002704	010301 			70$:	MOV	R3,R1		;RAISE LOWER LIMIT
    490	002706	062701 	000010 			ADD	#10,R1		;REDUCE BY ONE MORE ENTRY
    491	002712	000403 				BR	90$		;
    492	002714	010302 			80$:	MOV	R3,R2		;LOWER UPPER LIMIT
    493	002716	162702 	000010 			SUB	#10,R2		;REDUCE BY ONE MORE ENTRY
    494	002722	020102 			90$:	CMP	R1,R2		;ANY MORE TO SEARCH?
    495	002724	101750 				BLOS	60$		;IF LOS YES
    496	002726	000401 				BR	110$		;SYMBOL NOT IN LIBRARY
    497	002730				100$:				;
    498	002730	005116 				COM	(SP)		; SET NOT-IN-LIBRARY FLAG
    499	002732				110$:				;
    500	002732	000261 				SEC			; SET NOT-FOUND FLAG
    501	002734				120$:				;
    502	002734	012600 				MOV	(SP)+,R0	; GET FLAG
    503	002736	012605 				MOV	(SP)+,R5	; RESTORE R5 AND R4
    504	002740	012604 				MOV	(SP)+,R4	;
    505	002742					RETURN			;
    506
    507					;
    508					; PROCESS LIBRARY ELEMENT
    509					;
    510					; INPUTS:
    511					;
    512					;	R3=POINTER TO ENTRY IN MNT OR EPT
    513					;
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-9


    514					; OUTPUTS:
    515					;
    516					;	THE SPECIFIED LIBRARY MODULE IS PROCESSED
    517					;
    518					;
    519
    520	002744				LBSRC3:				;
    521	002744	012701 	000004G			MOV	#E$LMND+4,R1	;GET SIZE OF LIBRARY ELEMENT DESCRIPTOR
    522	002750					CALL	$ALVRT		; ALLOCATE VIRTUAL MEMORY
    523	002754					CALL	$LCKPG		; LOCK PAGE IN MEMORY
    524	002760	010046 				MOV	R0,-(SP)	; SAVE REAL ADDRESS
    525	002762	010146 				MOV	R1,-(SP)	; SAVE VIRTUAL ADDRESS
    526	002764	016701 	000000G			MOV	$CRVEL,R1	; GET VIRTUAL ADDRESS OF CURRENT
    527	002770	062701 	000000C			ADD	#<E$LNXT>/2,R1	; POINT TO LINK NEXT
    528	002774					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    529	003000					CALL	$WRMPG		; WRITE-MARK PAGE
    530	003004	011610 				MOV	(SP),(R0) 	; SET LINK TO NEXT
    531	003006	012667 	000000G			MOV	(SP)+,$CRVEL	; SET VIRTUAL ADDRESS OF DESCRIPTOR
    532	003012	012604 				MOV	(SP)+,R4	; SET REAL ADDRESS OF DESCRIPTOR
    533	003014	010467 	000000G			MOV	R4,$CRELM	; SAVE ADDRESS OF CURRENT ELEMENT
    534	003020	005364 	000000G			DEC	E$LNUM(R4)	;SET HIGHEST SECTION NUMBER TO -1
    535	003024	012764 	000000G	000000G		MOV	#SW$LB,E$LSWT(R4);SET SWITCH OPTION WORD
    536	003032	056764 	174742 	000000G		BIS	ALSW,E$LSWT(R4)	; MERGE AUTOLOAD SWITCH
    537	003040					CALL	LBFRD		;SET FOR FILE READ
    538	003044	005001 				CLR	R1		;CLEAR HIGH PART OF VIRTUAL BLOCK NUMBER
    539	003046	016302 	000004 			MOV	4(R3),R2	;SET LOW PART OF VIRTUAL BLOCK NUMBER
    540	003052	016303 	000006 			MOV	6(R3),R3	;SET RELATIVE BYTE WITHIN BLOCK
    541	003056	010264 	000000G			MOV	R2,E$LMND(R4)	;SAVE VIRTUAL BLOCK IN ELEMENT DESCRIPTOR
    542	003062	010364 	000002G			MOV	R3,E$LMND+2(R4)	;SAVE BYTE WITHIN BLOCK IN ELEMENT DESCRIPTOR
    543	003066					CALL	.POINT		;POINT TO DESIRED RECORD
    544	003072	103434 				BCS	110$		;IF CS I/O ERROR
    545	003074					GET$S	R0		; GET MODULE HEADER RECORD
    546	003100	103431 				BCS	110$		;IF CS I/O ERROR
    547	003102	016001 	000026 			MOV	F.NRBD+2(R0),R1 ;++008 GET ADDRESS OF BUFFER
    548	003106	132761 	000000G	000000G		BITB	#MH$SS,M$HFL(R1) ;++008 SELECTIVE SEARCH MODULE ?
    549	003114	001403 				BEQ	105$		;++008 NO -- CONTINUE
    550	003116	052764 	000000G	000000G		BIS	#SW$SS,E$LSWT(R4) ;++008 YES -- TURN ON SELECTIVE SEARCH
    551	003124				105$:				;++008
    552	003124	056764 	175012 	000000G		BIS	SLSW,E$LSWT(R4) ;++008 SELECTIVE SEARCH FLAG MAY OVERRIDE
    553	003132	005067 	000000G			CLR	$NBYTE		;CLEAR CURRENT BYTE COUNT
    554	003136					CALL	PRCELM		;PROCESS ELEMENT
    555
    556						.IF	DF	R$$11M
    557
    558	003142	016702 	174700 			MOV	LBRBF,R2	; GET NUMBER OF LAST BUFFER SEARCHED
    559	003146					CALL	LBRD		; READ IN LAST LIBRARY BUFFER
    560
    561						.ENDC
    562
    563	003152	016701 	000000G			MOV	$CRVEL,R1	; GET VIRTUAL ADDRESS OF ELEMENT
    564	003156					CALL	$UNLPG		; UNLOCK PAGE
    565	003162					RETURN			;
    566	003164	016002 	000000G		110$:	MOV	R$NAME(R0),R2	;GET ADDRESS OF NAME STRING
    567	003170	012701 				MOV	(PC)+,R1	;I/O ERROR
    568	003172	   000G	   000G			.BYTE	E$R10,S$V2	;FATAL-NO RETURN
    569	003174					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    570
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-10


    571					;
    572					; SUBROUTINE TO READ LIBRARY SEARCH BUFFER
    573					;
    574
    575	003200	016702 	174642 		LBRDB:	MOV	LBRBF,R2	;READ BUFFER BACKWARDS
    576	003204	005302 				DEC	R2		;BACK OFF ONE BUFFER
    577	003206	000403 				BR	LBRD		;
    578	003210	016702 	174632 		LBRDF:	MOV	LBRBF,R2	;READ BUFFER FORWARDS
    579	003214	005202 				INC	R2		;INCREMENT BY ONE BUFFER
    580	003216	010201 			LBRD:	MOV	R2,R1		;COPY BUFFER NUMBER
    581	003220	005301 				DEC	R1		;BACK OFF BY ONE BUFFER
    582	003222	000261 				SEC			;ASSUME NOT WITHIN RANGE
    583	003224	002475 				BLT	40$		;IF LT NOT WITHIN RANGE
    584
    585
    586						.IF DF	V1145
    587
    588						MUL	BKPBF,R1	;CALCULATE RELATIVE BLOCK NUMBER
    589
    590						.IFF
    591
    592	003226	016700 	174554 			MOV	BKPBF,R0	;GET NUMBER OF BLOCKS PER BUFFER
    593	003232					CALL	$MUL		;CALCULATE RELATIVE BLOCK NUMBER
    594
    595						.ENDC
    596
    597
    598	003236	010100 				MOV	R1,R0		;COPY RELATIVE BLOCK NUMBER
    599	003240	066701 	174574 			ADD	EPBLK,R1	;CALCULATE VIRTUAL BLOCK NUMBER IN EPT
    600	003244	020167 	174572 			CMP	R1,EPHBK	;WITHIN RANGE?
    601	003250	000261 				SEC			;ASSUME NOT WITHIN RANGE
    602	003252	002062 				BGE	40$		;IF GE NOT WITHIN RANGE
    603	003254	010267 	174566 			MOV	R2,LBRBF	;SET NEW SEARCH BUFFER NUMBER
    604	003260	010102 				MOV	R1,R2		;COPY STARTING VIRTUAL BLOCK NUMBER
    605	003262	066702 	174520 			ADD	BKPBF,R2	;CALCULATE ENDING VIRTUAL BLOCK NUMBER
    606	003266	016746 	174510 			MOV	BFEND,-(SP)	;ASSUME FULL BUFFER TO READ
    607	003272	020267 	174544 			CMP	R2,EPHBK	;WITHIN RANGE?
    608	003276	003421 				BLE	10$		;IF LE YES
    609
    610
    611						.IF DF	V1145
    612
    613						ASH	#6,R0		;CALCULATE NUMBER OF EPT ENTRIES TO START
    614
    615						.IFF
    616
    617		000006 				.REPT	6
    618						ASL	R0		;CALCULATE NUMBER OF EPT ENTRIES TO START
    619						.ENDR
    620
    621						.ENDC
    622
    623
    624	003314	016716 	174524 			MOV	EPNUM,(SP)	;GET NUMBER OF EPT ENTRIES IN LIBRARY
    625	003320	160016 				SUB	R0,(SP)		;SUBTRACT OUT NUMBER TO STARTING BLOCK
    626	003322	005316 				DEC	(SP)		;BACK OFF BY FOR RELATIVE ADDRESS CALCULATION
    627	003324	006316 				ASL	(SP)		;CALCULATE RELATIVE OFFSET WITHIN BUFFER
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-11


    628	003326	006316 				ASL	(SP)		;
    629	003330	006316 				ASL	(SP)		;
    630	003332	062716 	000200'			ADD	#BFBAS,(SP)	;ADD IN BASE ADDRESS OF SEARCH BUFFER
    631	003336	016702 	174500 			MOV	EPHBK,R2	;SET HIGHEST BLOCK IN EPT
    632	003342	160102 			10$:	SUB	R1,R2		;CALCULATE NUMBER OF BLOCKS TO READ
    633	003344	011667 	174434 			MOV	(SP),BFTOP	;SET ADDRESS OF LAST EPT ENTRY IN BUFFER
    634	003350	010216 				MOV	R2,(SP)		;SET NUMBER OF BLOCKS TO READ
    635	003352					CALL	LBSRD		;SET FOR LIBRARY SEARCH READ
    636	003356	103421 				BCS	50$		; IF C/S ERROR POSITIONING FILE
    637	003360	012701 	000200'			MOV	#BFBAS,R1	;GET BASE ADDRESS OF SEARCH BUFFER
    638	003364				20$:				;
    639	003364					GET$S	R0		; GET NEXT BLOCK
    640	003370	103414 				BCS	50$		;IF CS I/O ERROR
    641	003372	016002 	000026 			MOV	F.NRBD+2(R0),R2	;GET ADDRESS OF RECORD JUST READ
    642	003376	012746 	000400 			MOV	#256.,-(SP)	;SET LOOP COUNT
    643	003402	012221 			30$:	MOV	(R2)+,(R1)+	;MOVE BLOCK TO SEARCH BUFFER
    644	003404	005316 				DEC	(SP)		;DECREMENT LOOP COUNT
    645	003406	003375 				BGT	30$		;IF GT MORE TO MOVE
    646	003410	005726 				TST	(SP)+		;CLEAN STACK
    647	003412	005316 				DEC	(SP)		;DECREMENT LOOP COUNT
    648	003414	003363 				BGT	20$		;IF GT MORE TO GO
    649	003416	005726 				TST	(SP)+		;CLEAN STACK
    650	003420				40$:	RETURN			;
    651	003422				50$:	CALL	LBFRD		;RESET FOR FILE READ
    652	003426	016002 	000000G			MOV	R$NAME(R0),R2	;GET ADDRESS OF NAME STRING
    653	003432	012701 				MOV	(PC)+,R1	;I/O ERROR
    654	003434	   000G	   000G			.BYTE	E$R10,S$V2	;FATAL-NO RETURN
    655	003436					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    656
    657					;
    658					; SET FOR LIBRARY FILE READ
    659					;
    660
    661	003442	016700 	000000G		LBFRD:	MOV	$INPPT,R0	;GET INPUT FILE RECORD BLOCK
    662	003446	112760 	000002 	000000 		MOVB	#2,F.RTYP(R0)	;SET VARIABLE LENGTH RECORD TYPE
    663	003454	112760 	000004 	000001 		MOVB	#4,F.RATT(R0)	;RESET RECORD ATTRIBUTES
    664	003462	112760 	000004 	000016 		MOVB	#4,F.RACC(R0)	;SET RECORD ACCESS TO GET/PUT PARTIAL LOCATE
    665	003470					RETURN			;
    666
    667					;
    668					; SET FOR LIBRARY SEARCH READ
    669					;
    670
    671	003472	016700 	000000G		LBSRD:	MOV	$INPPT,R0	;GET INPUT FILE RECORD BLOCK
    672	003476	112760 	000001 	000000 		MOVB	#1,F.RTYP(R0)	;SET FIXED LENGTH RECORD TYPE
    673	003504	105060 	000001 			CLRB	F.RATT(R0)	;CLEAR RECORD ATTRIBUTES BYTE
    674	003510	012760 	001000 	000002 		MOV	#512.,F.RSIZ(R0);SET MAXIMUM RECORD LENGTH
    675	003516	112760 	000006 	000016 		MOVB	#6,F.RACC(R0)	;SET RECORD ACCESS TO PARTIAL LOCATE AND RANDOM
    676	003524	010160 	000036 			MOV	R1,F.RCNM+2(R0)	;SET NEXT RECORD NUMBER
    677	003530					CALL	.POSRC		; POSITION TO PROPER RECORD
    678	003534	112760 	000004 	000016 		MOVB	#FD.PLC,F.RACC(R0) ; RESET RANDOM BIT
    679	003542					RETURN			;
    680
    681					;
    682					; PROCESS ELEMENT
    683					;
    684
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-12


    685	003544	010346 			PRCELM:	MOV	R3,-(SP)	;SAVE REGISTER R3
    686	003546				PRCEL1:	CALL	$GTBYT		;GET RECORD LENGTH
    687	003552	103410 				BCS	PRCEL3		;IF CS EOF (ILL FORMAT)
    688	003554	010003 				MOV	R0,R3		;SAVE RECORD LENGTH
    689	003556				PRCEL2:	CALL	$GTWRD		;GET BLOCK TYPE
    690	003562	162703 	000002 			SUB	#2,R3		;ADJUST BYTE COUNT
    691	003566	020027 	000006 			CMP	R0,#LGBLK	;LEGAL BLOCK TYPE?
    692	003572	101401 				BLOS	PRCEL4		;IF LOS YES
    693	003574	005000 			PRCEL3:	CLR	R0		;SET ILLEGAL BLOCK TYPE
    694	003576	006300 			PRCEL4:	ASL	R0		;MAKE WORD INDEX
    695	003600					CALL	@DSPVCT(R0)	;CALL BLOCK DEPENDENT ROUTINE
    696	003604	000760 				BR	PRCEL1		;GO AGAIN
    697
    698					;
    699					; DISPATCH VECTOR
    700					;
    701
    702	003606	003774'			DSPVCT:	.WORD	ILFMT		;BLK 0-ILLEGAL BLOCK TYPE
    703	003610	003624'				.WORD	STGSD		;BLK 1-START GSD
    704	003612	007026'				.WORD	ENGSD		;BLK 2-END GSD
    705	003614	007340'				.WORD	RPEAT		;BLK 3-TXT
    706	003616	007340'				.WORD	RPEAT		;BLK 4-RLD
    707	003620	007340'				.WORD	RPEAT		;BLK 5-ISD
    708	003622	003774'				.WORD	ILFMT		;BLK 6-MODULE END
    709		000006 			LGBLK=<.-DSPVCT-2>/2		;HIGHEST LEGAL BLOCK TYPE
    710
    711					;
    712					; START GSD-BLOCK TYPE 1
    713					;
    714
    715	003624	010346 			STGSD:	MOV	R3,-(SP)	;SAVE BYTE COUNT
    716	003626	012703 	000122'			MOV	#LCLSYM+2,R3	; GET ADDRESS TO STORE SYMBOL
    717	003632	012746 	000004 			MOV	#4,-(SP)	;SET LOOP COUNT
    718	003636				10$:	CALL	$GTWRD		;GET A WORD
    719	003642	010023 				MOV	R0,(R3)+	;SAVE IN TEMP BUFFER
    720	003644	005316 				DEC	(SP)		;DECREMENT LOOP COUNT
    721	003646	003373 				BGT	10$		;IF GT GO AGAIN
    722	003650	005726 				TST	(SP)+		;REMOVE COUNT WORD FROM STACK
    723	003652	012603 				MOV	(SP)+,R3	;RETRIEVE BYTE COUNT
    724	003654	162703 	000010 			SUB	#8.,R3		;ADJUST FOR SYMBOL ENTRY
    725	003660	012701 	000120'			MOV	#LCLSYM,R1	;GET ADDR OF SYMBOL DESCRIPTOR
    726	003664	116102 	000000G			MOVB	S$CNT(R1),R2	;GET TYPE OF GSD ENTRY
    727	003670	020227 	000006 			CMP	R2,#LGTYP	;LEGAL TYPE?
    728	003674	101037 				BHI	ILFMT		;IF HI ILLEGAL FORMAT
    729	003676	006302 				ASL	R2		;MAKE WORD INDEX
    730	003700	010500 				MOV	R5,R0		;ADDRESS OF CURRENT SEGMENT TO R0
    731	003702					CALL	@GSDVCT(R2)	;DISPATCH TO ROUTINE
    732	003706	005703 				TST	R3		;ANY MORE TO PROCESS?
    733	003710	003345 				BGT	STGSD		;IF GT YES
    734	003712					RETURN			;
    735
    736					;
    737					; GSD ENTRY TYPE DISPATCH TABLE
    738					;
    739
    740	003714	003732'			GSDVCT:	.WORD	MODNME		;MODULE NAME
    741	003716	004014'				.WORD	SCTNME		;SECTION NAME
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-13


    742	003720	005044'				.WORD	INTSYM		;INTERNAL SYMBOL
    743	003722	005046'				.WORD	XFRADR		;TRANSFER ADDRESS
    744	003724	005256'				.WORD	SYMDCL		;SYMBOL DECLARATION
    745	003726	004060'				.WORD	PSTNME		;PROGRAM SECTION NAME
    746	003730	006752'				.WORD	VIDENT		;VERSION IDENTIFICATION
    747		000006 			LGTYP=<.-GSDVCT-2>/2		;HIGHEST LEGAL GSD TYPE
    748
    749					;
    750					; MODULE NAME
    751					;
    752
    753	003732	005764 	000000G		MODNME:	TST	E$LMOD(R4)	;MODULE NAME ALREADY DEFINED?
    754	003736	001016 				BNE	ILFMT		;IF NE YES
    755	003740	012700 	000124'			MOV	#LCLSYM+4,R0	; GET ADDRESS OF SECOND HALF OF SYMBOL
    756	003744	012701 	000116'			MOV	#MODN,R1	; GET ADDRESS TO STORE MODULE NAME
    757	003750	011064 	000002G			MOV	(R0),E$LMOD+2(R4);SET SECOND HALF OF MODULE NAME
    758	003754	014064 	000000G			MOV	-(R0),E$LMOD(R4);SET FIRST HALF OF MODULE NAME
    759	003760	012021 				MOV	(R0)+,(R1)+	;SET MODULE NAME IN LOCAL SYM DESCRIPTOR
    760	003762	011011 				MOV	(R0),(R1)	;
    761	003764	016701 	000000G			MOV	$CRVEL,R1	; GET VIRTUAL ADDRESS OF CURRENT ELEMENT
    762	003770					CALLR	$WRMPG		; WRITE-MARK PAGE
    763
    764					;
    765					; ILLEGAL FORMAT-BLOCK TYPES 0 AND 6
    766					;
    767
    768	003774	016702 	000000G		ILFMT:	MOV	$INPPT,R2	;GET INPUT FILE RECORD BLOCK
    769	004000	016202 	000000G			MOV	R$NAME(R2),R2	;GET ADDRESS OF NAME STRING
    770	004004	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
    771	004006	   000G	   000G			.BYTE	E$R14,S$V2	;FATAL-NO RETURN
    772	004010					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    773
    774					;
    775					; SECTION AND PROGRAM SECTION NAME
    776					;
    777
    778	004014	012702 	000000G		SCTNME:	MOV	#$ABSCT,R2	;GET ADDRESS OF ABS SECTION ENTRY
    779	004020	116261 	000000G	000000G		MOVB	C$SFLG(R2),C$SFLG(R1);ASSUME ABS SECTION
    780	004026	026261 	000000G	000000G		CMP	S$YM(R2),S$YM(R1);ABS SECTION?
    781	004034	001411 				BEQ	PSTNME		;IF EQ YES
    782	004036	152761 	000000G	000000G		BISB	#CS$REL,C$SFLG(R1);ASSUME NAMED REL SECTION
    783	004044	005761 	000000G			TST	S$YM(R1)	;NAMED SECTION?
    784	004050	001003 				BNE	PSTNME		;IF NE YES
    785	004052	142761 	000000C	000000G		BICB	#<CS$GBL!CS$ALO>,C$SFLG(R1) ; CLEAR GLOBAL, OVERLAYED FLAGS
    786	004060				PSTNME:				;
    787	004060	142761 	000000C	000000G		BICB	#<CS$IND!CS$MEM>,C$SFLG(R1) ; CLEAR MEMORY, INDIRECT FLAGS
    788	004066	132761 	000000G	000000G		BITB	#CS$LIB,C$SFLG(R1);LIB SECTION?
    789	004074	001420 				BEQ	3$		;IF EQ NO
    790	004076	132764 	000000G	000000G		BITB	#SW$RL,E$LSWT(R4);LIB SECTION LEGAL?
    791	004104	001014 				BNE	3$		;IF NE YES
    792	004106	012702 	000122'			MOV	#LCLSYM+2,R2	; GET ADDRESS OF SECTION NAME
    793	004112	012701 				MOV	(PC)+,R1	;ILLEGAL REFERENCE TO LIBRARY SECTION
    794	004114	   000G	   000G			.BYTE	E$R60,S$V0	;DIAGNOSTIC
    795	004116					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    796	004122	012701 	000120'			MOV	#LCLSYM,R1	;RETRIEVE ADDRESS OF LOCAL STORAGE
    797	004126	010500 				MOV	R5,R0		;RESET SEGMENT DESCRIPTOR ADDRESS
    798	004130	142761 	000000G	000000G		BICB	#CS$LIB,C$SFLG(R1);CLEAR LIB FLAG
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-14


    799	004136	132761 	000000G	000000G	3$:	BITB	#CS$GBL,C$SFLG(R1);LOCAL SECTION?
    800	004144	001513 				BEQ	50$		;IF EQ YES
    801	004146	012746 	000000G			MOV	#$WSRCC,-(SP)	;SET ADDRESS OF SEARCH ROUTINE
    802	004152				5$:	CALL	@(SP)+		;SEARCH FOR SECTION
    803	004154	103516 				BCS	60$		;IF CS NO FIND EM
    804	004156	001004 				BNE	7$		;IF NE FOUND ON PATH UP OR DOWN
    805	004160	016701 	000000G			MOV	$CRVSM,R1	; GET VIRTUAL ADDRESS OF SECTION
    806	004164	000167 	000402 			JMP	SCTCHK		;FOUND IN CURRENT SEGMENT
    807	004170	132760 	000000G	000000G	7$:	BITB	#CS$GBL,C$SFLG(R0);GLOBAL SECTION?
    808	004176	001765 				BEQ	5$		;IF EQ NO
    809
    810					;
    811					; FOUND ON PATH UP OR DOWN
    812					;
    813
    814	004200	005067 	173744 			CLR	SYDEF		;CLEAR DEFINITION FOUND FLAG
    815	004204					CALL	30$		;SET UP SEARCH PARAMETERS
    816	004210				10$:	CALL	@(SP)+		;CONTINUE SEARCH
    817	004212	103411 				BCS	20$		;IF CS DONE
    818	004214	132760 	000000G	000000G		BITB	#CS$GBL,C$SFLG(R0);GLOBAL SECTION?
    819	004222	001772 				BEQ	10$		;IF EQ NO
    820	004224					CALL	30$		;COMPARE PARAMETERS
    821	004230	103367 				BCC	10$		;IF CC CONTINUE SEARCH
    822	004232	005726 				TST	(SP)+		;CLEAN STACK
    823	004234	000450 				BR	40$		;AMBIGUOUS DEFINITION
    824
    825					;
    826					; ALL PATHS SEARCHED-ALLOCATE INDIRECT CONTROL SECTION ENTRY
    827					;
    828
    829	004236	005767 	173706 		20$:	TST	SYDEF		;DEFINITION FOUND?
    830	004242	001445 				BEQ	40$		;IF EQ NO
    831	004244	012701 	000002G			MOV	#C$SLTH+2,R1	;GET SIZE OF INDIRECT ENTRY
    832	004250					CALL	$ALVRT		; ALLOCATE VIRTUAL STORAGE
    833	004254	016760 	173670 	000000G		MOV	SYDEF,C$SBSE(R0);SET INDIRECT ENTRY ADDRESS
    834	004262	016760 	173660 	000000G		MOV	SRVSG,C$SLTH(R0) ; SET VIRTUAL ADDRESS OF SEGMENT DECRIPTOR
    835	004270	152760 	000000C	000000G		BISB	#<CS$IND!CS$GBL>,C$SFLG(R0) ; SET INDIRECT GLOBAL FLAGS
    836	004276	012702 	000120'			MOV	#LCLSYM,R2	; GET LOCAL DESCRIPTOR ADDRESS
    837	004302	000471 				BR	70$		;
    838					;
    839					; COMPARE PARAMETERS
    840					;
    841
    842	004304				30$:				;
    843	004304	016701 	000000G			MOV	$CRVSM,R1	; GET VIRTUAL ADDRESS OF SYMBOL
    844	004310	132760 	000000G	000000G		BITB	#CS$IND,C$SFLG(R0) ; INDIRECT REFERENCE?
    845	004316	001403 				BEQ	32$		; IF EQ NO
    846	004320	016001 	000000G			MOV	C$SBSE(R0),R1	; GET VA OF REAL ENTRY
    847	004324	000405 				BR	34$		;
    848	004326				32$:				;
    849	004326	010167 	173616 			MOV	R1,SYDEF	; SET DEFINITION FOUND FLAG
    850	004332	016767 	000000G	173606 		MOV	$CRVSR,SRVSG	; SAVE VIRTUAL ADDRESS OF SEARCH SEGMENT
    851	004340				34$:				;
    852	004340	020167 	173606 			CMP	R1,SYENT	; SAME AS LAST REFERENCE?
    853	004344	001401 				BEQ	36$		; IF EQ YES
    854	004346	000261 				SEC			; SET CARRY
    855	004350				36$:				;
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-15


    856	004350	010167 	173576 			MOV	R1,SYENT	; SET ADDRESS OF LAST ENTRY
    857	004354					RETURN			;
    858
    859					;
    860					; AMBIGUOUS CONTROL SECTION DEFINITION
    861					;
    862
    863	004356				40$:				;
    864	004356	012702 	000116'			MOV	#MODN,R2	; GET ADDRESS OF MODULE NAME
    865	004362	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
    866	004364	   000G	   000G			.BYTE	E$R15,S$V0	;DIAGNOSTIC
    867	004366					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    868	004372	000407 				BR	60$		;
    869
    870					;
    871					; LOCAL CONTROL SECTION
    872					;
    873
    874	004374	062700 	000000G		50$:	ADD	#S$GCST,R0	;POINT TO CONTROL SECTION TABLE HEADER
    875	004400					CALL	$SRCH		;SEARCH FOR SECTION ENTRY
    876	004404	010146 				MOV	R1,-(SP)	; ASSUME FOUND
    877	004406	103071 				BCC	SCTCHK		;IF CC YES
    878	004410	005726 				TST	(SP)+		;CLEAN STACK
    879	004412	012701 	000000G		60$:	MOV	#C$SLGH,R1	;GET LENGTH OF SECTION TABLE ENTRY
    880	004416					CALL	$ALVRT		; ALLOCATE VIRTUAL STORAGE
    881	004422	012702 	000120'			MOV	#LCLSYM,R2	; GET ADDRESS OF LOCAL DESCRIPTOR
    882	004426	116260 	000000G	000000G		MOVB	C$SFLG(R2),C$SFLG(R0) ; INSERT FLAG BYTE
    883	004434	012760 	000002 	000000G		MOV	#2,C$SBND(R0)	;SET DEFAULT BOUNDRY
    884	004442	016760 	000000G	000000G		MOV	$CRVEL,C$SELM(R0) ; SET BACK POINTER TO ELEMENT DESCRIPTOR
    885	004450	132760 	000000G	000000G		BITB	#CS$LIB,C$SFLG(R0);LIB SECTION?
    886	004456	001403 				BEQ	70$		;IF EQ NO
    887	004460	016760 	173444 	000000G		MOV	LCLSYM+10,C$SLTH(R0) ; ESTABLISH LENGTH OF SECTION
    888	004466				70$:				;
    889	004466	016260 	000000G	000000G		MOV	S$YM(R2),S$YM(R0) ; INSERT SYMBOL IN ENTRY
    890	004474	016260 	000002G	000002G		MOV	S$YM+2(R2),S$YM+2(R0) ;
    891	004502	010146 				MOV	R1,-(SP)	; SAVE ENTRY ADDRESS
    892	004504	016700 	000000G			MOV	$CRVSG,R0	; GET VIRTUAL ADDRESS OF CURRENT
    893	004510	062700 	000000C			ADD	#S$GCST/2,R0	; POINT TO SECTION TABLE HEADER
    894	004514					CALL	$SRCHI		;SEARCH FOR INSERT
    895	004520					CALL	$ISYM		;INSERT SYMBOL
    896	004524	032767 	000000G	000000G		BIT	#SE$QA,$SWTCH	;SEQUENCE ALLOCATION?
    897	004532	001414 				BEQ	80$		;IF EQ NO
    898	004534	012701 	000000G			MOV	#S$ZSEQ,R1	;GET SIZE OF SEQUENCE LIST ENTRY
    899	004540					CALL	$ALBLK		;ALLOCATE STORAGE
    900	004544	011660 	000002 			MOV	(SP),2(R0)	;SET ADDRESS OF SECTION TABLE ENTRY
    901	004550	016701 	000000G			MOV	$CRSEG,R1	;GET ADDRESS OF CURRENT SEGMENT
    902	004554	010071 	000002G			MOV	R0,@S$GSEQ+2(R1);LINK NEW ENTRY TO OLD LAST
    903	004560	010061 	000002G			MOV	R0,S$GSEQ+2(R1)	;SET NEW LAST ENTRY
    904	004564				80$:				;
    905	004564	011601 				MOV	(SP),R1		; RETRIEVE ENTRY ADDRESS
    906	004566					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    907
    908					;
    909					; CHECK FOR EQUIVALENT CONTROL SECTION DEFINITIONS
    910					;
    911
    912	004572	132760 	000000G	000000G	SCTCHK:	BITB	#CS$IND,C$SFLG(R0);INDIRECT REFERENCE?
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-16


    913	004600	001404 				BEQ	10$		;IF EQ NO
    914	004602	016001 	000000G			MOV	C$SBSE(R0),R1	; GET ADDRESS OF REAL ENTRY
    915	004606					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    916	004612				10$:				;
    917	004612	010116 				MOV	R1,(SP)		; SAVE VIRTUAL ADDRESS OF ENTRY
    918	004614	010046 				MOV	R0,-(SP)	; SAVE REAL ADDRESS OF ENTRY
    919	004616	012701 	000010'			MOV	#CRSCT,R1	; POINT TO LOCAL STORAGE
    920	004622	012702 	000000C			MOV	#C$SLGH/2,R2	; GET LENGTH OF SECTION ENTRY
    921	004626				15$:				;
    922	004626	012021 				MOV	(R0)+,(R1)+	; COPY SECTION ENTRY
    923	004630					SOB	R2,15$		; REPEAT
    924	004634	012600 				MOV	(SP)+,R0	; RESTORE R0
    925	004636	012702 	000120'			MOV	#LCLSYM,R2	;GET ADDR OF LOCAL DESCRIPTOR
    926	004642	116001 	000000G			MOVB	C$SFLG(R0),R1	;GET TABLE ENTRY FLAGS
    927	004646	116200 	000000G			MOVB	C$SFLG(R2),R0	;GET LOCAL ENTRY FLAGS
    928	004652	032701 	000000G			BIT	#CS$LIB,R1	;TABLE ENTRY LIB SECTION?
    929	004656	001404 				BEQ	20$		;IF EQ NO
    930	004660	042701 	000000G			BIC	#CS$LIB,R1	;CLEAR LIBRARY FLAG
    931	004664	042700 	000000G			BIC	#CS$LIB,R0	;CLEAR LIBRARY FLAG
    932	004670				20$:				;
    933	004670	042700 	000000G			BIC	#CS$ATL,R0	; CLEAR POSSIBLE AUTOLOAD FLAG
    934	004674	042701 	000000G			BIC	#CS$ATL,R1	; CLEAR POSSIBLE AUTOLOAD FLAG
    935	004700	120001 				CMPB	R0,R1		; EQUIVALENT?
    936	004702	001405 				BEQ	SCTCMT		;IF EQ YES
    937	004704	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
    938	004706	   000G	   000G			.BYTE	E$R16,S$V0	;DIAGNOSTIC
    939	004710	005742 				TST	-(R2)		; POINT TO FIRST HALF OF MODULE NAME
    940	004712					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    941
    942					;
    943					; BUILD CONTROL SECTION MAPPING TABLE ENTRY
    944					;
    945
    946	004716	010346 			SCTCMT:	MOV	R3,-(SP)	;SAVE R3
    947	004720	016701 	000000G			MOV	$CRVEL,R1	; GET VIRTUAL ADDRESS OF CURRENT
    948	004724					CALL	$WRMPG		; WRITE MARK PAGE
    949	004730	005264 	000000G			INC	E$LNUM(R4)	;INCREMENT SECTION NUMBER
    950	004734	016401 	000000G			MOV	E$LNUM(R4),R1	;GET HIGHEST SECTION NUMBER
    951	004740	010103 				MOV	R1,R3		;SAVE FOR LATER
    952	004742	005201 				INC	R1		;INCREMENT TO NEXT SECTION NUMBER
    953	004744	006301 				ASL	R1		;CONVERT TO BYTES
    954	004746	006301 				ASL	R1		;
    955	004750					CALL	$ALBLK		;ALLOCATE STORAGE
    956	004754	010046 				MOV	R0,-(SP)	;SAVE NEW TABLE ADDRESS
    957	004756	016401 	000000G			MOV	E$LCMT(R4),R1	;GET ADDRESS OF CURRENT TABLE
    958	004762	001417 				BEQ	20$		;IF EQ NONE
    959	004764	006303 				ASL	R3		;CONVERT SECTION NUMBER TO WORD COUNT
    960	004766	010302 				MOV	R3,R2		;SET LOOP COUNT
    961	004770	012120 			10$:	MOV	(R1)+,(R0)+	;MOVE CMT TO NEW LOCATION
    962	004772					SOB	R2,10$		;REPEAT
    963	004776	010046 				MOV	R0,-(SP)	;SAVE ADDR OF NEXT IN TABLE
    964	005000	012700 	000000G			MOV	#$FRHD,R0	;GET ADDRESS OF FRRE SPACE HEADER
    965	005004	010301 				MOV	R3,R1		;SET SIZE OF BLOCK TO RELEASE
    966	005006	006301 				ASL	R1		;CONVERT WORD COUNT TO BYTE COUNT
    967	005010	016402 	000000G			MOV	E$LCMT(R4),R2	;GET ADDRESS OF BLOCK TO RELEASE
    968	005014					CALL	$RLCB		;RELEASE OLD TABLE
    969	005020	012600 				MOV	(SP)+,R0	;RETRIEVE NEXT IN TABLE
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-17


    970	005022	012664 	000000G		20$:	MOV	(SP)+,E$LCMT(R4);SET ADDRESS OF NEW CMT TABLE
    971	005026	012603 				MOV	(SP)+,R3	;RESTORE R3
    972	005030	012610 				MOV	(SP)+,(R0)	;SET LINK TO TABLE ENTRY
    973	005032	012067 	172776 			MOV	(R0)+,CRVSC	; SET VIRTUAL ADDRESS OF CURRENT SEGMENT
    974	005036	016710 	173066 			MOV	LCLSYM+10,(R0)	; SET MAX LENGTH OF SECTION
    975	005042					RETURN			;
    976
    977					;
    978					; INTERNAL SYMBOL
    979					;
    980
    981	005044				INTSYM:	RETURN			;IGNOR-UNSUPPORTED FEATURE
    982
    983					;
    984					; TRANSFER ADDRESS
    985					;
    986
    987	005046				XFRADR:				;
    988	005046	022767 	000001 	173054 		CMP	#1,LCLSYM+10	; DUMMY TRANSFER ADDRESS
    989	005054	001477 				BEQ	60$		;IF EQ YES
    990	005056	026767 	000000G	000000G		CMP	$CRVSG,$RTSEG	; CURRENT=ROOT?
    991	005064	001061 				BNE	40$		;IF NE NO
    992	005066	012702 	000000G			MOV	#$XFRAD,R2	;ASSUME TASK XFR ADDRESS
    993	005072	032764 	000000G	000000G		BIT	#SW$DA,E$LSWT(R4);DEBUGGING AID?
    994	005100	001402 				BEQ	10$		;IF EQ NO
    995	005102	012702 	000000G			MOV	#$ODTAD,R2	;SET ODT XFR ADDRESS
    996	005106	022712 	000001 		10$:	CMP	#1,(R2)		;XFR ADDRESS ALREADY DEFINED?
    997	005112	001033 				BNE	30$		;IF NE YES
    998	005114	010246 				MOV	R2,-(SP)	;SAVE VECTOR ADDRESS
    999	005116	062700 	000000G			ADD	#S$GCST,R0	;POINT TO SECTION TABLE HEADER
   1000	005122					CALL	$SRCH		;SEARCH SECTION TABLE
   1001	005126	011602 				MOV	(SP),R2		; RETRIEVE VECTOR ADDRESS
   1002	005130	010116 				MOV	R1,(SP)		; SAVE VIRTUAL ADDRESS OF ENTRY
   1003	005132	103436 				BCS	40$		;IF CS NO FIND EM
   1004	005134	132760 	000000G	000000G		BITB	#CS$IND,C$SFLG(R0);INDIRECT REFERENCE?
   1005	005142	001032 				BNE	40$		;IF NE YES
   1006	005144	016701 	172760 			MOV	LCLSYM+10,R1	; GET OFFSET ADDRESS
   1007	005150	132760 	000000G	000000G		BITB	#CS$REL,C$SFLG(R0);ABS SECTION?
   1008	005156	001403 				BEQ	20$		;IF EQ YES
   1009	005160	066001 	000000G			ADD	C$SCUR(R0),R1	;ADD IN CURRENT BASE
   1010	005164	103421 				BCS	40$		;IF CS ADDRESS OVERFLOW
   1011	005166	032701 	000001 		20$:	BIT	#1,R1		;ODD ADDRESS?
   1012	005172	001016 				BNE	40$		;IF NE YES
   1013	005174	010122 				MOV	R1,(R2)+	;SET TRANSFER ADDRESS
   1014	005176	012612 				MOV	(SP)+,(R2)	; SET SECTION TABLE ENTRY ADDRESS
   1015	005200	000425 				BR	60$		;
   1016
   1017					;
   1018					; MULTIPLE DEFINITION OF TRANSFER ADDRESS
   1019					;
   1020
   1021	005202				30$:				;
   1022	005202	012702 	000116'			MOV	#MODN,R2	; POINT TO MODULE NAME
   1023	005206	016562 	000000G	000004 		MOV	S$GNME(R5),4(R2);INSERT SEGMENT NAME
   1024	005214	016562 	000002G	000006 		MOV	S$GNME+2(R5),6(R2);
   1025	005222	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
   1026	005224	   000G	   000G			.BYTE	E$R17,S$V0	;DIAGNOSTIC
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-18


   1027	005226	000410 				BR	50$		;
   1028
   1029					;
   1030					; ILLEGAL TRANSFER ADDRESS
   1031					;
   1032
   1033	005230				40$:				;
   1034	005230	005726 				TST	(SP)+		; CLEAN STACK
   1035	005232	012702 	000116'			MOV	#MODN,R2	; POINT TO MODULE NAME
   1036	005236	016262 	000012 	000010 		MOV	10.(R2),8.(R2)	;MOVE OFFSET ADDRESS
   1037	005244	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
   1038	005246	   000G	   000G			.BYTE	E$R18,S$V0	;DIAGNOSTIC
   1039	005250				50$:	CALL	$ERMSG		;OUTPUT ERROR MESSAGE
   1040	005254				60$:	RETURN			;
   1041
   1042					;
   1043					; SYMBOL DECLARATION
   1044					;
   1045
   1046	005256	010346 			SYMDCL:	MOV	R3,-(SP)	;SAVE R3
   1047	005260	010103 				MOV	R1,R3		;COPY LOCAL DESCRIPTOR ADDRESS
   1048	005262	142763 	000000G	000000G		BICB	#SY$LIB,S$YFLG(R3);CLEAR LIBRARY DEFINITION FLAG
   1049	005270	032764 	000000G	000000G		BIT	#SW$RL,E$LSWT(R4);RESIDENT LIBRARY ELEMENT?
   1050	005276	001403 				BEQ	5$		; IF EQ NO
   1051	005300	152763 	000000G	000000G		BISB	#SY$LIB,S$YFLG(R3);SET LIBRARY DEFINITION FLAG
   1052	005306	132763 	000000G	000000G	5$:	BITB	#SY$DEF,S$YFLG(R3);SYMBOL DEFINITION?
   1053	005314	001437 				BEQ	30$		;IF EQ NO
   1054	005316	012700 	000010'			MOV	#CRSCT,R0	; GET POINTER TO CURRENT SECTION DATA
   1055	005322	132760 	000000G	000000G		BITB	#CS$REL,C$SFLG(R0) ; ABS SECTION?
   1056	005330	001431 				BEQ	30$		; IF EQ YES
   1057	005332	132760 	000000G	000000G		BITB	#CS$ALO,C$SFLG(R0) ; OVERLAID?
   1058	005340	001003 				BNE	10$		; IF NE YES
   1059	005342	066063 	000000G	000000G		ADD	C$SCUR(R0),S$YVAL(R3) ; ADD RELOCATION BIAS
   1060	005350				10$:				;
   1061	005350	132760 	000000G	000000G		BITB	#CS$TYP,C$SFLG(R0) ; "I" SECTION?
   1062	005356	001016 				BNE	30$		; IF NE NO
   1063	005360	132760 	000000G	000000G		BITB	#CS$ATL,C$SFLG(R0) ; SECTION AUTOLOAD?
   1064	005366	001007 				BNE	20$		;IF NE YES
   1065	005370	032764 	000000G	000000G		BIT	#SW$AL,E$LSWT(R4);ELEMENT AUTOLOAD?
   1066	005376	001003 				BNE	20$		;IF NE YES
   1067	005400	105765 	000001G			TSTB	S$GSTS+1(R5)	;SEGMENT AUTOLOAD?
   1068	005404	001403 				BEQ	30$		;IF EQ NO
   1069	005406	152763 	000000G	000000G	20$:	BISB	#SY$ATL,S$YFLG(R3);SET AUTOLOAD FLAG
   1070	005414				30$:				;
   1071	005414	026727 	000000G	000000G		CMP	$SZSEG,#S$ZSEG	; RESIDENT SEGMENT DESCRIPTOR MAX LENGTH?
   1072	005422	001417 				BEQ	40$		; IF EQ YES, NO FURTHER TESTS NEEDED
   1073	005424	132763 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R3) ; SYMBOL REFERENCE?
   1074	005432	001013 				BNE	40$		; IF NE NO
   1075	005434	026367 	000000G	172450 		CMP	S$YM(R3),LOADNM	; MANUAL LOAD CALL
   1076	005442	001007 				BNE	40$		; IF NE NO
   1077	005444	026367 	000002G	172442 		CMP	S$YM+2(R3),LOADNM+2 ; CHECK SECOND HALF OF NAME
   1078	005452	001003 				BNE	40$		; NOT MANUAL LOAD REFERENCE
   1079	005454	062767 	000004 	000000G		ADD	#4,$SZSEG	; INCREASE RESIDENT SEGMENT DESCRIPTOR SIZE
   1080	005462				40$:				;
   1081	005462	012767 	177777 	172460 		MOV	#-1,SYDEF	; SET PASS COUNT FLAG
   1082	005470	012746 	000000G			MOV	#$WSRCS,-(SP)	;SET ADDRESS OF SEARCH ROUTINE
   1083	005474				SYMSRC:	CALL	@(SP)+		;SEARCH FOR SYMBOL
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-19


   1084	005476	103002 				BCC	1$		;IF CC FOUND ENTRY
   1085	005500	000167 	001070 			JMP	SYMINS		;
   1086	005504	132763 	000000G	000000G	1$:	BITB	#SY$DEF,S$YFLG(R3);CURRENT SYMBOL DEFINITION?
   1087	005512	001142 				BNE	SYMDEF		;IF NE YES
   1088
   1089					;
   1090					; CURRENT IS SYMBOL REFERENCE
   1091					;
   1092
   1093	005514	012602 				MOV	(SP)+,R2	;CLEAN STACK BUT SAVE ADDRESS
   1094	005516	005701 				TST	R1		;FIND IN CURRENT SEGMENT?
   1095	005520	001435 				BEQ	33$		;IF EQ YES
   1096	005522	010246 				MOV	R2,-(SP)	;RESTORE RETURN ADDRESS
   1097	005524	012702 	000150'			MOV	#SYDEF,R2	;GET ADDRESS OF FOUND SYMBOL FLAG
   1098	005530	005212 				INC	(R2)		;INCREMENT FLAG TO RECORD BEEN HERE
   1099	005532	132760 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R0);SYMBOL DEFINITION?
   1100	005540	001755 				BEQ	SYMSRC		;IF EQ NO-CONTINUE SEARCH
   1101	005542	005712 				TST	(R2)		;TEST FOUND FLAG
   1102	005544	001013 				BNE	20$		;IF NE BEEN HERE MORE THAN ONCE
   1103	005546					CALL	40$		;SET UP INITIAL PARAMETERS
   1104	005552				10$:	CALL	@(SP)+		;CONTINUE SEARCH
   1105	005554	103411 				BCS	30$		;IF CS DONE
   1106	005556	132760 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R0);SYMBOL DEFINED?
   1107	005564	001403 				BEQ	20$		;IF EQ NO
   1108	005566					CALL	40$		;COMPARE PARAMETERS
   1109	005572	103367 				BCC	10$		;IF CC OKAY
   1110	005574	005726 			20$:	TST	(SP)+		;CLEAN STACK
   1111	005576	000500 				BR	80$		;AMBIGUOUS SYMBOL DEFINITION
   1112
   1113					;
   1114					; ALL PATHS SEARCHED-ALLOCATE INDIRECT SYMBOL TABLE ENTRY
   1115					;
   1116
   1117	005600	005767 	172344 		30$:	TST	SYDEF		;DEFINITION FOUND?
   1118	005604	001475 				BEQ	80$		;IF EQ NO-AMBIGUOUS DEFINITION
   1119	005606	005767 	172332 			TST	SRCPF		;FOUND ON PATH UP?
   1120	005612	100002 				BPL	34$		;IF PL YES
   1121	005614	000167 	001126 		33$:	JMP	SYMRET		;
   1122	005620	012701 	000000G		34$:	MOV	#S$YLGH,R1	;GET SIZE OF SYMBOL ENTRY
   1123	005624					CALL	$ALVRT		; ALLOCATE VIRTUAL STORAGE
   1124	005630					CALL	$LCKPG		; LOCK DESCRIPTOR IN MEMORY
   1125	005634	016702 	172310 			MOV	SYDEF,R2	; GET VIRTUAL ADDRESS OF REAL SYMBOL
   1126	005640	010260 	000000G			MOV	R2,S$YVAL(R0)	; SET INDIRECT ENTRY ADDRESS
   1127	005644	152760 	000000G	000000G		BISB	#SY$IND,S$YFLG(R0);SET INDIRECT FLAG
   1128	005652	152760 	000000G	000000G		BISB	#SY$DEF,S$YFLG(R0);SET DEFINITION FLAG
   1129	005660	132767 	000000G	172266 		BITB	#SY$ATL,SYFLG	; AUTOLOAD SYMBOL
   1130	005666	001405 				BEQ	35$		;IF EQ NO
   1131	005670	010502 				MOV	R5,R2		; COPY REAL ADDRESS OF SEGMENT
   1132	005672					CALL	LNKATL		; LINK ITEM TO AUTOLOAD LIST
   1133	005676					CALL	$CVRL		; CONVERT ENTRY TO REAL ADDRESS
   1134	005702				35$:				;
   1135	005702					CALL	$UNLPG		; UNLOCK NEW ENTRY
   1136	005706	000167 	001000 			JMP	SYMIN1		; INSERT ENTRY IN CURRENT SEGMENT
   1137
   1138					;
   1139					; COMPARE PARAMETERS
   1140					;
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-20


   1141
   1142	005712	132760 	000000G	000000G	40$:	BITB	#SY$IND,S$YFLG(R0);INDIRECT REFERENCE?
   1143	005720	001403 				BEQ	50$		;IF EQ NO
   1144	005722	016000 	000000G			MOV	S$YVAL(R0),R0	;GET ADDRESS OF REAL ENTRY
   1145	005726	000414 				BR	60$		;
   1146	005730				50$:				;
   1147	005730	016067 	000000G	172216 		MOV	S$YFLG(R0),SYFLG ; SAVE ENTRY FLAGS
   1148	005736	016700 	000000G			MOV	$CRVSM,R0	; GET VIRTUAL ADDRESS OF DEFINITION
   1149	005742	010067 	172202 			MOV	R0,SYDEF	; SET DEFINITION FLAG
   1150	005746	010167 	172172 			MOV	R1,SRCPF	;SET PATH FLAG
   1151	005752	016767 	000000G	172166 		MOV	$CRVSR,SRVSG	; SET VIRTUAL ADDRESS OF SEGMENT
   1152	005760	020067 	172166 		60$:	CMP	R0,SYENT	;SAME AS LAST?
   1153	005764	000261 				SEC			;ASSUME ANSWER IS NO
   1154	005766	001001 				BNE	70$		;IF NE NO
   1155	005770	000241 				CLC			;CLEAR CARRY
   1156	005772	010067 	172154 		70$:	MOV	R0,SYENT	;SET ADDRESS OF LAST
   1157	005776					RETURN			;
   1158
   1159					;
   1160					; AMBIGUOUS SYMBOL DEFINITION
   1161					;
   1162
   1163	006000				80$:				;
   1164	006000	012702 	000116'			MOV	#MODN,R2	; GET ADDRESS OF MODULE NAME
   1165	006004	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
   1166	006006	   000G	   000G			.BYTE	E$R20,S$V0	;DIAGNOSTIC
   1167	006010					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
   1168	006014	000167 	000554 			JMP	SYMINS		;
   1169					;
   1170					; CURRENT IS SYMBOL DEFINITION
   1171					;
   1172
   1173	006020	005701 			SYMDEF:	TST	R1		;FIND IN CURRENT SEGMENT?
   1174	006022	001043 				BNE	10$		;IF NE NO
   1175	006024	016701 	000000G			MOV	$CRVSM,R1	; GET VIRTUAL ADDRESS OF SYMBOL
   1176	006030					CALL	$LCKPG		; LOCK PAGE IN MEMORY
   1177	006034					CALL	SYMCHK		; CHECK FOR MULTIPLE DEFINITION
   1178	006040	103555 				BCS	50$		; IF C/S SYMBOL MULTIPLY DEFINED
   1179	006042	001156 				BNE	55$		; IGNORE DUPLICATE ABS SYMBOL
   1180	006044	016701 	000000G			MOV	$CRVSM,R1	; GET VIRTUAL ADDRESS OF ENTRY
   1181	006050					CALL	$CVRL		; CONVERT TO REAL
   1182	006054					CALL	$WRMPG		; WRITE-MARK PAGE
   1183	006060					CALL	$UNLPG		; UNLOCK PAGE
   1184	006064	010167 	172062 			MOV	R1,SYENT	; SAVE VIRTUAL ADDRESS OF ENTRY
   1185	006070	116360 	000000G	000000G		MOVB	S$YFLG(R3),S$YFLG(R0);SET SYMBOL FLAGS
   1186	006076	016367 	000000G	172050 		MOV	S$YFLG(R3),SYFLG ; SAVE SYMBOL FLAGS
   1187	006104	016360 	000000G	000000G		MOV	S$YVAL(R3),S$YVAL(R0);SET SYMBOL VALUE
   1188	006112	016760 	171716 	000000G		MOV	CRVSC,S$YCMT(R0) ; SET SECTION ENTRY ADDRESS
   1189	006120	005365 	000000G			DEC	S$GUND(R5)	;DECREMENT UNDEFINED SYMBOL COUNT
   1190	006124	005367 	000000G			DEC	$MSYMC		;DECREMENT MASTER UNDEFINED SYMBOL COUNT
   1191	006130	000511 				BR	45$		;
   1192	006132				10$:				;
   1193	006132	010146 				MOV	R1,-(SP)	;SAVE PATH FLAG
   1194	006134	012746 	006162'			MOV	#20$,-(SP)	; SET RETURN ADDRESS
   1195	006140	010346 				MOV	R3,-(SP)	;PLACE R3 ON STACK
   1196	006142	016701 	000000G			MOV	$CRVSR,R1	; GET VIRTUAL ADDRESS OF SEARCH SEGMENT
   1197	006146					CALL	$CVLOK		; CONVERT TO REAL, LOCK IN CORE
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-21


   1198	006152	010067 	000000G			MOV	R0,$CRSRC	; SET REAL ADDRESS OF SEARCH SEGMENT
   1199	006156	000167 	000432 			JMP	SYMIN0		; INSERT SYMBOL IN CURRENT SEGMENT
   1200	006162				20$:				;
   1201	006162	016701 	000000G			MOV	$CRVSM,R1	; GET VIRTUAL ADDRESS OF FOUND REFERENCE
   1202	006166					CALL	$CVLOK		; CONVERT TO REAL, LOCK IN MEMORY
   1203	006172					CALL	$WRMPG		; WRITE MARK PAGE
   1204	006176	010046 				MOV	R0,-(SP)	; SAVE REAL ADDRESS
   1205	006200					CALL	SYMCHK		; CHECK FOR MULTIPLE DEFINITION
   1206	006204	103446 				BCS	30$		; IF C/S SYMBOL MULTIPLY DEFINED
   1207	006206	001047 				BNE	35$		; IF NE IGNORE DUPLICATE ABS SYMBOL
   1208	006210	012600 				MOV	(SP)+,R0	; RETRIEVE REAL ADDRESS OF SYMBOL
   1209	006212	016701 	000000G			MOV	$CRVSM,R1	; GET VIRTUAL ADDRESS OF ENTRY
   1210	006216					CALL	$CVRL		; CONVERT TO REAL
   1211	006222	016702 	000000G			MOV	$CRSRC,R2	;GET ADDRESS OF SEARCH SEGMENT
   1212	006226	005362 	000000G			DEC	S$GUND(R2)	;DECREMENT UNDEFINED SYMBOL COUNT
   1213	006232	005367 	000000G			DEC	$MSYMC		;DECREMENT MASTER UNDEFINED SYMBOL COUNT
   1214	006236	016702 	171710 			MOV	SYENT,R2	;GET ADDRESS OF CURRENT ENTRY
   1215	006242	010260 	000000G			MOV	R2,S$YVAL(R0)	;SET INDIRECT ENTRY ADDRESS
   1216	006246	005060 	000000G			CLR	S$YSEG(R0)	;CLEAR SEGMENT ADDRESS
   1217	006252	152760 	000000G	000000G		BISB	#SY$IND,S$YFLG(R0);SET INDIRECT FLAG
   1218	006260	152760 	000000G	000000G		BISB	#SY$DEF,S$YFLG(R0);SET DEFINITION FLAG
   1219	006266	022627 	000001 			CMP	(SP)+,#1	; FOUND ON PATH DOWN ?
   1220	006272	001416 				BEQ	40$		;++021 IF EQ NO
   1221	006274	132767 	000000G	171652 		BITB	#SY$ATL,SYFLG	; DEFINITION AUTOLOAD SYMBOL?
   1222	006302	001412 				BEQ	40$		;IF EQ NO
   1223	006304	016702 	000000G			MOV	$CRSRC,R2	; GET REAL ADDRESS OF SEARCH SEGMENT
   1224	006310	016701 	000000G			MOV	$CRVSM,R1	; GET VIRTUAL ADDRESS OF REFERENCE
   1225	006314					CALL	LNKATL		; LINK ITEM TO AUTOLOAD LIST
   1226	006320	000403 				BR	40$		;
   1227	006322				30$:				;
   1228	006322					CALL	60$		; MULTIPLE GLOBAL SYMBOL DEFINITION
   1229	006326				35$:				;
   1230	006326	022626 				CMP	(SP)+,(SP)+	; CLEAN STACK
   1231	006330				40$:				;
   1232	006330	016701 	000000G			MOV	$CRVSM,R1	; GET VIRTUAL ADDRESS OF CURRENT SYMBOL
   1233	006334					CALL	$UNLPG		; UNLOCK PAGE
   1234	006340	016701 	000000G			MOV	$CRVSR,R1	; GET VIRTUAL ADDRESS OF SEARCH SEGMENT
   1235	006344					CALL	$WRMPG		; WRITE-MARK PAGE
   1236	006350					CALL	$UNLPG		; UNLOCK PAGE
   1237	006354				45$:				;
   1238	006354					CALL	@(SP)+		; CONTINUE SEARCH
   1239	006356	103573 				BCS	SYMRET		; IF C/S NO MORE TO PROCESS
   1240	006360	010146 				MOV	R1,-(SP)	; SAVE PATH FLAG
   1241	006362	016701 	000000G			MOV	$CRVSR,R1	; GET VIRTUAL ADDRESS OF SEARCH SEGMENT
   1242	006366					CALL	$LCKPG		; LOCK PAGE IN CORE
   1243	006372	000673 				BR	20$		; PROCESS THIS SEGMENT
   1244
   1245					;
   1246					; MULTIPLE SYMBOL DEFINITION IN CURRENT SEGMENT
   1247					;
   1248
   1249	006374				50$:				;
   1250	006374					CALL	60$		;OUTPUT MESSAGE
   1251	006400				55$:				;
   1252	006400	005726 				TST	(SP)+		; CLEAN STACK
   1253	006402	016701 	000000G			MOV	$CRVSM,R1	; GET VIRTUAL ADDRESS OF FOUND ENTRY
   1254	006406					CALL	$UNLPG		; UNLOCK PAGE BUFFER
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-22


   1255	006412	000555 				BR	SYMRET		;
   1256
   1257					;
   1258					; MULTIPLY DEFINED SYMBOL
   1259					;
   1260
   1261	006414				60$:				;
   1262	006414	012702 	000116'			MOV	#MODN,R2	; GET ADDRESS OF MODULE NAME
   1263	006420	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
   1264	006422	   000G	   000G			.BYTE	E$R21,S$V0	;DIAGNOSTIC
   1265	006424					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
   1266	006430					RETURN			;
   1267
   1268
   1269					;
   1270					; LINK AN ITEM TO SEGMENT AUTOLOAD LIST
   1271					;
   1272
   1273	006432				LNKATL:				;
   1274	006432	005262 	000004G			INC	S$GATL+4(R2)	; INCREMENT NUMBER OF AUTOLOAD ENTRIES
   1275	006436	010146 				MOV	R1,-(SP)	; SAVE VIRTUAL ADDRESS OF REFERENCE
   1276	006440	010246 				MOV	R2,-(SP)	; SAVE REAL SEGMENT DESCRIPTOR ADDRESS
   1277	006442	012701 	000000G			MOV	#A$LLST,R1	; GET LENGTH OF AUTOLOAD ENTRY
   1278	006446					CALL	$ALBLK		; ALLOCATE STORAGE
   1279	006452	012602 				MOV	(SP)+,R2	; RESTORE SEGMENT DESCRIPTOR ADDRESS
   1280	006454	062702 	000000G			ADD	#S$GATL,R2	; POINT TO AUTOLOAD LISTHEAD
   1281	006460	005722 				TST	(R2)+		; LIST EMPTY?
   1282	006462	001002 				BNE	10$		; IF NE NO
   1283	006464	010012 				MOV	R0,(R2)		; MAKE THIS ENTRY LAST
   1284	006466	000401 				BR	20$		;
   1285	006470				10$:				;
   1286	006470	010032 				MOV	R0,@(R2)+	; LINK TO LAST ITEM IN LIST
   1287	006472				20$:				;
   1288	006472	010042 				MOV	R0,-(R2)	; MAKE THIS ITEM LAST
   1289	006474	011660 	000002 			MOV	(SP),2(R0)	; SET ADDRESS OF INDIRECT ENTRY
   1290	006500	012601 				MOV	(SP)+,R1	; RESTORE ENTRY ADDRESS
   1291	006502					RETURN			;
   1292
   1293					;
   1294					; CHECK FOR MULTIPLY DEFINED SYMBOLS
   1295					;
   1296
   1297	006504				SYMCHK:				;
   1298	006504	000241 				CLC			; ASSUME NO MULTIPLE DEFINITION
   1299	006506	132760 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R0) ; FIND DEFINITION?
   1300	006514	001426 				BEQ	30$		; IF EQ NO, EXIT
   1301	006516	132763 	000000G	000000G		BITB	#SY$REL,S$YFLG(R3) ; CURRENT ABSOLUTE?
   1302	006524	001020 				BNE	10$		; IF NE NO
   1303	006526	132760 	000000G	000000G		BITB	#SY$IND,S$YFLG(R0) ; INDIRECT ENTRY?
   1304	006534	001404 				BEQ	5$		; IF EQ NO
   1305	006536	016001 	000000G			MOV	S$YVAL(R0),R1	; GET VIRTUAL ADDRESS OF REAL ENTRY
   1306	006542					CALL	$CVRL		; CONVERT TO REAL ADDRESS
   1307	006546				5$:				;
   1308	006546	132760 	000000G	000000G		BITB	#SY$REL,S$YFLG(R0) ; ENTRY ABSOLUTE?
   1309	006554	001004 				BNE	10$		; IF NE NO
   1310	006556	026063 	000000G	000000G		CMP	S$YVAL(R0),S$YVAL(R3) ; SYMBOLS EQUIVALENT?
   1311	006564	001401 				BEQ	20$		; IF EQ YES
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-23


   1312	006566				10$:				;
   1313	006566	000261 				SEC			; SET MULTIPLE DEFINITION FLAG
   1314	006570				20$:				;
   1315	006570	000244 				CLZ			; SET EQUIVALENCE FLAG
   1316	006572				30$:				;
   1317	006572					RETURN			;
   1318
   1319					;
   1320					; INSERT SYMBOL IN CURRENT SEGMENT
   1321					;
   1322	006574				SYMINS:				;++008
   1323	006574	132763 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R3) ;++008 SYMBOL DEFINITION?
   1324	006602	001404 				BEQ	SYMIN0		;++008 NO -- CONTINUE INSERT
   1325	006604	032764 	000000G	000000G		BIT	#SW$SS,E$LSWT(R4) ;++008 SELECTIVE DEFINITION MODULE ?
   1326	006612	001055 				BNE	SYMRET		;++008 YES -- IGNORE
   1327	006614				SYMIN0:				;++008
   1328	006614	012701 	000000G			MOV	#S$YLGH,R1	;++008 GET SIZE OF SYMBOL TABLE ENTRY
   1329	006620					CALL	$ALVRT		; ALLOCATE STORAGE
   1330	006624	010167 	171322 			MOV	R1,SYENT	; SAVE ADDRESS OF SYMBOL ENTRY
   1331	006630	016367 	000000G	171316 		MOV	S$YFLG(R3),SYFLG ; SAVE SYMBOL FLAGS
   1332	006636	016360 	000000G	000000G		MOV	S$YFLG(R3),S$YFLG(R0);SET SYMBOL FLAGS
   1333	006644	016360 	000000G	000000G		MOV	S$YVAL(R3),S$YVAL(R0);SET SYMBOL VALUE
   1334	006652	016760 	171156 	000000G		MOV	CRVSC,S$YCMT(R0) ; SET SECTION ENTRY ADDRESS
   1335	006660	016760 	000000G	000000G		MOV	$CRVSG,S$YSEG(R0) ; SET VIRTUAL ADDRESS OF CURRENT SEGMENT
   1336	006666	132763 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R3);SYMBOL DEFINITION?
   1337	006674	001006 				BNE	SYMIN1		;IF NE YES
   1338	006676	005060 	000000G			CLR	S$YCMT(R0)	;CLEAR SECTION ENTRY ADDRESS
   1339	006702	005265 	000000G			INC	S$GUND(R5)	;INCREMENT UNDEFINED SYMBOL COUNT
   1340	006706	005267 	000000G			INC	$MSYMC		;INCREMENT MASTER UNDEFINED SYMBOL COUNT
   1341	006712	016360 	000000G	000000G	SYMIN1:	MOV	S$YM(R3),S$YM(R0);SET FIRST HALF OF SYMBOL
   1342	006720	016360 	000002G	000002G		MOV	S$YM+2(R3),S$YM+2(R0);SET SECOND HALF OF SYMBOL
   1343	006726	016700 	000000G			MOV	$CRVSG,R0	; GET VIRTUAL ADDRESS OF CURRENT SEGMENT
   1344	006732	062700 	000000C			ADD	#S$GSTB/2,R0	; POINT TO SYMBOL TABLE LISTHEAD
   1345	006736					CALL	$SRCHI		;SEARCH FOR INSERT
   1346	006742					CALL	$ISYM		;INSERT SYMBOL
   1347	006746	012603 			SYMRET:	MOV	(SP)+,R3	;RESTORE R3
   1348	006750					RETURN			;
   1349
   1350					;
   1351					; VERSION IDENTIFICATION
   1352					;
   1353
   1354	006752	012700 	000000G		VIDENT:	MOV	#$IDENT,R0	;GET ADDRESS OF PRG IDENTIFICATION
   1355	006756	005710 				TST	(R0)		;ANY PREVIOUS DEFINITION?
   1356	006760	001010 				BNE	10$		;IF NE YES
   1357	006762	032764 	000000G	000000G		BIT	#SW$RL,E$LSWT(R4) ;++016 RESIDENT LIBRARY ?
   1358	006770	001004 				BNE	10$		;++016 IF NE YES
   1359	006772	016120 	000000G			MOV	S$YM(R1),(R0)+	;INSERT PROGRAM IDENTIFICATION
   1360	006776	016110 	000002G			MOV	S$YM+2(R1),(R0)	;
   1361	007002	016164 	000000G	000000G	10$:	MOV	S$YM(R1),E$LIDT(R4);INSERT VERSION IDENTIFICATION
   1362	007010	016164 	000002G	000002G		MOV	S$YM+2(R1),E$LIDT+2(R4);
   1363	007016	016701 	000000G			MOV	$CRVEL,R1	; GET VIRTUAL ADDRESS OF CURRENT ELEMENT
   1364	007022					CALLR	$WRMPG		; WRITE-MARK PAGE, EXIT
   1365
   1366					;
   1367					; END GSD-BLOCK TYPE 2
   1368					;
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-24


   1369
   1370	007026	005726 			ENGSD:	TST	(SP)+		;CLEAN STACK
   1371	007030	016403 	000000G			MOV	E$LCMT(R4),R3	;GET ADDRESS OF CMT TABLE
   1372	007034	001456 				BEQ	40$		;IF EQ NONE IN TABLE
   1373	007036	010546 				MOV	R5,-(SP)	;SAVE CURRENT SEGMENT DESCRIPTOR ADDRESS
   1374	007040	016405 	000000G			MOV	E$LNUM(R4),R5	;GET HIGHEST SECTION NUMBER
   1375	007044	005205 				INC	R5		;CONVERT TO REPEAT COUNT
   1376	007046				10$:				;
   1377	007046	012301 				MOV	(R3)+,R1	; GET ENTRY ADDRESS
   1378	007050					CALL	$CVRL		; CONVERT TO REAL ADDRESS
   1379	007054					CALL	$WRMPG		; WRITE-MARK PAGE
   1380	007060	012301 				MOV	(R3)+,R1	;GET MAX SIZE
   1381	007062	132760 	000000G	000000G		BITB	#CS$REL,C$SFLG(R0);ABS SECTION?
   1382	007070	001435 				BEQ	30$		;IF EQ YES
   1383	007072	132760 	000000G	000000G		BITB	#CS$LIB,C$SFLG(R0);LIB SECTION?
   1384	007100	001012 				BNE	13$		;IF NE YES
   1385	007102	132760 	000000G	000000G		BITB	#CS$ALO,C$SFLG(R0);WHAT TYPE?
   1386	007110	001020 				BNE	20$		;IF NE OVERLAID
   1387	007112	060160 	000000G			ADD	R1,C$SCUR(R0)	;UPDATE CURRENT OFFSET ADDRESS
   1388	007116	103022 				BCC	30$		;IF CC OKAY
   1389	007120	012701 				MOV	(PC)+,R1	;P-SECTION OVERFLOW
   1390	007122	   000G	   000G			.BYTE	E$R19,S$V0	;DIAGNOSTIC
   1391	007124	000405 				BR	17$		;
   1392	007126	020160 	000000G		13$:	CMP	R1,C$SLTH(R0)	;COMPATABLE LENGTH?
   1393	007132	101414 				BLOS	30$		;IF LOS YES
   1394	007134	012701 				MOV	(PC)+,R1	;INCOMPATABLE ALLOCATION REFERENCE
   1395	007136	   000G	   000G			.BYTE	E$R59,S$V0	;DIAGNOSTIC
   1396	007140	010002 			17$:	MOV	R0,R2		;COPY ADDRESS OF P-SETION ENTRY
   1397	007142	005722 				TST	(R2)+		; POINT TO SECTION NAME
   1398	007144					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
   1399	007150	000405 				BR	30$		;
   1400	007152	020160 	000000G		20$:	CMP	R1,C$SCUR(R0)	;COMPARE SIZES
   1401	007156	101402 				BLOS	30$		;IF LOS NO CHANGE
   1402	007160	010160 	000000G			MOV	R1,C$SCUR(R0)	;SET NEW HIGH
   1403	007164				30$:	SOB	R5,10$		;REPEAT
   1404	007170	012605 				MOV	(SP)+,R5	;RESTORE SEGMENT DESCRIPTOR ADDRESS
   1405	007172				40$:				;
   1406	007172	032764 	000000G	000000G		BIT	#SW$LB,E$LSWT(R4) ; LIBRARY FILE?
   1407	007200	001055 				BNE	70$		; IF NE YES
   1408	007202	032764 	000000G	000000G		BIT	#SW$CC,E$LSWT(R4) ; CONCATENATED FILE?
   1409	007210	001451 				BEQ	70$		; IF EQ NO
   1410	007212				50$:				;
   1411	007212	016701 	000000G			MOV	$CRVEL,R1	; GET CURRENT VIRTUAL ADDRESS
   1412	007216					CALL	$UNLPG		; UNLOCK PAGE
   1413	007222				55$:				;
   1414	007222	005067 	000000G			CLR	$NBYTE		; CLEAR BYTE COUNT
   1415	007226					CALL	$GTBYT		;GET RECORD LENGTH
   1416	007232	103436 				BCS	60$		;IF CS ILL FORMAT
   1417	007234					CALL	$GTWRD		;GET BLOCK TYPE
   1418	007240	020027 	000006 			CMP	R0,#6		;END OF MODULE?
   1419	007244	001366 				BNE	55$		; IF NE NO
   1420	007246	005067 	000000G			CLR	$NBYTE		;CLEAR BYTE COUNT
   1421	007252					CALL	$GTBYT		;GET RECORD LENGTH
   1422	007256	103426 				BCS	70$		;IF CS NO MORE MODULES
   1423	007260	010003 				MOV	R0,R3		;SAVE RECORD LENGTH
   1424	007262					CALL	ACMOD		;ALLOCATE CONCATENATED MODULE DESCRIPTOR
   1425	007266					CALL	$LCKPG		; LOCK NEXT DESCRIPTOR IN MEMORY
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-25


   1426	007272	010046 				MOV	R0,-(SP)	; SAVE REAL ADDRESS OF NEXT
   1427	007274	010146 				MOV	R1,-(SP)	; SAVE VIRTUAL ADDRESS OF NEXT
   1428	007276	016701 	000000G			MOV	$CRVEL,R1	; GET VIRTUAL ADDRESS OF CURRENT
   1429	007302					CALL	$CVRL		; CONVERT TO REAL ADDRESS
   1430	007306					CALL	$WRMPG		; WRITE MARK PAGE
   1431	007312	011660 	000000G			MOV	(SP),E$LNXT(R0) ; SET LINK TO NEXT
   1432	007316	012667 	000000G			MOV	(SP)+,$CRVEL	; SET VIRTUAL ADDRESS OF NEXT DESCRIPTOR
   1433	007322	012604 				MOV	(SP)+,R4	; SET REAL ADDRESS OF NEXT DESCRIPTOR
   1434	007324	000167 	174226 			JMP	PRCEL2		;GO AGAIN
   1435	007330	000167 	174440 		60$:	JMP	ILFMT		;ILLEGAL FORMAT
   1436	007334	012603 			70$:	MOV	(SP)+,R3	;RESTORE R3
   1437	007336					RETURN			;
   1438
   1439					;
   1440					; REPEAT-BLOCK TYPES 3,4, AND 5
   1441					;
   1442
   1443	007340	005067 	000000G		RPEAT:	CLR	$NBYTE		;CLEAR BYTE COUNT
   1444	007344					RETURN			;
   1445
   1446					;
   1447					; SUBROUTINE TO ALLOCATE A CONCATENATED MODULE DESCRIPTOR
   1448					;
   1449
   1450	007346	012701 	000004G		ACMOD:	MOV	#E$LMOD+4,R1	;GET SIZE OF BLOCK NEEDED
   1451	007352					CALL	$ALVRT		; ALLOCATE VIRTUAL STORAGE
   1452	007356	005360 	000000G			DEC	E$LNUM(R0)	; SET HIGHEST SECTION NUMBER TO -1
   1453	007362	016460 	000000G	000000G		MOV	E$LSWT(R4),E$LSWT(R0) ; COPY ELEMENT SWITCH WORD
   1454	007370	010067 	000000G			MOV	R0,$CRELM	; SET ADDRESS OF ELEMENT DESCRIPTOR
   1455	007374					RETURN			;
   1456
   1457		000001 				.END
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-26
SYMBOL TABLE

ACMOD   007346R  	E$R59 = ****** GX	F.FVER= 000120   	NB.TYP= 000002   	SY$ATL= ****** GX
ALSW    000000R  	E$R60 = ****** GX	F.HIBK= 000004   	NB.VER= 000001   	SY$DEF= ****** GX
A$LLST= ****** GX	E$R74 = ****** GX	F.LUN = 000042   	N.DID = 000024   	SY$IND= ****** GX
BFBAS   000200R  	E$R77 = ****** GX	F.MBCT= 000054   	N.DVNM= 000032   	SY$LIB= ****** GX
BFEND   000002R  	E$R79 = ****** GX	F.MBC1= 000055   	N.FID = 000000   	SY$NLB= ****** GX
BFLST   001200R  	FA.APD= 000100   	F.MBFG= 000056   	N.FNAM= 000006   	SY$REL= ****** GX
BFTOP   000004R  	FA.CRE= 000010   	F.NRBD= 000024   	N.FTYP= 000014   	S$CNT = ****** GX
BKPBF   000006R  	FA.EXT= 000004   	F.NREC= 000030   	N.FVER= 000016   	S$GATL= ****** GX
B.BBFS= 000010   	FA.NSP= 000100   	F.OVBS= 000030   	N.NEXT= 000022   	S$GCST= ****** GX
B.BFST= 000015   	FA.RD = 000001   	F.RACC= 000016   	N.STAT= 000020   	S$GELT= ****** GX
B.NXBD= 000012   	FA.SHR= 000040   	F.RATT= 000001   	N.UNIT= 000034   	S$GNME= ****** GX
B.VBN = 000004   	FA.TMP= 000020   	F.RCNM= 000034   	PAR$$$= 000000   	S$GSEQ= ****** GX
CR    = 000015   	FA.WRT= 000002   	F.RCTL= 000017   	PRCELM  003544R  	S$GSTB= ****** GX
CRSCT   000010R  	FD.BLK= 000010   	F.RSIZ= 000002   	PRCEL1  003546R  	S$GSTS= ****** GX
CRVEL   000036R  	FD.CCL= 000002   	F.RTYP= 000000   	PRCEL2  003556R  	S$GUND= ****** GX
CRVSC   000034R  	FD.CR = 000002   	F.STBK= 000036   	PRCEL3  003574R  	S$V0  = ****** GX
CS$ALO= ****** GX	FD.DIR= 000010   	F.UNIT= 000136   	PRCEL4  003576R  	S$V2  = ****** GX
CS$ATL= ****** GX	FD.FTN= 000001   	F.URBD= 000020   	PSTNME  004060R  	S$YCMT= ****** GX
CS$GBL= ****** GX	FD.INS= 000010   	F.VBN = 000064   	P3BF    000156R  	S$YFLG= ****** GX
CS$IND= ****** GX	FD.PLC= 000004   	F.VBSZ= 000060   	P3BFE   001200R  	S$YLGH= ****** GX
CS$LIB= ****** GX	FD.RAH= 000001   	GSDVCT  003714R  	P3LBS   001312R  	S$YM  = ****** GX
CS$MEM= ****** GX	FD.RAN= 000002   	HT    = 000011   	P3MDS   001546R  	S$YSEG= ****** GX
CS$REL= ****** GX	FD.REC= 000001   	ILFMT   003774R  	RPEAT   007340R  	S$YVAL= ****** GX
CS$TYP= ****** GX	FD.RWM= 000001   	INTSYM  005044R  	R$BLKB= ****** GX	S$ZSEG= ****** GX
C$SBND= ****** GX	FD.SDI= 000020   	LBFRD   003442R  	R$NAME= ****** GX	S$ZSEQ= ****** GX
C$SBSE= ****** GX	FD.SQD= 000040   	LBMOD   000050R  	R$NMBK= ****** GX	S.BFHD= 000020
C$SCUR= ****** GX	FD.TTY= 000004   	LBRBF   000046R  	R$SWTH= ****** GX	S.FATT= 000016
C$SELM= ****** GX	FD.WBH= 000002   	LBRD    003216R  	R$$11M= 000000   	S.FDB = 000140
C$SFLG= ****** GX	FF    = 000014   	LBRDB   003200R  	R.FIX = 000001   	S.FNAM= 000006
C$SLGH= ****** GX	FO.APD= 000106   	LBRDF   003210R  	R.VAR = 000002   	S.FNB = 000036
C$SLTH= ****** GX	FO.MFY= 000002   	LBSR    002006R  	SCTCHK  004572R  	S.FNBW= 000017
DSPVCT  003606R  	FO.RD = 000001   	LBSRC   001746R  	SCTCMT  004716R  	S.FNTY= 000004
ENGSD   007026R  	FO.UPD= 000006   	LBSRC1  002172R  	SCTNME  004014R  	S.FTYP= 000002
EPALO = 000026   	FO.WRT= 000016   	LBSRC2  002522R  	SE$QA = ****** GX	S.NFEN= 000020
EPAVL = 000030   	F.ALOC= 000040   	LBSRC3  002744R  	SLSW    000142R  	VIDENT  006752R
EPBLK   000040R  	F.BBFS= 000062   	LBSRD   003472R  	SPA   = 000040   	VT    = 000013
EPHBK   000042R  	F.BDB = 000070   	LCLSYM  000120R  	SRCDR   000140R  	XFRADR  005046R
EPNUM   000044R  	F.BGBC= 000057   	LF    = 000012   	SRCPF   000144R  	$ABSCT= ****** GX
EPSTR = 000024   	F.BKDN= 000026   	LGBLK = 000006   	SRVSG   000146R  	$ALBLK= ****** GX
E$LCMT= ****** GX	F.BKDS= 000020   	LGTYP = 000006   	STGSD   003624R  	$ALVRT= ****** GX
E$LIDT= ****** GX	F.BKEF= 000050   	LNKATL  006432R  	SW$AL = ****** GX	$CRELM= ****** GX
E$LLGH= ****** GX	F.BKP1= 000051   	LOADNM  000112R  	SW$CC = ****** GX	$CRSEG= ****** GX
E$LMND= ****** GX	F.BKST= 000024   	MH$SS = ****** GX	SW$DA = ****** GX	$CRSRC= ****** GX
E$LMOD= ****** GX	F.BKVB= 000064   	MNALO = 000036   	SW$LB = ****** GX	$CRVEL= ****** GX
E$LNUM= ****** GX	F.CNTG= 000034   	MNAVL = 000040   	SW$RL = ****** GX	$CRVSG= ****** GX
E$LNXT= ****** GX	F.DFNB= 000046   	MNSTR = 000034   	SW$SS = ****** GX	$CRVSM= ****** GX
E$LSWT= ****** GX	F.DSPT= 000044   	MODN    000116R  	SYDEF   000150R  	$CRVSR= ****** GX
E$R10 = ****** GX	F.DVNM= 000134   	MODNME  003732R  	SYENT   000152R  	$CVLOK= ****** GX
E$R11 = ****** GX	F.EFBK= 000010   	M$HFL = ****** GX	SYFLG   000154R  	$CVRL = ****** GX
E$R14 = ****** GX	F.EFN = 000050   	NB.DEV= 000200   	SYMCHK  006504R  	$ERMSG= ****** GX
E$R15 = ****** GX	F.EOBB= 000032   	NB.DIR= 000100   	SYMDCL  005256R  	$FRHD = ****** GX
E$R16 = ****** GX	F.ERR = 000052   	NB.NAM= 000004   	SYMDEF  006020R  	$GTBYT= ****** GX
E$R17 = ****** GX	F.FACC= 000043   	NB.SD1= 000400   	SYMINS  006574R  	$GTWRD= ****** GX
E$R18 = ****** GX	F.FFBY= 000014   	NB.SD2= 001000   	SYMIN0  006614R  	$IDENT= ****** GX
E$R19 = ****** GX	F.FNAM= 000110   	NB.SNM= 000040   	SYMIN1  006712R  	$INPPT= ****** GX
E$R20 = ****** GX	F.FNB = 000102   	NB.STP= 000020   	SYMRET  006746R  	$ISED = ****** GX
E$R21 = ****** GX	F.FTYP= 000116   	NB.SVR= 000010   	SYMSRC  005474R  	$ISYM = ****** GX
P3MDS	MACRO M1108  05-DEC-77 23:03  PAGE 3-27
SYMBOL TABLE

$LCKPG= ****** GX	$PCTRL= ****** GX	$STFNB= ****** GX	$WRMPG= ****** GX	.GETSQ= ****** G
$LIBNM= ****** GX	$P3MDS  001200RG 	$STINP= ****** GX	$WSRCC= ****** GX	.OPFNB= ****** G
$LNKVM= ****** GX	$RLCB = ****** GX	$STRCB= ****** GX	$WSRCS= ****** GX	.POINT= ****** GX
$MSYMC= ****** GX	$RTSEG= ****** GX	$SWTCH= ****** GX	$XFRAD= ****** GX	.POSRC= ****** GX
$MUL  = ****** GX	$SAVRG= ****** GX	$SZSEG= ****** GX	$$    = 000001   	...GBL= 000000
$NBYTE= ****** GX	$SRCH = ****** GX	$UNLPG= ****** GX	.CLOSE= ****** G 	...TPC= 000140
$ODTAD= ****** GX	$SRCHI= ****** GX

. ABS.	000000	   000
      	007376	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  3659 WORDS  ( 15 PAGES)
DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:01:54
[44,10]P3MDS,[44,20]P3MDS/-SP=[44,30]MACFLM.,FCSPR.,P3MDS.019
P4MAL	MACRO M1108  05-DEC-77 23:05  PAGE 3


      1						.TITLE	P4MAL
      2						.IDENT	/14/
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 14
     20					;                                                                               ;**-1
     21					; D.N. CUTLER 26-OCT-72
     22					;
     23					;
     24					;
     25					; MODIFICATIONS
     26					;
     27					; NO.		DATE		PROGRAMMER
     28					; ---		----		----------
     29					;
     30					; 010		17-AUG-73	C. MONIA
     31					; 014		28-AUG-73	C. MONIA
     32					; 041		15-MAY-75	C. MONIA
     33					;
     34					; MACRO LIBRARY CALLS
     35					;
     36
     37						.MCALL	CLOSE$
     38
     39					;
     40					;
     41					;
     42					; LOCAL MACROS
     43					;
     44					; GENERATE SECTION MODIFICATION TABLE ENTRY
     45					;
     46					; GSCTM SYMBOL,ADDCON,MULTIP,SCTNAM
     47					;
     48					; WHERE:
     49					;
     50					;	SYMBOL=SYMBOL NAME THAT IF DEFINED THEN SECTION IS TO BE EX-
     51					;		TENDED BY AN AMOUNT EQUAL TO THE VALUE OF THE SYMBOL
     52					;		PLUS THE ADDITIVE CONSTANT MULTIPLIED BY THE MULTIPLI-
     53					;		CATIVE CONSTANT.
     54					;	ADDCON=ADDITIVE CONSTANT.
     55					;	MULTIP=ADDRESS OF MULTIPLICATIVE CONSTANT.
     56					;	SCTNAM=CONTROL SECTION NAME.
     57					;
P4MAL	MACRO M1108  05-DEC-77 23:05  PAGE 3-1


     58
     59						.MACRO	GSCTM SYMBOL,ADDCON,MULTIP,SCTNAM
     60						.CSECT	SCTTBL
     61					.=.-2
     62						.RAD50	/SYMBOL/
     63						.WORD	ADDCON
     64						.WORD	MULTIP
     65						.RAD50	/SCTNAM/
     66						.WORD	0
     67						.CSECT
     68						.ENDM
     69
     70					;
     71					; GENERATE UNIT MODIFICATION TABLE ENTRY
     72					;
     73					; GUNTM SYMBOL,DEVNAM
     74					;
     75					; WHERE:
     76					;
     77					;	SYMBOL=SYMBOL NAME THAT IF DEFINED THEN THE LOCATION POINTED
     78					;		TO BY THE SYMBOL VALUE IS TO BE MODIFIED WITH THE
     79					;		NUMBER OF LOGICAL UNITS.
     80					;	DEVNAM=A TWO CHARACTER DEVICE NAME. IF THE DEVICE NAME IS
     81					;		BLANK, THEN THE NUMBER OF UNITS IS THE PATCH VALUE
     82					;		AND NO LUN ASSIGNMENT IS GENERATED. ELSE THE NUMBER
     83					;		OF LUNS IS INCREMENTED AND THE UPDATED VALUE IS THE
     84					;		PATCH VALUE. AN ENTRY IS PLACED IN THE ASSIGNMENT LIST
     85					;		FOR THE DEVICE TO THE LUN SPECIFIED BY THE UPDATED
     86					;		NUMBER OF LOGICAL UNITS.
     87					;
     88
     89						.MACRO	GUNTM SYMBOL,DEVNAM
     90						.CSECT	LUNTBL
     91					.=.-2
     92						.RAD50	/SYMBOL/
     93						.WORD	0
     94						.IF NB	DEVNAM
     95					.=.-2
     96						.ASCII	/DEVNAM/
     97						.ENDC
     98						.WORD	0
     99						.CSECT
    100						.ENDM
    101
    102
    103						.IF	DF	R$$11M
    104
    105					;
    106					; ESTABLISH LOW CORE RESERVED SYMBOLS
    107					;
    108					; LOSAV	VECTOR,LOCOR
    109					;
    110					; WHERE:
    111					;
    112					;	VECTOR=	SYMBOL WHOSE VALUE, IF DEFINED IN THE ROOT SEGMENT
    113					;		IS PLACED IN A SPECIFIED LOW-CORE SAVE LOCATION
    114					;		WITHIN THE TASK HEADER
P4MAL	MACRO M1108  05-DEC-77 23:05  PAGE 3-2


    115					;
    116					;	LOCOR=	TKB STORAGE LOCATION CONTAINING THE ABOVE VALUE.
    117					;
    118						.MACRO	LOSAV,VECTOR,LOCOR
    119						.PSECT	SVTBL
    120					.=.-2
    121						.WORD	0
    122						.WORD	0
    123					NN=.
    124					.=.-4
    125						.RAD50	/VECTOR/
    126					.=NN
    127						.WORD	LOCOR
    128						.WORD	0
    129						.PSECT
    130						.ENDM
    131
    132						.ENDC
    133
    134					;
    135					; LOCAL DATA
    136					;
    137
    138						.IF	DF	R$$11M
    139
    140					;
    141					; LOW CORE VECTOR TABLE
    142					;
    143
    144	000000					.PSECT	SVTBL
    145	000000	000000 			LOBAS:	.WORD	0		; DUMMY ZERO WORD AT START OF TABLE
    146	000000					.PSECT
    147	000000					LOSAV	.FSRCB,$HFSR
    148	000000					LOSAV	$OTSVA,$HOTV
    149	000000					LOSAV	.NOVLY,$HOVLY
    150
    151						.ENDC
    152
    153					;
    154					; UNIT MODIFICATION TABLE
    155					;
    156					;		*** NOTE ***
    157					;
    158					; ANY 'AUTOMATIC' LUN/UNIT ASSIGNMENTS MUST BE INSERTED AFTER
    159					; THE ENTRY FOR '.NLUNS'.
    160					;
    161
    162	000000					.CSECT	LUNTBL
    163	000000	000000 			LUNBAS:	.WORD	0		;DUMMY ZERO WORD AT START OF TBL
    164	000002					GUNTM	.NLUNS
    165
    166						.IF	NDF	R$$11M
    167
    168						GUNTM	.MOLUN,MO
    169
    170						.IFF
    171
P4MAL	MACRO M1108  05-DEC-77 23:05  PAGE 3-3


    172	000000					GUNTM	.MOLUN,TI
    173
    174						.ENDC
    175
    176	000000					GUNTM	.NOVLY,OV
    177
    178						.IF	NDF	R$$11M
    179
    180						GUNTM	.ODTL1,CI	;++014
    181
    182						.IFF
    183
    184	000000					GUNTM	.ODTL1,TI
    185
    186						.ENDC
    187
    188	000000					GUNTM	.ODTL2,CL	;++014
    189	000000					GUNTM	.TRLUN,CL
    190
    191					;
    192					; SECTION MODIFICATION TABLE
    193					;
    194
    195	000000					.CSECT	SCTTBL
    196	000000	000000 			SCTBAS:	.WORD	0		;DUMMY ZERO WORD AT START OF TBL
    197	000002					GSCTM	F.FDB,0,$NUNIT,$$DEVT
    198	000000					GSCTM	F.BFHD,512.,$ACTFL,$$FSR1
    199
    200					;
    201					; SEGMENT TABLE BASE ADDRESS SYMBOL
    202					;
    203
    204	000000	130503 	076534 		SEGBAS:	.RAD50	/.NSTBL/	;
    205
    206					;
    207					; HIGHEST USABLE TASK IMAGE VIRTUAL ADDRESS
    208					;
    209
    210						.IIF  NDF	R$$11M, $HGHAD::	.BLKW	1
    211
    212					;+
    213					; **-$P4MAL-PHASE 4 MEMORY ALLOCATION
    214					;
    215					; THIS ROUTINE IS CALLED AT THE END OF PHASE 3 TO ALLOCATE BOTH PHY-
    216					; SICAL AND VIRTUAL MEMORY FOR THE TASK. RESIDENT COMMON AND LIBRARY
    217					; ROUTINES ARE PROCESSED FIRST FOLLOWED BY EACH SEGMENT IN THE ALLOC-
    218					; ATION. AS EACH SEGMENT IS CONSIDERED, EACH CONTROL SECTION FOR THAT
    219					; SEGMENT IS ALLOCATED AN ABSOLUTE ADDRESS RELATIVE TO ZERO. AT THE
    220					; END OF MEMORY ALLOCATION, ABSOLUTE ADDRESSES (RELATIVE TO ZERO) ARE
    221					; ASSIGNED TO ALL RELOCATABLE SYMBOLS. THE AUTOLOAD LIST FOR EACH SEG-
    222					; MENT IS THEN PROCESSED AND ABSOLUTE ADDRESSES ARE ASSIGNED TO AUTO-
    223					; LOAD VECTORS. THE FINAL STEP IS THE ALLOCATION AND ZEROING OF THE
    224					; DISK SPACE FOR THE TASK IMAGE.
    225					;
    226					; INPUTS:
    227					;
    228					;	TABLES CONTRUCTED BY PHASE 3.
P4MAL	MACRO M1108  05-DEC-77 23:05  PAGE 3-4


    229					;
    230					; OUTPUTS:
    231					;
    232					;	PHYSICAL AND VIRTUAL MEMORY IS ALLOCATED, ABSOLUTE ADDRESSES
    233					;	ARE ASSIGNED TO RELOCATABLE SYMBOLS, ABSOLUTE ADDRESSES ARE AS-
    234					;	SIGNED TO AUTOLOAD VECTORS, AND THE TASK IMAGE DISK SPACE IS
    235					;	ALLOCATED AND ZEROED.
    236					;-
    237
    238	000004				$P4MAL::SAVRG			;SAVE NONVOLITILE REGISTERS
    239	000010	016700 	000000G			MOV	$TSKPT,R0	; GET TASK RECORD BLOCK
    240	000014					CALL	$STRCB		; SETUP FILE-NAME BLOCK
    241
    242					;
    243					; PROCESS SECTION MODIFICATION TABLE
    244					;
    245
    246	000020	012705 	000000'			MOV	#SCTBAS,R5	;GET ADDRESS OF MODIFICATION TABLE
    247	000024	005715 			P4MAL1:	TST	(R5)		;ANY MORE ENTRIES?
    248	000026	001454 				BEQ	P4MAL2		;IF EQ NO
    249	000030					CALL	SYMSR		;SEARCH FOR SYMBOL
    250	000034	103444 				BCS	10$		;IF CS NOT FOUND
    251	000036	132760 	000000G	000000G		BITB	#SY$REL,S$YFLG(R0);ABS SYMBOL?
    252	000044	001040 				BNE	10$		;IF NE NO
    253	000046	016000 	000000G			MOV	S$YVAL(R0),R0	;GET SYMBOL VALUE
    254	000052	022525 				CMP	(R5)+,(R5)+	;POINT TO ADDITIVE CONSTANT
    255	000054	062500 				ADD	(R5)+,R0	;ADD IN ADDITIVE CONSTANT
    256	000056	013501 				MOV	@(R5)+,R1	;GET MULTIPLICATIVE CONSTANT
    257
    258
    259						.IF	NDF	V1145
    260
    261	000060					CALL	$MUL		;
    262
    263						.ENDC
    264
    265
    266						.IF	DF	V1145
    267
    268						MUL	R0,R1		;
    269
    270						.ENDC
    271
    272
    273	000064	010104 				MOV	R1,R4		;SAVE RESULT
    274	000066	012700 	000000G			MOV	#$SCTHD,R0	;GET ADDR OF SECTION EXTENSION HEADER
    275	000072	010501 				MOV	R5,R1		;POINT TO SECTION NAME
    276	000074	162701 	000000G			SUB	#S$YM,R1	;CALCULATE PROPER OFFSET
    277	000100					CALL	$SRCHR		; SEARCH FOR SECTION
    278	000104	103023 				BCC	20$		;IF CC ALREADY THERE
    279	000106	012701 	000002G			MOV	#C$SBSE+2,R1	;GET SIZE OF BLOCK NEEDED
    280	000112					CALL	$ALBLK		;ALLOCATE STORAGE
    281	000116	012560 	000000G			MOV	(R5)+,S$YM(R0)	;INSERT SECTION NAME
    282	000122	012560 	000002G			MOV	(R5)+,S$YM+2(R0);
    283	000126	010460 	000000G			MOV	R4,C$SBSE(R0)	;INSERT EXTENSION LENGTH
    284	000132	010001 				MOV	R0,R1		;COPY ENTRY ADDRESS
    285	000134	012700 	000000G			MOV	#$SCTHD,R0	;GET ADDR OF SECTION EXTENSION HEADER
P4MAL	MACRO M1108  05-DEC-77 23:05  PAGE 3-5


    286	000140					CALL	$ISYMR		; INSERT SECTION IN EXTENSION LIST
    287	000144	000727 				BR	P4MAL1		;GO AGAIN
    288	000146	062705 	000014 		10$:	ADD	#14,R5		;ADVANCE TO NEXT ENTRY
    289	000152	000724 				BR	P4MAL1		;GO AGAIN
    290	000154	022525 			20$:	CMP	(R5)+,(R5)+	;POINT TO NEXT ENTRY
    291	000156	000722 				BR	P4MAL1		;GO AGAIN
    292
    293					;
    294					; PROCESS UNIT MODIFICATION TABLE
    295					;
    296
    297	000160	012705 	000000'		P4MAL2:	MOV	#LUNBAS,R5	;GET ADDRESS OF UNIT MODIFICIATION TBL
    298	000164	005715 			10$:	TST	(R5)		;ANY MORE TO PROCESS?
    299	000166	001446 				BEQ	P4MAL3		;IF EQ NO
    300	000170	022715 				CMP	(PC)+,(R5)	;OVERLAY PATCH?
    301	000172	130477 				.RAD50	/.NO/		;
    302	000174	001004 				BNE	15$		;IF NE NO
    303	000176	022767 	000001 	000000G		CMP	#1,$NUMSG	;MORE THAN ONE SEGMENT?
    304	000204	001434 				BEQ	30$		;IF EQ NO
    305	000206				15$:	CALL	SYMSR		;SEARCH FOR SYMBOL
    306	000212	103431 				BCS	30$		;IF CS NOT FOUND
    307	000214					CALL	IPATCH		;INITIALIZE PATCH
    308	000220	012504 				MOV	(R5)+,R4	;GET DEVICE NAME
    309	000222	001402 				BEQ	20$		;IF EQ NO UPDATE OF UNITS
    310	000224	005267 	000000G			INC	$NUNIT		;INCREMENT NUMBER OF UNITS
    311	000230	016710 	000000G		20$:	MOV	$NUNIT,(R0)	;SET PATCH VALUE
    312	000234	005704 				TST	R4		;ANY DEVICE?
    313	000236	001752 				BEQ	10$		;IF EQ NO
    314	000240	012701 	000010 			MOV	#10,R1		;GET SIZE OF BLOCK NEEDED
    315	000244					CALL	$ALBLK		;ALLOCATE STORAGE
    316	000250	010077 	000002G			MOV	R0,@$LUNHD+2	;LINK TO OLD LAST
    317	000254	010067 	000002G			MOV	R0,$LUNHD+2	;SET NEW LAST
    318	000260	005720 				TST	(R0)+		;POINT TO DEVICE NAME
    319	000262	010420 				MOV	R4,(R0)+	;SET DEVICE NAME
    320	000264	012720 				MOV	(PC)+,(R0)+	;SET UNIT 0 AND ONE ASSIGNMENT
    321	000266	   000 	   001 			.BYTE	0,1		;
    322	000270	016710 	000000G			MOV	$NUNIT,(R0)	;SET LUN NUMBER
    323	000274	000733 				BR	10$		;
    324	000276	062705 	000006 		30$:	ADD	#6,R5		;ADVANCE TO NEXT ENTRY
    325	000302	000730 				BR	10$		;
    326
    327					;
    328					; CALCULATE HEADER SIZE
    329					;
    330
    331	000304	016700 	000000G		P4MAL3:	MOV	$NUNIT,R0	;GET NUMBER OF LOGICAL UNITS
    332	000310	012702 	000002 			MOV	#2,R2		; ASSUME LUNS LT 128.
    333	000314	012767 	002000 	000000G		MOV	#512.*2,$LBLSZ	; SET SIZE OF LABEL
    334	000322	020027 	000200 			CMP	R0,#128.	; CHECK NUMBER OF LUNS
    335	000326	003404 				BLE	5$		; IF LE ALL SET
    336	000330	005202 				INC	R2		; ELSE INCREMENT NUMBER OF LABEL BLOCKS
    337	000332	062767 	001000 	000000G		ADD	#512.,$LBLSZ	; ADD ANOTHER BLOCK TO SIZE
    338	000340				5$:
    339	000340	010267 	000000G			MOV	R2,$LBBLK	; SET NUMBER OF LABEL BLOCKS
    340	000344	010267 	000000G			MOV	R2,$HDRBN	; RELATIVE BLOCK NUMBER OF HEADER
    341
    342	000350	006300 				ASL	R0		;MULTIPLY BY 4
P4MAL	MACRO M1108  05-DEC-77 23:05  PAGE 3-6


    343	000352	006300 				ASL	R0		;
    344
    345						.IF	NDF	R$$11M
    346
    347						ADD	#H$DLUT+77+2,R0 ; ADD LENGTH OF HEADER AND ROUND
    348						ADD	$LBLSZ,R0	; ADD SIZE OF LABEL
    349						MOV	$TSKPT,R2	;GET TASK IMAGE RECORD BLOCK
    350						BIT	#SW$FP,R$SWTH(R2);FLOATING POINT SPECIFIED?
    351						BEQ	10$		;IF EQ NO
    352						ADD	#25.*2,R0	;ADD IN 25. MORE WORDS
    353					10$:	BIC	#77,R0		;CLEAR EXCESS BITS
    354
    355						.IFF
    356
    357	000354	016702 	000000G			MOV	$TSKPT,R2
    358	000360	016202 	000000G			MOV	R$SWTH(R2),R2	; FETCH TASK IMAGE FLAGS
    359	000364	005067 	000000G			CLR	$HDSIZ		; ASSUME TASK IMAGE HAS NO HEADER
    360	000370	032702 	000000G			BIT	#SW$NH,R2	 ; TEST FOR HEADER
    361	000374	001020 				BNE	P4MAL4		; BUILD WITHOUT HEADER IF NE
    362	000376	062700 	000000C			ADD	#<H$LUN-H$CSP>,R0 ; ADD LENGTH OF FIXED PART OF HEADER
    363	000402	032702 	000000C			BIT	#<SW$FP!SW$EA>,R2  ; FLOATING POINT OR EAE SPECIFIED?
    364	000406	001407 				BEQ	10$		; IF EQ NO
    365	000410	062700 	000006 			ADD	#6,R0		; ASSUME EAE
    366	000414	032702 	000000G			BIT	#SW$FP,R2	; SEE IF F/P
    367	000420	001402 				BEQ	10$		; IF EQ NO
    368	000422	062700 	000054 			ADD	#<25.*2-6>,R0	; YES ALLOCATE MORE SPACE
    369	000426				10$:
    370	000426	062700 	000022 			ADD	#22,R0		; ALLOCATE REGISTER SAVE AREA,PS AND GUARD
    371
    372						.ENDC
    373
    374	000432	010067 	000000G			MOV	R0,$HDSIZ	;SET HEADER SIZE
    375
    376					;
    377					; ALLOCATE CHECKPOINT AREA ON DISK
    378					;
    379
    380	000436				P4MAL4:				;
    381
    382						.IF	DF	R$$11M
    383
    384	000436					CALL	$SGALO		;++041 ALLOCATE VIRTUAL MEMORY
    385	000442	016700 	000000G			MOV	$PARSZ,R0	;++041 GET PARTITION SIZE
    386	000446	016702 	000000G			MOV	$TSKPT,R2	;++041 GET TASK FILE FLAGS
    387	000452	016202 	000000G			MOV	R$SWTH(R2),R2	;++041 ...
    388	000456	032767 	000000G	000000G		BIT	#MP$SY,$SWTCH	;++041 MAPPED SYSTEM?
    389	000464	001420 				BEQ	5$		;++041 IF EQ NO
    390	000466	005700 				TST	R0		;++041 SYSTEM CONTROLLED PARTITION?
    391	000470	001016 				BNE	5$		;++041 IF NE NO
    392	000472	016700 	000000G			MOV	$HVRTL,R0	;++041 GET LENGTH OF TASK IMAGE
    393	000476	062700 	000077 			ADD	#77,R0		;++041 ROUND TO NEXT 32W BOUNDRY
    394	000502	042700 	000077 			BIC	#77,R0		;++041 ...
    395	000506	006100 				ROL	R0		;++041 CONVERT TO NUMBER OF 32W BLOCKS
    396	000510	006100 				ROL	R0		;++041 ...
    397	000512	106100 				ROLB	R0		;++041 ...
    398	000514	000300 				SWAB	R0		;++041 ...
    399	000516	066700 	000000G			ADD	$LBEXT,R0	;++041 ADD TASK EXTENSION
P4MAL	MACRO M1108  05-DEC-77 23:05  PAGE 3-7


    400	000522	010067 	000000G			MOV	R0,$PARSZ	;++041 SAVE TOTAL TASK SIZE
    401	000526				5$:				;++041
    402	000526	032702 	000000G			BIT	#SW$CP,R2	;++041 TEST IF CHECKPOINTABLE
    403	000532	001007 				BNE	10$		; IF NE NO
    404	000534	062700 	000007 			ADD	#7,R0		; ROUND TO MULTIPLE OF 256W                     ;**NEW**
    405	000540	006200 				ASR	R0		; CONVERT TO BLOCKS                             ;**NEW**
    406	000542	006200 				ASR	R0		;                                               ;**NEW**
    407	000544	006200 				ASR	R0		;                                               ;**-2
    408	000546	060067 	000000G			ADD	R0,$HDRBN	; SET RELATIVE BLOCK NUMBER OF HEADER
    409	000552				10$:				; REF LABEL
    410
    411						.IFF
    412
    413					;
    414					; ALLOCATE PHYSICAL AND VIRTUAL MEMORY
    415					;
    416
    417						CALL	$PRALO		; ALLOCATE PAR'S
    418						CALL	$SGALO		; ALLOCATE VIRTUAL MEMORY
    419
    420					;
    421					; CALCULATE OFFSET BIAS
    422					;
    423
    424					P4MAL5:	MOV	$OFFST,R0	;GET BASE OR TOP
    425						BGE	10$		;IF GE BASE
    426						NEG	R0		;MAKE POSITIVE
    427					10$:	SWAB	R0		;MULTIPLY BY 256.
    428						ASL	R0		;FINISH ADJUST TO 4K MULTIPLE WITH SHIFT
    429						ASL	R0		;
    430						ASL	R0		;
    431						TST	$OFFST		;TOP OR BASE?
    432						BGE	30$		;IF GE BASE
    433						ADD	#20000,R0	;MAKE 4K BIGGER
    434						BCS	20$		;IF CS NO NEED TO CHECK
    435						CMP	R0,$HVRTL	;LEGAL TOP VALUE?
    436						BLO	40$		;IF LO NO
    437					20$:	SUB	$HVRTL,R0	;CALCULATE DIFFERENCE
    438						BIC	#17777,R0	;CLEAR EXCESS BITS
    439						BR	50$		;
    440					30$:	MOV	R0,R1		;COPY BASE ADDRESS
    441						ADD	$HVRTL,R1	;ADD IN VIRTUAL LENGTH
    442						BCC	50$		;IF CC OKAY
    443					40$:	MOV	#$OFFST,R2	;GET ADDRESS OF OFFSET WORD
    444						MOV	(PC)+,R1	;ILLEGAL OFFSET ADDRESS
    445						.BYTE	E$R47,S$V0	;DIAGNOSTIC
    446						CALL	$ERMSG		;++010 SEND ERROR MESSAGE
    447						CLR	R0		;CLEAR OFFSET BIAS
    448					50$:	MOV	R0,$OFFST	;SET OFFSET BIAS
    449
    450						.ENDC
    451
    452
    453					;
    454					; PROCESS SEGMENT TABLE BASE SYMBOL MODIFICATION
    455					;
    456
P4MAL	MACRO M1108  05-DEC-77 23:05  PAGE 3-8


    457	000552	012705 	000000'		P4MAL6:	MOV	#SEGBAS,R5	;GET ADDRESS OF SYMBOL
    458	000556					CALL	SYMSR		;SEARCH FOR SYMBOL DEFINITION
    459	000562	103410 				BCS	10$		;IF CS NO FIND EM
    460	000564					CALL	IPATCH		;SET UP PATCH VALUE
    461	000570					CALL	CVROOT		; GET REAL ADDRESS OF ROOT IN R1
    462	000574	016110 	000000G			MOV	S$GRWB(R1),(R0)	;SET BASE ADDRESS OF SEG TABLES
    463	000600	066710 	000000G			ADD	$OFFST,(R0)	;ADD IN OFFSET BIAS
    464	000604				10$:				;REF LABEL
    465
    466					;
    467					; NOW FINISH ALLOCATION
    468					;
    469
    470	000604					CALL	$SYALO		;ASSIGN ABSOLUTE ADDRESSES TO SYMS
    471	000610					CALL	$ALALO		;ALLOCATE AUTOLOAD VECTOR ADDRESSES
    472	000614					CALL	$DKALO		;ALLOCATE TASK IMAGE DISK SPACE
    473
    474						.IF	DF	R$$11M
    475
    476					;
    477					; SETUP LOW CORE POINTERS
    478					;
    479
    480	000620	012705 	177772'			MOV	#LOBAS-6,R5	; FETCH TABLE POINTER LESS OFFSET
    481	000624				20$:
    482	000624	062705 	000006 			ADD	#6,R5		; OFFSET TO NEXT ENTRY
    483	000630	005715 				TST	(R5)		; ANY MORE TO PROCESS
    484	000632	001420 				BEQ	40$		; IF EQ NO
    485	000634	005075 	000004 			CLR	@4(R5)		; ASSUME VECTOR NOT DEFINED IN ROOT
    486	000640					CALL	SYMSR		; SEARCH ROOT FOR DEFINITION
    487	000644	103767 				BCS	20$		; IF C/S NOT DEFINED
    488	000646	132760 	000000G	000000G		BITB	#SY$REL,S$YFLG(R0) ; TEST IF RELOCATABLE
    489	000654	001403 				BEQ	30$		; IF EQ NO
    490	000656	016775 	000000G	000004 		MOV	$OFFST,@4(R5)	; SETUP RELOCATION BIAS
    491	000664				30$:
    492	000664	066075 	000000G	000004 		ADD	S$YVAL(R0),@4(R5) ; RELOCATE DEFINITION
    493	000672	000754 				BR	20$		; GO AGAIN
    494	000674				40$:				; REF. LABEL
    495
    496						.ENDC
    497
    498	000674					CALL	$HEADR		;OUTPUT TASK HEADER
    499	000700	032767 	000000G	000000G		BIT	#TS$KF,$SWTCH	; TASK FILE SPECIFIED ?
    500	000706	001427 				BEQ	50$		; IF EQ NO
    501	000710	016701 	000000G			MOV	$TSKNM,R1	; GET TASK NAME BLOCK
    502	000714					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    503	000720					CALL	$WRMPG		; WRITE MARK THE PAGE
    504	000724	010001 				MOV	R0,R1		; COPY REAL ADDRESS
    505	000726	005061 	000000G			CLR	E$LNUM(R1)	; CLEAR HIGHEST SECTION NUMBER
    506	000732	016700 	000000G			MOV	$TSKPT,R0	; GET TASK RECORD BLOCK POINTER
    507	000736	062701 	000014G			ADD	#E$LMND+14,R1	; POINT TO VERSION
    508	000742	016021 	000120 			MOV	F.FNB+N.FVER(R0),(R1)+ ; SAVE VERSION NUMBER
    509	000746	016021 	000102 			MOV	F.FNB+N.FID(R0),(R1)+ ; REPLACE DIRECTORY I/D WITH FILE I/D
    510	000752	016021 	000104 			MOV	F.FNB+N.FID+2(R0),(R1)+ ;
    511	000756	016021 	000106 			MOV	F.FNB+N.FID+4(R0),(R1)+ ;
    512	000762					CLOSE$	R0		; CLOSE TASK FILE
    513	000766				50$:				;
P4MAL	MACRO M1108  05-DEC-77 23:05  PAGE 3-9


    514	000766					RETURN			;
    515
    516					;
    517					; SUBROUTINE TO ALLOCATE AND INITIALIZE PATCH LIST ENTRY
    518					;
    519
    520	000770	012701 	000022 		IPATCH:	MOV	#6+4+6+2,R1	;GET SIZE OF BLOCK NEEDED
    521	000774					CALL	$ALBLK		;ALLOCATE STORAGE
    522	001000	012701 	000000G			MOV	#$PATHD,R1	;GET ADDRESS OF PATCH LISTHEAD
    523	001004	005721 				TST	(R1)+		;ANYTHING IN LIST?
    524	001006	001403 				BEQ	10$		;IF EQ NO
    525	001010	014110 				MOV	-(R1),(R0)	;LINK OLD FIRST TO NEW FIRST
    526	001012	010011 				MOV	R0,(R1)		;SET NEW FIRST
    527	001014	000402 				BR	20$		;
    528	001016	010031 			10$:	MOV	R0,@(R1)+	;SET ADDRESS OF FIRST
    529	001020	010041 				MOV	R0,-(R1)	;SET ADDRESS OF LAST
    530	001022	005720 			20$:	TST	(R0)+		;POINT TO NUMBER OF PATCHES
    531	001024	005220 				INC	(R0)+		;SET PATCHES TO ONE
    532	001026					CALL	CVROOT		; GET REAL ADDRESS OF ROOT IN R1
    533	001032	016120 	000000G			MOV	S$GNME(R1),(R0)+;SET SEGMENT NAME OF PATCH
    534	001036	016120 	000002G			MOV	S$GNME+2(R1),(R0)+;
    535	001042	012720 	000002 			MOV	#2,(R0)+	;TYPE EQUAL GLOBAL PATCH
    536	001046	012520 				MOV	(R5)+,(R0)+	;INSERT SYMBOL NAME
    537	001050	012520 				MOV	(R5)+,(R0)+	;
    538	001052	005020 				CLR	(R0)+		;CLEAR OFFSET VALUE
    539	001054					RETURN			;
    540
    541					;
    542					; SUBROUTINE TO SEARCH ROOT SEGMENT FOR SYMBOL DEFINITION
    543					;
    544
    545	001056				SYMSR:				;
    546	001056					CALL	CVROOT		; GET REAL ADDRESS OF ROOT IN R1
    547	001062	010100 				MOV	R1,R0		; COPY REAL ADDRESS
    548	001064	062700 	000000G			ADD	#S$GSTB,R0	;POINT TO SYMBOL TABLE
    549	001070	010501 				MOV	R5,R1		;COPY TABLE ENTRY ADDRESS
    550	001072	162701 	000000G			SUB	#S$YM,R1	;CALCULATE PROPER OFFSET
    551	001076					CALL	$SRCH		;SEARCH SYMBOL TABLE
    552	001102	103413 				BCS	20$		;IF CS NO FIND EM
    553	001104	132760 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R0);SYMBOL DEFINITION?
    554	001112	001406 				BEQ	10$		;IF EQ NO
    555	001114	132760 	000000G	000000G		BITB	#SY$IND,S$YFLG(R0);INDIRECT REFERENCE?
    556	001122	001002 				BNE	10$		;IF NE YES
    557	001124	000241 				CLC			;CLEAR CARRY
    558	001126	000401 				BR	20$		;
    559	001130	000261 			10$:	SEC			;SET CARRY
    560	001132				20$:	RETURN			;
    561
    562					;
    563					; CONVERT VIRTUAL ADDRESS OF ROOT TO REAL ADDRESS IN R1
    564					;
    565
    566	001134				CVROOT:				;
    567	001134	010046 				MOV	R0,-(SP)	; SAVE R0
    568	001136	016701 	000000G			MOV	$RTSEG,R1	; GET VIRTUAL ADDRESS OF ROOT SEGMENT
    569	001142					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    570	001146					CALL	$WRMPG		; WRITE-MARK PAGE
P4MAL	MACRO M1108  05-DEC-77 23:05  PAGE 3-10


    571	001152	010001 				MOV	R0,R1		; COPY REAL ADDRESS
    572	001154	012600 				MOV	(SP)+,R0	; RESTORE R0
    573	001156					RETURN			;
    574
    575
    576		000001 				.END
P4MAL	MACRO M1108  05-DEC-77 23:05  PAGE 3-11
SYMBOL TABLE

B.BBFS= 000010   	F.ALOC= 000040   	F.STBK= 000036   	P4MAL4  000436R  	$CVRL = ****** GX
B.BFST= 000015   	F.BBFS= 000062   	F.UNIT= 000136   	P4MAL6  000552R  	$DKALO= ****** GX
B.NXBD= 000012   	F.BDB = 000070   	F.URBD= 000020   	R$SWTH= ****** GX	$HDRBN= ****** GX
B.VBN = 000004   	F.BGBC= 000057   	F.VBN = 000064   	R$$11M= 000000   	$HDSIZ= ****** GX
CR    = 000015   	F.BKDN= 000026   	F.VBSZ= 000060   	R.FIX = 000001   	$HEADR= ****** GX
CVROOT  001134R  	F.BKDS= 000020   	HT    = 000011   	R.VAR = 000002   	$HFSR = ****** GX
C$SBSE= ****** GX	F.BKEF= 000050   	H$CSP = ****** GX	SCTBAS  000000R     004	$HOTV = ****** GX
E$LMND= ****** GX	F.BKP1= 000051   	H$LUN = ****** GX	SEGBAS  000000R  	$HOVLY= ****** GX
E$LNUM= ****** GX	F.BKST= 000024   	IPATCH  000770R  	SPA   = 000040   	$HVRTL= ****** GX
FA.APD= 000100   	F.BKVB= 000064   	LF    = 000012   	SW$CP = ****** GX	$ISYMR= ****** GX
FA.CRE= 000010   	F.CNTG= 000034   	LOBAS   000000R     002	SW$EA = ****** GX	$LBBLK= ****** GX
FA.EXT= 000004   	F.DFNB= 000046   	LUNBAS  000000R     003	SW$FP = ****** GX	$LBEXT= ****** GX
FA.NSP= 000100   	F.DSPT= 000044   	MP$SY = ****** GX	SW$NH = ****** GX	$LBLSZ= ****** GX
FA.RD = 000001   	F.DVNM= 000134   	NB.DEV= 000200   	SYMSR   001056R  	$LUNHD= ****** GX
FA.SHR= 000040   	F.EFBK= 000010   	NB.DIR= 000100   	SY$DEF= ****** GX	$MUL  = ****** GX
FA.TMP= 000020   	F.EFN = 000050   	NB.NAM= 000004   	SY$IND= ****** GX	$NUMSG= ****** GX
FA.WRT= 000002   	F.EOBB= 000032   	NB.SD1= 000400   	SY$REL= ****** GX	$NUNIT= ****** GX
FD.BLK= 000010   	F.ERR = 000052   	NB.SD2= 001000   	S$GNME= ****** GX	$OFFST= ****** GX
FD.CCL= 000002   	F.FACC= 000043   	NB.SNM= 000040   	S$GRWB= ****** GX	$PARSZ= ****** GX
FD.CR = 000002   	F.FFBY= 000014   	NB.STP= 000020   	S$GSTB= ****** GX	$PATHD= ****** GX
FD.DIR= 000010   	F.FNAM= 000110   	NB.SVR= 000010   	S$YFLG= ****** GX	$P4MAL  000004RG
FD.FTN= 000001   	F.FNB = 000102   	NB.TYP= 000002   	S$YM  = ****** GX	$RTSEG= ****** GX
FD.INS= 000010   	F.FTYP= 000116   	NB.VER= 000001   	S$YVAL= ****** GX	$SAVRG= ****** GX
FD.PLC= 000004   	F.FVER= 000120   	NN    = 000020R     002	S.BFHD= 000020   	$SCTHD= ****** GX
FD.RAH= 000001   	F.HIBK= 000004   	N.DID = 000024   	S.FATT= 000016   	$SGALO= ****** GX
FD.RAN= 000002   	F.LUN = 000042   	N.DVNM= 000032   	S.FDB = 000140   	$SRCH = ****** GX
FD.REC= 000001   	F.MBCT= 000054   	N.FID = 000000   	S.FNAM= 000006   	$SRCHR= ****** GX
FD.RWM= 000001   	F.MBC1= 000055   	N.FNAM= 000006   	S.FNB = 000036   	$STRCB= ****** GX
FD.SDI= 000020   	F.MBFG= 000056   	N.FTYP= 000014   	S.FNBW= 000017   	$SWTCH= ****** GX
FD.SQD= 000040   	F.NRBD= 000024   	N.FVER= 000016   	S.FNTY= 000004   	$SYALO= ****** GX
FD.TTY= 000004   	F.NREC= 000030   	N.NEXT= 000022   	S.FTYP= 000002   	$TSKNM= ****** GX
FD.WBH= 000002   	F.OVBS= 000030   	N.STAT= 000020   	S.NFEN= 000020   	$TSKPT= ****** GX
FF    = 000014   	F.RACC= 000016   	N.UNIT= 000034   	TS$KF = ****** GX	$WRMPG= ****** GX
FO.APD= 000106   	F.RATT= 000001   	PAR$$$= 000000   	VT    = 000013   	$$    = 000001
FO.MFY= 000002   	F.RCNM= 000034   	P4MAL1  000024R  	$ACTFL= ****** GX	.CLOSE= ****** G
FO.RD = 000001   	F.RCTL= 000017   	P4MAL2  000160R  	$ALALO= ****** GX	...GBL= 000000
FO.UPD= 000006   	F.RSIZ= 000002   	P4MAL3  000304R  	$ALBLK= ****** GX	...TPC= 000140
FO.WRT= 000016   	F.RTYP= 000000

. ABS.	000000	   000
      	001160	   001
SVTBL 	000024	   002
LUNTBL	000046	   003
SCTTBL	000032	   004
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2397 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:36
[44,10]P4MAL,[44,20]P4MAL/-SP=[44,30]MACFLM.,FCSPR.,P4MAL.014
P5CEL	MACRO M1108  05-DEC-77 23:06  PAGE 3


      1						.TITLE	P5CEL
      2						.IDENT	/00/
      3					                                                                                ;**-1
      4
      5					;
      6					; COPYRIGHT   1975,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					;
      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     12					;
     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     15					; EQUIPMENT CORPORATION.
     16					;
     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     19					;
     20					; VERSION 00
     21					;                                                                               ;**-1
     22					; C. MONIA 11-JAN-75
     23					;
     24					; OUTPUT THE TASK BUILDER CREF FOR EACH ELEMENT
     25					;
     26					; MACRO LIBRARY CALLS
     27					;
     28
     29						.MCALL	PUT$S
     30
     31					;
     32					; LOCAL DATA
     33					;
     34					; CREF HEADER DATA (ADJACENCY ASSUMED)
     35					;
     36
     37		000000'			$$=.
     38
     39	000000	077272 	000000 		CRFNM:	.RAD50	/TKB   /	; TASK NAME
     40	000004	000000 			CRFID:	.WORD	0		; TASK I/D
     41	000006				CRFTIM:	.BLKW	5.		; CREATION TIME
     42	000020	000000 			CRFLG:	.WORD	0		; HEADER FLAGS WORD
     43
     44		000022 			HDSIZ=.-$$
     45
     46					;
     47					; LOCAL SYMBOL STORAGE
     48					;
     49
     50	000022				LCLSYM:	.BLKW	6.		;
     51
     52					;
     53					; CREF DATA RECORD BUFFER (ADJACENCY ASSUMED)
     54					;
     55
     56		000036'			$$=.
     57
P5CEL	MACRO M1108  05-DEC-77 23:06  PAGE 3-1


     58	000036				SYM:	.BLKW	2		; SYMBOL NAME (2-WORD, RADIX 50)
     59	000042				MODN:	.BLKW	2		; MODULE NAME (2-WORD, RADIX 50)
     60	000046				SYVAL:	.BLKW	1		; SYMBOL VALUE (2-WORD, RADIX 50)
     61	000050				SYFLG:	.BLKB	1		; SYMBOL FLAGS
     62	000051	   000 			SYFMT:	.BYTE	0		; CREF FORMAT
     63
     64		000014 			DSIZ=.-$$
     65
     66					;
     67					; MODULE FUNCTION DETAILS:
     68					;
     69					;+
     70					; **-$P5CEL-CREATE THE CROSS REFERENCE FOR EACH ELEMENT IN THE SEGMENT
     71					;
     72					; INPUTS:
     73					;
     74					;	PHASE THREE SYMBOL AND SECTION TABLES
     75					;
     76					; OUTPUTS:
     77					;
     78					;	THE CREF FILE FOR EACH ELEMENT IS PRODUCED
     79					;
     80					;-
     81
     82
     83	000052				$P5CEL::			;
     84	000052					SAVRG			; SAVE NON-VOLATILE REGISTERS
     85	000056				10$:				;
     86	000056					CALL	$GTBYT		; GET RECORD LENGTH
     87	000062	103410 				BCS	20$		; IF C/S-EOF(ILLEGAL FORMAT)
     88	000064	010003 				MOV	R0,R3		; SAVE RECORD LENGTH
     89	000066					CALL	$GTWRD		; GET BLOCK TYPE
     90	000072	162703 	000002 			SUB	#2,R3		; ADJUST BYTE COUNT
     91	000076	020027 	000006 			CMP	R0,#LGBLK	; LEGAL BLOCK TYPE
     92	000102	101401 				BLOS	30$		; IF LOS YES
     93	000104				20$:				;
     94	000104	005000 				CLR	R0		; FORCE ILLEGAL FORMAT
     95	000106				30$:				;
     96	000106	006300 				ASL	R0		; MAKE WORD INDEX
     97	000110					CALL	@DSPVCT(R0)	; CALL BLOCK DEPENDANT ROUTINE
     98	000114	000760 				BR	10$		; GO AGAIN
     99
    100					;
    101					; DISPATCH VECTOR TABLE
    102					;
    103
    104	000116				DSPVCT:				;
    105	000116	000514'				.WORD	ILFMT		; BLOCK 0-ILLEGAL BLOCK TYPE
    106	000120	000134'				.WORD	STGSD		; BLOCK 1-START GSD
    107	000122	000512'				.WORD	ENGSD		; BLOCK 2-END GSD
    108	000124	000534'				.WORD	RPEAT		; BLOCK 3-TXT
    109	000126	000534'				.WORD	RPEAT		; BLOCK 4-RLD
    110	000130	000534'				.WORD	RPEAT		; BLOCK 5-ISD
    111	000132	000504'				.WORD	MODND		; BLOCK 6-MODULE END
    112		000006 			LGBLK=<.-DSPVCT-2>/2
    113
    114					;
P5CEL	MACRO M1108  05-DEC-77 23:06  PAGE 3-2


    115					; START GSD -BLOCK TYPE 1
    116					;
    117
    118	000134				STGSD:				;
    119	000134	012704 	000024'			MOV	#LCLSYM+2,R4	; GET ADDRESS TO STORE SYMBOL
    120	000140	012705 	000004 			MOV	#4,R5		; SET REPEAT COUNT
    121	000144				10$:				;
    122	000144					CALL	$GTWRD		; GET A WORD
    123	000150	010024 				MOV	R0,(R4)+	; SAVE IN TEMP BUFFER
    124	000152					SOB	R5,10$		; REPEAT
    125	000156	162703 	000010 			SUB	#8.,R3		; ADJUST FOR SYMBOL ENTRY
    126	000162	012701 	000022'			MOV	#LCLSYM,R1	; GET ADDRESS OF SYMBOL DESCRIPTOR
    127	000166	116102 	000000G			MOVB	S$CNT(R1),R2	; GET TYPE OF GSD ENTRY
    128	000172	020227 	000006 			CMP	R2,#LGTYP	; LEGAL TYPE ?
    129	000176	101146 				BHI	ILFMT		; IF HI ILLEGAL FORMAT
    130	000200	006302 				ASL	R2		; MAKE WORD INDEX
    131	000202	016700 	000000G			MOV	$CRSEG,R0	; GET ADDRESS OF CURRENT SEGMENT
    132	000206					CALL	@GSDVCT(R2)	; DISPATCH TO ROUTINE
    133	000212	005703 				TST	R3		; ANY MORE TO PROCESS
    134	000214	003347 				BGT	STGSD		; IF GT GO AGAIN
    135	000216					RETURN			;
    136
    137					;
    138					; GSD ENTRY TYPE DISPATCH TABLE
    139					;
    140
    141	000220				GSDVCT:				;
    142	000220	000236'				.WORD	MODNME		; MODULE NAME
    143	000222	000254'				.WORD	SCTNME		; SECTION NAME
    144	000224	000256'				.WORD	INTSYM		; INTERNAL SYMBOL
    145	000226	000260'				.WORD	XFRADR		; TRANSFER ADDRESS
    146	000230	000262'				.WORD	SYMDCL		; SYMBOL DECLARATION
    147	000232	000254'				.WORD	SCTNME		; PROGRAM SECTION NAME
    148	000234	000510'				.WORD	VIDENT		; VERSION IDENTIFICATION
    149		000006 			LGTYP=<.-GSDVCT-2>/2
    150
    151					;
    152					; MODULE NAME
    153					;
    154
    155	000236				MODNME:				;
    156	000236	016167 	000000G	177576 		MOV	S$YM(R1),MODN	; SAVE MODULE NAME
    157	000244	016167 	000002G	177572 		MOV	S$YM+2(R1),MODN+2 ; ...
    158	000252					RETURN			;
    159
    160					;
    161					; SECTION AND PROGRAM SECTION NAME
    162					;
    163
    164	000254				SCTNME:				;
    165	000254					RETURN			;
    166
    167					;
    168					; INTERNAL SYMBOL
    169					;
    170
    171	000256				INTSYM:				;
P5CEL	MACRO M1108  05-DEC-77 23:06  PAGE 3-3


    172	000256					RETURN			;
    173
    174					;
    175					; TRANSFER ADDRESS
    176					;
    177
    178	000260				XFRADR:				;
    179	000260					RETURN			;
    180
    181					;
    182					; SYMBOL DECLARATION
    183					;
    184
    185	000262				SYMDCL:				;
    186	000262	012702 	000036'			MOV	#SYM,R2		; GET ADDRESS TO STORE SYMBOL DATA
    187	000266	016122 	000000G			MOV	S$YM(R1),(R2)+	; STORE SYMBOL NAME
    188	000272	016122 	000002G			MOV	S$YM+2(R1),(R2)+ ; ...
    189	000276	116102 	000000G			MOVB	S$YFLG(R1),R2	; GET FLAGS BYTE
    190	000302	142702 	000000C			BICB	#^C<SY$DEF!SY$REL>,R2	;++036 CLEAR ALL BUT DEF. AND REL. FLAGS
    191	000306	110267 	177536 			MOVB	R2,SYFLG	; SET FLAGS
    192	000312					CALL	$WSRCS		; SEARCH FOR SYMBOL
    193	000316	103471 				BCS	30$		; IF C/S SYMBOL NOT IN TABLE
    194	000320	010104 				MOV	R1,R4		; SAVE PATH FLAG
    195	000322	116005 	000000G			MOVB	S$YFLG(R0),R5	; SAVE SYMBOL FLAGS
    196	000326	005002 				CLR	R2		; ASSUME DEFINITION NOT FOUND
    197	000330	132705 	000000G			BITB	#SY$DEF,R5	; DEFINITION FOUND?
    198	000334	001416 				BEQ	20$		; IF EQ NO
    199	000336	132705 	000000G			BITB	#SY$IND,R5	; INDIRECT DEFINITION?
    200	000342	001404 				BEQ	10$		; IF EQ NO
    201	000344	016001 	000000G			MOV	S$YVAL(R0),R1	; GET ADDRESS OF REAL ENTRY
    202	000350					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    203	000354				10$:				;
    204	000354	016002 	000000G			MOV	S$YVAL(R0),R2	; GET SYMBOL VALUE
    205	000360	132705 	000000G			BITB	#SY$REL,R5	; RELOCATABLE SYMBOL
    206	000364	001402 				BEQ	20$		; IF EQ NO
    207	000366	066702 	000000G			ADD	$OFFST,R2	; ADD OFFSET BIAS
    208	000372				20$:				;
    209	000372	010267 	177450 			MOV	R2,SYVAL	; SET SYMBOL VALUE
    210	000376	005704 				TST	R4		; FOUND IN CURRENT SEGMENT?
    211	000400	001032 				BNE	27$		; IF NE NO
    212	000402	142705 	000000C			BICB	#^C<SY$ATR!SY$ATL!SY$IND>,R5 ; CLEAR ALL BUT AUTOLOAD FLAGS
    213	000406	150567 	177436 			BISB	R5,SYFLG	; MERGE FLAGS
    214	000412	132705 	000000G			BITB	#SY$IND,R5	; SYMBOL DEFINED IN OTHER SEGMENT?
    215	000416	001423 				BEQ	27$		; IF EQ NO
    216	000420				23$:				;
    217	000420					CALL	@(SP)+		; SEARCH FOR REAL DEFINITION
    218	000422	103004 				BCC	25$		; IF C/C HAVE SYMBOL
    219	000424	142767 	000000G	177416 		BICB	#SY$IND,SYFLG	; CLEAR INDIRECT FLAG
    220	000432	000416 				BR	28$		;
    221	000434				25$:				;
    222	000434	100771 				BMI	23$		; IF MI FOUND ON PATH DOWN
    223	000436	132760 	000000G	000000G		BITB	#SY$IND,S$YFLG(R0) ; INDIRECT DEFINITION?
    224	000444	001365 				BNE	23$		; IF NE NO CONTINUE SEARCH
    225	000446	132760 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R0) ; DEFINITION?
    226	000454	001761 				BEQ	23$		; IF EQ NO
    227	000456	026767 	000000G	000000G		CMP	$CRVSR,$RTSEG	; FOUND IN ROOT SEGMENT?
    228	000464	001755 				BEQ	23$		; IF EQ YES
P5CEL	MACRO M1108  05-DEC-77 23:06  PAGE 3-4


    229	000466				27$:				;
    230	000466	005226 				INC	(SP)+		; CLEAN STACK
    231	000470				28$:				;
    232	000470	012701 	000036'			MOV	#SYM,R1		; POINT TO SYMBOL BUFFER
    233	000474	012702 	000014 			MOV	#DSIZ,R2	; SET RECORD SIZE
    234	000500	000420 				BR	PUTS		; PUT THE RECORD
    235	000502				30$:				;
    236	000502					RETURN			;
    237
    238					;
    239					; BLOCK TYPE 6 - END OF MODULE
    240					;
    241
    242	000504				MODND:				;
    243	000504	005726 				TST	(SP)+		; REMOVE RETURN
    244	000506					RETURN			;
    245
    246
    247					;
    248					; VERSION IDENTIFIER
    249					;
    250
    251	000510				VIDENT:				;
    252	000510					RETURN			;
    253
    254					;
    255					; END GSD
    256					;
    257
    258	000512				ENGSD:				;
    259	000512	000410 				BR	RPEAT		;
    260					;
    261					; ILLEGAL FORMAT-BLOCK TYPE 0
    262					;
    263
    264	000514				ILFMT:				;
    265	000514	016702 	000000G			MOV	$INPPT,R2	; GET INPUT FILE RECORD BLOCK
    266	000520	016202 	000000G			MOV	R$NAME(R2),R2	; GET ADDRESS OF NAME STRING
    267	000524	012701 				MOV	(PC)+,R1	; DIAGNOSTIC
    268	000526	   000G	   000G			.BYTE	E$R14,S$V2	; FATAL-NO RETURN
    269	000530					CALL	$ERMSG		; OUTPUT ERROR MESSAGE
    270
    271
    272
    273					;
    274					; IGNORE REMAINDER OF RECORD
    275					;
    276
    277	000534				RPEAT:				;
    278	000534	005067 	000000G			CLR	$NBYTE		; FORCE READ OF NEXT RECORD
    279	000540					RETURN			;
    280
    281					;
    282					; PUT A CREF RECORD
    283					;
    284
    285	000542				PUTS:				;
P5CEL	MACRO M1108  05-DEC-77 23:06  PAGE 3-5


    286	000542	016700 	000000G			MOV	$CRFPT,R0	; GET ADDRESS OF CREF FDB
    287	000546	010260 	000002 			MOV	R2,F.RSIZ(R0)	; SET MAX RECORD LENGTH
    288	000552					PUT$S	R0,R1,R2	; OUTPUT THE RECORD
    289	000566	103006 				BCC	10$		; IF C/C OUTPUT OK
    290	000570	016002 	000000G			MOV	R$NAME(R0),R2	; GET ADDRESS OF RECORD BLOCK
    291	000574	012701 	000000C			MOV	#<S$V2*400!E$R25>,R1 ; GET ERROR/SEVERITY
    292	000600					CALL	$ERMSG		; FATAL, NO RETURN
    293	000604				10$:				;
    294	000604					RETURN			;
    295
    296					;+
    297					; **-$CRFHD-OUTPUT THE CREF HEADER
    298					;
    299					; THIS SUBROUTINE IS CALLED TO WRITE THE CREF HEADER RECORD
    300					; INTO THE CREF FILE.
    301					;
    302					; INPUTS:
    303					;
    304					;	$BLTIM=CREATION TIME OF TASK
    305					;
    306					; OUTPUTS:
    307					;
    308					;	CREF FILE HEADER RECORD IS WRITTEN
    309					;
    310					;-
    311
    312	000606				$CRFHD::			;
    313	000606	012700 	000000G			MOV	#$BLTIM,R0	; GET TIME OF CREATION
    314	000612	012702 	000006'			MOV	#CRFTIM,R2	; GET ADDRESS TO STORE TIME
    315	000616	012701 	000005 			MOV	#5,R1		; SET WORD COUNT
    316	000622				10$:				;
    317	000622	012022 				MOV	(R0)+,(R2)+	; COPY CREATION TIME
    318	000624					SOB	R1,10$		; ...
    319	000630	012701 	000000'			MOV	#CRFNM,R1	; GET ADDRESS OF HEADER RECORD BUFFER
    320	000634	012702 	000022 			MOV	#HDSIZ,R2	; GET HEADER SIZE
    321	000640	000740 				BR	PUTS		; OUTPUT HEADER
    322
    323		000001 				.END
P5CEL	MACRO M1108  05-DEC-77 23:06  PAGE 3-6
SYMBOL TABLE

B.BBFS= 000010   	FD.TTY= 000004   	F.MBC1= 000055   	NB.SVR= 000010   	S$YM  = ****** GX
B.BFST= 000015   	FD.WBH= 000002   	F.MBFG= 000056   	NB.TYP= 000002   	S$YVAL= ****** GX
B.NXBD= 000012   	FF    = 000014   	F.NRBD= 000024   	NB.VER= 000001   	S.BFHD= 000020
B.VBN = 000004   	FO.APD= 000106   	F.NREC= 000030   	N.DID = 000024   	S.FATT= 000016
CR    = 000015   	FO.MFY= 000002   	F.OVBS= 000030   	N.DVNM= 000032   	S.FDB = 000140
CRFID   000004R  	FO.RD = 000001   	F.RACC= 000016   	N.FID = 000000   	S.FNAM= 000006
CRFLG   000020R  	FO.UPD= 000006   	F.RATT= 000001   	N.FNAM= 000006   	S.FNB = 000036
CRFNM   000000R  	FO.WRT= 000016   	F.RCNM= 000034   	N.FTYP= 000014   	S.FNBW= 000017
CRFTIM  000006R  	F.ALOC= 000040   	F.RCTL= 000017   	N.FVER= 000016   	S.FNTY= 000004
DSIZ  = 000014   	F.BBFS= 000062   	F.RSIZ= 000002   	N.NEXT= 000022   	S.FTYP= 000002
DSPVCT  000116R  	F.BDB = 000070   	F.RTYP= 000000   	N.STAT= 000020   	S.NFEN= 000020
ENGSD   000512R  	F.BGBC= 000057   	F.STBK= 000036   	N.UNIT= 000034   	VIDENT  000510R
E$R14 = ****** GX	F.BKDN= 000026   	F.UNIT= 000136   	PAR$$$= 000000   	VT    = 000013
E$R25 = ****** GX	F.BKDS= 000020   	F.URBD= 000020   	PUTS    000542R  	XFRADR  000260R
FA.APD= 000100   	F.BKEF= 000050   	F.VBN = 000064   	RPEAT   000534R  	$BLTIM= ****** GX
FA.CRE= 000010   	F.BKP1= 000051   	F.VBSZ= 000060   	R$NAME= ****** GX	$CRFHD  000606RG
FA.EXT= 000004   	F.BKST= 000024   	GSDVCT  000220R  	R$$11M= 000000   	$CRFPT= ****** GX
FA.NSP= 000100   	F.BKVB= 000064   	HDSIZ = 000022   	R.FIX = 000001   	$CRSEG= ****** GX
FA.RD = 000001   	F.CNTG= 000034   	HT    = 000011   	R.VAR = 000002   	$CRVSR= ****** GX
FA.SHR= 000040   	F.DFNB= 000046   	ILFMT   000514R  	SCTNME  000254R  	$CVRL = ****** GX
FA.TMP= 000020   	F.DSPT= 000044   	INTSYM  000256R  	SPA   = 000040   	$ERMSG= ****** GX
FA.WRT= 000002   	F.DVNM= 000134   	LCLSYM  000022R  	STGSD   000134R  	$GTBYT= ****** GX
FD.BLK= 000010   	F.EFBK= 000010   	LF    = 000012   	SYFLG   000050R  	$GTWRD= ****** GX
FD.CCL= 000002   	F.EFN = 000050   	LGBLK = 000006   	SYFMT   000051R  	$INPPT= ****** GX
FD.CR = 000002   	F.EOBB= 000032   	LGTYP = 000006   	SYM     000036R  	$NBYTE= ****** GX
FD.DIR= 000010   	F.ERR = 000052   	MODN    000042R  	SYMDCL  000262R  	$OFFST= ****** GX
FD.FTN= 000001   	F.FACC= 000043   	MODND   000504R  	SYVAL   000046R  	$P5CEL  000052RG
FD.INS= 000010   	F.FFBY= 000014   	MODNME  000236R  	SY$ATL= ****** GX	$RTSEG= ****** GX
FD.PLC= 000004   	F.FNAM= 000110   	NB.DEV= 000200   	SY$ATR= ****** GX	$SAVRG= ****** GX
FD.RAH= 000001   	F.FNB = 000102   	NB.DIR= 000100   	SY$DEF= ****** GX	$WSRCS= ****** GX
FD.RAN= 000002   	F.FTYP= 000116   	NB.NAM= 000004   	SY$IND= ****** GX	$$    = 000001
FD.REC= 000001   	F.FVER= 000120   	NB.SD1= 000400   	SY$REL= ****** GX	.PUTSQ= ****** G
FD.RWM= 000001   	F.HIBK= 000004   	NB.SD2= 001000   	S$CNT = ****** GX	...GBL= 000000
FD.SDI= 000020   	F.LUN = 000042   	NB.SNM= 000040   	S$V2  = ****** GX	...TPC= 000140
FD.SQD= 000040   	F.MBCT= 000054   	NB.STP= 000020   	S$YFLG= ****** GX

. ABS.	000000	   000
      	000642	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2309 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:24
[44,10]P5CEL,[44,20]P5CEL/-SP=[44,30]MACFLM.,FCSPR.,P5CEL.000
P5CRF	MACRO M1108  05-DEC-77 23:06  PAGE 3


      1						.TITLE	P5CRF
      2						.IDENT	/00/
      3
      4					;
      5					; COPYRIGHT   1975,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A SINGLE COMPUTER SYSTEM  AND  CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE)  ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE INFORMATION IN  THIS DOCUMENT IS  SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND SHOULD NOT  BE CONSTRUED AS  A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC ASSUMES  NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     17					; OF ITS  SOFTWARE  ON  EQUIPMENT  WHICH IS NOT  SUPPLIED BY DEC.
     18					;
     19					; VERSION 00
     20					;
     21					; C. MONIA 15-JAN-75
     22					;
     23					; PHASE 5 CREF OUTPUT
     24					;
     25					; MACRO LIBRARY CALLS
     26					;
     27
     28						.MCALL	CLOSE$,DIR$,OFNB$W,RQST$,SDAT$
     29
     30					;
     31					; EQUATED SYMBOLS
     32					;
     33
     34
     35		000001 			CRSPL=000001			; CREF SPOOLING FLAG
     36
     37					;
     38					; LOCAL DATA
     39					;
     40					;
     41					; CREF REQUEST DPB
     42					;
     43
     44	000000				CRFRQ:	RQST$	CRF...
     45
     46					;
     47					; CREF SEND DPB
     48					;
     49
     50	000016				CRFSN:	SDAT$	CRF...,SNDBF	;
     51
     52					;
     53					; SEND DATA BUFFER
     54					;
     55
     56	000032				SNDBF:	.BLKW	13.		;
     57
P5CRF	MACRO M1108  05-DEC-77 23:06  PAGE 3-1


     58					;+
     59					; **-$P5CRF-CREATE CREF OUTPUT FILE
     60					;
     61					; THIS SUBROUTINE IS CALLED AFTER THE MAP FILE HAS BEEN OUTPUT
     62					; TO WRITE THE CREF OUTPUT FILE AND INVOKE THE CREF TASK. IF NO CREF WAS
     63					; REQUESTED, THE MAP FILE IS SPOOLED(IF SPECIFIED) AND CLOSED.
     64					;
     65					; INPUTS:
     66					;
     67					;	TABLES CONSTRUCTED IN PHASE 3
     68					;	MAP FILE FDB (FILE MUST BE OPEN)
     69					;
     70					; OUTPUTS:
     71					;
     72					;	IF A CREF FILE IS TO BE PRODUCED, THE APPROPRIATE SUBROUTINES
     73					;	ARE CALLED TO CREATE THE FILE AND THE CREF TASK IS INVOKED.
     74					;	ELSE, THE MAP FILE IS CLOSED AND THE SPOOLER IS REQUESTED.
     75					;
     76					;-
     77
     78	000064				$P5CRF::			;
     79	000064					SAVRG			; SAVE THE NON-VOLATILE REGISTERS
     80	000070	012705 	000000G			MOV	#$SWTCH,R5	; GET ADDRESS OF SWITCH WORD
     81	000074	032715 	000000G			BIT	#MA$PF,(R5)	; MAP FILE SPECIFIED?
     82	000100	001543 				BEQ	50$		; IF EQ NO
     83	000102	032715 	000000G			BIT	#CR$EF,(R5)	; CREF FILE SPECIFIED?
     84	000106	001527 				BEQ	40$		; IF EQ NO
     85	000110	012700 	000032'			MOV	#SNDBF,R0	; GET ADDRESS OF SEND BUFFER
     86	000114	016701 	000000G			MOV	$MAPPT,R1	; GET ADDRESS OF MAP FILE FDB
     87	000120	016120 	000110 			MOV	F.FNB+N.FNAM(R1),(R0)+ ; COPY FILE NAME
     88	000124	016120 	000112 			MOV	F.FNB+N.FNAM+2(R1),(R0)+ ; ...
     89	000130	016120 	000114 			MOV	F.FNB+N.FNAM+4(R1),(R0)+ ; ...
     90	000134	016120 	000116 			MOV	F.FNB+N.FTYP(R1),(R0)+ ; COPY FILE TYPE
     91	000140	016120 	000120 			MOV	F.FNB+N.FVER(R1),(R0)+ ; COPY FILE VERSION
     92	000144	016120 	000126 			MOV	F.FNB+N.DID(R1),(R0)+ ; COPY DIRECTORY I/D
     93	000150	016120 	000130 			MOV	F.FNB+N.DID+2(R1),(R0)+ ; ...
     94	000154	016120 	000132 			MOV	F.FNB+N.DID+4(R1),(R0)+ ; ...
     95	000160	016120 	000134 			MOV	F.FNB+N.DVNM(R1),(R0)+ ; COPY DEVICE NAME
     96	000164	116120 	000136 			MOVB	F.FNB+N.UNIT(R1),(R0)+ ; COPY UNIT NUMBER
     97	000170	105010 				CLRB	(R0)		; CLEAR FLAGS BYTE
     98	000172	032715 	000000G			BIT	#SP$OL,(R5)	; SPOOL OUTPUT?
     99	000176	001002 				BNE	10$		; IF NE NO
    100	000200	152710 	000001 			BISB	#CRSPL,(R0)	; SET SPOOL FLAG
    101	000204				10$:				;
    102	000204	062700 	000003 			ADD	#3,R0		; STEP TO ACTUAL OUTPUT DEV.
    103	000210	016720 	000000G			MOV	$CRODV,(R0)+	; SET SPECIAL CREF OUTPUT DEVICE
    104	000214	116720 	000000G			MOVB	$CROUN,(R0)+	; SET SPECIAL OUTPUT UNIT
    105	000220	105020 				CLRB	(R0)+		; CLEAR FLAGS BYTE
    106	000222					CLOSE$	R1		; CLOSE MAP FILE
    107	000230	103003 				BCC	20$		; IF C/C CLOSED SUCCEEDED
    108	000232	042715 	000000C			BIC	#<MA$PF!CR$EF>,(R5) ; CLEAR MAP, CREF SWITCHES
    109	000236	000464 				BR	50$		; EXIT
    110	000240				20$:				;
    111	000240	016700 	000000G			MOV	$CRFPT,R0	; GET ADDRESS OF CREF FDB
    112	000244	010004 				MOV	R0,R4		; SAVE FDB ADDRESS
    113	000246					CALL	$STRCB		; SETUP CREF RECORD BLOCK
    114	000252					OFNB$W	R4		; OPEN CREF FILE FOR OUTPUT
P5CRF	MACRO M1108  05-DEC-77 23:06  PAGE 3-2


    115	000266	016467 	000120 	177562 		MOV	F.FNB+N.FVER(R4),SNDBF+<10.*2> ; SET CREF VERSION
    116	000274	103011 				BCC	30$		; IF C/C OK
    117	000276	042715 	000000G			BIC	#CR$EF,(R5)	; CLEAR CREF FLAG
    118	000302	016402 	000000G			MOV	R$NAME(R4),R2	; GET ADDRESS OF NAMEBLOCK
    119	000306	012701 	000000C			MOV	#<S$V0*400!E$R11>,R1 ; GET ERROR/SEVERITY
    120	000312					CALL	$ERMSG		; OUTPUT ERROR MESSAGE
    121	000316	000434 				BR	50$		;
    122	000320				30$:				;
    123	000320					CALL	$CRFHD		; OUTPUT THE CREF HEADER RECORD
    124	000324	012700 	000412'			MOV	#P5CRF,R0	; GET PHASE DEPENDANT ROUTINE ADDRESS
    125	000330					CALL	$PCTRL		; CALL PHASE DEPENDANT ROUTINE
    126	000334					CLOSE$	$CRFPT		; CLOSE CREF OUTPUT FILE
    127	000344	103421 				BCS	50$		; IF C/S EXIT NOW
    128	000346					DIR$	#CRFSN		; SEND CREF DATA
    129	000354	103415 				BCS	50$		; IF C/S EXIT NOW
    130	000356					DIR$	#CRFRQ		; REQUEST CREF EXECUTION
    131	000364	000411 				BR	50$		;
    132	000366				40$:				;
    133	000366	016700 	000000G			MOV	$MAPPT,R0	; GET ADDRESS OF MAP FILE FDB
    134	000372	032715 	000000G			BIT	#SP$OL,(R5)	; SPOOL OUTPUT?
    135	000376	001002 				BNE	45$		; IF NE NO
    136	000400					CALL	.PRINT		; SUBMIT MAP FILE FOR PRINTING
    137	000404				45$:				;
    138	000404					CLOSE$	R0		; CLOSE MAP FILE
    139	000410				50$:				;
    140	000410					RETURN			;
    141
    142					;
    143					; OUTPUT THE CREF FILE
    144					;
    145
    146	000412				P5CRF:				;
    147	000412					SAVRG			; SAVE THE NON-VOLATILE REGISTERS
    148	000416	012746 	000000G			MOV	#$STINP,-(SP)	; SET ADDRESS OF FILE SETUP ROUTINE
    149	000422				10$:				;
    150	000422					CALL	@(SP)+		; SETUP NEXT INPUT FILE
    151	000424	103403 				BCS	20$		; IF C/S COMPLETED ALL FILES IN THIS SEGMENT
    152	000426					CALL	$P5CEL		; GENERATE CREF OUTPUT FOR THIS FILE
    153	000432	000773 				BR	10$		; GO AGAIN
    154	000434				20$:				;
    155	000434					RETURN			;
    156
    157
    158		000001 				.END
P5CRF	MACRO M1108  05-DEC-77 23:06  PAGE 3-3
SYMBOL TABLE

BA    = ****** GX	FD.TTY= 000004   	F.FVER= 000120   	NB.TYP= 000002   	S.DATN= 000002
B.BBFS= 000010   	FD.WBH= 000002   	F.HIBK= 000004   	NB.VER= 000001   	S.FATT= 000016
B.BFST= 000015   	FF    = 000014   	F.LUN = 000042   	N.DID = 000024   	S.FDB = 000140
B.NXBD= 000012   	FO.APD= 000106   	F.MBCT= 000054   	N.DVNM= 000032   	S.FNAM= 000006
B.VBN = 000004   	FO.MFY= 000002   	F.MBC1= 000055   	N.FID = 000000   	S.FNB = 000036
CR    = 000015   	FO.RD = 000001   	F.MBFG= 000056   	N.FNAM= 000006   	S.FNBW= 000017
CRFRQ   000000R  	FO.UPD= 000006   	F.NRBD= 000024   	N.FTYP= 000014   	S.FNTY= 000004
CRFSN   000016R  	FO.WRT= 000016   	F.NREC= 000030   	N.FVER= 000016   	S.FTYP= 000002
CRSPL = 000001   	F.ALOC= 000040   	F.OVBS= 000030   	N.NEXT= 000022   	S.NFEN= 000020
CR$EF = ****** GX	F.BBFS= 000062   	F.RACC= 000016   	N.STAT= 000020   	VT    = 000013
E$R11 = ****** GX	F.BDB = 000070   	F.RATT= 000001   	N.UNIT= 000034   	$CRFHD= ****** GX
FA.APD= 000100   	F.BGBC= 000057   	F.RCNM= 000034   	PAR$$$= 000000   	$CRFPT= ****** GX
FA.CRE= 000010   	F.BKDN= 000026   	F.RCTL= 000017   	P5CRF   000412R  	$CRODV= ****** GX
FA.EXT= 000004   	F.BKDS= 000020   	F.RSIZ= 000002   	R$NAME= ****** GX	$CROUN= ****** GX
FA.NSP= 000100   	F.BKEF= 000050   	F.RTYP= 000000   	R$$11M= 000000   	$ERMSG= ****** GX
FA.RD = 000001   	F.BKP1= 000051   	F.STBK= 000036   	R.FIX = 000001   	$MAPPT= ****** GX
FA.SHR= 000040   	F.BKST= 000024   	F.UNIT= 000136   	R.QSGC= 000015   	$PCTRL= ****** GX
FA.TMP= 000020   	F.BKVB= 000064   	F.URBD= 000020   	R.QSPC= 000014   	$P5CEL= ****** GX
FA.WRT= 000002   	F.CNTG= 000034   	F.VBN = 000064   	R.QSPN= 000006   	$P5CRF  000064RG
FD.BLK= 000010   	F.DFNB= 000046   	F.VBSZ= 000060   	R.QSPR= 000012   	$SAVRG= ****** GX
FD.CCL= 000002   	F.DSPT= 000044   	HT    = 000011   	R.QSTN= 000002   	$STINP= ****** GX
FD.CR = 000002   	F.DVNM= 000134   	LF    = 000012   	R.VAR = 000002   	$STRCB= ****** GX
FD.DIR= 000010   	F.EFBK= 000010   	MA$PF = ****** GX	SNDBF   000032R  	$SWTCH= ****** GX
FD.FTN= 000001   	F.EFN = 000050   	NB.DEV= 000200   	SPA   = 000040   	$$    = 000001
FD.INS= 000010   	F.EOBB= 000032   	NB.DIR= 000100   	SP$OL = ****** GX	$$$OST= 000016
FD.PLC= 000004   	F.ERR = 000052   	NB.NAM= 000004   	S$V0  = ****** GX	$$$T1 = 000006
FD.RAH= 000001   	F.FACC= 000043   	NB.SD1= 000400   	S.BFHD= 000020   	.CLOSE= ****** G
FD.RAN= 000002   	F.FFBY= 000014   	NB.SD2= 001000   	S.DABA= 000006   	.OPFNB= ****** G
FD.REC= 000001   	F.FNAM= 000110   	NB.SNM= 000040   	S.DABL= 000012   	.PRINT= ****** GX
FD.RWM= 000001   	F.FNB = 000102   	NB.STP= 000020   	S.DAEF= 000010   	...GBL= 000000
FD.SDI= 000020   	F.FTYP= 000116   	NB.SVR= 000010   	S.DASP= 000014   	...TPC= 000140
FD.SQD= 000040

. ABS.	000000	   000
      	000436	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2862 WORDS  ( 12 PAGES)
DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:00:28
[44,10]P5CRF,[44,20]P5CRF/-SP=[44,30]MACFLM.,FCSPR.,P5CRF.000
P5ELM	MACRO M1108  05-DEC-77 23:07  PAGE 2


      1						.TITLE	P5ELM
      2						.IDENT	/08/                                                           ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     12					;
     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     15					; EQUIPMENT CORPORATION.
     16					;
     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     19					;
     20					; VERSION 08                                                                   ;**NEW**
     21					;                                                                               ;**-1
     22					; D. N. CUTLER/C. MONIA 27-JAN-74
     23					;
     24					;
     25					;
     26					; MODIFICATIONS
     27					;
     28					; NO.		DATE		PROGRAMMER
     29					; ---		----		----------
     30					;
     31					; 004		04-AUG-73	C. MONIA
     32					; 008		16-AUG-73	C.MONIA
     33					;
     34					;
     35					;
     36					;
     37					; PHASE 5 ELEMENT PROCESSING
     38					;
     39					; LOCAL DATA
     40					;
     41
     42	000000				BEGST:	.BLKW	1		;++004 BEGINING OF COMPLEX RELOCATION STACK
     43	000002				CMDBT:	.BLKW	1		;RLD COMMAND BYTE
     44	000004				CRADR:	.BLKW	1		;CURRENT VIRTUAL ADDRESS (MINUS 4)
     45	000006				CRSCT:	.BLKW	10.		; CURRENT CONTROL SECTION DATA                  ;**NEW**
     46	000032				ENDST:	.BLKW	1		;++004 END OF COMPLEX RELOCATION STACK          ;**-1
     47	000034				LCLSYM:	.BLKW	6		;LOCAL SYMBOL DESCRIPTOR
     48
     49					;+
     50					; **-$P5ELM-PHASE 5 ELEMENT PROCESSING
     51					;
     52					; THIS ROUTINE IS CALLED TO PROCESS EACH ELEMENT IN PHASE 5. THE
     53					; ELEMENT IS RELOCATED AND THE TASK IMAGE IS WRITTEN.
     54					;
     55					; INPUTS:
     56					;
     57					;	$CRELM=ADDRESS OF CURRENT ELEMENT DESCRIPTOR.
P5ELM	MACRO M1108  05-DEC-77 23:07  PAGE 2-1


     58					;	$CRSEG=ADDRESS OF CURRENT SEGMENT DESCRIPTOR.
     59					;
     60					; OUTPUTS:
     61					;
     62					;	NONE.
     63					;-
     64
     65	000050				$P5ELM::SAVRG			;SAVE NONVOLITILE REGISTERS
     66	000054	016701 	000000G			MOV	$ASCT,R1	; GET VIRTUAL ADDRESS OF CURRENT SECTION        ;**NEW**
     67	000060					CALL	$CVRL		; CONVERT TO REAL ADDRESS                       ;**NEW**
     68	000064	010001 				MOV	R0,R1		; COPY REAL ADDRESS                             ;**NEW**
     69	000066					CALL	CPYSCT		; COPY SECTION DATA                             ;**NEW**
     70	000072	016700 	000000G			MOV	$CRVSG,R0	; GET VIRTUAL ADDRESS OF CURRENT SEGMENT        ;**-1
     71	000076					CALL	$ADRST		;SET ADDRESS LIMITS
     72	000102				10$:	CALL	$GTBYT		;GET RECORD LENGTH
     73	000106	103410 				BCS	20$		;IF CS EOF (ILL FORMAT)
     74	000110	010003 				MOV	R0,R3		;SAVE RECORD LENGTH
     75	000112					CALL	$GTWRD		;GET BLOCK TYPE
     76	000116	162703 	000002 			SUB	#2,R3		;ADJUST BYTE COUNT
     77	000122	020027 	000006 			CMP	R0,#LGBLK	;LEGAL BLOCK TYPE?
     78	000126	101401 				BLOS	30$		;IF LOS YES
     79	000130	005000 			20$:	CLR	R0		;SET ZERO BLOCK TYPE
     80	000132	006300 			30$:	ASL	R0		;MAKE WORD INDEX
     81	000134					CALL	@DSPVCT(R0)	;CALL BLOCK DEPENDENT ROUTINE
     82	000140	000760 				BR	10$		;GO AGAIN
     83
     84					;
     85					; DISPATCH VECTOR
     86					;
     87
     88	000142	001652'			DSPVCT:	.WORD	ILFMT		;BLK 0-ILLEGAL BLOCK TYPE
     89	000144	000362'				.WORD	RPEAT		; BLK 1-START GSD
     90	000146	000362'				.WORD	RPEAT		; BLK 2-END GSD
     91	000150	000160'				.WORD	TXT		;BLK 3-TXT
     92	000152	000262'				.WORD	RLD		;BLK 4-RLD
     93	000154	000362'				.WORD	RPEAT		;BLK 5-ISD
     94	000156	002030'				.WORD	MODND		;BLK 6-MODULE END
     95		000006 			LGBLK=<.-DSPVCT-2>/2		;HIGHEST LEGAL BLOCK TYPE
     96
     97					;
     98					; TXT-BLOCK TYPE 3
     99					;
    100
    101	000160	032767 	000000G	000000G	TXT:	BIT	#TS$KF,$SWTCH	;TASK IMAGE FILE SPECIFIED?
    102	000166	001475 				BEQ	RPEAT		;IF EQ NO
    103	000170					CALL	$GTWRD		;GET LOAD ADDRESS
    104	000174	162703 	000002 			SUB	#2,R3		;ADJUST BYTE COUNT
    105	000200	012702 	000006'			MOV	#CRSCT,R2	; GET ADDRESS OF CURRENT SECTION                ;**NEW**
    106	000204	132762 	000000G	000000G		BITB	#CS$REL,C$SFLG(R2);ABS SECTION?                                 ;**-1
    107	000212	001404 				BEQ	10$		;IF EQ YES
    108	000214	066200 	000000G			ADD	C$SCUR(R2),R0	;ADD CURRENT SECTOR BASE
    109	000220	066700 	000000G			ADD	$OFFST,R0	;ADD OFFSET BIAS
    110	000224	010004 			10$:	MOV	R0,R4		;SAVE LOAD ADDRESS
    111	000226	162700 	000004 			SUB	#4,R0		;BIAS FOR DISPLACEMENT BYTES
    112	000232	010067 	177546 			MOV	R0,CRADR	;STORE AS CURRENT VIRTUAL ADDRESS
    113	000236				20$:	CALL	$GTBYT		;GET NEXT BYTE
    114	000242	010001 				MOV	R0,R1		;TEXT BYTE TO R1
P5ELM	MACRO M1108  05-DEC-77 23:07  PAGE 2-2


    115	000244	010400 				MOV	R4,R0		;VIRTUAL ADDRESS TO R0
    116	000246					CALL	$WRBYT		;WRITE BYTE INTO IMAGE FILE
    117	000252	005204 				INC	R4		;INCREMENT VIRTUAL ADDRESS
    118	000254					SOB	R3,20$		;REPEAT
    119	000260					RETURN			;
    120
    121					;
    122					; RLD-BLOCK TYPE 4
    123					;
    124
    125	000262	032767 	000000G	000000G	RLD:	BIT	#TS$KF,$SWTCH	;TASK IMAGE FILE SPECIFIED?
    126	000270	001434 				BEQ	RPEAT		;IF EQ NO
    127	000272				10$:	CALL	$GTBYT		;GET COMMAND BYTE
    128	000276	010067 	177500 			MOV	R0,CMDBT	;SAVE COMMAND BYTE
    129	000302					CALL	$GTBYT		;GET DISPLACEMENT BYTE
    130	000306	162703 	000002 			SUB	#2,R3		;ADJUST BYTE COUNT
    131	000312	010004 				MOV	R0,R4		;SAVE DISPLACEMENT BYTE
    132	000314	066704 	177464 			ADD	CRADR,R4	;CALCULATE VIRTUAL ADDRESS
    133	000320	016700 	177456 			MOV	CMDBT,R0	;RETRIEVE COMMAND BYTE
    134	000324	042700 	177600 			BIC	#177600,R0	;CLEAR GARBAGE BITS
    135	000330	020027 	000017 			CMP	R0,#LGCMD	;LEGAL COMMAND?
    136	000334	101010 				BHI	20$		;IF HI NO
    137	000336	006300 				ASL	R0		;MAKE WORD INDEX
    138	000340	012705 	000006'			MOV	#CRSCT,R5	; GET ADDRESS OF CURRENT SECTION DATA           ;**NEW**
    139	000344					CALL	@RLDVCT(R0)	;DISPATCH TO RELOCATION ROUTINE                 ;**-1
    140	000350	005703 				TST	R3		;ANY MORE TO PROCESS?
    141	000352	003347 				BGT	10$		;IF GT YES
    142	000354					RETURN			;
    143	000356	000167 	001270 		20$:	JMP	ILFMT		;
    144
    145					;
    146					; RPEAT-BLOCK TYPE 5
    147					;
    148
    149	000362	005067 	000000G		RPEAT:	CLR	$NBYTE		;CLEAR BYTE COUNT
    150	000366					RETURN			;
    151
    152					;
    153					; RLD DISPATCH VECTOR
    154					;
    155
    156	000370	001652'			RLDVCT:	.WORD	ILFMT		;ILLEGAL FORMAT
    157	000372	000430'				.WORD	INTREL		;INTERNAL RELOCATION
    158	000374	000446'				.WORD	GBLREL		;GLOBAL RELOCATION
    159	000376	000454'				.WORD	INTDIS		;INTERNAL DISPLACED RELOCATION
    160	000400	000470'				.WORD	GBLDIS		;GLOBAL DISPLACED RELOCATION
    161	000402	000504'				.WORD	GBLADD		;GLOBAL ADDITIVE RELOCATION
    162	000404	000522'				.WORD	GADDIS		;GLOBAL ADDITIVE DISPLACED RELOCATION
    163	000406	000724'				.WORD	LOCDEF		;LOCATION COUNTER DEFINITION
    164	000410	000770'				.WORD	LOCMOD		;LOCATION COUNTER MODIFICATION
    165	000412	001032'				.WORD	LIMIT		;LIMIT DIRECTIVE
    166	000414	000546'				.WORD	SECREL		;SECTOR RELOCATION
    167	000416	001652'				.WORD	ILFMT		;ILLEGAL FORMAT
    168	000420	000554'				.WORD	SCRDIS		;SECTOR DISPLACED RELOCATION
    169	000422	000570'				.WORD	SECADD		;SECTOR ADDITIVE RELOCATION
    170	000424	000606'				.WORD	SECDIS		;SECTOR ADDITIVE DISPLACED RELOCATION
    171	000426	001072'				.WORD	CPLREL		;++004 COMPLEX RELOCATION
P5ELM	MACRO M1108  05-DEC-77 23:07  PAGE 2-3


    172		000017 			LGCMD=<.-RLDVCT-2>/2		;HIGHEST LEGAL RLD TYPE
    173
    174					;
    175					; INTERNAL RELOCATION
    176					;
    177
    178	000430				INTREL:	CALL	$GTWRD		;GET CONSTANT
    179	000434	066500 	000000G			ADD	C$SCUR(R5),R0	;ADD CURRENT SECTOR BASE
    180	000440	066700 	000000G			ADD	$OFFST,R0	;ADD OFFSET BIAS
    181	000444	000472 				BR	ADJCNT		;
    182
    183					;
    184					; GLOBAL RELOCATION
    185					;
    186
    187	000446				GBLREL:	CALL	GTSVL		;GET SYMBOL VALUE
    188	000452	000471 				BR	IMGOUT		;
    189
    190					;
    191					; INTERNAL DISPLACED RELOCATION
    192					;
    193
    194	000454				INTDIS:	CALL	$GTWRD		;GET CONSTANT
    195	000460	160400 				SUB	R4,R0		;CALCULATE DISPLACEMENT
    196	000462	162700 	000002 			SUB	#2,R0		;
    197	000466	000461 				BR	ADJCNT		;
    198
    199					;
    200					; GLOBAL DISPLACED RELOCATION
    201					;
    202
    203	000470				GBLDIS:	CALL	GTSVL		;GET SYMBOL VALUE
    204	000474	160400 				SUB	R4,R0		;CALCULATE DISPLACEMENT
    205	000476	162700 	000002 			SUB	#2,R0		;
    206	000502	000455 				BR	IMGOUT		;
    207
    208					;
    209					; GLOBAL ADDITIVE RELOCATION
    210					;
    211
    212	000504				GBLADD:	CALL	GTSVL		;GET SYMBOL VALUE
    213	000510	010046 				MOV	R0,-(SP)	;SAVE VALUE
    214	000512					CALL	$GTWRD		;GET ADDITIVE CONSTANT
    215	000516	062600 				ADD	(SP)+,R0	;ADD CONSTANT
    216	000520	000444 				BR	ADJCNT		;
    217
    218					;
    219					; GLOBAL ADDITIVE DISPLACED RELOCATION
    220					;
    221
    222	000522				GADDIS:	CALL	GTSVL		;GET SYMBOL VALUE
    223	000526	010046 				MOV	R0,-(SP)	;SAVE VALUE
    224	000530					CALL	$GTWRD		;GET CONSTANT
    225	000534	062600 				ADD	(SP)+,R0	;ADD CONSTANT
    226	000536	160400 				SUB	R4,R0		;CALCULATE DISPLACEMENT
    227	000540	162700 	000002 			SUB	#2,R0		;
    228	000544	000432 				BR	ADJCNT		;
P5ELM	MACRO M1108  05-DEC-77 23:07  PAGE 2-4


    229
    230					;
    231					; SECTOR RELOCATION
    232					;
    233
    234	000546				SECREL:	CALL	GTCVL		;GET CURRENT SECTOR BASE
    235	000552	000431 				BR	IMGOUT		;
    236
    237					;
    238					; SECTOR DISPLACED RELOCATION
    239					;
    240
    241	000554				SCRDIS:	CALL	GTCVL		;GET CURRENT SECTOR BASE
    242	000560	160400 				SUB	R4,R0		;CALCULATE DISPLACEMENT
    243	000562	162700 	000002 			SUB	#2,R0		;
    244	000566	000423 				BR	IMGOUT		;
    245
    246					;
    247					; SECTOR ADDITIVE RELOCATION
    248					;
    249
    250	000570				SECADD:	CALL	GTCVL		;GET CURRENT SECTOR BASE VALUE
    251	000574	010046 				MOV	R0,-(SP)	;SAVE VALUE
    252	000576					CALL	$GTWRD		;GET ADDITIVE CONSTANT
    253	000602	062600 				ADD	(SP)+,R0	;ADD CONSTANT
    254	000604	000412 				BR	ADJCNT		;
    255
    256					;
    257					; SECTOR ADDITIVE DISPLACED RELOCATION
    258					;
    259
    260	000606				SECDIS:	CALL	GTCVL		;GET CURRENT SECTOR BASE VALUE
    261	000612	010046 				MOV	R0,-(SP)	;SAVE VALUE
    262	000614					CALL	$GTWRD		;GET ADDITIVE CONSTANT
    263	000620	062600 				ADD	(SP)+,R0	;ADD CONSTANT
    264	000622	160400 				SUB	R4,R0		;CALCULATE DISPLACEMENT
    265	000624	162700 	000002 			SUB	#2,R0		;
    266	000630	000400 				BR	ADJCNT		;
    267
    268
    269					;
    270					; ADJUST BYTE COUNT
    271					;
    272
    273	000632	162703 	000002 		ADJCNT:	SUB	#2,R3		;ADJUST BY ONE WORD
    274
    275					;
    276					; IMAGE OUTPUT
    277					;
    278
    279	000636	012746 	000000G		IMGOUT:	MOV	#$WRWRD,-(SP)	;ASSUME WORD WRITE
    280	000642	032767 	000200 	177132 		BIT	#200,CMDBT	;BYTE COMMAND?
    281	000650	001422 				BEQ	10$		;IF EQ NO
    282	000652	012716 	000000G			MOV	#$WRBYT,(SP)	;SET FOR BYTE WRITE
    283	000656	032700 	177400 			BIT	#177400,R0	;TOP BYTE ZERO?
    284	000662	001415 				BEQ	10$		;IF EQ YES BYPASS TEST
    285	000664	110002 				MOVB	R0,R2		;COPY BYTE
P5ELM	MACRO M1108  05-DEC-77 23:07  PAGE 2-5


    286	000666	020002 				CMP	R0,R2		;IDENTICAL RESULT?
    287	000670	001412 				BEQ	10$		;IF EQ YES
    288	000672	010046 				MOV	R0,-(SP)	;SAVE OUTPUT VALUE
    289	000674	016702 	000000G			MOV	$CRELM,R2	;GET ADDRESS OF ELEMENT DESCRIPTOR
    290	000700	062702 	000000G			ADD	#E$LMOD,R2	;POINT TO MODULE NAME
    291	000704	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
    292	000706	   000G	   000G			.BYTE	E$R27,S$V0	;DIAGNOSTIC
    293	000710					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    294	000714	012600 				MOV	(SP)+,R0	;RESTORE R0
    295	000716	010001 			10$:	MOV	R0,R1		;OUTPUT VALUE TO R1
    296	000720	010400 				MOV	R4,R0		;VIRTUAL ADDRESS TO R0
    297	000722					CALLR	@(SP)+		;++004 OUTPUT TEXT - EXIT
    298
    299					;
    300					; LOCATION COUNTER DEFINITION
    301					;
    302
    303	000724				LOCDEF:	CALL	GTCVL		;GET CURRENT SECTOR BASE AND ADDR
    304	000730					CALL	CPYSCT		; COPY SECTION DATA                             ;**NEW**
    305	000734	010046 				MOV	R0,-(SP)	;SAVE CURRENT BASE ADDRESS                      ;**-1
    306	000736	010200 				MOV	R2,R0		;SET SEGMENT ADDRESS
    307	000740					CALL	$ADRST		;SET ADDRESS LIMITS
    308	000744					CALL	$GTWRD		;GET OFFSET VALUE
    309	000750	162703 	000002 			SUB	#2,R3		;ADJUST BYTE COUNT
    310	000754	062600 				ADD	(SP)+,R0	;ADD IN CURRENT BASE ADDRESS
    311	000756	162700 	000004 			SUB	#4,R0		;BACK UP FOR DISPLACEMENT BYTE
    312	000762	010067 	177016 			MOV	R0,CRADR	;SET CURRENT VIRTUAL ADDRESS
    313	000766					RETURN			;
    314
    315					;
    316					; LOCATION COUNTER MODIFICATION
    317					;
    318
    319	000770				LOCMOD:	CALL	$GTWRD		;GET OFFSET CONSTANT
    320	000774	162703 	000002 			SUB	#2,R3		;ADJUST BYTE COUNT
    321	001000	132765 	000000G	000000G		BITB	#CS$REL,C$SFLG(R5);ABS SECTION?
    322	001006	001404 				BEQ	10$		;IF EQ YES
    323	001010	066500 	000000G			ADD	C$SCUR(R5),R0	;ADD CURRENT SECTION BASE
    324	001014	066700 	000000G			ADD	$OFFST,R0	;ADD OFFSET BIAS
    325	001020	162700 	000004 		10$:	SUB	#4,R0		;BACK UP FOR DISPLACEMENT BYTE
    326	001024	010067 	176754 			MOV	R0,CRADR	;SET CURRENT VIRTUAL ADDRESS
    327	001030					RETURN			;
    328
    329					;
    330					; LIMIT
    331					;
    332
    333	001032	016701 	000000G		LIMIT:	MOV	$OFFST,R1	;GET LOWEST VIRTUAL ADDRESS
    334
    335						.IF	DF	R$$11M
    336
    337	001036	066701 	000000G			ADD	$HDSIZ,R1	; OFSET PAST HEADER
    338
    339						.ENDC
    340
    341	001042	010400 				MOV	R4,R0		;SET VIRTUAL ADDRESS
    342	001044					CALL	$WRWRD		;WRITE FIRST WORD
P5ELM	MACRO M1108  05-DEC-77 23:07  PAGE 2-6


    343	001050	016701 	000000G			MOV	$HVRTL,R1	;GET HIGHEST VIRTUAL ADDRESS
    344	001054	066701 	000000G			ADD	$OFFST,R1	;ADD IN OFFSET BIAS
    345	001060	010400 				MOV	R4,R0		;SET VIRTUAL ADDRESS
    346	001062	062700 	000002 			ADD	#2,R0		;ADJUST TO NEXT WORD
    347	001066					CALLR	$WRWRD		;++004 WRITE SECOND WORD
    348
    349
    350					;
    351					;++004 COMPLEX RELOCATION STRING PROCESSING
    352					;
    353
    354	001072				CPLREL:
    355	001072	024646 				CMP	-(SP),-(SP)	;++004 ALLOCATE GUARD WORDS FROM STACK
    356	001074	010602 				MOV	SP,R2		;++004 MARK BOTTOM OF STACK
    357	001076	010267 	176676 			MOV	R2,BEGST	;++004 SAVE BOTTOM
    358	001102	162706 	000060 			SUB	#48.,SP		;++004 ALLOCATE STACK SPACE
    359	001106	010667 	176720 			MOV	SP,ENDST	;++004 MARK TOP OF STACK
    360	001112				10$:
    361	001112					CALL	$GTBYT		;++004 COMAND BYTE => R0
    362	001116	005303 				DEC	R3		;++004 DECREMENT BYTE COUNT
    363	001120	020027 	000020 			CMP	R0,#LGCPL	;++004 LEGAL COMMAND TYPE?
    364	001124	101005 				BHI	30$		;++004 NO -- BAD FORMAT
    365	001126	006300 				ASL	R0		;++004 CONVERT TO WORD OFFSET
    366	001130					CALL	@CPLVCT(R0)	;++004 CALL PROCESSING ROUTINE
    367	001134	005703 				TST	R3		;++004 CHECK BYTE COUNT
    368	001136	003365 				BGT	10$		;++004 OK -- GO AGAIN
    369	001140				30$:
    370	001140	000167 	000506 			JMP	ILFMT		;++004 BAD COUNT
    371
    372	001144				CPLVCT:				;++004 COMPLEX RELOCATION PROCESSING VECTOR
    373	001144	001206'				.WORD	CPLNOP		;++004 NOP
    374	001146	001212'				.WORD	CPLADD		;++004 ADD
    375	001150	001210'				.WORD	CPLSUB		;++004 SUBTRACT
    376	001152	001246'				.WORD	CPLMUL		;++004 MULTIPLY
    377	001154	001254'				.WORD	CPLDIV		;++004 DIVIDE
    378	001156	001224'				.WORD	CPLAND		;++004 'AND'
    379	001160	001242'				.WORD	CPLOR		;++004 'OR'
    380	001162	001232'				.WORD	CPLXOR		;++004 'XOR'
    381	001164	001216'				.WORD	CPLNEG		;++004 NEGATE
    382	001166	001220'				.WORD	CPLCOM		;++004 COMPLEMENT
    383	001170	001476'				.WORD	CPLSTO		;++004 STORE
    384	001172	001470'				.WORD	CPLSTD		;++004 STORE DISPLACED
    385	001174	001652'				.WORD	ILFMT		;++004 ILLEGAL FORMAT
    386	001176	001652'				.WORD	ILFMT		;++004 ILLEGAL FORMAT
    387	001200	001402'				.WORD	CPLPGB		;++004 PUSH GLOBAL
    388	001202	001410'				.WORD	CPLPRL		;++004 PUSH RELOCATABLE VALUE
    389	001204	001376'				.WORD	CPLPC		;++004 PUSH CONSTANT
    390		000020 			LGCPL=<.-CPLVCT>/2-1
P5ELM	MACRO M1108  05-DEC-77 23:07  PAGE 3


    392
    393					;
    394					;++004  COMPLEX RELOCATION -- 'NOP'
    395					;
    396
    397	001206				CPLNOP:	RETURN
    398
    399					;
    400					;++004  SUBTRACT (SP)+,(SP)
    401					;
    402
    403	001210	005412 			CPLSUB:	NEG	@R2		;++004 NEGATE TOP ITEM ON STACK
    404
    405					;
    406					;++004  ADD (SP)+,(SP)
    407					;
    408
    409	001212	062212 			CPLADD:	ADD	(R2)+,(R2)	;++004 ADD TOP TWO ITEMS
    410	001214	000462 				BR	CPLRTN		;++004 CHECK STACK, EXIT
    411
    412					;
    413					;++004  COMPLEX NEGATE -'(SP)'
    414					;
    415
    416	001216				CPLNEG:				;++004 DECREMENT TOP ITEM
    417	001216	005312 				DEC	@R2
    418
    419					;
    420					;++004  COMPLEX COMPLEMENT :(SP)
    421					;
    422
    423	001220				CPLCOM:
    424	001220	005112 				COM	@R2		;++004 COMPLEMENT TOP ITEM
    425	001222					RETURN			;++004 EXIT
    426
    427					;
    428					;++004  COMPLEX 'AND' (SP)+,(SP)
    429					;
    430
    431	001224				CPLAND:
    432	001224	005112 				COM	(R2)		;++004 COMPLEMENT TOP ITEM
    433	001226	042212 				BIC	(R2)+,(R2)	;++004 'AND' BOTH ITEMS
    434	001230	000454 				BR	CPLRTN		;++004 EXIT
    435
    436					;
    437					;++004 EXCLUSIVE OR (SP)+,(SP)
    438					;
    439
    440	001232				CPLXOR:
    441	001232	016201 	000002 			MOV	2(R2),R1	;++004 FETCH SECOND ITEM
    442	001236	042212 				BIC	(R2)+,(R2)	;++004 CLEAR BITS SET IN BOTH -- SECOND ITEM
    443	001240	040142 				BIC	R1,-(R2)	;++004 DITTO FIRST ITEM
    444
    445					;
    446					;++004  COMPLEX 'OR' (SP)+,(SP)
    447					;
    448
P5ELM	MACRO M1108  05-DEC-77 23:07  PAGE 3-1


    449	001242				CPLOR:
    450	001242	052212 				BIS	(R2)+,(R2)	;++004 'OR' BOTH ITEMS.
    451	001244	000446 				BR	CPLRTN		;++004 EXIT
    452
    453					;
    454					;++004 COMPLEX MULTIPLY (SP)+,(SP)
    455					;
    456
    457	001246				CPLMUL:
    458						.IF	NDF	V1145
    459	001246	012746 	002130'			MOV	#MUL1,-(SP)	;++004 SET ADDRESS OF COMP. ROUTINE
    460	001252	000421 				BR	SGNOP		;++004 EXECUTE SIGNED ARITHMETIC
    461						.IFF
    462						MOV	(R2)+,R1	;++004 GET TOP ITEM - REGISTER MUST BE ODD
    463						MUL	(R2)+,R1	;++004 MULTIPLY TOP TWO ITEMS
    464						MOV	R1,-(R2)	;++004 STORE RESULT
    465						BR	CPLRTN		;++004 EXIT
    466						.ENDC
    467
    468					;
    469					;++004  COMPLEX DIVIDE (SP)+,(SP)
    470					;
    471
    472	001254				CPLDIV:
    473						.IF	DF	V1145
    474						MOV	2(R2),R1	;++004 FETCH LOW PART
    475						SXT	R0		;++004 EXTEND SIGN
    476						DIV	(R2)+,R0	;++004 DIVIDE EM UP
    477						BVC	SGNEX		;++004 OK - DIVISOR NOT ZERO
    478						.IFF
    479	001254	005722 				TST	(R2)+		;++004 VERIFY DIVISOR .NE. 0
    480	001256	001014 				BNE	10$		;++004 OK -- PROCEED
    481					;
    482						.IFTF
    483	001260	010246 				MOV	R2,-(SP)	;++004 SAVE 'STACK POINTER'
    484	001262	016702 	000000G			MOV	$CRELM,R2	;++004 FETCH ADDRESS OF CURRENT ELEMENT
    485	001266	062702 	000000G			ADD	#E$LMOD,R2	;++004 POINT TO MODULE NAME
    486	001272	012701 				MOV	(PC)+,R1	;++004 ERROR/SEVERITY
    487	001274	   000G	   000G			.BYTE	E$R72,S$V0	;++004 DIAGNOSTIC
    488	001276					CALL	$ERMSG		;++004 REPORT ERROR
    489	001302	012602 				MOV	(SP)+,R2	;++004 RESTORE 'STACK POINTER'
    490	001304	005012 				CLR	(R2)		;++004 FORCE RESULT OF 0
    491	001306	000425 				BR	CPLRTN		;++004 EXIT
    492						.IFF
    493	001310				10$:
    494	001310	005742 				TST	-(R2)		;++004 POINT TO FIRST ITEM
    495	001312	012746 	000000G			MOV	#$DIV,-(SP)	;++004 SET ADDRESS OF ARITH. ROUTINE
    496	001316				SGNOP:
    497	001316	011201 				MOV	(R2),R1		;++004 FETCH TOP ITEM
    498	001320	100001 				BPL	10$		;++004 SEE IF POSITIVE
    499	001322	005401 				NEG	R1		;++004 GET ABS. VALUE
    500	001324				10$:
    501	001324	016200 	000002 			MOV	2(R2),R0	;++004 FETCH SECOND ITEM
    502	001330	100002 				BPL	20$		;++004 GET ABS VALUE
    503	001332	005400 				NEG	R0		;++004
    504	001334	005112 				COM	(R2)		;++004 SIGN .NE. 0 -- SO EFFECTIVE 'XOR'
    505	001336				20$:
P5ELM	MACRO M1108  05-DEC-77 23:07  PAGE 3-2


    506	001336					CALL	@(SP)+		;++004 CALL ARITHMETIC ROUTINE
    507	001340	005722 				TST	(R2)+		;++004 CHECK SIGN OF RESULT
    508	001342	100001 				BPL	SGNEX		;++004 OK AS IS -- EXIT
    509	001344	005400 				NEG	R0		;++004 SIGNS WERE DIFFERENT - NEGATE
    510						.ENDC
    511	001346				SGNEX:
    512	001346	010012 				MOV	R0,(R2)		;++004 REPLACE TOP ITEM WITH RESULT
    513	001350	000404 				BR	CPLRTN		;++004 CHECK STACK, EXIT
    514
    515					;
    516					;++004  CHECK FOR STACK OVERFLOW/UNDERFLOW
    517					;
    518
    519	001352				CPLRT1:
    520	001352	020267 	176454 			CMP	R2,ENDST	;++004 SEE IF 'PUSH' CAUSED OVERFLOW
    521	001356	101404 				BLOS	CPLERX		;++004 YES - ERROR
    522	001360					RETURN			;++004 NO, EXIT
    523	001362				CPLRTN:
    524	001362	020267 	176412 			CMP	R2,BEGST	;++004 CHECK STACK POINTER VS. START
    525	001366	103402 				BLO	CPLEXT		;++004 IF .LO. -OK
    526	001370	000167 	000256 		CPLERX:	JMP	ILFMT		;++004 ELSE ERROR
    527	001374				CPLEXT:	RETURN			;++004 EXIT
    528
    529					;
    530					;++004 PUSH CONSTANT
    531					;
    532
    533	001376				CPLPC:
    534	001376	005001 				CLR	R1		;++004 CLEAR RELOCATION BASE
    535	001400	000424 				BR	CPLGTV		;++004 GET CONSTANT - PUSH ON STACK
    536
    537					;
    538					;++004  PUSH GLOBAL SYMBOL
    539					;
    540
    541	001402				CPLPGB:
    542	001402					CALL	GTSVL		;++004 GET SYMBOL VALUE IN R0
    543	001406	000426 				BR	CPLPSH		;++004 PUSH SYMBOL VALUE
    544
    545					;
    546					;++004  PUSH RELOCATABLE VALUE
    547					;
    548
    549	001410				CPLPRL:
    550	001410					CALL	$GTBYT		;++004 GET SECTION NUMBER
    551	001414	005303 				DEC	R3		;++004 DECREMENT BYTE COUNT
    552	001416	016701 	000000G			MOV	$CRELM,R1	;++004 GRAB ADDRESS OF CURRENT ELEMENT
    553	001422	020061 	000000G			CMP	R0,E$LNUM(R1)	;++004 SEE IF SECTOR NO. OK
    554	001426	101360 				BHI	CPLERX		;++004 NO - ERROR
    555	001430	016101 	000000G			MOV	E$LCMT(R1),R1	;++004 GET MAPPING TABLE ADDRESS
    556	001434	006300 				ASL	R0		;++004 CONVERT SECTION NO. TO TWO-WORD INDEX
    557	001436	006300 				ASL	R0		;++004
    558	001440	060001 				ADD	R0,R1		;++004 GET ENTRY IN TABLE
    559	001442	011101 				MOV	(R1),R1		; GET VIRTUAL ADDRESS OF SECTION                ;**NEW**
    560	001444					CALL	GTCVL2		;++004 GET RELOCATION BASE IN R0                ;**-1
    561	001450	010001 				MOV	R0,R1		;++004 SAVE
    562	001452				CPLGTV:
P5ELM	MACRO M1108  05-DEC-77 23:07  PAGE 3-3


    563	001452					CALL	$GTWRD		;++004 GET OFFSET WITHIN SECTION
    564	001456	162703 	000002 			SUB	#2,R3		;++004 BOOKEEP THE BYTE COUNT
    565	001462	060100 				ADD	R1,R0		;++004 RELOCATE OFFSET
    566	001464				CPLPSH:
    567	001464	010042 				MOV	R0,-(R2)	;++004 PUSH RESULT
    568	001466	000731 				BR	CPLRT1		;++004 EXIT
    569
    570					;
    571					;++004  COMPLEX STORE - DISPLACED
    572					;
    573					;++004  THIS OPERATION TERMINATES A COMPLEX RELOCATION STRING
    574					;
    575
    576	001470				CPLSTD:
    577	001470	160412 				SUB	R4,@R2		;++004 SUBTRACT VIRTUAL ADDRESS
    578	001472	162712 	000002 			SUB	#2,@R2		;++004 OFFSET FOR PC
    579					;
    580					;++004  COMPLEX STORE- NOT DISPLACED
    581					;
    582					;++004  THIS OPERATION TERMINATES A COMPLEX RELOCATION STRING
    583					;
    584	001476	012200 			CPLSTO:	MOV	(R2)+,R0	;++004 FETCH DATA TO BE STORED
    585	001500	020267 	176274 			CMP	R2,BEGST	;++004 CHECK STACK
    586	001504	001331 				BNE	CPLERX		;++004 ERROR IF NOT AT BEGINNING
    587	001506				10$:
    588	001506	010206 				MOV	R2,SP		;++004 RESTORE STACK
    589	001510	022626 				CMP	(SP)+,(SP)+ 	;+004 FIX STACK
    590	001512					CALLR	IMGOUT		;++004 OUTPUT TASK IMAGE DATA
    591					                                                                                ;**NEW**
    592					;                                                                               ;**NEW**
    593					; COPY SECTION DATA TO LOCAL STORAGE                                            ;**NEW**
    594					;                                                                               ;**NEW**
    595					                                                                                ;**NEW**
    596	001516				CPYSCT:				;                                               ;**NEW**
    597	001516					SAVVR			; SAVE VOLATILE REGISTERS                       ;**NEW**
    598	001522	012700 	000006'			MOV	#CRSCT,R0	; GET BLOCK TO STORE SECTION DATA               ;**NEW**
    599	001526	012702 	000000C			MOV	#C$SLGH/2,R2	; GET WORD COUNT FOR ENTRY                      ;**NEW**
    600	001532				10$:				;                                               ;**NEW**
    601	001532	012120 				MOV	(R1)+,(R0)+	; COPY ENTRY                                    ;**NEW**
    602	001534					SOB	R2,10$		;                                               ;**NEW**
    603	001540					RETURN			;                                               ;**NEW**
    604					                                                                                ;**NEW**
    605					;
    606					; GET SECTION ENTRY ADDRESS AND CURRENT BASE
    607					;
    608
    609	001542				GTCVL:	CALL	GTSYM		;GET SECTION NAME
    610	001546	062700 	000000G			ADD	#S$GCST,R0	;POINT TO SECTION TABLE HEADER
    611	001552					CALL	$SRCH		;SEARCH FOR SECTION
    612	001556	103435 				BCS	ILFMT		;IF CS ILLEGAL FORMAT
    613	001560	016702 	000000G			MOV	$CRVSG,R2	; ASSUME CURRENT SEGMENT
    614	001564	132760 	000000G	000000G		BITB	#CS$IND,C$SFLG(R0);INDIRECT REFERENCE?
    615	001572	001410 				BEQ	GTCVL3		; IF EQ NO                                      ;**NEW**
    616	001574	016002 	000000G			MOV	C$SLTH(R0),R2	;GET ADDRESS OF REAL SEGMENT                    ;**-1
    617	001600	016001 	000000G			MOV	C$SBSE(R0),R1	; GET VA OF REAL ENTRY                          ;**NEW**
    618	001604				GTCVL2:				;                                               ;**NEW**
    619	001604	010246 				MOV	R2,-(SP)	; SAVE R2                                       ;**NEW**
P5ELM	MACRO M1108  05-DEC-77 23:07  PAGE 3-4


    620	001606					CALL	$CVRL		; CONVERT TO REAL ADDRESS                       ;**NEW**
    621	001612	012602 				MOV	(SP)+,R2	; RESTORE R2                                    ;**NEW**
    622	001614				GTCVL3:				;                                               ;**NEW**
    623	001614	010001 				MOV	R0,R1		; SAVE REAL ADDRESS                             ;**NEW**
    624	001616	016100 	000000G			MOV	C$SCUR(R1),R0	; GET CURRENT BASE                              ;**NEW**
    625	001622	132761 	000000G	000000G		BITB	#CS$LIB,C$SFLG(R1);LIB SECTION?                                 ;**-4
    626	001630	001007 				BNE	20$		;IF NE YES
    627	001632	066700 	000000G			ADD	$OFFST,R0	;ASSUME RELATIVE SECTION
    628	001636	132761 	000000G	000000G		BITB	#CS$REL,C$SFLG(R1);REL SECTION?
    629	001644	001001 				BNE	20$		;IF NE YES
    630	001646	005000 				CLR	R0		;BASE OF ALL ABS SECTIONS IS ZERO
    631	001650				20$:	RETURN			;
    632
    633					;
    634					; ILLEGAL FORMAT-BLOCK TYPES 0 AND 6
    635					;
    636
    637	001652				ILFMT:				;                                               ;**NEW**
    638	001652	016702 	000000G			MOV	$INPPT,R2	; GET INPUT FILE RECORD BLOCK                   ;**NEW**
    639	001656	016202 	000000G			MOV	R$NAME(R2),R2	;GET ADDRESS OF NAME STRING                     ;**-1
    640	001662	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
    641	001664	   000G	   000G			.BYTE	E$R14,S$V2	;FATAL-NO RETURN
    642	001666					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    643
    644					;
    645					; GET SYMBOL VALUE
    646					;
    647
    648	001672				GTSVL:				;                                               ;**NEW**
    649	001672	010246 				MOV	R2,-(SP)	; SAVE R2                                       ;**NEW**
    650	001674					CALL	GTSYM		; GET SYMBOL NAME                               ;**NEW**
    651	001700					CALL	$WSRCS		;SEARCH FOR SYMBOL                              ;**-1
    652	001704	103430 				BCS	20$		;IF CS NO FIND EM
    653	001706	005726 				TST	(SP)+		;CLEAN STACK
    654	001710	010001 				MOV	R0,R1		;SAVE SYMBOL ENTRY ADDRESS
    655	001712	005000 				CLR	R0		;ASSUME UNDEFINED SYMBOL
    656	001714	132761 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R1);SYMBOL DEFINITION?
    657	001722	001421 				BEQ	20$		;IF EQ NO
    658	001724	132761 	000000G	000000G		BITB	#SY$IND,S$YFLG(R1);INDIRECT REFERENCE?
    659	001732	001405 				BEQ	10$		;IF EQ NO
    660	001734	016101 	000000G			MOV	S$YVAL(R1),R1	;GET ADDRESS OF REAL ENTRY
    661	001740					CALL	$CVRL		; CONVERT TO REAL ADDRESS                       ;**NEW**
    662	001744	010001 				MOV	R0,R1		; COPY REAL ADDRESS                             ;**NEW**
    663	001746	016100 	000000G		10$:	MOV	S$YVAL(R1),R0	;GET SYMBOL VALUE
    664	001752	132761 	000000G	000000G		BITB	#SY$REL,S$YFLG(R1);ABS SYMBOL?
    665	001760	001402 				BEQ	20$		;IF EQ YES
    666	001762	066700 	000000G			ADD	$OFFST,R0	;ADD OFFSET BIAS
    667	001766				20$:				;                                               ;**NEW**
    668	001766	012602 				MOV	(SP)+,R2	; RESTORE R2                                    ;**NEW**
    669	001770					RETURN			;                                               ;**NEW**
    670					                                                                                ;**-1
    671					;
    672					; GET SYMBOL
    673					;
    674
    675	001772				GTSYM:	CALL	$GTWRD		;GET FIRST HALF OF SYMBOL
    676	001776	010067 	176034 			MOV	R0,LCLSYM+2	;                                               ;**NEW**
P5ELM	MACRO M1108  05-DEC-77 23:07  PAGE 3-5


    677	002002					CALL	$GTWRD		;GET SECOND HALF OF SYMBOL                      ;**-1
    678	002006	010067 	176026 			MOV	R0,LCLSYM+4	;                                               ;**NEW**
    679	002012	162703 	000004 			SUB	#4,R3		;ADJUST BYTE COUNT                              ;**-1
    680	002016	016700 	000000G			MOV	$CRSEG,R0	;GET ADDRESS OF CURRENT SEGMENT
    681	002022	012701 	000034'			MOV	#LCLSYM,R1	;GET ADDRESS OF LOCAL SYM DESCRIPTOR
    682	002026					RETURN			;
    683
    684
    685					;
    686					; END OF MODULE-BLOCK TYPE 6
    687					;
    688
    689	002030	005726 			MODND:	TST	(SP)+		;REMOVE RETURN FROM STACK
    690	002032	016704 	000000G			MOV	$CRELM,R4	;GET ADDRESS OF ELEMENT DESCRIPTOR
    691	002036	016403 	000000G			MOV	E$LCMT(R4),R3	;GET ADDRESS OF CMT TABLE
    692	002042	001431 				BEQ	40$		;IF EQ NONE IN TABLE
    693	002044	016405 	000000G			MOV	E$LNUM(R4),R5	; GET HIGHEST SECTION NUMBER                    ;**NEW**
    694	002050	005205 				INC	R5		; INCREMENT FOR LOOP COUNT                      ;**NEW**
    695	002052				10$:				;                                               ;**NEW**
    696	002052	012301 				MOV	(R3)+,R1	; GET VIRTUAL ADDRESS OF ENTRY                  ;**NEW**
    697	002054					CALL	$CVRL		; CONVERT TO REAL ADDRESS                       ;**NEW**
    698	002060					CALL	$WRMPG		; WRITE-MARK PAGE                               ;**NEW**
    699	002064	012301 				MOV	(R3)+,R1	; GET MAX SIZE                                  ;**NEW**
    700	002066	132760 	000000G	000000G		BITB	#CS$LIB,C$SFLG(R0);LIB SECTION?                                 ;**-4
    701	002074	001012 				BNE	30$		;IF NE YES - DON'T UPDATE
    702	002076	132760 	000000G	000000G		BITB	#CS$REL,C$SFLG(R0);ABS SECTION?
    703	002104	001406 				BEQ	30$		;IF EQ YES
    704	002106	132760 	000000G	000000G		BITB	#CS$ALO,C$SFLG(R0);WHAT TYPE?
    705	002114	001002 				BNE	30$		;IF NE OVERLAID
    706	002116	060160 	000000G			ADD	R1,C$SCUR(R0)	;UPDATE CURRENT OFFSET ADDRESS
    707	002122				30$:				;                                               ;**NEW**
    708	002122					SOB	R5,10$		; REPEAT                                        ;**NEW**
    709	002126				40$:	RETURN			;                                               ;**-1
    710
    711						.IF	NDF	V1145
    712					;
    713					;++004 SUBROUTINE TO PERFORM SOFTWARE MULTIPLY AND LEAVE
    714					;++004 LOW 16 BITS IN R0
    715					;
    716					;++004 INPUTS:
    717					;
    718					;++004	R0 -- MULTIPLICAND
    719					;++004  R1 -- MULTIPLIER
    720					;
    721					;++004	OUTPUTS:
    722					;
    723					;++004	R0 -- 16 LSB OF RESULT
    724					;
    725					;
    726
    727	002130				MUL1:				;++004
    728	002130					CALL	$MUL		;++004 CALL MULTIPLY ROUTINE
    729	002134	010100 				MOV	R1,R0		;++004 PUT LOW HALF OF RESULT IN R0
    730	002136					RETURN			;++004 EXIT
    731						.ENDC
    732
    733
P5ELM	MACRO M1108  05-DEC-77 23:07  PAGE 3-6


    734		000001 				.END
P5ELM	MACRO M1108  05-DEC-77 23:07  PAGE 3-7
SYMBOL TABLE

ADJCNT  000632R  	CPLXOR  001232R  	GBLADD  000504R  	RLDVCT  000370R  	$CRELM= ****** GX
BEGST   000000R  	CPYSCT  001516R  	GBLDIS  000470R  	RPEAT   000362R  	$CRSEG= ****** GX
CMDBT   000002R  	CR    = 000015   	GBLREL  000446R  	R$NAME= ****** GX	$CRVSG= ****** GX
CPLADD  001212R  	CRADR   000004R  	GTCVL   001542R  	R$$11M= 000000   	$CVRL = ****** GX
CPLAND  001224R  	CRSCT   000006R  	GTCVL2  001604R  	SCRDIS  000554R  	$DIV  = ****** GX
CPLCOM  001220R  	CS$ALO= ****** GX	GTCVL3  001614R  	SECADD  000570R  	$ERMSG= ****** GX
CPLDIV  001254R  	CS$IND= ****** GX	GTSVL   001672R  	SECDIS  000606R  	$GTBYT= ****** GX
CPLERX  001370R  	CS$LIB= ****** GX	GTSYM   001772R  	SECREL  000546R  	$GTWRD= ****** GX
CPLEXT  001374R  	CS$REL= ****** GX	HT    = 000011   	SGNEX   001346R  	$HDSIZ= ****** GX
CPLGTV  001452R  	C$SBSE= ****** GX	ILFMT   001652R  	SGNOP   001316R  	$HVRTL= ****** GX
CPLMUL  001246R  	C$SCUR= ****** GX	IMGOUT  000636R  	SPA   = 000040   	$INPPT= ****** GX
CPLNEG  001216R  	C$SFLG= ****** GX	INTDIS  000454R  	SY$DEF= ****** GX	$MUL  = ****** GX
CPLNOP  001206R  	C$SLGH= ****** GX	INTREL  000430R  	SY$IND= ****** GX	$NBYTE= ****** GX
CPLOR   001242R  	C$SLTH= ****** GX	LCLSYM  000034R  	SY$REL= ****** GX	$OFFST= ****** GX
CPLPC   001376R  	DSPVCT  000142R  	LF    = 000012   	S$GCST= ****** GX	$P5ELM  000050RG
CPLPGB  001402R  	ENDST   000032R  	LGBLK = 000006   	S$V0  = ****** GX	$SAVRG= ****** GX
CPLPRL  001410R  	E$LCMT= ****** GX	LGCMD = 000017   	S$V2  = ****** GX	$SAVVR= ****** GX
CPLPSH  001464R  	E$LMOD= ****** GX	LGCPL = 000020   	S$YFLG= ****** GX	$SRCH = ****** GX
CPLREL  001072R  	E$LNUM= ****** GX	LIMIT   001032R  	S$YVAL= ****** GX	$SWTCH= ****** GX
CPLRTN  001362R  	E$R14 = ****** GX	LOCDEF  000724R  	TS$KF = ****** GX	$WRBYT= ****** GX
CPLRT1  001352R  	E$R27 = ****** GX	LOCMOD  000770R  	TXT     000160R  	$WRMPG= ****** GX
CPLSTD  001470R  	E$R72 = ****** GX	MODND   002030R  	VT    = 000013   	$WRWRD= ****** GX
CPLSTO  001476R  	FF    = 000014   	MUL1    002130R  	$ADRST= ****** GX	$WSRCS= ****** GX
CPLSUB  001210R  	GADDIS  000522R  	RLD     000262R  	$ASCT = ****** GX	$$    = 000001
CPLVCT  001144R

. ABS.	000000	   000
      	002140	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1238 WORDS  ( 5 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:34
[44,10]P5ELM,[44,20]P5ELM/-SP=[44,30]MACFLM.,P5ELM.008
P5EOS	MACRO M1108  05-DEC-77 23:07  PAGE 2


      1						.TITLE	P5EOS
      2						.IDENT	/06/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					;
      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     12					;
     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     15					; EQUIPMENT CORPORATION.
     16					;
     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     19					;
     20					; VERSION 06
     21					;                                                                               ;**-1
     22					; D. N. CUTLER/C. MONIA 27-JAN-74
     23					;
     24					; PHASE 5 END-OF-SEGMENT PROCESSING
     25					;
     26					; LOCAL DATA
     27					;
     28					; SYMBOL DATA
     29					;
     30
     31	000000				CRSYM:	.BLKW	10.		;
     32
     33					;+
     34					; **-$P5EOS-PHASE 5 OUTPUT AUTOLOAD VECTORS AND SEGMENT TABLES
     35					;
     36					; THIS ROUTINE IS CALLED AFTER THE PHASE 5 MODULE SCAN TO WRITE
     37					; AUTOLOAD VECTORS AND SEGMENT TABLES INTO THE TASK IMAGE
     38					; AND PROCESS THE PATCH LIST.
     39					;
     40					; INPUTS:
     41					;
     42					;	NONE.
     43					;
     44					; OUTPUTS:
     45					;
     46					;	NONE.
     47					;-
     48
     49	000024				$P5EOS::			;
     50	000024					SAVRG			; SAVE NON-VOLATILE REGISTERS.
     51	000030	032767 	000000G	000000G		BIT	#TS$KF,$SWTCH	; TASK IMAGE FILE SPECIFIED?
     52	000036	001002 				BNE	5$		; IF NE YES
     53	000040	000167 	000652 			JMP	P5EOS2		; ELSE EXIT NOT
     54	000044				5$:				;
     55	000044	022767 	000001 	000000G		CMP	#1,$NUMSG	;MORE THAN ONE SEGMENT?
     56	000052	001002 				BNE	7$		; IF NE YES
     57	000054	000167 	000442 			JMP	80$		; NO SEGMENT TABLES OR A/L VECTORS TO BE WRITTEN
P5EOS	MACRO M1108  05-DEC-77 23:07  PAGE 2-1


     58	000060				7$:				;
     59	000060	016700 	000000G			MOV	$RTSEG,R0	;GET ADDRESS OF ROOT SEGMENT
     60	000064					CALL	$ADRST		;SET ADDRESS LIMITS
     61	000070	016703 	000000G			MOV	$CRSEG,R3	; GET ADDRESS OF CURRENT SEGMENT
     62	000074	012705 	000000'			MOV	#CRSYM,R5	; GET ADDRESS OF TEMP BUFFER
     63	000100	016315 	000000G			MOV	S$GBLK(R3),(R5)	; SET BLOCK NUMBER (RELATIVE)
     64
     65						.IF	NDF	R$$11M
     66
     67						SUB	$LBBLK,(R5)	; MAKE BLOCK RELATIVE TO HEADER
     68
     69						.IFF
     70
     71	000104	166715 	000000G			SUB	$HDRBN,(R5)	; MAKE BLOCK RELATIVE TO HEADER
     72
     73						.ENDC
     74
     75	000110	016304 	000000G			MOV	S$GSTS(R3),R4	; GET STATUS WORD
     76	000114	000304 				SWAB	R4		; POSITION STATUS BITS TO HIGH BYTE
     77	000116	105004 				CLRB	R4		; CLEAR LOW BYTE
     78	000120	006304 				ASL	R4		; POSITION TO BITS 15 - 12
     79	000122	006304 				ASL	R4		; ...
     80	000124	006304 				ASL	R4		; ...
     81	000126	006304 				ASL	R4		; ...
     82	000130	052704 	100000 			BIS	#100000,R4	; FORCE FIRST DESCRIPTOR WORD TO BE NON-ZERO
     83	000134	050425 				BIS	R4,(R5)+	; SET IN STATUS BITS
     84	000136	016304 	000000G			MOV	S$GSEG(R3),R4	; GET VIRTUAL ADDRESS OF DESCRIPTOR
     85	000142	066704 	000000G			ADD	$OFFST,R4	; ADD OFFSET BIAS
     86	000146	016315 	000000G			MOV	S$GLDA(R3),(R5)	; SET LOAD ADDRESS
     87	000152	066725 	000000G			ADD	$OFFST,(R5)+	; ADD OFFSET BIAS
     88	000156	016325 	000000G			MOV	S$GLNG(R3),(R5)+ ; SET SEGMENT LENGTH
     89	000162	062703 	000000G			ADD	#S$GUP,R3	; POINT TO UP-LINK
     90	000166	012325 				MOV	(R3)+,(R5)+	; GET UP LINK
     91	000170	012325 				MOV	(R3)+,(R5)+	; GET LINK DOWN
     92	000172	012325 				MOV	(R3)+,(R5)+	; GET LINK NEXT
     93	000174	005723 				TST	(R3)+		; STEP PAST LINK-PREVIOUS
     94	000176	012325 				MOV	(R3)+,(R5)+	; GET SEGMENT NAME
     95	000200	012325 				MOV	(R3)+,(R5)+	; ...
     96
     97					;
     98					; WRITE BLOCK, LOAD ADDRESS, AND LENGTH INTO TASK IMAGE
     99					;
    100
    101	000202	012703 	000003 			MOV	#3,R3		;SET REPEAT COUNT
    102	000206	012705 	000000'			MOV	#CRSYM,R5	; GET ADDRESS OF DESCRIPTOR IMAGE
    103	000212	012501 			10$:	MOV	(R5)+,R1	;SET WORD TO BE WRITTEN
    104	000214	010400 				MOV	R4,R0		;SET VIRTUAL ADDRESS OF WORD
    105	000216					CALL	$WRWRD		;WRITE WORD INTO IMAGE
    106	000222	062704 	000002 			ADD	#2,R4		;ADVANCE VIRTUAL ADDRESS
    107	000226					SOB	R3,10$		;REPEAT
    108
    109					;
    110					; WRITE ADDRESS OF UP, DOWN, AND NEXT INTO TASK IMAGE
    111					;
    112
    113	000232	012703 	000003 			MOV	#3,R3		;SET REPEAT COUNT
    114	000236	012501 			20$:	MOV	(R5)+,R1	;GET ADDRESS OF SEGMENT DESCRIPTOR
P5EOS	MACRO M1108  05-DEC-77 23:07  PAGE 2-2


    115	000240	001406 				BEQ	30$		;IF EQ NONE
    116	000242					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    117	000246	016001 	000000G			MOV	S$GSEG(R0),R1	; GET TASK-VIRTUAL ADDRESS OF DESCRIPTOR
    118	000252	066701 	000000G			ADD	$OFFST,R1	;ADD OFFSET BIAS
    119	000256	010400 			30$:	MOV	R4,R0		;SET VIRTUAL ADDRESS OF WORD
    120	000260					CALL	$WRWRD		;WRITE WORD INTO IMAGE
    121	000264	062704 	000002 			ADD	#2,R4		;ADVANCE VIRTUAL ADDRESS
    122	000270					SOB	R3,20$		;REPEAT
    123
    124					;
    125					; WRITE S$GNME INTO TASK IMAGE
    126					;
    127
    128	000274	026727 	000000G	000000G		CMP	$SZSEG,#S$ZSEG	; SEGMENT NAME TO BE WRITTEN?
    129	000302	103412 				BLO	45$		; IF LO NO
    130	000304	012703 	000002 			MOV	#2,R3		;SET REPEAT COUNT
    131	000310	012501 			40$:	MOV	(R5)+,R1	;SET WORD TO BE WRITTEN
    132	000312	010400 				MOV	R4,R0		;SET VIRTUAL ADDRESS OF WORD
    133	000314					CALL	$WRWRD		;WRITE WORD INTO IMAGE
    134	000320	062704 	000002 			ADD	#2,R4		;ADVANCE VIRTUAL ADDRESS
    135	000324					SOB	R3,40$		;REPEAT
    136
    137					;
    138					; WRITE AUTOLOAD VECTORS
    139					;
    140
    141	000330				45$:				;
    142	000330	016700 	000000G			MOV	$CRSEG,R0	;GET ADDRESS OF CURRENT SEGMENT
    143	000334	016005 	000000G			MOV	S$GATL(R0),R5	;GET ADDRESS OF FIRST AUTOLOAD ENTRY
    144	000340	001470 				BEQ	80$		;IF EQ NONE
    145	000342	016004 	000000G			MOV	S$GRWB(R0),R4	;GET R/W BASE ADDRESS
    146	000346	066704 	000000G			ADD	$OFFST,R4	;ADD OFFSET BIAS
    147	000352	016700 	000000G			MOV	$CRVSG,R0	; GET VIRTUAL ADDRESS OF CURRENT SEGMENT        ;**-2
    148	000356					CALL	$ADRST		;SET ADDRESS LIMITS
    149	000362				50$:				;
    150	000362	016501 	000002 			MOV	2(R5),R1	; GET VIRTUAL ADDRESS OF ENTRY SYMBOL
    151	000366					CALL	$CVRL		; CONVERT TO REAL
    152	000372	012701 	000000'			MOV	#CRSYM,R1	; GET ADDRESS OF LOCAL STORAGE
    153	000376	010103 				MOV	R1,R3		; COPY ADDRESS
    154	000400	012702 	000000C			MOV	#S$YLGH/2,R2	; GET LENGTH OF ENTRY IN WORDS
    155	000404				55$:				;
    156	000404	012021 				MOV	(R0)+,(R1)+	; COPY ENTRY
    157	000406					SOB	R2,55$		; REPEAT
    158	000412	016301 	000000G			MOV	S$YSEG(R3),R1	; GET V/A OF CALLED SEGMENT DESCRIPTOR
    159	000416					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    160	000422	016067 	000000G	000000G		MOV	S$GSEG(R0),$ALADR ; GET TASK-VIRTUAL ADDRESS OF DESCRIPTOR
    161	000430	066767 	000000G	000000G		ADD	$OFFST,$ALADR	; ADD OFFSET BIAS
    162	000436	016301 	000000G			MOV	S$YVAL(R3),R1	; GET SYMBOL VALUE
    163	000442	132763 	000000G	000000G		BITB	#SY$REL,S$YFLG(R3) ; ABS SYMBOL?
    164	000450	001402 				BEQ	60$		;IF EQ YES
    165	000452	066701 	000000G			ADD	$OFFST,R1	;ADD OFFSET BIAS
    166	000456				60$:				;
    167	000456	010167 	000002G			MOV	R1,$ALADR+2	; SET AUTOLOAD ENTRY POINT ADDRESS              ;**NEW**
    168	000462	010546 				MOV	R5,-(SP)	;SAVE R5                                        ;**-1
    169	000464	012705 	000000G			MOV	#$ALVCT,R5	; GET ADDRESS OF PROTOTYPE VECTOR
    170	000470	012703 	000000C			MOV	#<S$ZATL/2>,R3	; SET REPEAT COUNT                              ;**NEW**
    171	000474	012501 			70$:	MOV	(R5)+,R1	;GET WORD TO BE WRITTEN                         ;**-1
P5EOS	MACRO M1108  05-DEC-77 23:07  PAGE 2-3


    172	000476	010400 				MOV	R4,R0		;SET VIRTUAL ADDRESS OF WORD
    173	000500					CALL	$WRWRD		;WRITE WORD INTO IMAGE
    174	000504	062704 	000002 			ADD	#2,R4		;ADVANCE VIRTUAL ADDRESS
    175	000510					SOB	R3,70$		;REPEAT
    176	000514	012605 				MOV	(SP)+,R5	;RETRIEVE R5
    177	000516	011505 				MOV	(R5),R5		;GET ADDRESS OF NEXT ENTRY
    178	000520	001320 				BNE	50$		;IF NE GO AGAIN
    179	000522				80$:				;
    180	000522	016700 	000000G			MOV	$CRVSG,R0	; GET VIRTUAL ADDRESS OF CURRENT SEGMENT
    181	000526					CALL	$ADRST		;SET ADDRESS LIMITS
    182
    183					;
    184					; PROCESS PATCH LIST
    185					;
    186
    187	000532				P5EOS1:				;
    188	000532	032767 	000000G	000000G		BIT	#TS$KF,$SWTCH	; TASK IMAGE FILE SPECIFIED
    189	000540	001466 				BEQ	P5EOS2		; IF EQ NO
    190	000542	012705 	000000G			MOV	#$PATHD,R5	;GET ADDRESS OF PATCH LISTHEAD
    191	000546	011505 			10$:	MOV	(R5),R5		;GET ADDRESS OF NEXT PATCH BLOCK
    192	000550	001462 				BEQ	P5EOS2		; IF EQ DONE
    193	000552	010504 				MOV	R5,R4		;COPY ADDRESS OF BLOCK
    194	000554	005724 				TST	(R4)+		;POINT TO NUMBER OF PARAMETERS
    195	000556	012403 				MOV	(R4)+,R3	;GET NUMBER OF PARAMETERS
    196	000560	016700 	000000G			MOV	$CRSEG,R0	;GET ADDRESS OF CURRENT SEGMENT
    197	000564	022460 	000000G			CMP	(R4)+,S$GNME(R0);SEGMENT NAME MATCH?
    198	000570	001366 				BNE	10$		;IF NE NO
    199	000572	022460 	000002G			CMP	(R4)+,S$GNME+2(R0);SEGMENT NAME MATCH?
    200	000576	001363 				BNE	10$		;IF NE NO
    201	000600	005724 				TST	(R4)+		;WHAT TYPE OF ENTRY?
    202	000602	001431 				BEQ	30$		;IF EQ ABSOLUTE
    203	000604	010401 				MOV	R4,R1		;COPY ADDRESS OF SYMBOL
    204	000606	162701 	000000G			SUB	#S$YM,R1	;CALCULATE PROPER OFFSET FROM SYMBOL
    205	000612	062700 	000000G			ADD	#S$GSTB,R0	;POINT TO SYMBOL TABLE
    206	000616					CALL	$SRCH		;SEARCH FOR SYMBOL
    207	000622	103751 				BCS	10$		;IF CS NOT FOUND
    208	000624	132760 	000000G	000000G		BITB	#SY$IND,S$YFLG(R0);INDIRECT REFERENCE?
    209	000632	001345 				BNE	10$		;IF NE YES
    210	000634	132760 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R0);SYMBOL DEFINITION?
    211	000642	001741 				BEQ	10$		;IF EQ NO
    212	000644	022424 				CMP	(R4)+,(R4)+	;POINT TO OFFSET
    213	000646	132760 	000000G	000000G		BITB	#SY$REL,S$YFLG(R0);ABS SYMBOL?
    214	000654	001402 				BEQ	20$		;IF EQ YES
    215	000656	066714 	000000G			ADD	$OFFST,(R4)	;ADD IN OFFSET BIAS
    216	000662	066014 	000000G		20$:	ADD	S$YVAL(R0),(R4)	;ADD IN SYMBOL VALUE
    217	000666	010346 			30$:	MOV	R3,-(SP)	;SET LOOP COUNT
    218	000670	012403 				MOV	(R4)+,R3	;GET PATCH ADDRESS
    219	000672	010300 			40$:	MOV	R3,R0		;SET ADDRESS TO WRITE PATCH
    220	000674	012401 				MOV	(R4)+,R1	;GET WORD TO BE WRITTEN
    221	000676					CALL	$WRWRD		;WRITE WORD INTO IMAGE FILE
    222	000702	062703 	000002 			ADD	#2,R3		;ADVANCE TO NEXT PATCH ADDRESS
    223	000706	005316 				DEC	(SP)		;DECREMENT LOOP COUNT
    224	000710	003370 				BGT	40$		;IF GT GO AGAIN
    225	000712	005726 				TST	(SP)+		;CLEAN STACK
    226	000714	000714 				BR	10$		; PROCESS NEXT PATCH
    227	000716				P5EOS2:				;
    228	000716					RETURN			;
P5EOS	MACRO M1108  05-DEC-77 23:07  PAGE 2-4


    229
    230		000001 				.END
P5EOS	MACRO M1108  05-DEC-77 23:07  PAGE 2-5
SYMBOL TABLE

CR    = 000015   	SY$IND= ****** GX	S$GSTS= ****** GX	VT    = 000013   	$PATHD= ****** GX
CRSYM   000000R  	SY$REL= ****** GX	S$GUP = ****** GX	$ADRST= ****** GX	$P5EOS  000024RG
FF    = 000014   	S$GATL= ****** GX	S$YFLG= ****** GX	$ALADR= ****** GX	$RTSEG= ****** GX
HT    = 000011   	S$GBLK= ****** GX	S$YLGH= ****** GX	$ALVCT= ****** GX	$SAVRG= ****** GX
LF    = 000012   	S$GLDA= ****** GX	S$YM  = ****** GX	$CRSEG= ****** GX	$SRCH = ****** GX
P5EOS1  000532R  	S$GLNG= ****** GX	S$YSEG= ****** GX	$CRVSG= ****** GX	$SWTCH= ****** GX
P5EOS2  000716R  	S$GNME= ****** GX	S$YVAL= ****** GX	$CVRL = ****** GX	$SZSEG= ****** GX
R$$11M= 000000   	S$GRWB= ****** GX	S$ZATL= ****** GX	$HDRBN= ****** GX	$WRWRD= ****** GX
SPA   = 000040   	S$GSEG= ****** GX	S$ZSEG= ****** GX	$NUMSG= ****** GX	$$    = 000001
SY$DEF= ****** GX	S$GSTB= ****** GX	TS$KF = ****** GX	$OFFST= ****** GX

. ABS.	000000	   000
      	000720	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  833 WORDS  ( 4 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[44,10]P5EOS,[44,20]P5EOS/-SP=[44,30]MACFLM.,P5EOS.006
P5IMG	MACRO M1108  05-DEC-77 23:08  PAGE 3


      1						.TITLE	P5IMG
      2						.IDENT	/07/                                                           ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					;
      6					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					;
      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     12					;
     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     15					; EQUIPMENT CORPORATION.
     16					;
     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     19					;
     20					; VERSION 07                                                                   ;**NEW**
     21					;                                                                               ;**-3
     22					; D.N. CUTLER 30-OCT-72
     23					;
     24					; PHASE 5 TASK IMAGE OUTPUT ROUTINES
     25					;
     26					; MACRO LIBRARY CALLS
     27					;
     28
     29						.MCALL	READ$,WTSE$S,WRITE$
     30
     31					;
     32					; LOCAL DATA
     33					;
     34
     35	000000	000000 			BLKNM:	.WORD	0		;HIGH ORDER PART OF VIRTUAL BLOCK NUMBER
     36	000002				BLK:	.BLKW	1		;CURRENT DISK BLOCK NUMBER
     37	000004				BUF:	.BLKW	256.		;OUTPUT BUFFER
     38	001004				VDSK:	.BLKW	1		;STARTING DISK ADDR (BYTE)
     39	001006				VEND:	.BLKW	1		;ENDING DISK ADDR (BYTE)
     40	001010				IOSTS:	.BLKW	2		;I/O STATUS DOUBLEWORD
     41
     42
     43					;+
     44					; **-$FINFL-FINISH TASK IMAGE FILE
     45					;
     46					; THIS ROUTINE IS CALLED AT THE END OF PHASE 5 TO FINISH THE WRITING
     47					; OF THE TASK IMAGE FILE. THE CURRENT BUFFER IS FLUSHED AND A SCAN
     48					; OF THE BITMAP IS EXECUTED. A ZERO BLOCK IS WRITTEN INTO THE IMAGE
     49					; FOR EACH BLOCK THAT HAS NOT YET BEEN WRITTEN.
     50					;
     51					; INPUTS:
     52					;
     53					;	NONE.
     54					;
     55					; OUTPUTS:
     56					;
     57					;	WRITING OF THE TASK IMAGE FILE IS FINISHED.
P5IMG	MACRO M1108  05-DEC-77 23:08  PAGE 3-1


     58					;-
     59
     60	001014				$FINFL::SAVRG			;SAVE NONVOLITILE REGISTERS
     61	001020					CALL	$FLUSH		;FLUSH CURRENT BUFFER
     62	001024					CALL	CLRBF		;CLEAR BUFFER
     63	001030	005001 				CLR	R1		;CLEAR STARTING VIRTUAL BLOCK NUMBER
     64	001032	016702 	000002G			MOV	$BITMP+2,R2	;GET ADDRESS OF BITMAP
     65	001036	016703 	000000G			MOV	$BITMP,R3	;GET SIZE OF BITMAP
     66	001042	012704 	000010 		10$:	MOV	#8.,R4		;SET REPEAT COUNT FOR ONE BYTE
     67	001046	112205 				MOVB	(R2)+,R5	;GET NEXT BITMAP BYTE
     68	001050	005201 			20$:	INC	R1		;INCREMENT VIRTUAL BLOCK NUMBER
     69	001052	006005 				ROR	R5		;CAPTURE LOW BIT IN CARRY
     70	001054	103006 				BCC	30$		;IF CC ALREADY WRITTEN
     71	001056	010167 	176720 			MOV	R1,BLK		;SET VIRTUAL BLOCK NUMBER
     72	001062	005267 	000000G			INC	$BFFLG		;SET BUFFER FLAG "TRUE"
     73	001066					CALL	$FLUSH		;FLUSH BUFFER
     74	001072				30$:	SOB	R4,20$		;REPEAT (BYTE)
     75	001076					SOB	R3,10$		;REPEAT (MAP)
     76	001102					RETURN			;
     77
     78					;+
     79					; **-$FLUSH-FLUSH BUFFER
     80					;
     81					; THIS ROUTINE IS CALLED TO FLUSH THE CURRENT CONTENTS OF THE IMAGE
     82					; BUFFER. THE BUFFER IS WRITTEN TO DISK AND THE BUFFER FLAG IS SET
     83					; TO "FALSE".
     84					;
     85					; INPUTS:
     86					;
     87					;	$BFFLG=TRUE/FALSE BUFFER FLAG.
     88					;	BUF=OUTPUT BUFFER.
     89					;
     90					; OUTPUTS:
     91					;
     92					;	THE CURRENT BUFFER IS WRITTEN OUT AND THE BUFFER FLAG IS
     93					;	SET TO "FALSE".
     94					;	NOTE: REGISTERS R0 AND R1 ARE NOT DESTROYED.
     95					;-
     96
     97	001104	005767 	000000G		$FLUSH::TST	$BFFLG		;ANYTHING IN BUFFER?
     98	001110	001435 				BEQ	10$		;IF EQ NO
     99	001112	010046 				MOV	R0,-(SP)	;SAVE R0
    100	001114	016700 	000000G			MOV	$TSKPT,R0	;GET TASK IMAGE FILE RECORD BLOCK
    101	001120					WRITE$	R0,#BUF,#<256.*2>,#BLKNM,#1,#IOSTS;WRITE OUT BUFFER
    102	001176					CALL	CHKST		;CHECK WRITE STATUS
    103	001202	012600 				MOV	(SP)+,R0	;RESTORE R0
    104	001204	005067 	000000G		10$:	CLR	$BFFLG		;SET BUFFER FLAG "FALSE"
    105	001210					RETURN			;
    106
    107					;+
    108					; **-$WRBYT-WRITE BYTE INTO TASK IMAGE FILE
    109					;
    110					; THIS ROUTINE IS CALLED TO WRITE A BYTE OF TEXT INTO THE TASK
    111					; IMAGE FILE.
    112					;
    113					; INPUTS:
    114					;
P5IMG	MACRO M1108  05-DEC-77 23:08  PAGE 3-2


    115					;	R0=VIRTUAL ADDRESS OF THE BYTE TO BE WRITTEN.
    116					;	R1=BYTE TO BE WRITTEN.
    117					;	$CRELM=ADDRESS OF CURRENT ELEMENT DESCRIPTOR.
    118					;
    119					; OUTPUTS:
    120					;
    121					;	BYTE IS WRITTEN INTO THE TASK IMAGE FILE.
    122					;-
    123
    124	001212	020067 	000000G		$WRBYT::CMP	R0,$ENDRW	;IN RW AREA?
    125	001216	101004 				BHI	10$		;IF HI NO
    126					                                                                                ;**NEW**
    127						.IF	NDF	R$$11M                                                  ;**NEW**
    128					                                                                                ;**NEW**
    129						CMP	R0,$BEGRW	;WITHIN LIMITS?
    130					                                                                                ;**NEW**
    131						.IFF                                                                    ;**NEW**
    132					                                                                                ;**NEW**
    133	001220	020067 	000000G			CMP	R0,$LOWRW	; WITHIN LIMITS                                 ;**NEW**
    134					                                                                                ;**NEW**
    135						.ENDC                                                                   ;**NEW**
    136					                                                                                ;**NEW**
    137	001224	103407 				BLO	20$		;IF LO NO
    138	001226	000416 				BR	40$		;
    139	001230	020067 	000000G		10$:	CMP	R0,$BEGRO	;IN RO AREA?
    140	001234	103403 				BLO	20$		;IF LO NO
    141	001236	020067 	000000G			CMP	R0,$ENDRO	;WITHIN LIMITS?
    142	001242	101410 				BLOS	30$		;IF LOS YES
    143	001244	016702 	000000G		20$:	MOV	$CRELM,R2	;GET ADDRESS OF ELEMENT DESCRIPTOR
    144	001250	062702 	000000G			ADD	#E$LMOD,R2	;POINT TO MODULE NAME
    145	001254	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
    146	001256	   000G	   000G			.BYTE	E$R26,S$V2	;FATAL-NO RETURN
    147	001260	000167 	000340 			JMP	CHKST1		;
    148	001264				30$:
    149						.IIF  NDF  R$$11M, SUB	$BIAS,R0	; SUBTRACT RO ADDRESS BIAS
    150	001264	166700 	000000G		40$:	SUB	$BEGRW,R0	;NORMALIZE TO START OF SEGMENT
    151						.IIF  NDF  R$$11M, ADD	$HDOFF,R0	; ADD IN HEADER OFFSET
    152	001270	005767 	000000G			TST	$BFFLG		;ANYTHING IN BUFFER?
    153	001274	001410 				BEQ	60$		;IF EQ NO
    154	001276	020067 	177502 			CMP	R0,VDSK		;IN CURRENT BUFFER?
    155	001302	103403 				BLO	50$		;IF LO NO
    156	001304	020067 	177476 			CMP	R0,VEND		;IN CURRENT BUFFER?
    157	001310	101507 				BLOS	80$		;IF LOS YES
    158	001312				50$:	CALL	$FLUSH		;FLUSH CURRENT CONTENTS OF BUFFER
    159	001316	010002 			60$:	MOV	R0,R2		;COPY DISK BYTE ADDRESS
    160	001320	052702 	000777 			BIS	#777,R2		;CALCULATE ENDING BUFFER ADDRESS
    161	001324	010267 	177456 			MOV	R2,VEND		;SET ENDING BUFFER ADDRESS
    162	001330	042702 	000777 			BIC	#777,R2		;CALCULATE STARTING BUFFER ADDRESS
    163	001334	010267 	177444 			MOV	R2,VDSK		;SET STARTING BUFFER ADDRESS
    164	001340	000302 				SWAB	R2		;DIVIDE BY 256. BYTES
    165	001342	006202 				ASR	R2		;CALCULATE RELATIVE BLOCK NUMBER
    166	001344	066702 	000000G			ADD	$RLBLK,R2	;ADD IN BASE RELATIVE BLOCK NUMBER
    167	001350	005202 				INC	R2		;CONVERT TO VIRTUAL BLOCK NUMBER
    168	001352	010267 	176424 			MOV	R2,BLK		;SET CURRENT BLOCK NUMBER
    169	001356	005267 	000000G			INC	$BFFLG		;SET BUFFER FLAG TO "TRUE"
    170	001362	010046 				MOV	R0,-(SP)	;SAVE R0
    171	001364	010146 				MOV	R1,-(SP)	;SAVE R1
P5IMG	MACRO M1108  05-DEC-77 23:08  PAGE 3-3


    172	001366	005302 				DEC	R2		;CONVERT TO RELATIVE BLOCK NUMBER
    173
    174
    175						.IF	DF	V1145
    176
    177						MOV	R2,R1		;SET LOW PART OF DIVIDEND
    178						CLR	R0		;CLEAR HIGH PART OF DIVIDEND
    179						DIV	#8.,R0		;CALCULATE RELATIVE BYTE AND BIT
    180
    181						.IFF
    182
    183	001370	010200 				MOV	R2,R0		;SET DIVIDEND
    184	001372	012701 	000010 			MOV	#8.,R1		;SET DIVISOR
    185	001376					CALL	$DIV		;CALCULATE RELATIVE BYTE AND BIT
    186
    187						.ENDC
    188
    189
    190	001402	066700 	000002G			ADD	$BITMP+2,R0	;POINT TO BYTE IN BITMAP
    191	001406	012702 	000001 			MOV	#1,R2		;GET MASK BIT
    192
    193
    194						.IF	DF	V1145
    195
    196						ASH	R1,R2		;SHIFT MASK BIT INTO PLACE
    197
    198						.IFF
    199
    200	001412	005301 			65$:	DEC	R1		;DECREMENT SHIFT COUNT
    201	001414	002402 				BLT	70$		;IF LT DONE
    202	001416	006302 				ASL	R2		;SHIFT MASK BIT INTO PLACE
    203	001420	000774 				BR	65$		;
    204
    205						.ENDC
    206
    207
    208	001422	130210 			70$:	BITB	R2,(R0)		;BLOCK ALREADY WRITTEN?
    209	001424	001404 				BEQ	73$		;IF EQ YES
    210	001426	140210 				BICB	R2,(R0)		;CLEAR BIT IN BITMAP
    211	001430					CALL	CLRBF		;CLEAR BUFFER
    212	001434	000433 				BR	77$		;
    213	001436	016700 	000000G		73$:	MOV	$TSKPT,R0	;GET TASK IMAGE FILE RECORD BLOCK
    214	001442					READ$	R0,#BUF,#<256.*2>,#BLKNM,#1,#IOSTS;READ IN BLOCK
    215	001520					CALL	CHKST		;CHECK READ STATUS
    216	001524	012601 			77$:	MOV	(SP)+,R1	;RESTORE R1 AND R0
    217	001526	012600 				MOV	(SP)+,R0	;
    218	001530	166700 	177250 		80$:	SUB	VDSK,R0		;CALCULATE ADDRESS IN BUFFER
    219	001534	110160 	000004'			MOVB	R1,BUF(R0)	;STORE BYTE
    220	001540					RETURN			;
    221
    222					;+
    223					; **-$WRWRD-WRITE WORD INTO TASK IMAGE FILE
    224					;
    225					; THIS ROUTINE IS CALLED TO WRITE A WORD OF TEXT INTO THE TASK
    226					; IMAGE FILE.
    227					;
    228					; INPUTS:
P5IMG	MACRO M1108  05-DEC-77 23:08  PAGE 3-4


    229					;
    230					;	R0=VIRTUAL ADDRESS OF WORD TO BE WRITTEN.
    231					;	R1=WORD TO BE WRITTEN.
    232					;
    233					; OUTPUTS:
    234					;
    235					;	WORD IS WRITTEN INTO THE TASK IMAGE FILE.
    236					;-
    237
    238	001542	010146 			$WRWRD::MOV	R1,-(SP)	;SAVE R0 AND R1
    239	001544	010046 				MOV	R0,-(SP)	;
    240	001546					CALL	$WRBYT		;WRITE FIRST BYTE
    241	001552	012600 				MOV	(SP)+,R0	;RESTORE R0 AND R1
    242	001554	012601 				MOV	(SP)+,R1	;
    243	001556	005200 				INC	R0		;INCREMENT VIRTUAL ADDRESS
    244	001560	000301 				SWAB	R1		;SWAP BYTES
    245	001562					CALL	$WRBYT		;WRITE SECOND BYTE
    246	001566					RETURN			;
    247
    248					;
    249					; SUBROUTINE TO CHECK STATUS OF I/O OPERATION
    250					;
    251
    252	001570	103411 			CHKST:	BCS	10$		;IF CS I/O ERROR
    253	001572					WTSE$S	#1		;WAIT FOR I/O TO COMPLETE
    254	001604	105367 	177200 			DECB	IOSTS		;I/O ERROR?
    255	001610	001001 				BNE	10$		;IF NE YES
    256	001612					RETURN			;
    257	001614	016002 	000000G		10$:	MOV	R$NAME(R0),R2	;GET ADDRESS OF NAME STRING
    258	001620	012701 				MOV	(PC)+,R1	;I/O ERROR
    259	001622	   000G	   000G			.BYTE	E$R25,S$V2	;FATAL-NO RETURN
    260	001624				CHKST1:	CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    261
    262					;
    263					; SUBROUTINE TO CLEAR BUFFER
    264					;
    265
    266	001630	012700 	000004'		CLRBF:	MOV	#BUF,R0		;GET ADDRESS OF BUFFER
    267	001634	012701 	000400 			MOV	#256.,R1	;SET REPEAT COUNT
    268	001640	005020 			10$:	CLR	(R0)+		;CLEAR BUFFER
    269	001642					SOB	R1,10$		;REPEAT
    270	001646					RETURN			;
    271
    272		000001 				.END
P5IMG	MACRO M1108  05-DEC-77 23:08  PAGE 3-5
SYMBOL TABLE

BLK     000002R  	FD.RAN= 000002   	F.ERR = 000052   	NB.DIR= 000100   	S.FNBW= 000017
BLKNM   000000R  	FD.REC= 000001   	F.FACC= 000043   	NB.NAM= 000004   	S.FNTY= 000004
BUF     000004R  	FD.RWM= 000001   	F.FFBY= 000014   	NB.SD1= 000400   	S.FTYP= 000002
B.BBFS= 000010   	FD.SDI= 000020   	F.FNAM= 000110   	NB.SD2= 001000   	S.NFEN= 000020
B.BFST= 000015   	FD.SQD= 000040   	F.FNB = 000102   	NB.SNM= 000040   	VDSK    001004R
B.NXBD= 000012   	FD.TTY= 000004   	F.FTYP= 000116   	NB.STP= 000020   	VEND    001006R
B.VBN = 000004   	FD.WBH= 000002   	F.FVER= 000120   	NB.SVR= 000010   	VT    = 000013
CHKST   001570R  	FF    = 000014   	F.HIBK= 000004   	NB.TYP= 000002   	$BEGRO= ****** GX
CHKST1  001624R  	FO.APD= 000106   	F.LUN = 000042   	NB.VER= 000001   	$BEGRW= ****** GX
CLRBF   001630R  	FO.MFY= 000002   	F.MBCT= 000054   	N.DID = 000024   	$BFFLG= ****** GX
CR    = 000015   	FO.RD = 000001   	F.MBC1= 000055   	N.DVNM= 000032   	$BITMP= ****** GX
E$LMOD= ****** GX	FO.UPD= 000006   	F.MBFG= 000056   	N.FID = 000000   	$CRELM= ****** GX
E$R25 = ****** GX	FO.WRT= 000016   	F.NRBD= 000024   	N.FNAM= 000006   	$DIV  = ****** GX
E$R26 = ****** GX	F.ALOC= 000040   	F.NREC= 000030   	N.FTYP= 000014   	$ENDRO= ****** GX
FA.APD= 000100   	F.BBFS= 000062   	F.OVBS= 000030   	N.FVER= 000016   	$ENDRW= ****** GX
FA.CRE= 000010   	F.BDB = 000070   	F.RACC= 000016   	N.NEXT= 000022   	$ERMSG= ****** GX
FA.EXT= 000004   	F.BGBC= 000057   	F.RATT= 000001   	N.STAT= 000020   	$FINFL  001014RG
FA.NSP= 000100   	F.BKDN= 000026   	F.RCNM= 000034   	N.UNIT= 000034   	$FLUSH  001104RG
FA.RD = 000001   	F.BKDS= 000020   	F.RCTL= 000017   	PAR$$$= 000000   	$LOWRW= ****** GX
FA.SHR= 000040   	F.BKEF= 000050   	F.RSIZ= 000002   	R$NAME= ****** GX	$RLBLK= ****** GX
FA.TMP= 000020   	F.BKP1= 000051   	F.RTYP= 000000   	R$$11M= 000000   	$SAVRG= ****** GX
FA.WRT= 000002   	F.BKST= 000024   	F.STBK= 000036   	R.FIX = 000001   	$TSKPT= ****** GX
FD.BLK= 000010   	F.BKVB= 000064   	F.UNIT= 000136   	R.VAR = 000002   	$WRBYT  001212RG
FD.CCL= 000002   	F.CNTG= 000034   	F.URBD= 000020   	SPA   = 000040   	$WRWRD  001542RG
FD.CR = 000002   	F.DFNB= 000046   	F.VBN = 000064   	S$V2  = ****** GX	$$    = 000001
FD.DIR= 000010   	F.DSPT= 000044   	F.VBSZ= 000060   	S.BFHD= 000020   	.READ = ****** G
FD.FTN= 000001   	F.DVNM= 000134   	HT    = 000011   	S.FATT= 000016   	.WRITE= ****** G
FD.INS= 000010   	F.EFBK= 000010   	IOSTS   001010R  	S.FDB = 000140   	...GBL= 000000
FD.PLC= 000004   	F.EFN = 000050   	LF    = 000012   	S.FNAM= 000006   	...TPC= 000140
FD.RAH= 000001   	F.EOBB= 000032   	NB.DEV= 000200   	S.FNB = 000036

. ABS.	000000	   000
      	001650	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2370 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:27
[44,10]P5IMG,[44,20]P5IMG/-SP=[44,30]MACFLM.,FCSPR.,P5IMG.007
P5MAP	MACRO M1108  05-DEC-77 23:08  PAGE 3


      1						.TITLE	P5MAP
      2						.IDENT	/06/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					;
      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     12					;
     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     15					; EQUIPMENT CORPORATION.
     16					;
     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     19					;
     20					; VERSION 06                                                                    ;**NEW**
     21					;                                                                               ;**-1
     22					; D. N. CUTLER/C. MONIA 27-JAN-74
     23					;
     24					;
     25					; MODIFICATIONS:                                                                ;**NEW**
     26					;                                                                               ;**NEW**
     27					; NO.		DATE		PROGRAMMER                                      ;**NEW**
     28					; ---		----		----------                                      ;**NEW**
     29					;                                                                               ;**NEW**
     30					; 036		15-JAN-75	C. MONIA                                        ;**NEW**
     31					;                                                                               ;**NEW**
     32					; OUTPUT THE TASK BUILDER MAP                                                   ;**NEW**
     33					; MACRO LIBRARY CALLS
     34					;
     35
     36						.MCALL	CLOSE$,OFNB$W                                                   ;**NEW**
     37					                                                                                ;**NEW**
     38					;                                                                               ;**NEW**
     39					;++036 LOCAL DATA                                                               ;**NEW**
     40					;++036                                                                          ;**NEW**
     41					;++036 TIME PARAMETERS FOR THS BUILD                                            ;**NEW**
     42					;++036                                                                          ;**NEW**
     43					                                                                                ;**NEW**
     44	000000				$BLTIM::.BLKW	8.		;++036                                          ;**NEW**
     45					                                                                                ;**NEW**
     46					                                                                                ;**-1
     47					;
     48					; MODULE FUNCTION DETAILS
     49					;
     50					;+
     51					; **-$P5MAP-OUTPUT TASK BUILDER MAP
     52					;
     53					; THIS ROUTINE IS CALLED TO WRITE THE TASK BUILDER
     54					; MAP FILE.
     55					;
     56					;
     57					; INPUTS:
P5MAP	MACRO M1108  05-DEC-77 23:08  PAGE 3-1


     58					;
     59					;	TABLES CONSTRUCTED IN PHASE 3
     60					;
     61					; OUTPUTS:
     62					;
     63					;	THE TASK BUILDER MAP FILE IS WRITTEN
     64					;
     65					;+
     66					;
     67
     68	000020				$P5MAP::
     69	000020					SAVRG			; SAVE NON-VOLATILE REGISTERS
     70	000024	016700 	000000G			MOV	$INPPT,R0	; GET INPUT FILE RECORD BLOCK
     71	000030					CALL	$STRCB		; SET FDB RESIDENT
     72	000034	012705 	000000G			MOV	#$SWTCH,R5	; GET ADDRESS OF SWITCH WORD
     73	000040	032715 	000000G			BIT	#MA$PF,(R5)	; MAP FILE SPECIFIED ?
     74	000044	001431 				BEQ	15$		; IF EQ NO
     75	000046	016700 	000000G			MOV	$MAPPT,R0	; GET MAP FILE RECORD BLOCK POINTER
     76	000052	010004 				MOV	R0,R4		; SAVE MAP RECORD BLOCK POINTER
     77	000054					CALL	$STRCB		; SETUP RECORD BLOCK
     78	000060	010400 				MOV	R4,R0		; RETRIEVE POINTER
     79	000062					OFNB$W	R0		; OPEN MAP FILE
     80	000074	103011 				BCC	10$		; IF C/C OKAY
     81	000076	016002 	000000G			MOV	R$NAME(R0),R2	; GET ADDRESS OF NAME STRING
     82	000102	012701 				MOV	(PC)+,R1	; GET ERROR/SEVERITY
     83	000104	   000G	   000G			.BYTE	E$R11,S$V0	; DIAGNOSTIC
     84	000106					CALL	$ERMSG		; OUTPUT ERROR MESSAGE
     85	000112	042715 	000000G			BIC	#MA$PF,(R5)	; CLEAR MAP FILE OPTION SWITCH
     86	000116	000404 				BR	15$		; OUTPUT ONLY UNDEFINED SYMBOLS VIA CO
     87	000120				10$:				;
     88	000120	005067 	000000G			CLR	$MPFLG		; CLEAR MAP BUFFER FLAG
     89	000124					CALL	$MPHDG		; OUTPUT MAP HEADING
     90	000130				15$:				;
     91	000130	012700 	000160'			MOV	#P5RSC,R0	; GET PHASE CONTROL ROUTINE ADDRESS
     92	000134					CALL	$PCTRL		; CALL PHASE CONTROL ROUTINE
     93	000140	012700 	000242'			MOV	#P5MAP,R0	; GET PHASE CONTROL ROUTINE ADDRESS
     94	000144					CALL	$PCTRL		; CALL PHASE CONTROL ROUTINE
     95	000150	012705 	000000G			MOV	#$SWTCH,R5	; GET ADDRESS OF SWITCH WORD
     96	000154					CALLR	$P5CRF		;++036 CONDITIONALLY OUTPUT CREF FILE           ;**NEW**
     97					                                                                                ;**-9
     98					;
     99					; RESET THE BASE ADDRESS FOR ALL SECTIONS WITHIN THE
    100					; SEGMENT PRIOR TO DISPLAYING THE ALLOCATION FOR
    101					; EVERY ELEMENT
    102					;
    103
    104	000160				P5RSC:				;
    105	000160					SAVRG			; SAVE THE NON-VOLATILE REGISTERS
    106	000164	016700 	000000G			MOV	$CRSEG,R0	; GET ADDRESS OF SECTION
    107	000170	062700 	000000G			ADD	#S$GCST,R0	; POINT TO SECTION TABLE
    108	000174	012746 	000000G			MOV	#$ISED,-(SP)	; PUSH ADDRESS OF SYMBOL EDIT ROUTINE
    109	000200				10$:				;
    110	000200					CALL	@(SP)+		; GET NEXT ENTRY
    111	000202	103416 				BCS	20$		; IF C/S NO MORE
    112	000204	132760 	000000G	000000G		BITB	#CS$IND,C$SFLG(R0) ; INDIRECT ENTRY?
    113	000212	001372 				BNE	10$		; IF NE YES
    114	000214	132760 	000000G	000000G		BITB	#CS$REL,C$SFLG(R0) ; ABS SECTION?
P5MAP	MACRO M1108  05-DEC-77 23:08  PAGE 3-2


    115	000222	001766 				BEQ	10$		; IF EQ YES
    116	000224	016060 	000000G	000000G		MOV	C$SBSE(R0),C$SCUR(R0) ; RESET CURRENT BASE
    117	000232					CALL	$WRMPG		; WRITE-MARK PAGE
    118	000236	000760 				BR	10$		; GO AGAIN
    119	000240				20$:				;
    120	000240					RETURN			;
    121
    122
    123					;
    124					; MAP OUTPUT ROUTINE FOR EACH SEGMENT
    125					;
    126
    127	000242				P5MAP:				;
    128	000242					SAVRG			; SAVE NON-VOLATILE REGISTERS
    129	000246	032767 	000000G	000000G		BIT	#MA$PF,$SWTCH	; MAP FILE SPECIFIED?
    130	000254	001415 				BEQ	30$		; IF EQ NO
    131	000256	016700 	000000G			MOV	$CRVSG,R0	; GET VIRTUAL ADDRESS OF CURRENT SEGMENT
    132	000262					CALL	$ADRSM		; SET ADDRESS LIMITS
    133	000266					CALL	$MPSEG		; OUTPUT SEGMENT NAME
    134	000272				10$:				;
    135	000272	012746 	000000G			MOV	#$STINP,-(SP)	; SET ADDRESS OF INPUT FILE SETUP ROUTINE
    136	000276				20$:				;
    137	000276					CALL	@(SP)+		; SETUP NEXT INPUT FILE
    138	000300	103403 				BCS	30$		; IF C/S NO MORE TO PROCESS
    139	000302					CALL	$P5MEL		; SCAN ELEMENT
    140	000306	000773 				BR	20$		; GO AGAIN
    141
    142					;
    143					; OUTPUT ANY UNDEFINED SYMBOLS
    144					;
    145
    146	000310				30$:				;
    147	000310	016700 	000000G			MOV	$CRSEG,R0	; GET ADDRESS OF CURRENT SEGMENT
    148	000314	005760 	000000G			TST	S$GUND(R0)	; ANY UNDEFINED SYMBOLS?
    149	000320	001414 				BEQ	40$		; IF EQ NO
    150	000322	010002 				MOV	R0,R2		; COPY DESCRIPTOR ADDRESS
    151	000324	062702 	177776G			ADD	#S$GNME-2,R2	; POINT TO SEGMENT NAME
    152	000330	010246 				MOV	R2,-(SP)	; SAVE ADDRESS
    153	000332	011246 				MOV	(R2),-(SP)	; SAVE CONTENTS
    154	000334	016012 	000000G			MOV	S$GUND(R0),(R2) ; SETUP PARAMETER BLOCK
    155	000340	012701 				MOV	(PC)+,R1	; GET ERROR/SEVERITY
    156	000342	   000G	   000G			.BYTE	E$R28,S$V0	; DIAGNOSTIC
    157	000344					CALL	$ERMSG		; OUTPUT ERROR MESSAGE
    158	000350	012636 				MOV	(SP)+,@(SP)+	; RESTORE DESCRIPTOR CONTENTS
    159	000352				40$:				;
    160	000352	032767 	000000G	000000G		BIT	#MA$PF,$SWTCH	; MAP FILE SPECIFIED?
    161	000360	001402 				BEQ	P5MEX		; IF EQ NO
    162	000362					CALL	$MPUND		; FLUSH OUTPUT AND UNDEFINED SYMBOLS
    163	000366				P5MEX:				;
    164	000366					RETURN			;
    165
    166		000001 				.END
P5MAP	MACRO M1108  05-DEC-77 23:08  PAGE 3-3
SYMBOL TABLE

B.BBFS= 000010   	FD.SDI= 000020   	F.FNB = 000102   	NB.STP= 000020   	S.FNBW= 000017
B.BFST= 000015   	FD.SQD= 000040   	F.FTYP= 000116   	NB.SVR= 000010   	S.FNTY= 000004
B.NXBD= 000012   	FD.TTY= 000004   	F.FVER= 000120   	NB.TYP= 000002   	S.FTYP= 000002
B.VBN = 000004   	FD.WBH= 000002   	F.HIBK= 000004   	NB.VER= 000001   	S.NFEN= 000020
CR    = 000015   	FF    = 000014   	F.LUN = 000042   	N.DID = 000024   	VT    = 000013
CS$IND= ****** GX	FO.APD= 000106   	F.MBCT= 000054   	N.DVNM= 000032   	$ADRSM= ****** GX
CS$REL= ****** GX	FO.MFY= 000002   	F.MBC1= 000055   	N.FID = 000000   	$BLTIM  000000RG
C$SBSE= ****** GX	FO.RD = 000001   	F.MBFG= 000056   	N.FNAM= 000006   	$CRSEG= ****** GX
C$SCUR= ****** GX	FO.UPD= 000006   	F.NRBD= 000024   	N.FTYP= 000014   	$CRVSG= ****** GX
C$SFLG= ****** GX	FO.WRT= 000016   	F.NREC= 000030   	N.FVER= 000016   	$ERMSG= ****** GX
E$R11 = ****** GX	F.ALOC= 000040   	F.OVBS= 000030   	N.NEXT= 000022   	$INPPT= ****** GX
E$R28 = ****** GX	F.BBFS= 000062   	F.RACC= 000016   	N.STAT= 000020   	$ISED = ****** GX
FA.APD= 000100   	F.BDB = 000070   	F.RATT= 000001   	N.UNIT= 000034   	$MAPPT= ****** GX
FA.CRE= 000010   	F.BGBC= 000057   	F.RCNM= 000034   	PAR$$$= 000000   	$MPFLG= ****** GX
FA.EXT= 000004   	F.BKDN= 000026   	F.RCTL= 000017   	P5MAP   000242R  	$MPHDG= ****** GX
FA.NSP= 000100   	F.BKDS= 000020   	F.RSIZ= 000002   	P5MEX   000366R  	$MPSEG= ****** GX
FA.RD = 000001   	F.BKEF= 000050   	F.RTYP= 000000   	P5RSC   000160R  	$MPUND= ****** GX
FA.SHR= 000040   	F.BKP1= 000051   	F.STBK= 000036   	R$NAME= ****** GX	$PCTRL= ****** GX
FA.TMP= 000020   	F.BKST= 000024   	F.UNIT= 000136   	R$$11M= 000000   	$P5CRF= ****** GX
FA.WRT= 000002   	F.BKVB= 000064   	F.URBD= 000020   	R.FIX = 000001   	$P5MAP  000020RG
FD.BLK= 000010   	F.CNTG= 000034   	F.VBN = 000064   	R.VAR = 000002   	$P5MEL= ****** GX
FD.CCL= 000002   	F.DFNB= 000046   	F.VBSZ= 000060   	SPA   = 000040   	$SAVRG= ****** GX
FD.CR = 000002   	F.DSPT= 000044   	HT    = 000011   	S$GCST= ****** GX	$STINP= ****** GX
FD.DIR= 000010   	F.DVNM= 000134   	LF    = 000012   	S$GNME= ****** GX	$STRCB= ****** GX
FD.FTN= 000001   	F.EFBK= 000010   	MA$PF = ****** GX	S$GUND= ****** GX	$SWTCH= ****** GX
FD.INS= 000010   	F.EFN = 000050   	NB.DEV= 000200   	S$V0  = ****** GX	$WRMPG= ****** GX
FD.PLC= 000004   	F.EOBB= 000032   	NB.DIR= 000100   	S.BFHD= 000020   	$$    = 000001
FD.RAH= 000001   	F.ERR = 000052   	NB.NAM= 000004   	S.FATT= 000016   	.OPFNB= ****** G
FD.RAN= 000002   	F.FACC= 000043   	NB.SD1= 000400   	S.FDB = 000140   	...GBL= 000000
FD.REC= 000001   	F.FFBY= 000014   	NB.SD2= 001000   	S.FNAM= 000006   	...TPC= 000140
FD.RWM= 000001   	F.FNAM= 000110   	NB.SNM= 000040   	S.FNB = 000036

. ABS.	000000	   000
      	000370	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2218 WORDS  ( 9 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:24
[44,10]P5MAP,[44,20]P5MAP/-SP=[44,30]MACFLM.,FCSPR.,P5MAP.006
P5MDS	MACRO M1108  05-DEC-77 23:09  PAGE 3


      1						.TITLE	P5MDS
      2						.IDENT	/11/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					;
      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     12					;
     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     15					; EQUIPMENT CORPORATION.
     16					;
     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     19					;
     20					; VERSION 11                                                                    ;**NEW**
     21					;                                                                               ;**-1
     22					; D. N. CUTLER/C. MONIA 27-JAN-74
     23					;
     24					; PHASE 5 MODULE SCAN
     25					;
     26					; MACRO LIBRARY CALLS
     27					;
     28
     29						.MCALL	CLOSE$,OFNB$U
     30
     31					;
     32					; LOCAL DATA
     33					;
     34					; AUTOLOAD ENTRY POINT NAME
     35					;
     36
     37	000000	124375 	077530 		$ALSYM::.RAD50	/$AUTO/		;
     38
     39					;
     40					; AUTOLOAD VECTOR PROTOTYPE
     41					;
     42
     43	000004	004737 	000000 		$ALVCT::JSR	PC,@#0		; CALL TO AUTO
     44	000010				$ALADR::.BLKW	1		; CALLED SEGMENT DESCRIPTOR ADDRESS
     45						.BLKW	1		; ADDRESS OF REAL AUTOLOAD ENTRY POINT          ;**-1
     46
     47					;+
     48					; **-$P5MDS-PHASE 5 MODULE SCAN
     49					;
     50					; THIS ROUTINE IS CALLED TO DO THE PHASE 5 MODULE SCAN OF ALL SEG-
     51					; MENTS IN THE ALLOCATION. AS EACH SEGMENT IS CONSIDERED, THE ELE-
     52					; MENT LIST IS SCANNED. THE SCAN STARTS WITH THE FIRST ELEMENT IN
     53					; THE LIST AND CONTINUES TO THE END OF THE LIST. AS EACH ELEMENT
     54					; IS CONSIDERED, THE NECESSARY RELOCATION IS PERFORMED AND THE RE-
     55					; SULTANT TEXT IS WRITTEN INTO THE TASK IMAGE.FILE.
     56					;
     57					; INPUTS:
P5MDS	MACRO M1108  05-DEC-77 23:09  PAGE 3-1


     58					;
     59					;	NONE.
     60					;
     61					; OUTPUTS:
     62					;
     63					;	NONE.
     64					;-
     65
     66	000014				$P5MDS::SAVRG			;SAVE NONVOLITILE REGISTERS
     67	000020	032767 	000000G	000000G		BIT	#TS$KF,$SWTCH	; TASK IMAGE FILE SPECIFIED?
     68	000026	001503 				BEQ	70$		; IF EQ NO
     69	000030	016700 	000000G			MOV	$TSKPT,R0	; GET TASK IMAGE RECORD BLOCK
     70	000034	010004 				MOV	R0,R4		; SAVE RECORD BLOCK POINTER
     71	000036					CALL	$STRCB		; SETUP RECORD BLOCK
     72	000042	010400 				MOV	R4,R0		; RETRIEVE POINTER
     73	000044					OFNB$U	R0		; OPEN TASK FILE FOR UPDATE
     74	000056	103470 				BCS	80$		; IF C/S ERROR
     75	000060	016700 	000000G			MOV	$INPPT,R0	; GET INPUT FILE RECORD BLOCK
     76	000064					CALL	$STRCB		; SET FDB RESIDENT
     77	000070	005067 	000000G		20$:	CLR	$BFFLG		;SET BUFFER FLAG FALSE
     78	000074	005067 	000000G			CLR	$WRSEG		;CLEAR SEGMENT BEING WRITTEN INTO
     79	000100	005067 	177702 			CLR	$ALVCT+2	; ASSUME AUTOLOAD ENTRY NOT DEFINED
     80	000104	016701 	000000G			MOV	$RTSEG,R1	; GET VIRTUAL ADDRESS OF ROOT SEGMENT
     81	000110					CALL	$CVRL		; CONVERT TO REAL ADDRESS
     82	000114	062700 	000000G			ADD	#S$GSTB,R0	;POINT TO SYMBOL TABLE
     83	000120	012701 	000000'			MOV	#$ALSYM,R1	; GET ADDRESS OF ENTRY NAME
     84	000124	162701 	000000G			SUB	#S$YM,R1	;CALCULATE PROPER OFFSET
     85	000130					CALL	$SRCH		;SEARCH FOR SYMBOL
     86	000134	103426 				BCS	50$		;IF CS NOT THERE
     87	000136	132760 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R0);SYMBOL DEFINITION?
     88	000144	001422 				BEQ	50$		;IF EQ NO
     89	000146	132760 	000000G	000000G		BITB	#SY$IND,S$YFLG(R0);INDIRECT REFERENCE?
     90	000154	001404 				BEQ	30$		;IF EQ NO
     91	000156	016001 	000000G			MOV	S$YVAL(R0),R1	; GET V/A OF REAL SYMBOL
     92	000162					CALL	$CVRL		; CONVERT TO REAL ADDRESS
     93	000166	016001 	000000G		30$:	MOV	S$YVAL(R0),R1	;GET SYMBOL VALUE
     94	000172	132760 	000000G	000000G		BITB	#SY$REL,S$YFLG(R0);ABS SYMBOL?
     95	000200	001402 				BEQ	40$		;IF EQ YES
     96	000202	066701 	000000G			ADD	$OFFST,R1	;ADD OFFSET BIAS
     97	000206				40$:				;
     98	000206	010167 	177574 			MOV	R1,$ALVCT+2	; SET ADDRESS OF AUTO
     99	000212	012700 	000264'		50$:	MOV	#P5MDS,R0	;GET PHASE CONTROL ROUTINE ADDRESS
    100	000216					CALL	$PCTRL		;CALL PHASE CONTROL ROUTINE
    101	000222					CALL	$FINFL		;FINISH TASK IMAGE FILE
    102	000226					CLOSE$	$TSKPT		;CLOSE TASK IMAGE FILE
    103	000236				70$:	RETURN			;
    104	000240				80$:				;
    105	000240	012701 	000000C			MOV	#<S$V0*400!E$R25>,R1 ; UNABLE TO RE-OPEN TASK FILE
    106	000244	016002 	000000G			MOV	R$NAME(R0),R2	; GET ADDRESS OF NAME STRING
    107	000250					CALL	$ERMSG		; OUTPUT ERROR MESSAGE
    108	000254	042767 	000000G	000000G		BIC	#TS$KF,$SWTCH	; CLEAR TASK IMAGE OPTION BIT
    109	000262					RETURN			; EXIT
    110					;
    111					; SEGMENT RELOCATION
    112					;
    113					; THIS ROUTINE IS CALLED FOR EACH SEGMENT IN THE ALLOCATION.
    114					;
P5MDS	MACRO M1108  05-DEC-77 23:09  PAGE 3-2


    115
    116	000264				P5MDS:	SAVRG			;SAVE NONVOLITILE REGISTERS
    117	000270	016700 	000000G			MOV	$CRVSG,R0	; GET VIRTUAL ADDRESS OF CURRENT SEGMENT
    118	000274					CALL	$ADRST		;SET ADDRESS LIMITS
    119	000300	012746 	000000G			MOV	#$STINP,-(SP)	; SET ADDRESS OF INPUT SETUP ROUTINE
    120	000304				20$:	CALL	@(SP)+		;SET UP NEXT INPUT FILE
    121	000306	103403 				BCS	P5MDS1		;IF CS NO MORE
    122	000310					CALL	$P5ELM		;PROCESS ELEMENT
    123	000314	000773 				BR	20$		;GO AGAIN
    124	000316				P5MDS1:				; OUTPUT SEGMENT TABLES, AUTOLOAD VECTORS
    125	000316					CALLR	$P5EOS		; PERFORM END-OF-SEGMENT CLEANUP
    126
    127		000001 				.END
P5MDS	MACRO M1108  05-DEC-77 23:09  PAGE 3-3
SYMBOL TABLE

B.BBFS= 000010   	FO.MFY= 000002   	F.MBC1= 000055   	N.FNAM= 000006   	TS$KF = ****** GX
B.BFST= 000015   	FO.RD = 000001   	F.MBFG= 000056   	N.FTYP= 000014   	VT    = 000013
B.NXBD= 000012   	FO.UPD= 000006   	F.NRBD= 000024   	N.FVER= 000016   	$ADRST= ****** GX
B.VBN = 000004   	FO.WRT= 000016   	F.NREC= 000030   	N.NEXT= 000022   	$ALADR  000010RG
CR    = 000015   	F.ALOC= 000040   	F.OVBS= 000030   	N.STAT= 000020   	$ALSYM  000000RG
E$R25 = ****** GX	F.BBFS= 000062   	F.RACC= 000016   	N.UNIT= 000034   	$ALVCT  000004RG
FA.APD= 000100   	F.BDB = 000070   	F.RATT= 000001   	PAR$$$= 000067   	$BFFLG= ****** GX
FA.CRE= 000010   	F.BGBC= 000057   	F.RCNM= 000034   	P5MDS   000264R  	$CRVSG= ****** GX
FA.EXT= 000004   	F.BKDN= 000026   	F.RCTL= 000017   	P5MDS1  000316R  	$CVRL = ****** GX
FA.NSP= 000100   	F.BKDS= 000020   	F.RSIZ= 000002   	R$NAME= ****** GX	$ERMSG= ****** GX
FA.RD = 000001   	F.BKEF= 000050   	F.RTYP= 000000   	R$$11M= 000000   	$FINFL= ****** GX
FA.SHR= 000040   	F.BKP1= 000051   	F.STBK= 000036   	R.FIX = 000001   	$INPPT= ****** GX
FA.TMP= 000020   	F.BKST= 000024   	F.UNIT= 000136   	R.VAR = 000002   	$OFFST= ****** GX
FA.WRT= 000002   	F.BKVB= 000064   	F.URBD= 000020   	SPA   = 000040   	$PCTRL= ****** GX
FD.BLK= 000010   	F.CNTG= 000034   	F.VBN = 000064   	SY$DEF= ****** GX	$P5ELM= ****** GX
FD.CCL= 000002   	F.DFNB= 000046   	F.VBSZ= 000060   	SY$IND= ****** GX	$P5EOS= ****** GX
FD.CR = 000002   	F.DSPT= 000044   	HT    = 000011   	SY$REL= ****** GX	$P5MDS  000014RG
FD.DIR= 000010   	F.DVNM= 000134   	LF    = 000012   	S$GSTB= ****** GX	$RTSEG= ****** GX
FD.FTN= 000001   	F.EFBK= 000010   	NB.DEV= 000200   	S$V0  = ****** GX	$SAVRG= ****** GX
FD.INS= 000010   	F.EFN = 000050   	NB.DIR= 000100   	S$YFLG= ****** GX	$SRCH = ****** GX
FD.PLC= 000004   	F.EOBB= 000032   	NB.NAM= 000004   	S$YM  = ****** GX	$STINP= ****** GX
FD.RAH= 000001   	F.ERR = 000052   	NB.SD1= 000400   	S$YVAL= ****** GX	$STRCB= ****** GX
FD.RAN= 000002   	F.FACC= 000043   	NB.SD2= 001000   	S.BFHD= 000020   	$SWTCH= ****** GX
FD.REC= 000001   	F.FFBY= 000014   	NB.SNM= 000040   	S.FATT= 000016   	$TSKPT= ****** GX
FD.RWM= 000001   	F.FNAM= 000110   	NB.STP= 000020   	S.FDB = 000140   	$WRSEG= ****** GX
FD.SDI= 000020   	F.FNB = 000102   	NB.SVR= 000010   	S.FNAM= 000006   	$$    = 000001
FD.SQD= 000040   	F.FTYP= 000116   	NB.TYP= 000002   	S.FNB = 000036   	.CLOSE= ****** G
FD.TTY= 000004   	F.FVER= 000120   	NB.VER= 000001   	S.FNBW= 000017   	.OPFNB= ****** G
FD.WBH= 000002   	F.HIBK= 000004   	N.DID = 000024   	S.FNTY= 000004   	...GBL= 000000
FF    = 000014   	F.LUN = 000042   	N.DVNM= 000032   	S.FTYP= 000002   	...TPC= 000140
FO.APD= 000106   	F.MBCT= 000054   	N.FID = 000000   	S.NFEN= 000020

. ABS.	000000	   000
      	000322	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2213 WORDS  ( 9 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:22
[44,10]P5MDS,[44,20]P5MDS/-SP=[44,30]MACFLM.,FCSPR.,P5MDS.011
P5MEL	MACRO M1108  05-DEC-77 23:09  PAGE 2


      1						.TITLE	P5MEL
      2						.IDENT	/06/
      3					                                                                                ;**-1
      4
      5					;
      6					; COPYRIGHT   1975,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					;
      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     12					;
     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     15					; EQUIPMENT CORPORATION.
     16					;
     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     19					;
     20					; VERSION 06
     21					;                                                                               ;**-1
     22					; D. N. CUTLER/C. MONIA 27-JAN-74
     23					;
     24					; OUTPUT THE TASK BUILDER MAP FOR EACH ELEMENT
     25					;
     26					; MODIFICATIONS:
     27					;
     28					; NO.		DATE		PROGRAMMER
     29					; ---		----		----------
     30					;
     31					; 039		31-MAR-75	C. MONIA
     32					;
     33					;
     34					; LOCAL DATA
     35					;
     36					; LOCAL SYMBOL STORAGE
     37					;
     38
     39	000000				LCLSYM:	.BLKW	6		;
     40
     41					;
     42					; MODULE FUNCTION DETAILS:
     43					;
     44					;+
     45					; **-$P5MEL-OUTPUT THE TASK BUILDER MAP FOR EACH ELEMENT IN THE SEGMENT
     46					;
     47					; INPUTS:
     48					;
     49					;	PHASE THREE TABLES
     50					;
     51					; OUTPUTS:
     52					;
     53					;	A MAP OF EACH ELEMENT IS PRODUCED
     54					;
     55					;-
     56					;
     57
P5MEL	MACRO M1108  05-DEC-77 23:09  PAGE 2-1


     58	000014				$P5MEL::			;
     59	000014					SAVRG			; SAVE NON-VOLATILE REGISTERS
     60	000020	016700 	000000G			MOV	$CRVSG,R0	; GET VIRTUAL ADDRESS OF CURRENT SEGMENT
     61	000024					CALL	$ADRSM		; SET ADDRESS LIMITS
     62	000030					CALL	$MPELT		; OUTPUT ELEMENT NAME
     63	000034				10$:				;
     64	000034					CALL	$GTBYT		; GET RECORD LENGTH
     65	000040	103410 				BCS	20$		; IF C/S-EOF(ILLEGAL FORMAT)
     66	000042	010003 				MOV	R0,R3		; SAVE RECORD LENGTH
     67	000044					CALL	$GTWRD		; GET BLOCK TYPE
     68	000050	162703 	000002 			SUB	#2,R3		; ADJUST BYTE COUNT
     69	000054	020027 	000006 			CMP	R0,#LGBLK	; LEGAL BLOCK TYPE
     70	000060	101401 				BLOS	30$		; IF LOS YES
     71	000062				20$:				;
     72	000062	005000 				CLR	R0		; FORCE ILLEGAL FORMAT
     73	000064				30$:				;
     74	000064	006300 				ASL	R0		; MAKE WORD INDEX
     75	000066					CALL	@DSPVCT(R0)	; CALL BLOCK DEPENDANT ROUTINE
     76	000072	000760 				BR	10$		; GO AGAIN
     77
     78					;
     79					; DISPATCH VECTOR TABLE
     80					;
     81
     82	000074				DSPVCT:				;
     83	000074	000370'				.WORD	ILFMT		; BLOCK 0-ILLEGAL BLOCK TYPE
     84	000076	000112'				.WORD	STGSD		; BLOCK 1-START GSD
     85	000100	000366'				.WORD	ENGSD		; BLOCK 2-END GSD
     86	000102	000502'				.WORD	RPEAT		; BLOCK 3-TXT
     87	000104	000502'				.WORD	RPEAT		; BLOCK 4-RLD
     88	000106	000502'				.WORD	RPEAT		; BLOCK 5-ISD
     89	000110	000410'				.WORD	MODND		; BLOCK 6-MODULE END
     90		000006 			LGBLK=<.-DSPVCT-2>/2
     91
     92					;
     93					; START GSD -BLOCK TYPE 1
     94					;
     95
     96	000112				STGSD:				;
     97	000112	012704 	000002'			MOV	#LCLSYM+2,R4	; GET ADDRESS TO STORE SYMBOL
     98	000116	012705 	000004 			MOV	#4,R5		; SET REPEAT COUNT
     99	000122				10$:				;
    100	000122					CALL	$GTWRD		; GET A WORD
    101	000126	010024 				MOV	R0,(R4)+	; SAVE IN TEMP BUFFER
    102	000130					SOB	R5,10$		; REPEAT
    103	000134	162703 	000010 			SUB	#8.,R3		; ADJUST FOR SYMBOL ENTRY
    104	000140	012701 	000000'			MOV	#LCLSYM,R1	; GET ADDRESS OF SYMBOL DESCRIPTOR
    105	000144	116102 	000000G			MOVB	S$CNT(R1),R2	; GET TYPE OF GSD ENTRY
    106	000150	020227 	000006 			CMP	R2,#LGTYP	; LEGAL TYPE ?
    107	000154	101105 				BHI	ILFMT		; IF HI ILLEGAL FORMAT
    108	000156	006302 				ASL	R2		; MAKE WORD INDEX
    109	000160	016700 	000000G			MOV	$CRSEG,R0	; GET ADDRESS OF CURRENT SEGMENT
    110	000164					CALL	@GSDVCT(R2)	; DISPATCH TO ROUTINE
    111	000170	005703 				TST	R3		; ANY MORE TO PROCESS
    112	000172	003347 				BGT	STGSD		; IF GT GO AGAIN
    113	000174					RETURN			;
    114
P5MEL	MACRO M1108  05-DEC-77 23:09  PAGE 2-2


    115					;
    116					; GSD ENTRY TYPE DISPATCH TABLE
    117					;
    118
    119	000176				GSDVCT:				;
    120	000176	000214'				.WORD	MODNME		; MODULE NAME
    121	000200	000216'				.WORD	SCTNME		; SECTION NAME
    122	000202	000240'				.WORD	INTSYM		; INTERNAL SYMBOL
    123	000204	000242'				.WORD	XFRADR		; TRANSFER ADDRESS
    124	000206	000244'				.WORD	SYMDCL		; SYMBOL DECLARATION
    125	000210	000216'				.WORD	SCTNME		; PROGRAM SECTION NAME
    126	000212	000364'				.WORD	VIDENT		; VERSION IDENTIFICATION
    127		000006 			LGTYP=<.-GSDVCT-2>/2
    128
    129					;
    130					; MODULE NAME
    131					;
    132
    133	000214				MODNME:				;
    134	000214					RETURN			;
    135
    136					;
    137					; SECTION AND PROGRAM SECTION NAME
    138					;
    139
    140	000216				SCTNME:				;
    141	000216	062700 	000000G			ADD	#S$GCST,R0	; POINT TO SECTION NAME
    142	000222					CALL	$SRCH		; SEARCH FOR SYMBOL
    143	000226	103460 				BCS	ILFMT		; IF C/S ILLEGAL FORMAT
    144	000230	012701 	000000'			MOV	#LCLSYM,R1	; GET ADDRESS OF LOCAL SYMBOL
    145	000234					CALLR	$MPSCT		; OUTPUT SECTION NAME
    146
    147					;
    148					; INTERNAL SYMBOL
    149					;
    150
    151	000240				INTSYM:				;
    152	000240					RETURN			;
    153
    154					;
    155					; TRANSFER ADDRESS
    156					;
    157
    158	000242				XFRADR:				;
    159	000242					RETURN			;
    160
    161					;
    162					; SYMBOL DECLARATION
    163					;
    164
    165	000244				SYMDCL:				;
    166	000244	132761 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R1) ; SYMBOL DEFINITION?
    167	000252	001414 				BEQ	20$		; IF EQ NO
    168	000254	062700 	000000G			ADD	#S$GSTB,R0	; POINT TO SYMBOL TABLE
    169	000260					CALL	$SRCH		; SEARCH FOR SYMBOL NAME
    170	000264	103430 				BCS	70$		; IF C/S CHECK IF SELECTIVE MODULE
    171	000266	132760 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R0) ; DEFINITION?                                ;**-2
P5MEL	MACRO M1108  05-DEC-77 23:09  PAGE 2-3


    172	000274	001424 				BEQ	70$		;++039 IF EQ NO, CHECK IF SELECTIVE MODULE
    173	000276					CALL	$MPSYM		; OUTPUT SYMBOL NAME
    174	000302	000420 				BR	60$		;
    175	000304				20$:				;
    176	000304	012746 	000000G			MOV	#$WSRCS,-(SP)	; SET ADDRESS OF SEARCH ROUTINE
    177	000310				30$:				;
    178	000310					CALL	@(SP)+		; SEARCH FOR SYMBOL
    179	000312	103410 				BCS	50$		; IF C/S NOT THERE
    180	000314	003006 				BGT	40$		; IF GT-FOUND ON PATH UP
    181	000316	132760 	000000G	000000G		BITB	#SY$DEF,S$YFLG(R0) ; DEFINITION ?
    182	000324	001771 				BEQ	30$		; IF EQ-NO CONTINUE SEARCH
    183	000326	005726 				TST	(SP)+		; CLEAN STACK
    184	000330	000405 				BR	60$		; EXIT
    185	000332				40$:				;
    186	000332	005726 				TST	(SP)+		; CLEAN STACK
    187	000334				50$:				;
    188	000334	012700 	000000'			MOV	#LCLSYM,R0	; GET ADDRESS OF LOCAL SYMBOL DESCRIPTOR
    189	000340					CALL	$MPUSY		; OUTPUT UNDEFINED SYMBOL REFERENCE
    190	000344				60$:				;
    191	000344					RETURN			;
    192	000346				70$:				;
    193	000346	016701 	000000G			MOV	$CRELM,R1	; GET ADDRESS OF ELEMENT DESCRIPTOR
    194	000352	032761 	000000G	000000G		BIT	#SW$SS,E$LSWT(R1) ; SELECTIVE EXTRACTION MODULE ?
    195	000360	001403 				BEQ	ILFMT		; IF EQ ILLEGAL FORMAT
    196	000362					RETURN			;
    197
    198					;
    199					; VERSION IDENTIFIER
    200					;
    201
    202	000364				VIDENT:				;
    203	000364					RETURN			;
    204
    205					;
    206					; END GSD
    207					;
    208
    209	000366				ENGSD:				;
    210	000366	000445 				BR	RPEAT		;
    211					;
    212					; ILLEGAL FORMAT-BLOCK TYPES 0 - 6
    213					;
    214
    215	000370				ILFMT:				;
    216	000370	016702 	000000G			MOV	$INPPT,R2	; GET INPUT FILE RECORD BLOCK
    217	000374	016202 	000000G			MOV	R$NAME(R2),R2	; GET ADDRESS OF NAME STRING
    218	000400	012701 				MOV	(PC)+,R1	; DIAGNOSTIC
    219	000402	   000G	   000G			.BYTE	E$R14,S$V2	; FATAL-NO RETURN
    220	000404					CALL	$ERMSG		; OUTPUT ERROR MESSAGE
    221
    222					;
    223					; BLOCK TYPE 6 - MODULE END
    224					;
    225
    226	000410				MODND:				;
    227	000410	005726 				TST	(SP)+		; REMOVE RETURN
    228	000412	016704 	000000G			MOV	$CRELM,R4	; GET ELEMENT DESCRIPTOR ADDRESS
P5MEL	MACRO M1108  05-DEC-77 23:09  PAGE 2-4


    229	000416	016403 	000000G			MOV	E$LCMT(R4),R3	; GET CMT TABLE ADDRESS
    230	000422	001426 				BEQ	30$		; IF EQ NONE
    231	000424	016446 	000000G			MOV	E$LNUM(R4),-(SP) ; GET HIGHEST SECTION NUMBER
    232	000430	005216 				INC	(SP)		; CONVERT TO LOOP COUNT
    233	000432				10$:				;
    234	000432	012301 				MOV	(R3)+,R1	; GET ADDRESS OF ENTRY
    235	000434					CALL	$CVRL		; CONVERT TO REAL
    236	000440					CALL	$WRMPG		; WRITE-MARK PAGE
    237	000444	012301 				MOV	(R3)+,R1	; GET MAX LENGTH OF ENTRY
    238	000446	132760 	000000C	000000G		BITB	#<CS$LIB!CS$ALO>,C$SFLG(R0) ; LIB. OR OVR SECTION?
    239	000454	001006 				BNE	20$		; IF NE YES, DON'T UPDATE LENGTH
    240	000456	132760 	000000G	000000G		BITB	#CS$REL,C$SFLG(R0) ; ABS SECTION?
    241	000464	001402 				BEQ	20$		; IF EQ YES
    242	000466	060160 	000000G			ADD	R1,C$SCUR(R0)	; UPDATE CURRENT OFFSET ADDRESS
    243	000472				20$:				;
    244	000472	005316 				DEC	(SP)		; DECREMENT COUNT
    245	000474	003356 				BGT	10$		; IF GT GO AGAIN
    246	000476	005726 				TST	(SP)+		; CLEAN STACK
    247	000500				30$:				;
    248	000500					RETURN			;
    249
    250					;
    251					; IGNORE REMAINDER OF RECORD
    252					;
    253
    254	000502				RPEAT:				;
    255	000502	005067 	000000G			CLR	$NBYTE		; FORCE READ OF NEXT RECORD
    256	000506					RETURN			;
    257
    258		000001 				.END
P5MEL	MACRO M1108  05-DEC-77 23:09  PAGE 2-5
SYMBOL TABLE

CR    = 000015   	FF    = 000014   	R$NAME= ****** GX	S$YFLG= ****** GX	$INPPT= ****** GX
CS$ALO= ****** GX	GSDVCT  000176R  	R$$11M= 000000   	VIDENT  000364R  	$MPELT= ****** GX
CS$LIB= ****** GX	HT    = 000011   	SCTNME  000216R  	VT    = 000013   	$MPSCT= ****** GX
CS$REL= ****** GX	ILFMT   000370R  	SPA   = 000040   	XFRADR  000242R  	$MPSYM= ****** GX
C$SCUR= ****** GX	INTSYM  000240R  	STGSD   000112R  	$ADRSM= ****** GX	$MPUSY= ****** GX
C$SFLG= ****** GX	LCLSYM  000000R  	SW$SS = ****** GX	$CRELM= ****** GX	$NBYTE= ****** GX
DSPVCT  000074R  	LF    = 000012   	SYMDCL  000244R  	$CRSEG= ****** GX	$P5MEL  000014RG
ENGSD   000366R  	LGBLK = 000006   	SY$DEF= ****** GX	$CRVSG= ****** GX	$SAVRG= ****** GX
E$LCMT= ****** GX	LGTYP = 000006   	S$CNT = ****** GX	$CVRL = ****** GX	$SRCH = ****** GX
E$LNUM= ****** GX	MODND   000410R  	S$GCST= ****** GX	$ERMSG= ****** GX	$WRMPG= ****** GX
E$LSWT= ****** GX	MODNME  000214R  	S$GSTB= ****** GX	$GTBYT= ****** GX	$WSRCS= ****** GX
E$R14 = ****** GX	RPEAT   000502R  	S$V2  = ****** GX	$GTWRD= ****** GX	$$    = 000001

. ABS.	000000	   000
      	000510	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  873 WORDS  ( 4 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[44,10]P5MEL,[44,20]M5MEL/-SP=[44,30]MACFLM.,P5MEL.006
P6STB	MACRO M1108  05-DEC-77 23:09  PAGE 3


      1						.TITLE	P6STB
      2						.IDENT	/12/                                                            ;**NEW**
      3					;                                                                               ;**-1
      4					; COPYRIGHT   1975, DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      5					;
      6					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      7					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      8					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
      9					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     10					;
     11					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     12					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     13					; EQUIPMENT CORPORATION.
     14					;
     15					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     16					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     17					;
     18					;
     19					; VERSION 12
     20					;                                                                               ;**-1
     21					; D. N. CUTLER/C. MONIA	21-JAN-74
     22					;
     23					; MODIFICATIONS:
     24					;
     25					; NO.		DATE		PROGRAMMER
     26					; ---		----		----------
     27					;
     28					; 038		22-MAR-75	C. MONIA
     29					;
     30					;
     31					; SYMBOL TABLE OUTPUT
     32					;
     33					; EQUATED SYMBOLS
     34					;
     35					; GSD ENTRY TYPES
     36					;
     37
     38		000006 			IDNTYP=6			;IDENTIFICATION
     39		000005 			SECTYP=5			;P-SECTION NAME
     40		000004 			SYMTYP=4			;SYMBOL NAME
     41		000000 			TTLTYP=0			;MODULE NAME
     42
     43					;
     44					; OBJECT FILE BLOCK TYPES
     45					;
     46
     47		000001 			GSDSTR=1			;GSD START
     48		000002 			GSDEND=2			;GSD END
     49		000006 			MODEND=6			;MODULE END
     50
     51
     52					; MACRO LIBRARY CALLS
     53					;
     54
     55						.MCALL	CLOSE$,OFNB$W,PUT$S
     56
     57					;
P6STB	MACRO M1108  05-DEC-77 23:09  PAGE 3-1


     58					; LOCAL DATA
     59					;
     60
     61	000000				CRSCT:	.BLKW	1		; VIRTUAL ADDRESS OF CURRENT SECTION
     62	000002				LCLSYM:	.BLKW	10.		; DATA FROM CURRENT SECTION.
     63	000026				STBBF:	.BLKW	64.		;SYMBOL BUFFER
     64	000226				STBPT:	.BLKW	1		;SYMBOL BUFFER POINTER
     65
     66					;+
     67					; **-$P6STB-PHASE 6 SYMBOL TABLE OUTPUT
     68					;
     69					; THIS ROUTINE IS CALLED AT THE END OF PHASE 5 TO OUTPUT A SYMBOL
     70					; TABLE FILE. THE FILE IS WRITTEN IN OBJECT MODULE FORMAT SO THAT
     71					; IT MAY BE READ BY THE TASK BUILDER.
     72					;
     73					; INPUTS:
     74					;
     75					;	NONE.
     76					;
     77					; OUTPUTS:
     78					;
     79					;	SYMBOL TABLE FILE IS WRITTEN.
     80					;-
     81
     82	000230				$P6STB::SAVRG			;SAVE NONVOLITILE REGISTERS
     83	000234	016700 	000000G			MOV	$STBPT,R0	; GET RECORD BLOCK POINTER
     84	000240	010004 				MOV	R0,R4		; SAVE POINTER
     85	000242					CALL	$STRCB		; SETUP OUTPUT FILE
     86	000246	010400 				MOV	R4,R0		; RETRIEVE POINTER
     87	000250					OFNB$W	R0		; OPEN SYMBOL FILE
     88	000262	103007 				BCC	10$		;IF CC OKAY
     89	000264	016002 	000000G			MOV	R$NAME(R0),R2	;GET ADDRESS OF NAME STRING
     90	000270	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
     91	000272	   000G	   000G			.BYTE	E$R11,S$V0	;DIAGNOSTIC
     92	000274					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
     93	000300	000503 				BR	20$		;
     94	000302				10$:				;
     95	000302	016701 	000000G			MOV	$RTSEG,R1	; GET VIRTUAL ADDRESS OF ROOT
     96	000306					CALL	$CVRL		; CONVERT TO REAL ADDRESS
     97	000312	010001 				MOV	R0,R1		; COPY REAL ADDRESS
     98	000314	012700 	000026'			MOV	#STBBF,R0	; GET SYMBOL BUFFER ADDRESS
     99	000320	012720 	000001 			MOV	#GSDSTR,(R0)+	; SET FIRST BLOCK TYPE
    100	000324	016120 	000000G			MOV	S$GNME(R1),(R0)+;SET MODULE NAME
    101	000330	016120 	000002G			MOV	S$GNME+2(R1),(R0)+;
    102	000334	012720 				MOV	(PC)+,(R0)+	;SET GSD ENTRY TYPE
    103	000336	   000 	   000 			.BYTE	0,TTLTYP	;
    104	000340	005020 				CLR	(R0)+		;CLEAR 4TH WORD OF ENTRY
    105	000342	016720 	000000G			MOV	$IDENT,(R0)+	;SET PROGRAM IDENTIFICATION
    106	000346	016720 	000002G			MOV	$IDENT+2,(R0)+	;
    107	000352	012720 				MOV	(PC)+,(R0)+	;SET GSD ENTRY TYPE
    108	000354	   000 	   006 			.BYTE	0,IDNTYP	;
    109	000356	005020 				CLR	(R0)+		;CLEAR 4TH WORD OF ENTRY
    110	000360	016701 	000000G			MOV	$STBPT,R1	; GET ADDRESS OF STB RECORD BLOCK
    111	000364	032761 	000000G	000000G		BIT	#SW$PI,R$SWTH(R1);PIC OUTPUT?
    112	000372	001013 				BNE	15$		;IF NE YES
    113	000374	016720 	000000G			MOV	$ABSNM,(R0)+	;INSERT NAME OF ABS SECTION
    114	000400	016720 	000002G			MOV	$ABSNM+2,(R0)+	;
P6STB	MACRO M1108  05-DEC-77 23:09  PAGE 3-2


    115	000404	012710 				MOV	(PC)+,(R0)	;SET TYPE/FLAGS
    116	000406	   000 	   005 			.BYTE	0,SECTYP	;
    117	000410	052710 	000000G			BIS	#CS$ALO,(R0)	;INSERT DEFAULT ABS FLAG BITS
    118	000414	052720 	000000G			BIS	#CS$GBL,(R0)+	;
    119	000420	005020 				CLR	(R0)+		;CLEAR LENGTH
    120	000422	010067 	177600 		15$:	MOV	R0,STBPT	;SAVE SYMBOL BUFFER POINTER
    121	000426	012700 	000512'			MOV	#P6STB,R0	;GET PHASE CONTROL ROUTINE ADDRESS
    122	000432					CALL	$PCTRL		;CALL PHASE CONTROL ROUTINE
    123	000436	012704 	000030'			MOV	#STBBF+2,R4	;GET POINTER INTO BUFFER
    124	000442	026704 	177560 			CMP	STBPT,R4	;ANYTHING IN BUFFER?
    125	000446	001402 				BEQ	17$		;IF EQ NO
    126	000450					CALL	STOUT1		;OUTPUT PARTIAL BUFFER
    127	000454	012764 	000002 	177776 	17$:	MOV	#GSDEND,-2(R4)	;SET BLOCK TYPE
    128	000462					CALL	STOUT2		;OUTPUT GSD END BLOCK
    129	000466	012764 	000006 	177776 		MOV	#MODEND,-2(R4)	;SET BLOCK TYPE
    130	000474					CALL	STOUT2		;OUTPUT MODULE END BLOCK
    131	000500					CLOSE$	$STBPT		;CLOSE SYMBOL FILE
    132	000510				20$:	RETURN			;
    133
    134					;
    135					; OUTPUT SEGMENT SYMBOL TABLE
    136					;
    137					; THIS ROUTINE IS CALLED FOR EACH SEGMENT IN THE ALLOCATION
    138					;
    139
    140	000512				P6STB:	SAVRG			;SAVE NONVOLITILE REGISTERS
    141	000516	016703 	000000G			MOV	$CRSEG,R3	;GET ADDRESS OF CURRENT SEGMENT                 ;**-1
    142	000522	016704 	177500 			MOV	STBPT,R4	;GET SYMBOL BUFFER POINTER
    143	000526	032767 	000000G	000000G		BIT	#SE$QA,$SWTCH	;SEQUENCE ALLOCATION
    144	000534	001022 				BNE	20$		; IF NE YES
    145	000536	012746 	000001 			MOV	#1,-(SP)	;++038 SET SUBLIST COUNT
    146	000542	062703 	000002G			ADD	#S$GCST+2,R3	; POINT TO SECTION TABLE+2
    147	000546				5$:				;
    148	000546	010346 				MOV	R3,-(SP)	; SAVE LISTHEAD ADDRESS
    149	000550					CALL	10$		; PROCESS ALL SECTIONS IN THIS SUBLIST
    150	000554	012603 				MOV	(SP)+,R3	; RETRIEVE SUBLIST ADDRESS
    151	000556	005723 				TST	(R3)+		; POINT TO NEXT LISTHEAD
    152	000560	005316 				DEC	(SP)		; DECREMENT COUNT
    153	000562	003371 				BGT	5$		; IF GT GO AGAIN
    154	000564	005226 				INC	(SP)+		; CLEAN STACK
    155	000566					RETURN			; EXIT
    156	000570				10$:				;
    157	000570	011301 				MOV	(R3),R1		; GET VIRTUAL ADDRESS OF SECTION
    158	000572	001415 				BEQ	40$		; IF EQ DONE
    159	000574					CALL	50$		; SCAN SYMBOL TABLE IF NECESSARY
    160	000600	000773 				BR	10$		; GO AGAIN
    161	000602				20$:				;
    162	000602	010305 				MOV	R3,R5		; COPY ADDRESS OF SEGMENT
    163	000604	062705 	000000G			ADD	#S$GSEQ,R5	; POINT TO SEQUENCE ALLOCATION LISTHEAD
    164	000610				30$:				;
    165	000610	011505 				MOV	(R5),R5		; GET ADDRESS OF NEXT ENTRY
    166	000612	001405 				BEQ	40$		; IF EQ DONE
    167	000614	016501 	000002 			MOV	2(R5),R1	; GET VIRTUAL ADDRESS OF SECTION
    168	000620					CALL	50$		; SCAN SYMBOL TABLE IF REQUIRED
    169	000624	000771 				BR	30$		; GO AGAIN
    170	000626				40$:				;
    171	000626	010467 	177374 			MOV	R4,STBPT	; SAVE BUFFER POINTER
P6STB	MACRO M1108  05-DEC-77 23:09  PAGE 3-3


    172	000632					RETURN			;
    173	000634				50$:				;
    174	000634					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    175	000640	010167 	177134 			MOV	R1,CRSCT	; SAVE VIRTUAL ADDRESS OF CURRENT SECTION
    176	000644	012701 	000002'			MOV	#LCLSYM,R1	; GET ADDRESS TO STORE ENTRY
    177	000650	010103 				MOV	R1,R3		; COPY ADDRESS
    178	000652	012702 	000000C			MOV	#C$SLGH/2,R2	; SET LENGTH OF ENTRY
    179	000656				60$:				;
    180	000656	012021 				MOV	(R0)+,(R1)+	; COPY ENTRY
    181	000660					SOB	R2,60$		;
    182	000664	142763 	000000G	000000G		BICB	#CS$ATL,C$SFLG(R3) ; CLEAR POSSIBLE AUTOLOAD FLAG
    183	000672	132763 	000000G	000000G		BITB	#CS$IND,C$SFLG(R3) ;INDIRECT ENTRY?
    184	000700	001015 				BNE	80$		;IF NE YES
    185	000702	016301 	000000G			MOV	C$SELM(R3),R1	; GET BACK POINTER TO ELEMENT DESCRIPTOR
    186	000706	001406 				BEQ	75$		;IF EQ . ABS. SECTION
    187	000710					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    188	000714	032760 	000000G	000000G		BIT	#SW$RL,E$LSWT(R0) ;LIBRARY ELEMENT?
    189	000722	001004 				BNE	80$		;IF NE YES
    190	000724	010546 			75$:	MOV	R5,-(SP)	;SAVE R5
    191	000726					CALL	P6SCN		;SCAN SYMBOL TABLE
    192	000732	012605 				MOV	(SP)+,R5	;RESTORE R5
    193	000734				80$:	RETURN			;
    194
    195					;
    196					; SYMBOL TABLE SCAN
    197					;
    198
    199	000736				P6SCN:				;
    200	000736	016705 	000000G			MOV	$STBPT,R5	; GET STB FILE RECORD BLOCK
    201	000742	032765 	000000G	000000G		BIT	#SW$PI,R$SWTH(R5);PIC OUTPUT?
    202	000750	001430 				BEQ	20$		;IF EQ NO
    203	000752	016324 	000000G			MOV	S$YM(R3),(R4)+	;SET SECTION NAME
    204	000756	001005 				BNE	5$		;IF NE NOT BLANK SECTION
    205	000760	005744 				TST	-(R4)		;BACK UP BUFFER POINTER
    206	000762	005763 	000000G			TST	C$SLTH(R3)	;ZERO LENGTH?
    207	000766	001506 				BEQ	60$		;IF EQ YES - BYPASS
    208	000770	005724 				TST	(R4)+		;RE-ADJUST BUFFER POINTER
    209	000772	016324 	000002G		5$:	MOV	S$YM+2(R3),(R4)+;SET SECOND HALF OF NAME
    210	000776	012700 				MOV	(PC)+,R0	;GET GSD SECTION ENTRY TYPE
    211	001000	   000 	   005 			.BYTE	0,SECTYP	;
    212	001002	156300 	000000G			BISB	C$SFLG(R3),R0	;MERGE IN FLAG BITS
    213	001006	032700 	000000G			BIT	#CS$REL,R0	;ABS SECTION?
    214	001012	001402 				BEQ	10$		;IF EQ YES
    215	001014	052700 	000000G			BIS	#CS$LIB,R0	;MERGE IN LIBRARY BIT
    216	001020	010024 			10$:	MOV	R0,(R4)+	;SET TYPE/FLAGS
    217	001022	016324 	000000G			MOV	C$SLTH(R3),(R4)+;SET LENGTH OF SECTION
    218	001026					CALL	STOUT		;OUTPUT IF NECESSARY
    219	001032	016700 	000000G		20$:	MOV	$CRSEG,R0	;GET ADDRESS OF CURRENT SEGMENT
    220	001036	062700 	000000G			ADD	#S$GSTB,R0	;POINT TO SYMBOL TABLE
    221	001042	012746 	000000G			MOV	#$ISED,-(SP)	;SET ADDRESS OF SYMBOL EDIT ROUTINE
    222	001046				30$:	CALL	@(SP)+		;GET NEXT SYMBOL
    223	001050	103455 				BCS	60$		;IF CS DONE
    224	001052	026760 	176722 	000000G		CMP	CRSCT,S$YCMT(R0) ; SECTION MATCH?
    225	001060	001372 				BNE	30$		;IF NE NO
    226	001062	132760 	000000G	000000G		BITB	#SY$LIB,S$YFLG(R0);SYMBOL DEFINED IN LIBRARY?
    227	001070	001366 				BNE	30$		;IF NE YES
    228	001072					CALL	$WRMPG		; WRITE-MARK PAGE
P6STB	MACRO M1108  05-DEC-77 23:09  PAGE 3-4


    229	001076	016024 	000000G			MOV	S$YM(R0),(R4)+	;SET SYMBOL NAME
    230	001102	016024 	000002G			MOV	S$YM+2(R0),(R4)+;
    231	001106	012701 				MOV	(PC)+,R1	;GET GSD ENTRY TYPE
    232	001110	   000 	   004 			.BYTE	0,SYMTYP	;
    233	001112	156001 	000000G			BISB	S$YFLG(R0),R1	;MERGE FLAG BITS
    234	001116	032765 	000000G	000000G		BIT	#SW$PI,R$SWTH(R5);PIC OUTPUT?
    235	001124	001012 				BNE	40$		;IF NE YES
    236	001126	132763 	000000G	000000G		BITB	#CS$REL,C$SFLG(R3);ABS SECTION?
    237	001134	001415 				BEQ	50$		;IF EQ YES
    238	001136	066760 	000000G	000000G		ADD	$OFFST,S$YVAL(R0);ADD OFFSET BIAS
    239	001144	042701 	000000G			BIC	#SY$REL,R1	;CLEAR RELATIVE FLAG
    240	001150	000407 				BR	50$		;
    241	001152	032763 	000000G	000000G	40$:	BIT	#CS$REL,C$SFLG(R3);ABS SECTION?
    242	001160	001403 				BEQ	50$		;IF EQ YES
    243	001162	166360 	000000G	000000G		SUB	C$SBSE(R3),S$YVAL(R0);MAKE SYMBOL VALUE RELATIVE
    244	001170	010124 			50$:	MOV	R1,(R4)+	;SET TYPE/FLAGS
    245	001172	016024 	000000G			MOV	S$YVAL(R0),(R4)+;SET SYMBOL VALUE
    246	001176					CALL	STOUT		;OUTPUT IF NECESSARY
    247	001202	000721 				BR	30$		;GO AGAIN
    248	001204				60$:	RETURN			;
    249
    250					;
    251					; SYMBOL BUFFER OUTPUT ROUTINE
    252					;
    253
    254	001206	020427 	000216'		STOUT:	CMP	R4,#STBPT-8.	;ROOM FOR ANOTHER SYMBOL?
    255	001212	103003 				BHIS	STOUT2		;IF HIS NO
    256	001214					RETURN			;
    257	001216	016704 	177004 		STOUT1:	MOV	STBPT,R4	;GET BUFFER POINTER
    258	001222	162704 	000026'		STOUT2:	SUB	#STBBF,R4	;CALCULATE LENGTH OF BUFFER
    259	001226	001420 				BEQ	10$		;IF EQ EMPTY
    260	001230	016700 	000000G			MOV	$STBPT,R0	;GET SYMBOL FILE RECORD BLOCK
    261	001234					PUT$S	R0,#STBBF,R4	; OUTPUT RECORD
    262	001252	103006 				BCC	10$		;IF CC OKAY
    263	001254	016002 	000000G			MOV	R$NAME(R0),R2	;GET ADDRESS OF NAME STRING
    264	001260	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
    265	001262	   000G	   000G			.BYTE	E$R25,S$V2	;FATAL-NO RETURN
    266	001264					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    267	001270	012704 	000026'		10$:	MOV	#STBBF,R4	;GET ADDRESS OF SYMBOL BUFFER
    268	001274	012724 	000001 			MOV	#GSDSTR,(R4)+	;SET BLOCK TYPE
    269	001300					RETURN			;
    270
    271		000001 				.END
P6STB	MACRO M1108  05-DEC-77 23:09  PAGE 3-5
SYMBOL TABLE

B.BBFS= 000010   	FD.REC= 000001   	F.HIBK= 000004   	N.DID = 000024   	S$YCMT= ****** GX
B.BFST= 000015   	FD.RWM= 000001   	F.LUN = 000042   	N.DVNM= 000032   	S$YFLG= ****** GX
B.NXBD= 000012   	FD.SDI= 000020   	F.MBCT= 000054   	N.FID = 000000   	S$YM  = ****** GX
B.VBN = 000004   	FD.SQD= 000040   	F.MBC1= 000055   	N.FNAM= 000006   	S$YVAL= ****** GX
CR    = 000015   	FD.TTY= 000004   	F.MBFG= 000056   	N.FTYP= 000014   	S.BFHD= 000020
CRSCT   000000R  	FD.WBH= 000002   	F.NRBD= 000024   	N.FVER= 000016   	S.FATT= 000016
CS$ALO= ****** GX	FF    = 000014   	F.NREC= 000030   	N.NEXT= 000022   	S.FDB = 000140
CS$ATL= ****** GX	FO.APD= 000106   	F.OVBS= 000030   	N.STAT= 000020   	S.FNAM= 000006
CS$GBL= ****** GX	FO.MFY= 000002   	F.RACC= 000016   	N.UNIT= 000034   	S.FNB = 000036
CS$IND= ****** GX	FO.RD = 000001   	F.RATT= 000001   	PAR$$$= 000000   	S.FNBW= 000017
CS$LIB= ****** GX	FO.UPD= 000006   	F.RCNM= 000034   	P6SCN   000736R  	S.FNTY= 000004
CS$REL= ****** GX	FO.WRT= 000016   	F.RCTL= 000017   	P6STB   000512R  	S.FTYP= 000002
C$SBSE= ****** GX	F.ALOC= 000040   	F.RSIZ= 000002   	R$NAME= ****** GX	S.NFEN= 000020
C$SELM= ****** GX	F.BBFS= 000062   	F.RTYP= 000000   	R$SWTH= ****** GX	TTLTYP= 000000
C$SFLG= ****** GX	F.BDB = 000070   	F.STBK= 000036   	R$$11M= 000000   	VT    = 000013
C$SLGH= ****** GX	F.BGBC= 000057   	F.UNIT= 000136   	R.FIX = 000001   	$ABSNM= ****** GX
C$SLTH= ****** GX	F.BKDN= 000026   	F.URBD= 000020   	R.VAR = 000002   	$CRSEG= ****** GX
E$LSWT= ****** GX	F.BKDS= 000020   	F.VBN = 000064   	SECTYP= 000005   	$CVRL = ****** GX
E$R11 = ****** GX	F.BKEF= 000050   	F.VBSZ= 000060   	SE$QA = ****** GX	$ERMSG= ****** GX
E$R25 = ****** GX	F.BKP1= 000051   	GSDEND= 000002   	SPA   = 000040   	$IDENT= ****** GX
FA.APD= 000100   	F.BKST= 000024   	GSDSTR= 000001   	STBBF   000026R  	$ISED = ****** GX
FA.CRE= 000010   	F.BKVB= 000064   	HT    = 000011   	STBPT   000226R  	$OFFST= ****** GX
FA.EXT= 000004   	F.CNTG= 000034   	IDNTYP= 000006   	STOUT   001206R  	$PCTRL= ****** GX
FA.NSP= 000100   	F.DFNB= 000046   	LCLSYM  000002R  	STOUT1  001216R  	$P6STB  000230RG
FA.RD = 000001   	F.DSPT= 000044   	LF    = 000012   	STOUT2  001222R  	$RTSEG= ****** GX
FA.SHR= 000040   	F.DVNM= 000134   	MODEND= 000006   	SW$PI = ****** GX	$SAVRG= ****** GX
FA.TMP= 000020   	F.EFBK= 000010   	NB.DEV= 000200   	SW$RL = ****** GX	$STBPT= ****** GX
FA.WRT= 000002   	F.EFN = 000050   	NB.DIR= 000100   	SYMTYP= 000004   	$STRCB= ****** GX
FD.BLK= 000010   	F.EOBB= 000032   	NB.NAM= 000004   	SY$LIB= ****** GX	$SWTCH= ****** GX
FD.CCL= 000002   	F.ERR = 000052   	NB.SD1= 000400   	SY$REL= ****** GX	$WRMPG= ****** GX
FD.CR = 000002   	F.FACC= 000043   	NB.SD2= 001000   	S$GCST= ****** GX	$$    = 000001
FD.DIR= 000010   	F.FFBY= 000014   	NB.SNM= 000040   	S$GNME= ****** GX	.CLOSE= ****** G
FD.FTN= 000001   	F.FNAM= 000110   	NB.STP= 000020   	S$GSEQ= ****** GX	.OPFNB= ****** G
FD.INS= 000010   	F.FNB = 000102   	NB.SVR= 000010   	S$GSTB= ****** GX	.PUTSQ= ****** G
FD.PLC= 000004   	F.FTYP= 000116   	NB.TYP= 000002   	S$V0  = ****** GX	...GBL= 000000
FD.RAH= 000001   	F.FVER= 000120   	NB.VER= 000001   	S$V2  = ****** GX	...TPC= 000140
FD.RAN= 000002

. ABS.	000000	   000
      	001302	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2514 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:30
[44,10]P6STB,[44,20]P6STB/-SP=[44,30]MACFLM.,FCSPR.,P6STB.012
RDPAG	MACRO M1108  05-DEC-77 23:10  PAGE 3


      1						.TITLE	RDPAG
      2						.IDENT	/01/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     17					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 01                                                                    ;**NEW**
     20					;                                                                               ;**-2
     21					; C. MONIA 22-FEB-74
     22					;
     23					; SUBROUTINES TO READ/WRITE PAGE BUFFERS TO VIRTUAL STORE
     24					;
     25					; MACRO LIBRARY CALLS
     26					;
     27
     28						.MCALL	READ$,WRITE$,WTSE$S
     29
     30					;
     31					; LOCAL DATA
     32					;
     33
     34	000000	000000 			BLK:	.WORD	0		; HIGH ORDER PART OF VIRTUAL BLOCK NUMBER
     35	000002				BLKL:	.BLKW	1		; LOW ORDER PART OF VIRTUAL BLOCK NUMBER
     36
     37	000004				IOSTS:	.BLKW	2		; I/O DONE STATUS BLOCK
     38
     39					;+
     40					; **-RDPAG-READ A PAGE INTO MEMORY
     41					;
     42					; INPUTS:
     43					;
     44					;	R0=PAGE ADDRESS
     45					;	PAGE HEADER (P$GBLK) MUST CONTAIN RELATIVE BLOCK
     46					;	NUMBER OF PAGE.
     47					;
     48					; OUTPUTS:
     49					;
     50					;	REQUESTED PAGE IS TRANSFERRED INTO MEMORY
     51					;-
     52
     53	000010				$RDPAG::			;
     54	000010					SAVVR			; SAVE VOLATILE REGISTERS
     55	000014					CALL	STIOR		; SETUP FOR READ
     56	000020					READ$	R0,R1,#512.,#BLK,#2,#IOSTS ; EXECUTE READ
     57	000074					CALLR	CHKST		; WAIT FOR COMPLETION
RDPAG	MACRO M1108  05-DEC-77 23:10  PAGE 3-1


     58
     59					;+
     60					; **-$WRPAG-WRITE A PAGE INTO VIRTUAL STORE
     61					;
     62					; INPUTS:
     63					;
     64					;	R2=ADDDRESS OF PAGE TO BE SWAPPED OUT
     65					;	PAGE HEADER (P$GBLK) MUST CONTAIN RELATIVE BLOCK NUMBER
     66					;	OF PAGE
     67					;
     68					; OUTPUTS:
     69					;
     70					;	REQUESTED PAGE IS TRANSFERRED TO VIRTUAL STORE
     71					;
     72					;-
     73
     74	000100				$WRPAG::			;
     75	000100					SAVVR			; SAVE VOLATILE REGISTERS
     76	000104					CALL	STIOW		; SET REGISTERS FOR WRITE
     77	000110					WRITE$	R0,R1,#512.,#BLK,#2,#IOSTS ; EXECUTE SWAP
     78	000164					CALL	CHKST		; WAIT FOR COMPLETION
     79	000170	012760 	000000G	000040 		MOV	#W$KEXT,F.ALOC(R0) ; RESET DEFAULT EXTENSION                    ;**NEW**
     80	000176					RETURN			;                                               ;**-1
     81
     82					;
     83					; SETUP REGISTERS FOR A PAGE I/O REQUEST
     84					;
     85
     86	000200				STIOR:				;
     87	000200	010001 				MOV	R0,R1		; COPY PAGE ADDRESS
     88	000202	000401 				BR	STIO		;
     89	000204				STIOW:				;
     90	000204	010201 				MOV	R2,R1		; COPY PAGE ADDRESS
     91	000206				STIO:				;
     92	000206	116167 	000000G	177566 		MOVB	P$GBLK(R1),BLKL ; SET LOW PART OF VBN
     93	000214	005267 	177562 			INC	BLKL		; CONVERT RELATIVE BLOCK TO VBN
     94	000220	062701 	000000G			ADD	#P$GHD,R1	; STEP PAST HEADER
     95	000224	016700 	000000G			MOV	$WRKPT,R0	; GET RECORD BLOCK
     96	000230					RETURN			;
     97
     98					;
     99					; CHECK STATUS OF I/O REQUEST
    100					;
    101
    102	000232				CHKST:				;
    103	000232	103411 				BCS	10$		; IF C/S  I/O ERROR
    104	000234					WTSE$S	#2		; WAIT FOR I/O COMPLETION
    105	000246	106167 	177532 			ROLB	IOSTS		; GET SIGN OF STATUS BYTE
    106	000252	103401 				BCS	10$		; I/O ERROR IF C-SET
    107	000254					RETURN			; RETURN
    108	000256				10$:				;
    109	000256	005002 				CLR	R2		; SET DUMMY PARAMETER BLOCK ADDRESS
    110	000260	012701 	000000C			MOV	#<S$V2*400!E$R73>,R1 ; GET ERROR/SEVERITY
    111	000264					CALL	$ERMSG		; FATAL-NO RETURN
    112
    113		000001 				.END
RDPAG	MACRO M1108  05-DEC-77 23:10  PAGE 3-2
SYMBOL TABLE

BLK     000000R  	FD.RWM= 000001   	F.EOBB= 000032   	HT    = 000011   	R.VAR = 000002
BLKL    000002R  	FD.SDI= 000020   	F.ERR = 000052   	IOSTS   000004R  	SPA   = 000040
B.BBFS= 000010   	FD.SQD= 000040   	F.FACC= 000043   	LF    = 000012   	STIO    000206R
B.BFST= 000015   	FD.TTY= 000004   	F.FFBY= 000014   	NB.DEV= 000200   	STIOR   000200R
B.NXBD= 000012   	FD.WBH= 000002   	F.FNAM= 000110   	NB.DIR= 000100   	STIOW   000204R
B.VBN = 000004   	FF    = 000014   	F.FNB = 000102   	NB.NAM= 000004   	S$V2  = ****** GX
CHKST   000232R  	FO.APD= 000106   	F.FTYP= 000116   	NB.SD1= 000400   	S.BFHD= 000020
CR    = 000015   	FO.MFY= 000002   	F.FVER= 000120   	NB.SD2= 001000   	S.FATT= 000016
E$R73 = ****** GX	FO.RD = 000001   	F.HIBK= 000004   	NB.SNM= 000040   	S.FDB = 000140
FA.APD= 000100   	FO.UPD= 000006   	F.LUN = 000042   	NB.STP= 000020   	S.FNAM= 000006
FA.CRE= 000010   	FO.WRT= 000016   	F.MBCT= 000054   	NB.SVR= 000010   	S.FNB = 000036
FA.EXT= 000004   	F.ALOC= 000040   	F.MBC1= 000055   	NB.TYP= 000002   	S.FNBW= 000017
FA.NSP= 000100   	F.BBFS= 000062   	F.MBFG= 000056   	NB.VER= 000001   	S.FNTY= 000004
FA.RD = 000001   	F.BDB = 000070   	F.NRBD= 000024   	N.DID = 000024   	S.FTYP= 000002
FA.SHR= 000040   	F.BGBC= 000057   	F.NREC= 000030   	N.DVNM= 000032   	S.NFEN= 000020
FA.TMP= 000020   	F.BKDN= 000026   	F.OVBS= 000030   	N.FID = 000000   	VT    = 000013
FA.WRT= 000002   	F.BKDS= 000020   	F.RACC= 000016   	N.FNAM= 000006   	W$KEXT= ****** GX
FD.BLK= 000010   	F.BKEF= 000050   	F.RATT= 000001   	N.FTYP= 000014   	$ERMSG= ****** GX
FD.CCL= 000002   	F.BKP1= 000051   	F.RCNM= 000034   	N.FVER= 000016   	$RDPAG  000010RG
FD.CR = 000002   	F.BKST= 000024   	F.RCTL= 000017   	N.NEXT= 000022   	$SAVVR= ****** GX
FD.DIR= 000010   	F.BKVB= 000064   	F.RSIZ= 000002   	N.STAT= 000020   	$WRKPT= ****** GX
FD.FTN= 000001   	F.CNTG= 000034   	F.RTYP= 000000   	N.UNIT= 000034   	$WRPAG  000100RG
FD.INS= 000010   	F.DFNB= 000046   	F.STBK= 000036   	PAR$$$= 000000   	$$    = 000001
FD.PLC= 000004   	F.DSPT= 000044   	F.UNIT= 000136   	P$GBLK= ****** GX	.READ = ****** G
FD.RAH= 000001   	F.DVNM= 000134   	F.URBD= 000020   	P$GHD = ****** GX	.WRITE= ****** G
FD.RAN= 000002   	F.EFBK= 000010   	F.VBN = 000064   	R$$11M= 000000   	...GBL= 000000
FD.REC= 000001   	F.EFN = 000050   	F.VBSZ= 000060   	R.FIX = 000001   	...TPC= 000140

. ABS.	000000	   000
      	000270	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2223 WORDS  ( 9 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:21
[44,10]RDPAG,[44,20]RDPAG/-SP=[44,30]MACFLM.,FCSPR.,RDPAG.001
RQVCB	MACRO M1108  05-DEC-77 23:10  PAGE 2


      1						.TITLE	RQVCB
      2						.IDENT	/00/
      3
      4					;
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     17					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 00
     20					;
     21					; C. MONIA 22-FEB-74
     22					;
     23					; REQUEST VIRTUAL CORE BLOCK
     24					;
     25					;+
     26					; **-$RQVCB-REQUEST VIRTUAL MEMORY ALLOCATION
     27					;
     28					; INPUTS:
     29					;
     30					;	R1=ALLOCATION REQUEST IN BYTES (</= 512.)
     31					;	$HGVAD=NEXT FREE VIRTUAL ADDRESS
     32					;
     33					; OUTPUTS:
     34					;
     35					;	C-CLEAR: REQUEST SUCCEEDED.
     36					;
     37					;	R1=VIRTUAL ADDRESS OF REQUESTED BLOCK
     38					;	$HGVAD=UPDATED VALUE OF NEXT FREE ADDRESS
     39					;
     40					;	C-SET: REQUEST FAILED
     41					;
     42					;	FAILURE CONDITIONS:
     43					;
     44					;	(1) REQUEST EXCEEDED 512. BYTES
     45					;	(2) VIRTUAL STORAGE EXHAUSTED
     46					;
     47					; THIS ROUTINE IS CALLED TO ALLOCATE SPACE FROM VIRTUAL
     48					; MEMORY. THE ALLOCATION REQUEST IS ROUNDED UP TO THE
     49					; NEAREST WORD. IF THE ROUNDED VALUE CROSSES A DISK BLOCK
     50					; BOUNDRY THEN ALLOCATION BEGINS AT THE NEXT BLOCK.
     51					;
     52					;		*** NOTE ***
     53					;
     54					; VIRTUAL ADDRESSES ARE WORD VALUES.
     55					;-
     56
     57	000000				$RQVCB::			;
RQVCB	MACRO M1108  05-DEC-77 23:10  PAGE 2-1


     58	000000	010102 				MOV	R1,R2		; SAVE LENGTH
     59	000002	016701 	000000G			MOV	$HGVAD,R1	; GET HIGHEST VIRTUAL ADDRESS
     60	000006	001424 				BEQ	20$		; IF EQ NO SPACE LEFT
     61	000010	000241 				CLC			; CLEAR CARRY
     62	000012	006002 				ROR	R2		; DO UNSIGNED DIVIDE
     63	000014	005502 				ADC	R2		; ROUND UP TO NEAREST WORD
     64	000016	020227 	000400 			CMP	R2,#256.	; CHECK LENGTH OF REQUEST
     65	000022	101016 				BHI	20$		; IF HIGH, TOO BIG
     66	000024	005302 				DEC	R2		; BACK OFF SIZE BY ONE
     67	000026	010100 				MOV	R1,R0		; COPY FREE ADDRESS
     68	000030	060200 				ADD	R2,R0		; COMPUTE LAST ADDRESS IN ALLOCATION
     69	000032	103413 				BCS	30$		; IF C/S ADDRESS SPACE OVERFLOW
     70	000034	105000 				CLRB	R0		; CLEAR DISPLACEMENT INTO BLOCK
     71	000036	020001 				CMP	R0,R1		; SEE IF CROSSING BLOCK BOUNDRY
     72	000040	101401 				BLOS	10$		; IF LOS NO
     73	000042	010001 				MOV	R0,R1		; SET VIRTUAL ADDRESS
     74	000044				10$:				;
     75	000044	005202 				INC	R2		; CONVERT BACK TO LENGTH
     76	000046	060102 				ADD	R1,R2		; COMPUTE NEXT FREE ADDRESS
     77	000050	010267 	000000G			MOV	R2,$HGVAD	; UPDATE FREE ADDRESS
     78	000054	000241 				CLC			; SET SUCCESS
     79	000056	000401 				BR	30$		; EXIT
     80	000060				20$:				;
     81	000060	000261 				SEC			; SET FAILURE
     82	000062				30$:				;
     83	000062					RETURN			;
     84
     85		000001 				.END
RQVCB	MACRO M1108  05-DEC-77 23:10  PAGE 2-2
SYMBOL TABLE

CR    = 000015   	HT    = 000011   	R$$11M= 000000   	VT    = 000013   	$RQVCB  000000RG
FF    = 000014   	LF    = 000012   	SPA   = 000040   	$HGVAD= ****** GX

. ABS.	000000	   000
      	000064	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  527 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:05
[44,10]RQVCB,[44,20]RQVCB/-SP=[44,30]MACFLM.,RQVCB.000
RSRCH	MACRO M1108  05-DEC-77 23:10  PAGE 2


      1						.TITLE	RSRCH
      2						.IDENT	/01/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     17					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 00                                                                    ;**NEW**
     20					;                                                                               ;**-1
     21					; C. MONIA 19-APR-74                                                            ;**NEW**
     22					;                                                                               ;**NEW**
     23					; MODIFICATIONS:                                                                ;**NEW**
     24					;                                                                               ;**NEW**
     25					; NO.		DATE		PROGRAMMER                                      ;**NEW**
     26					; ---		----		----------                                      ;**NEW**
     27					;                                                                               ;**NEW**
     28					; 036		20-JAN-75	C. MONIA                                        ;**NEW**
     29					;                                                                               ;**NEW**
     30					;                                                                               ;**-1
     31					; REAL-MEMORY SEARCH AND INSERT PACKAGE
     32					;
     33					; EQUATED SYMBOLS                                                               ;**NEW**
     34					;                                                                               ;**NEW**
     35					; OFFSET TO KEY                                                                 ;**NEW**
     36					;                                                                               ;**NEW**
     37					                                                                                ;**NEW**
     38		000002 			SYM=000002			;                                               ;**NEW**
     39					                                                                                ;**NEW**
     40					;+
     41					; DATA STRUCTURES:
     42					;
     43					; EACH ITEM IN THE LIST IS ASSUMED TO HAVE THE FOLLOWING FORMAT:
     44					;
     45					;	ITEM:	.WORD	NEXT	; LINK TO NEXT (0=LAST)
     46					;		.WORD	VAL	; FIRST HALF OF KEY VALUE
     47					;		.WORD	VAL	; SECOND HALF OF KEY VALUE
     48					;		.WORD	DATA	; ANY DATA
     49					;		  .		;
     50					;		  .		;
     51					;		  .		;
     52					;		  .		;
     53					;		.WORD	DATA	; END OF ITEM
     54					;-
     55					;+
     56					; **-$ISYMR-INSERT ITEM IN LEXICALLY ORDERED LIST
     57					;
RSRCH	MACRO M1108  05-DEC-77 23:10  PAGE 2-1


     58					; INPUTS:
     59					;
     60					;	R0=LISTHEAD ADDRESS
     61					;	R1=ADDRESS OF ITEM TO BE INSERTED
     62					;
     63					; OUTPUTS:
     64					;
     65					;	NONE
     66					;
     67					; THIS ROUTINE IS CALLED TO INSERT AN ITEM IN A LIST WHOSE KEY VALUES ARE
     68					; IN LEXICAL ORDER.
     69					;-
     70
     71	000000				$ISYMR::			;
     72	000000	010002 				MOV	R0,R2		; SAVE ADDRESS OF CURRENT
     73	000002	011000 				MOV	(R0),R0		; GET NEXT ITEM
     74	000004	001411 				BEQ	10$		; IF EQ DONE
     75	000006	026061 	000002 	000002 		CMP	SYM(R0),SYM(R1) ; CHECK FIRST HALF OF KEY                       ;**NEW**
     76	000014	103771 				BLO	$ISYMR		; IF LO, GO AGAIN                               ;**-1
     77	000016	101004 				BHI	10$		; IF HI, FOUND PLACE TO INSERT
     78	000020	026061 	000004 	000004 		CMP	SYM+2(R0),SYM+2(R1) ; CHECK SECOND HALF OF KEY                  ;**NEW**
     79	000026	103764 				BLO	$ISYMR		; IF LO GO AGAIN                                ;**-1
     80	000030				10$:				;
     81	000030	010112 				MOV	R1,(R2)		; LINK NEW ITEM TO PREVIOUS
     82	000032	010011 				MOV	R0,(R1)		; LINK CURRENT TO NEW
     83	000034					RETURN			;
     84					;+
     85					; **-$SRCHR-SEARCH LIST IN REAL MEMORY FOR KEY VALUE
     86					;
     87					; INPUTS:
     88					;
     89					;	R0=LISTHEAD ADDRESS
     90					;	R1=ADDRESS OF CONTAINING KEY VALUE
     91					;
     92					; OUTPUTS:
     93					;
     94					;	C-CLEAR=KEY VALUE IN LIST
     95					;	R0=ADDRESS OF ITEM CONTAINING VALUE
     96					;
     97					;	C-SET=KEY VALUE NOT IN LIST
     98					;
     99					; THIS ROUTINE IS CALLED TO SEARCH A LIST AS DESCRIBED UNDER 'DATA STRUCTURES
    100					; FOR AN ITEM CONTAINING THE SPECIFIED KEY CONTAINED IN S$YM(R1), AND S$YM+2(R1)
    101					;-
    102
    103	000036				$SRCHR::			;
    104	000036	000261 				SEC			; ASSUME KEY NOT IN LIST
    105	000040	011000 				MOV	(R0),R0		; GET NEXT ITEM
    106	000042	001410 				BEQ	10$		; IF EQ NOT IN LIST
    107	000044	026061 	000002 	000002 		CMP	SYM(R0),SYM(R1)	; CHECK FIRST HALF OF KEY                       ;**NEW**
    108	000052	001371 				BNE	$SRCHR		; IF NE GO AGAIN                                ;**-1
    109	000054	026061 	000004 	000004 		CMP	SYM+2(R0),SYM+2(R1) ; CHECK SECOND HALF OF KEY                  ;**NEW**
    110	000062	001365 				BNE	$SRCHR		; IF NE GO AGAIN                                ;**-1
    111	000064				10$:				;
    112	000064					RETURN			;
    113
    114		000001 				.END
RSRCH	MACRO M1108  05-DEC-77 23:10  PAGE 2-2
SYMBOL TABLE

CR    = 000015   	HT    = 000011   	R$$11M= 000000   	SYM   = 000002   	$ISYMR  000000RG
FF    = 000014   	LF    = 000012   	SPA   = 000040   	VT    = 000013   	$SRCHR  000036RG

. ABS.	000000	   000
      	000066	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  527 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
[44,10]RSRCH,[44,20]RSRCH/-SP=[44,30]MACFLM.,RSRCH.001
SCAN	MACRO M1108  05-DEC-77 23:10  PAGE 3


      1						.TITLE	SCAN
      2						.IDENT	/03/								;**NEW**
      3															;**-1
      4					;
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     17					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 03									;**NEW**
     20					;										;**-1
     21					; D.N. CUTLER 16-OCT-72
     22					;
     23					; MONITOR DEPENDENT COMMAND STRING ANALYSIS ROUTINES
     24					;
     25					; MACRO LIBRARY CALLS								;**NEW**
     26					;										;**NEW**
     27															;**NEW**
     28						.MCALL	CSI$,CSI$1,CSI$2						;**NEW**
     29															;**-5
     30					;
     31					; EQUATED SYMBOLS
     32					;
     33
     34	000000					CSI$			;DEFINE CSI BLOCK OFFSET DEFINITIONS		;**NEW**
     35		000054 			T$MSIZ==C.SIZE			;SIZE OF CSI BLOCK				;**NEW**
     36															;**-4
     37					;+
     38					; **-$SCANI/$SCANO-SCAN FOR INPUT/OUTPUT FILE SPECIFCICATION
     39					;
     40					; THIS ROUTINE IS CALLED TO SCAN A COMMAND STRING FOR THE NEXT INPUT
     41					; OR OUTPUT FILE. $SYNTX MUST HAVE BEEN PREVIOUSLY CALLED TO SET UP
     42					; THE COMMAND BUFFER AND TO DO THE SYNTAX ANALYSIS.
     43					;
     44					; INPUTS:
     45					;
     46					;	R0=ADDRESS OF RECORD BLOCK.
     47					;	R1=ADDRESS OF TEMP BUFFER AREA.
     48					;
     49					; OUTPUTS:
     50					;
     51					;	C=1 IF NO FILE SPECIFIED OR ILLEGAL SWITCH.				;**NEW**
     52					;	C=0 IF REQUEST IS SUCESSFUL.						;**-1
     53					;	IN EITHER CASE R0 IS RETURNED AS THE MORE FILES FLAG.			;**NEW**
     54					;		IF R0 EQ 0, THEN MORE FILES ARE SPECIFIED.			;**NEW**
     55					;		IF R0 EQ 1, THEN NO MORE FILES ARE SPECIFIED.			;**NEW**
     56					;-
     57
SCAN	MACRO M1108  05-DEC-77 23:10  PAGE 3-1


     58	000000	112761 	000001 	000000 	$SCANI::MOVB	#CS.INP,C.TYPR(R1);SET FOR INPUT FILE				;**NEW**
     59	000006	000403 				BR	SCANO		;						;**NEW**
     60	000010	112761 	000002 	000000 	$SCANO::MOVB	#CS.OUT,C.TYPR(R1);SET FOR OUTPUT FILE				;**NEW**
     61	000016				SCANO:	SAVRG			;SAVE NONVOLITILE REGISTERS			;**NEW**
     62	000022	010005 				MOV	R0,R5		;SAVE RECORD BLOCK ADDRESS			;**NEW**
     63	000024					CSI$2	R1,,R$SWBK(R5)	;GET FILE SPECIFICATION				;**NEW**
     64	000040	010102 				MOV	R1,R2		;COPY CSI BLOCK ADDRESS				;**NEW**
     65	000042	116204 	000001 			MOVB	C.STAT(R2),R4	;GET STATUS BYTE				;**NEW**
     66	000046	103444 				BCS	10$		;IF CS ILLEGAL SWITCH				;**NEW**
     67	000050	132704 	000005 			BITB	#CS.NMF!CS.DVF,R4;FILE OR DEVICE SPECIFIED?			;**NEW**
     68	000054	001464 				BEQ	60$		;IF EQ NO					;**NEW**
     69	000056	132704 	000010 			BITB	#CS.WLD,R4	;WILD CARD SPECIFIED?				;**NEW**
     70	000062	001041 				BNE	20$		;IF NE YES					;**NEW**
     71	000064	022762 	000000G	000006 		CMP	#F$DEVL,C.DEVD(R2);LEGAL DEVICE NAME LENGTH?			;**NEW**
     72	000072	103447 				BLO	40$		;IF LO NO					;**NEW**
     73	000074	022762 	000000G	000012 		CMP	#F$DIRL,C.DIRD(R2);LEGAL DIRECTORY NAME LENGTH?			;**NEW**
     74	000102	103436 				BLO	35$		;IF LO NO					;**NEW**
     75	000104	022762 	000000G	000016 		CMP	#F$FILL,C.FILD(R2);LEGAL FILENAAME LENGTH?			;**NEW**
     76	000112	103425 				BLO	20$		;IF LO NO					;**NEW**
     77	000114	016505 	000044 			MOV	F.DSPT(R5),R5	;GET ADDRESS OF DATA SET DESCRIPTOR		;**NEW**
     78	000120	062702 	000006 			ADD	#C.DSDS,R2	;POINT TO CSI DATA SET DESCRIPTOR		;**NEW**
     79	000124	012746 	000003 			MOV	#3,-(SP)	;SET LOOP COUNT					;**NEW**
     80	000130	012203 			3$:	MOV	(R2)+,R3	;GET LENGTH OF LINE SEGMENT			;**NEW**
     81	000132	010325 				MOV	R3,(R5)+	;STORE IN DESCRIPTOR				;**NEW**
     82	000134	012201 				MOV	(R2)+,R1	;GET ADDRESS OF LINE SEGMENT			;**NEW**
     83	000136	012500 				MOV	(R5)+,R0	;GET ADDRESS TO STORE LINE SEGMENT		;**NEW**
     84	000140	005303 			5$:	DEC	R3		;DECREMENT BYTE COUNT				;**NEW**
     85	000142	002402 				BLT	7$		;IF LT DONE					;**NEW**
     86	000144	112120 				MOVB	(R1)+,(R0)+	;						;**NEW**
     87	000146	000774 				BR	5$		;						;**NEW**
     88	000150	005316 			7$:	DEC	(SP)		;DECREMENT LOOP COUNT				;**NEW**
     89	000152	003366 				BGT	3$		;IF GT MORE TO GO				;**NEW**
     90	000154	005726 				TST	(SP)+		;CLEAN STACK					;**NEW**
     91	000156	000424 				BR	70$		;						;**NEW**
     92															;**NEW**
     93					;										;**NEW**
     94					; ILLEGAL SWITCH SPECIFICATION							;**NEW**
     95					;										;**NEW**
     96															;**NEW**
     97	000160	012701 			10$:	MOV	(PC)+,R1	;GET ERROR,SEVERITY				;**NEW**
     98	000162	   000G	   000G			.BYTE	E$R3,S$V2	;FATAL-NO RETURN				;**NEW**
     99	000164	000402 				BR	30$		;						;**NEW**
    100															;**NEW**
    101					;										;**NEW**
    102					; ILLEGAL FILE SPECIFICATION							;**NEW**
    103					;										;**NEW**
    104															;**NEW**
    105	000166	012701 			20$:	MOV	(PC)+,R1	;GET ERROR,SEVERITY				;**NEW**
    106	000170	   000G	   000G			.BYTE	E$R55,S$V2	;FATAL-NO RETURN				;**NEW**
    107	000172	062702 	000016 		30$:	ADD	#C.FILD,R2	;POINT TO FILENAME DESCRIPTOR			;**NEW**
    108	000176	000411 				BR	50$		;						;**NEW**
    109															;**NEW**
    110					;										;**NEW**
    111					; ILLEGAL DIRECTORY NAME							;**NEW**
    112					;										;**NEW**
    113															;**NEW**
    114	000200	012701 			35$:	MOV	(PC)+,R1	;GET ERROR,SEVERITY				;**NEW**
SCAN	MACRO M1108  05-DEC-77 23:10  PAGE 3-2


    115	000202	   000G	   000G			.BYTE	E$R58,S$V2	;FATAL-NO RETURN				;**NEW**
    116	000204	062702 	000012 			ADD	#C.DIRD,R2	;POINT TO DIRECTORY NAME			;**NEW**
    117	000210	000404 				BR	50$		;						;**NEW**
    118															;**NEW**
    119					;										;**NEW**
    120					; ILLEGAL DEVICE SPECIFICATION							;**NEW**
    121					;										;**NEW**
    122															;**NEW**
    123	000212	012701 			40$:	MOV	(PC)+,R1	;GET ERROR,SEVERITY				;**NEW**
    124	000214	   000G	   000G			.BYTE	E$R56,S$V2	;FATAL-NO RETURN				;**NEW**
    125	000216	062702 	000006 			ADD	#C.DEVD,R2	;POINT TO DEVICE NAME DESCRIPTOR		;**NEW**
    126	000222				50$:	CALL	$ERMSG		;OUTPUT ERROR MESSAGE				;**NEW**
    127	000226	000261 			60$:	SEC			;SET CARRY					;**NEW**
    128	000230	006046 			70$:	ROR	-(SP)		;SAVE CARRY BIT					;**NEW**
    129	000232	005000 				CLR	R0		;ASSUME MORE FILES ARE SPECIFIED		;**NEW**
    130	000234	132704 	000020 			BITB	#CS.MOR,R4	;MORE FILES?					;**NEW**
    131	000240	001001 				BNE	80$		;IF NE YES					;**NEW**
    132	000242	005200 				INC	R0		;SET NO FILES					;**NEW**
    133	000244	006126 			80$:	ROL	(SP)+		;RESTORE CARRY					;**NEW**
    134	000246					RETURN			;						;**NEW**
    135															;**-63
    136					;+
    137					; **-$SYNTX-COMMAND STRING SYNTAX ANALYSIS
    138					;
    139					; THIS ROUTINE IS CALLED TO ANALYZE A COMMAND STRING FOR CORRECT SYN-
    140					; TAX AND TO SET UP THE COMMAND BUFFER FOR THE ABOVE SCAN ROUTINES.
    141					;
    142					; INPUTS:
    143					;
    144					;	R0=ADDRESS OF BYTE COUNT,REC ADDR DOUBLEWORD.				;**NEW**
    145					;	R1=ADDRESS OF TEMP BUFFER AREA						;**-1
    146					;
    147					; OUTPUTS:
    148					;
    149					;	C=1 IF SYNTAX ERROR.
    150					;	C=0 IF NO SYNTAX ERROR.
    151					;-
    152
    153	000250	012061 	000002 		$SYNTX::MOV	(R0)+,C.CMLD(R1);SET LENGTH OF LINE				;**NEW**
    154	000254	011061 	000004 			MOV	(R0),C.CMLD+2(R1);SET ADDRESS OF LINE				;**NEW**
    155	000260					CSI$1	R1		;ANALYZE SYNTAX					;**NEW**
    156	000266	103010 				BCC	10$		;IF CS RETURN					;**NEW**
    157	000270	010102 				MOV	R1,R2		;COPY ADDRESS OF CSI BLOCK			;**NEW**
    158	000272	062702 	000002 			ADD	#C.CMLD,R2	;POINT TO LINE SEGMENT DESCRIPTOR		;**NEW**
    159	000276	012701 				MOV	(PC)+,R1	;SYNTAX ERROR					;**NEW**
    160	000300	   000G	   000G			.BYTE	E$R1,S$V1	;DIAGNOSTIC					;**NEW**
    161	000302					CALL	$ERMSG		;OUTPUT ERROR MESSAGE				;**NEW**
    162	000306	000261 				SEC			;SET CARRY					;**NEW**
    163	000310				10$:	RETURN			;						;**NEW**
    164															;**-20
    165		000001 				.END
SCAN	MACRO M1108  05-DEC-77 23:10  PAGE 3-3
SYMBOL TABLE

B.BBFS= 000010   	FA.EXT= 000004   	F.BBFS= 000062   	F.RACC= 000016   	N.UNIT= 000034
B.BFST= 000015   	FA.NSP= 000100   	F.BDB = 000070   	F.RATT= 000001   	PAR$$$= 000001
B.NXBD= 000012   	FA.RD = 000001   	F.BGBC= 000057   	F.RCNM= 000034   	R$SWBK= ****** GX
B.VBN = 000004   	FA.SHR= 000040   	F.BKDN= 000026   	F.RCTL= 000017   	R$$11M= 000000
CR    = 000015   	FA.TMP= 000020   	F.BKDS= 000020   	F.RSIZ= 000002   	R.FIX = 000001
CS.DIF= 000002   	FA.WRT= 000002   	F.BKEF= 000050   	F.RTYP= 000000   	R.VAR = 000002
CS.DVF= 000004   	FD.BLK= 000010   	F.BKP1= 000051   	F.STBK= 000036   	SCANO   000016R
CS.EQU= 000040   	FD.CCL= 000002   	F.BKST= 000024   	F.UNIT= 000136   	SPA   = 000040
CS.INP= 000001   	FD.CR = 000002   	F.BKVB= 000064   	F.URBD= 000020   	S$V1  = ****** GX
CS.MOR= 000020   	FD.DIR= 000010   	F.CNTG= 000034   	F.VBN = 000064   	S$V2  = ****** GX
CS.NMF= 000001   	FD.FTN= 000001   	F.DFNB= 000046   	F.VBSZ= 000060   	S.BFHD= 000020
CS.OUT= 000002   	FD.INS= 000010   	F.DSPT= 000044   	HT    = 000011   	S.FATT= 000016
CS.WLD= 000010   	FD.PLC= 000004   	F.DVNM= 000134   	LF    = 000012   	S.FDB = 000140
C.CMLD= 000002   	FD.RAH= 000001   	F.EFBK= 000010   	NB.DEV= 000200   	S.FNAM= 000006
C.DEVD= 000006   	FD.RAN= 000002   	F.EFN = 000050   	NB.DIR= 000100   	S.FNB = 000036
C.DIRD= 000012   	FD.REC= 000001   	F.EOBB= 000032   	NB.NAM= 000004   	S.FNBW= 000017
C.DSDS= 000006   	FD.RWM= 000001   	F.ERR = 000052   	NB.SD1= 000400   	S.FNTY= 000004
C.FILD= 000016   	FD.SDI= 000020   	F.FACC= 000043   	NB.SD2= 001000   	S.FTYP= 000002
C.MKW1= 000024   	FD.SQD= 000040   	F.FFBY= 000014   	NB.SNM= 000040   	S.NFEN= 000020
C.MKW2= 000026   	FD.TTY= 000004   	F.FNAM= 000110   	NB.STP= 000020   	T$MSIZ= 000054 G
C.SIZE= 000054   	FD.WBH= 000002   	F.FNB = 000102   	NB.SVR= 000010   	VT    = 000013
C.STAT= 000001   	FF    = 000014   	F.FTYP= 000116   	NB.TYP= 000002   	$ERMSG= ****** GX
C.SWAD= 000022   	FO.APD= 000106   	F.FVER= 000120   	NB.VER= 000001   	$SAVRG= ****** GX
C.TYPR= 000000   	FO.MFY= 000002   	F.HIBK= 000004   	N.DID = 000024   	$SCANI  000000RG
E$R1  = ****** GX	FO.RD = 000001   	F.LUN = 000042   	N.DVNM= 000032   	$SCANO  000010RG
E$R3  = ****** GX	FO.UPD= 000006   	F.MBCT= 000054   	N.FID = 000000   	$SYNTX  000250RG
E$R55 = ****** GX	FO.WRT= 000016   	F.MBC1= 000055   	N.FNAM= 000006   	$$    = 000001
E$R56 = ****** GX	F$DEVL= ****** GX	F.MBFG= 000056   	N.FTYP= 000014   	.CSI1 = ****** G
E$R58 = ****** GX	F$DIRL= ****** GX	F.NRBD= 000024   	N.FVER= 000016   	.CSI2 = ****** G
FA.APD= 000100   	F$FILL= ****** GX	F.NREC= 000030   	N.NEXT= 000022   	...GBL= 000000
FA.CRE= 000010   	F.ALOC= 000040   	F.OVBS= 000030   	N.STAT= 000020   	...TPC= 000140

. ABS.	000000	   000
      	000312	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2148 WORDS  ( 9 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:20
[44,10]SCAN,[44,20]SCAN/-SP=[44,30]MACFLM.,FCSPR.,SCAN.003
SCVTR	MACRO M1108  05-DEC-77 23:11  PAGE 2


      1						.TITLE	SCVTR
      2						.IDENT	/03/								;**NEW**
      3															;**-1
      4					;
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     17					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 03									;**NEW**
     20					;										;**-1
     21					; D.N. CUTLER 23-NOV-72
     22					;
     23					; SCAN CONVERSION ROUTINES
     24					;+										;**NEW**
     25					; **-$AS-ASCII CONVERSION							;**NEW**
     26					;										;**NEW**
     27					; INPUTS:									;**NEW**
     28					;										;**NEW**
     29					;	R0=ADDRESS OF NEXT BYTE IN INPUT BUFFER.				;**NEW**
     30					;	R5=ADDRESS TO STORE CONVERTED VALUE.					;**NEW**
     31					;										;**NEW**
     32					; OUTPUTS:									;**NEW**
     33					;										;**NEW**
     34					;	UP TO 2 ASCII CHARACTERS ARE MOVED TO THE SPECIFIED ADDRESS		;**NEW**
     35					;	BLANK FILLED.								;**NEW**
     36					;		R0=ADDRESS OF NEXT BYTE IN INPUT BUFFER.			;**NEW**
     37					;		R2=TERMINAL CHARACTER.						;**NEW**
     38					;		R5=ADDRESS TO STORE NEXT CONVERTED VALUE.			;**NEW**
     39					;-										;**NEW**
     40															;**NEW**
     41	000000	012725 	020040 		$AS::	MOV	#"  ,(R5)+	;BLANK FILL OUTPUT WORD				;**NEW**
     42	000004	012701 	000101 			MOV	#'A,R1		;SET LOW LIMIT					;**NEW**
     43	000010	012746 	000132 			MOV	#'Z,-(SP)	;SET HIGH LIMIT					;**NEW**
     44	000014	112002 				MOVB	(R0)+,R2	;GET NEXT BYTE					;**NEW**
     45	000016	020201 				CMP	R2,R1		;WITHIN RANGE?					;**NEW**
     46	000020	103414 				BLO	10$		;IF LO NO					;**NEW**
     47	000022	020216 				CMP	R2,(SP)		;WITHIN RANGE?					;**NEW**
     48	000024	101012 				BHI	10$		;IF HI NO					;**NEW**
     49	000026	110265 	177776 			MOVB	R2,-2(R5)	;STORE FIRST CHARACTER				;**NEW**
     50	000032	112002 				MOVB	(R0)+,R2	;GET NEXT CHARACTER				;**NEW**
     51	000034	020201 				CMP	R2,R1		;WITHIN RANGE?					;**NEW**
     52	000036	103405 				BLO	10$		;IF LO NO					;**NEW**
     53	000040	020216 				CMP	R2,(SP)		;WITHIN RANGE?					;**NEW**
     54	000042	101003 				BHI	10$		;IF HI NO					;**NEW**
     55	000044	110265 	177777 			MOVB	R2,-1(R5)	;STORE SECOND BYTE				;**NEW**
     56	000050	112002 				MOVB	(R0)+,R2	;GET NEXT BYTE					;**NEW**
     57	000052	005726 			10$:	TST	(SP)+		;CLEAN STACK					;**NEW**
SCVTR	MACRO M1108  05-DEC-77 23:11  PAGE 2-1


     58	000054	000460 				BR	RR2		;SKIP TRAILING BLANKS				;**NEW**
     59															;**NEW**
     60					;+
     61					; **-$DC-SIGNED DECIMAL CONVERSION
     62					; **-$OT-SIGNED OCTAL CONVERSION
     63					;
     64					; INPUTS:
     65					;
     66					;	R0=ADDRESS OF NEXT BYTE IN INPUT BUFFER.
     67					;	R5=ADDRESS TO STORE CONVERTED VALUE.
     68					;
     69					; OUTPUTS:
     70					;
     71					;	NUMBER IS CONVERTED AND STORED IN THE SPECIFIED ADDRESS.
     72					;	TRAILING BLANKS AND HT'S ARE BYPASSED.
     73					;		R0=ADDRESS OF NEXT BYTE IN INPUT BUFFER.
     74					;		R2=TERMINAL CHARACTER.
     75					;		R5=ADDRESS TO STORE NEXT CONVERTED VALUE.
     76					;-
     77
     78	000056	012702 	000000G		$DC::	MOV	#$CDTB,R2	;SET FOR DECIMAL CONVERSION
     79	000062	000402 				BR	OT1		;
     80	000064	012702 	000000G		$OT::	MOV	#$COTB,R2	;SET FOR OCTAL CONVERSION
     81	000070	005046 			OT1:	CLR	-(SP)		;ASSUME POSITIVE NUMBER
     82	000072	122710 	000053 			CMPB	#'+,(R0)	;LEADING PLUS SIGN?
     83	000076	001404 				BEQ	10$		;IF EQ YES
     84	000100	122710 	000055 			CMPB	#'-,(R0)	;LEADING MINUS SIGN?
     85	000104	001002 				BNE	20$		;IF NE NO
     86	000106	005316 				DEC	(SP)		;CHANGE TO NEGATIVE NUMBER
     87	000110	005200 			10$:	INC	R0		;BYPASS SIGN CHARACTER
     88	000112				20$:	CALL	(R2)		;CONVERT NUMBER TO BINARY
     89	000114	005726 				TST	(SP)+		;PLUS OR MINUS?
     90	000116	001401 				BEQ	30$		;IF EQ PLUS
     91	000120	005401 				NEG	R1		;MAKE RESULT NEGATIVE
     92	000122	010125 			30$:	MOV	R1,(R5)+	;STORE PARAMETER
     93	000124	000434 				BR	RR2		;
     94
     95					;+										;**NEW**
     96					; **-$DV-DEVICE/UNIT CONVERSION							;**NEW**
     97					;										;**NEW**
     98					; INPUTS:									;**NEW**
     99					;										;**NEW**
    100					;	R0=ADDRESS OF NEXT BYTE IN INPUT BUFFER.				;**NEW**
    101					;	R5=ADDRESS TO STORE CONVERTED VALUE.					;**NEW**
    102					;										;**NEW**
    103					; OUTPUTS:									;**NEW**
    104					;										;**NEW**
    105					;	THE DEVICE NAME AND UNIT ARE CONVERTED AND STORED IN			;**NEW**
    106					;	THE SPECIFIED ADDRESSES.						;**NEW**
    107					;		R0=ADDRESS OF NEXT BYTE IN INPUT BUFFER.			;**NEW**
    108					;		R2=TERMINAL CHARACTER.						;**NEW**
    109					;		R5=ADDRESS TO STORE NEXT CONVERTED VALUE.			;**NEW**
    110					;-										;**NEW**
    111															;**NEW**
    112	000126				$DV::	CALL	$AS		;CONVERT DEVICE NAME				;**NEW**
    113	000132	005300 				DEC	R0		;BACKUP TO TERMINATOR				;**NEW**
    114	000134					CALL	$OT		;CONVERT UNIT NUMBER				;**NEW**
SCVTR	MACRO M1108  05-DEC-77 23:11  PAGE 2-2


    115	000140					RETURN			;						;**NEW**
    116															;**NEW**
    117					;+
    118					; **-$RP-RAD50 CONVERSION/PERIOD TERMINATOR
    119					; **-$RR-RAD50 CONVERSION/PERIOD RAD50 CHARACTER
    120					;
    121					; INPUTS:
    122					;
    123					;	R0=ADDRESS OF NEXT BYTE IN INPUT BUFFER.
    124					;	R5=ADDRESS TO STORE CONVERTED VALUES.
    125					;
    126					; OUTPUTS:
    127					;
    128					;	TWO RAD50 WORDS ARE CONVERTED AND STORED IN THE SPECIFIED
    129					;	ADDRESS. TRAILING BLANKS AND HT'S ARE BYPASSED.
    130					;		R0=ADDRESS OF NEXT BYTE IN INPUT BUFFER.
    131					;		R2=TERMINAL CHARACTER.
    132					;		R5=ADDRESS TO STORE NEXT CONVERTED VALUE.
    133					;-
    134
    135	000142	005001 			$RP::	CLR	R1		;SET FOR PERIOD TERMINATOR
    136	000144	000401 				BR	RR1		;
    137	000146	010601 			$RR::	MOV	SP,R1		;SET FOR PERIOD RAD50 CHARACTER
    138	000150	010146 			RR1:	MOV	R1,-(SP)	;SAVE PERIOD DISPOSITION FLAG
    139	000152	005025 				CLR	(R5)+		;CLEAR TWO WORDS
    140	000154	005025 				CLR	(R5)+		;
    141	000156					CALL	$CAT5		;CONVERT FIRST HALF
    142	000162	010165 	177774 			MOV	R1,-4(R5)	;STORE FIRST HALF OF RESULT
    143	000166	103412 				BCS	20$		;IF CS DONE
    144	000170	011601 				MOV	(SP),R1		;RETRIEVE FLAG
    145	000172					CALL	$CAT5		;CONVERT SECOND HALF
    146	000176	010165 	177776 			MOV	R1,-2(R5)	;SAVE SECOND HALF OF RESULT
    147	000202	103404 				BCS	20$		;IF CS DONE
    148	000204	011601 			10$:	MOV	(SP),R1		;RETRIEVE FLAG
    149	000206					CALL	$CAT5		;SKIP TO END OF RAD50 FIELD
    150	000212	103374 				BCC	10$		;IF CC GO AGAIN
    151	000214	005726 			20$:	TST	(SP)+		;CLEAN STACK
    152	000216	122702 	000040 		RR2:	CMPB	#' ,R2		;BLANK TERMINATOR?
    153	000222	001403 				BEQ	10$		;IF EQ YES
    154	000224	122702 	000011 			CMPB	#HT,R2		;HT TERMINATOR?
    155	000230	001002 				BNE	20$		;IF NE NO
    156	000232	112002 			10$:	MOVB	(R0)+,R2	;BYPASS BLANK OR HT
    157	000234	001370 				BNE	RR2		;IF NE GO AGAIN
    158	000236				20$:	RETURN			;
    159
    160					;+
    161					; **-$SETNB-SET NONBLANK
    162					;
    163					; INPUTS:
    164					;
    165					;	R0=ADDRESS OF NEXT BYTE IN INPUT BUFFER.
    166					;
    167					; OUTPUTS:
    168					;
    169					;	LEADING BLANKS AND HT'S ARE BYPASSED.
    170					;		R0=ADDRESS OF NEXT BYTE IN INPUT BUFFER.
    171					;-
SCVTR	MACRO M1108  05-DEC-77 23:11  PAGE 2-3


    172
    173	000240	122710 	000040 		$SETNB::CMPB	#' ,(R0)	;BLANK?
    174	000244	001403 				BEQ	10$		;IF EQ YES
    175	000246	122710 	000011 			CMPB	#HT,(R0)	;HT?
    176	000252	001002 				BNE	20$		;IF NE NO
    177	000254	005200 			10$:	INC	R0		;INCREMENT TO NEXT BYTE
    178	000256	000770 				BR	$SETNB		;GO AGAIN
    179	000260				20$:	RETURN			;
    180
    181		000001 				.END
SCVTR	MACRO M1108  05-DEC-77 23:11  PAGE 2-4
SYMBOL TABLE

CR    = 000015   	RR1     000150R  	VT    = 000013   	$COTB = ****** GX	$RP     000142RG
FF    = 000014   	RR2     000216R  	$AS     000000RG 	$DC     000056RG 	$RR     000146RG
HT    = 000011   	R$$11M= 000000   	$CAT5 = ****** GX	$DV     000126RG 	$SETNB  000240RG
LF    = 000012   	SPA   = 000040   	$CDTB = ****** GX	$OT     000064RG 	$$    = 000001
OT1     000070R

. ABS.	000000	   000
      	000262	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  637 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:08
[44,10]SCVTR,[44,20]SCVTR/-SP=[44,30]MACFLM.,SCVTR.003
SGALO	MACRO M1108  05-DEC-77 23:11  PAGE 2


      1						.TITLE	SGALO
      2						.IDENT	/13/
      3					                                                                                ;**-1
      4
      5					;
      6					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      8					;
      9					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
     10					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     11					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     12					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     13					;
     14					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     15					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     16					; EQUIPMENT CORPORATION.
     17					;
     18					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     19					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     20					;
     21					; VERSION 13
     22					;                                                                               ;**-1
     23					; D. N. CUTLER/C. MONIA 27-JAN-74
     24					;
     25					;
     26					;
     27					; MODIFICATIONS
     28					;
     29					; NO.		DATE		PROGRAMMER
     30					; ---		----		----------
     31					;
     32					; 001		03-JULY-73	C. MONIA
     33					; 021		27-JAN-74	C. MONIA
     34					; 041		19-MAY-75	C. MONIA
     35					;
     36					;
     37					;
     38					;
     39					; SEGMENT PHYSICAL AND VIRTUAL MEMORY ALLOCATION
     40					;
     41					; LOCAL DATA
     42					;
     43					; ADJACENCY IS ASSUMED
     44					;
     45
     46	000000				LCLGH:	.BLKW	1		;LOCAL LENGTH OF SEGMENT
     47	000002				LVADR:	.BLKW	1		;LOCAL VIRTUAL ADDRESS
     48	000004				HGSEG:	.BLKW	1		;++021 SEGMENT WITH HIGHEST VIRTUAL ADDRESS
     49	000006				PRVHG:	.BLKW	1		;++021 PREVIOUS HIGH SEGMENT
     50
     51					;+
     52					; **-$SGALO-SEGMENT MEMORY ALLOCATION
     53					;
     54					; THIS ROUTINE IS CALLED IN PHASE 4 TO ALLOCATE PHYSICAL AND VIRTUAL
     55					; MEMORY FOR ALL SEGMENTS IN THE ALLOCATION.
     56					;
     57					; INPUTS:
SGALO	MACRO M1108  05-DEC-77 23:11  PAGE 2-1


     58					;
     59					;	NONE.
     60					;
     61					; OUTPUTS:
     62					;
     63					;	PHYSICAL AND VIRTUAL MEMORY IS ALLOCATED FOR ALL SEGMENTS.
     64					;-
     65
     66	000010	005067 	000000G		$SGALO::CLR	$HVRTL		;CLEAR HIGHEST VIRTUAL ADDRESS
     67	000014	005067 	000000G			CLR	$MXLGH		;CLEAR MAXIMUM MEMORY NEEDED
     68	000020	005067 	000000G			CLR	$RLBLK		;++041 CLEAR RELATIVE DISK BLOCK
     69
     70	000024	012700 	000036'			MOV	#SGALO,R0	;GET PHASE CONTROL ROUTINE ADDRESS
     71	000030					CALL	$PCTRL		;CALL CONTROL ROUTINE
     72	000034					RETURN			;
     73
     74					;
     75					; SEGMENT MEMORY ALLOCATION ROUTINE
     76					;
     77					; THIS ROUTINE IS CALLED FOR EACH SEGMENT IN THE ALLOCATION.
     78					;
     79
     80	000036				SGALO:	SAVRG			;SAVE NONVOLITILE REGISTERS
     81	000042	016701 	000000G			MOV	$CRVSG,R1	; GET VIRTUAL ADDRESS OF CURRENT SEGMENT
     82	000046					CALL	$WRMPG		; WRITE-MARK PAGE
     83	000052	016705 	000000G			MOV	$CRSEG,R5	;GET ADDRESS OF CURRENT SEGMENT
     84	000056	016765 	000000G	000000G		MOV	$RLBLK,S$GBLK(R5);SET RELATIVE BLOCK NUMBER
     85
     86						.IF	NDF	R$$11M
     87
     88						MOV	#LCLGH,R0	; GET ADDRESS OF DATA AREA
     89						MOV	$HDSIZ,(R0)+	;ASSUME ROOT SEGMENT-SET SIZE
     90						MOV	$STACK,(R0)	;SET INITIAL VIRTUAL ADDRESS
     91						ADD	(R0),-(R0)	;ADD STACK LENGTH TO SIZE
     92
     93						.IFF
     94
     95	000064	012700 	000002'			MOV	#LVADR,R0	; GET ADDRESS OF DATA AREA
     96	000070	016710 	000000G			MOV	$HDSIZ,(R0)	; ASSUME ROOT SEGMENT, SET ADDRESS
     97	000074	066710 	000000G			ADD	$STACK,(R0)	; ADD STACK TO HEADER SIZE
     98	000100	011040 				MOV	(R0),-(R0)	; SET SIZE
     99
    100						.ENDC
    101
    102	000102	016501 	000000G			MOV	S$GDWN(R5),R1	;GET LINK DOWN
    103	000106	001010 				BNE	5$		;++021 IF NE NOT ROOT
    104	000110	026767 	000000G	000000G		CMP	$CRVSG,$RTSEG	;++021 RESIDENT ROOT?
    105	000116	001420 				BEQ	10$		;++021 IF EQ YES
    106	000120	016701 	177660 			MOV	HGSEG,R1	;++021 SET HIGHEST SEGMENT AS DOWN
    107	000124	010167 	177656 			MOV	R1,PRVHG	;++021 SET PREVIOUS HIGH SEGMENT
    108	000130				5$:				;++021
    109	000130					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    110	000134	012701 	000000'			MOV	#LCLGH,R1	; GET ADDRESS OF LOCAL LENGTH
    111	000140	005021 				CLR	(R1)+		; CLEAR LOCAL LENGTH
    112	000142	016011 	000000G			MOV	S$GVAD(R0),(R1)	; SET LOCAL VIRTUAL ADDRESS
    113	000146	011165 	000000G			MOV	(R1),S$GLDA(R5)	; SET LOAD ADDRESS OF CURRENT SEGMENT
    114	000152	016065 	000000G	000000G		MOV	S$GMEM(R0),S$GMEM(R5) ; SET INITIAL LENGTH VALUE
SGALO	MACRO M1108  05-DEC-77 23:11  PAGE 2-2


    115	000160	012704 	000002 		10$:	MOV	#2,R4		;SET FOR RW SECTIONS
    116	000164	005003 				CLR	R3		;CLEAR FOUND FLAG
    117	000166					CALL	CSALO		;ALLOCATE MEMORY FOR ALL RW SECTIONS
    118	000172	010401 				MOV	R4,R1		;SET BOUNDRY VALUE
    119	000174	012704 	000002'			MOV	#LVADR,R4	;GET ADDRESS OF CURRENT VIRTUAL ADDR
    120	000200	011400 				MOV	(R4),R0		;GET CURRENT VIRTUAL ADDRESS
    121	000202					CALL	ADRUND		;ROUND VIRTUAL ADDRESS
    122	000206	010014 				MOV	R0,(R4)		;SET NEW CURRENT VIRTUAL ADDRESS
    123	000210	010065 	000000G			MOV	R0,S$GRWB(R5)	;SET VIRTUAL ADDRESS OF RW BASE
    124	000214	014400 				MOV	-(R4),R0	;GET CURRENT LENGTH
    125	000216	012701 	000002 			MOV	#2,R1		;SET BOUNDRY VALUE
    126	000222					CALL	ADRUND		;ROUND LENGTH
    127	000226	010014 				MOV	R0,(R4)		;SET NEW LOCAL LENGTH
    128	000230	016700 	000000G			MOV	$NUMSG,R0	;GET NUMBER OF SEGMENTS IN ALLOCATION
    129	000234	022700 	000001 			CMP	#1,R0		;ONLY ONE?
    130	000240	001447 				BEQ	SGALO1		;IF EQ YES
    131	000242	026767 	000000G	000000G		CMP	$CRVSG,$RTSEG	; ROOT SEGMENT?
    132	000250	001021 				BNE	20$		;IF NE NO
    133	000252	016701 	000000G			MOV	$SZSEG,R1	; GET SIZE OF RESIDENT SEGMENT DESCRIPTOR
    134
    135
    136						.IF	NDF	V1145
    137
    138	000256					CALL	$MUL		;
    139
    140						.ENDC
    141
    142
    143						.IF	DF	V1145
    144
    145						MUL	R1,R0		;
    146
    147						.ENDC
    148
    149
    150	000262	062701 	000002 			ADD	#2,R1		; INCLUDE TERMINAL ZERO WORD                    ;**NEW**
    151	000266	010146 				MOV	R1,-(SP)	;SAVE OFFSET VALUE
    152	000270	011400 				MOV	(R4),R0		;GET CURRENT LENGTH
    153	000272					CALL	ADOFST		;ADD OFFSET VALUE
    154	000276	010024 				MOV	R0,(R4)+	;SET NEW CURRENT LENGTH
    155	000300	011400 				MOV	(R4),R0		;GET CURRENT VIRTUAL ADDRESS
    156	000302	012601 				MOV	(SP)+,R1	;RETRIEVE OFFSET VALUE
    157	000304					CALL	ADOFST		;ADD OFFSET VALUE
    158	000310	010014 				MOV	R0,(R4)		;SET NEW CURRENT VIRTUAL ADDRESS
    159	000312	005744 				TST	-(R4)		;BACK UP TO LOCAL LENGTH
    160	000314	016500 	000004G		20$:	MOV	S$GATL+4(R5),R0	;GET NUMBER OF AUTOLOAD ROUTINES
    161	000320	001417 				BEQ	SGALO1		;IF EQ NONE
    162	000322	012701 	000000G			MOV	#S$ZATL,R1	;GET SIZE OF AUTOLOAD VECTOR
    163
    164
    165						.IF	NDF	V1145
    166
    167	000326					CALL	$MUL		;
    168
    169						.ENDC
    170
    171
SGALO	MACRO M1108  05-DEC-77 23:11  PAGE 2-3


    172						.IF	DF	V1145
    173
    174						MUL	R1,R0		;
    175
    176						.ENDC
    177
    178
    179	000332	010146 				MOV	R1,-(SP)	;SAVE OFFSET VALUE
    180	000334	011400 				MOV	(R4),R0		;GET CURRENT LENGTH
    181	000336					CALL	ADOFST		;ADD OFFSET VALUE
    182	000342	010024 				MOV	R0,(R4)+	;SET NEW CURRENT LENGTH
    183	000344	011400 				MOV	(R4),R0		;GET CURRENT VIRTUAL ADDRESS
    184	000346	012601 				MOV	(SP)+,R1	;RETRIEVE OFFSET VALUE
    185	000350					CALL	ADOFST		;ADD OFFSET VALUE
    186	000354	010014 				MOV	R0,(R4)		;SET NEW VIRTUAL ADDRESS
    187	000356	005744 				TST	-(R4)		;BACK UP TO LOCAL LENGTH
    188	000360				SGALO1:	CALL	UPMAX		;UPDATE MAXIMUMS
    189	000364	012465 	000000G			MOV	(R4)+,S$GRW(R5)	;SET LENGTH OF RW SECTIONS
    190	000370	005703 				TST	R3		;FIND ANY RO ENTRIES?
    191	000372	001520 				BEQ	60$		;IF EQ NO
    192	000374	026767 	000000G	000000G		CMP	$CRVSG,$RTSEG	; ROOT SEGMENT?
    193	000402	001410 				BEQ	20$		;IF EQ YES
    194	000404	010502 				MOV	R5,R2		;GET ADDRESS OF CURRENT SEGMENT
    195	000406	062702 	000000G			ADD	#S$GNME,R2	;POINT TO SEGMENT NAME
    196	000412	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
    197	000414	   000G	   000G			.BYTE	E$R22,S$V0	;DIAGNOSTIC
    198	000416					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    199	000422	000433 				BR	30$		;
    200	000424	011400 			20$:	MOV	(R4),R0		;GET CURRENT VIRTUAL ADDRESS
    201
    202						.IF	NDF	R$$11M
    203
    204						MOV	#100,R1		;GET BOUNDRY VALUE
    205
    206						.IFF
    207
    208	000426	012701 	000002 			MOV	#2,R1		; GET BOUNDARY VALUE
    209
    210						.IFTF
    211
    212	000432					CALL	ADRUND		;ROUND VIRTUAL ADDRESS
    213	000436	161400 				SUB	(R4),R0		;CALCULATE NET INCREASE
    214	000440	010046 				MOV	R0,-(SP)	;SAVE INCREASE
    215	000442	010001 				MOV	R0,R1		;SET OFFSET VALUE
    216	000444	016500 	000000G			MOV	S$GRW(R5),R0	;GET LENGTH OF RW SECTIONS
    217	000450					CALL	ADOFST		;ADD OFFSET VALUE
    218	000454	010065 	000000G			MOV	R0,S$GRW(R5)	;SET NEW LENGTH RW SECTIONS
    219	000460	012601 				MOV	(SP)+,R1	;RETRIEVE INCREMENTAL LENGTH
    220	000462	016500 	000000G			MOV	S$GMEM(R5),R0	;GET LENGTH OF PHYSICAL MEMORY
    221	000466					CALL	ADOFST		;ADD OFFSET VALUE
    222	000472	010065 	000000G			MOV	R0,S$GMEM(R5)	;SET NEW LENGTH OF PHYSICAL MEMORY
    223
    224						.IFT
    225
    226						MOV	(R4),R0		;GET CURRENT VIRTUAL ADDRESS
    227						MOV	#20000,R1	;SET BOUNDRY VALUE
    228
SGALO	MACRO M1108  05-DEC-77 23:11  PAGE 2-4


    229						.IFF
    230
    231	000476	011400 				MOV	(R4),R0		; GET CURRENT VIRTUAL ADDRESS
    232	000500	012701 	000002 			MOV	#2,R1		; SET BOUNDARY VALUE
    233
    234						.ENDC
    235
    236	000504					CALL	ADRUND		;ROUND VIRTUAL ADDRESS
    237	000510	010014 				MOV	R0,(R4)		;SET NEW VIRTUAL ADDRESS
    238	000512	005044 			30$:	CLR	-(R4)		;CLEAR LOCAL LENGTH
    239	000514	012704 	177776 			MOV	#-2,R4		;SET FOR RO SECTIONS
    240	000520					CALL	CSALO		;ALLOCATE MEMORY FOR ALL RO SECTIONS
    241	000524	012704 	000000'			MOV	#LCLGH,R4	;GET ADDRESS OF CURRENT LENGTH
    242	000530	011400 				MOV	(R4),R0		;GET CURRENT LENGTH
    243	000532	026767 	000000G	000000G		CMP	$CRVSG,$RTSEG	; ROOT SEGMENT?
    244	000540	001415 				BEQ	40$		;IF EQ YES
    245	000542	012701 	000002 			MOV	#2,R1		;SET BOUNDRY VALUE
    246	000546					CALL	ADRUND		;ROUND LENGTH
    247	000552	010014 				MOV	R0,(R4)		;SET NEW LOCAL LENGTH
    248	000554	010001 				MOV	R0,R1		;SET OFFSET VALUE
    249	000556	016500 	000000G			MOV	S$GRW(R5),R0	;GET LENGTH OF RW SECTIONS
    250	000562					CALL	ADOFST		;ADD OFFSET VALUE
    251	000566	010065 	000000G			MOV	R0,S$GRW(R5)	;SET NEW LENGTH OF RW SECTIONS
    252	000572	000416 				BR	50$		;
    253	000574				40$:
    254						.IIF  NDF  R$$11M, MOV	#100,R1	; SET BOUNDARY VALUE
    255	000574	012701 	000004 			.IIF   DF  R$$11M, MOV	#4,R1	; SET BOUNDARY VALUE
    256	000600					CALL	ADRUND		;ROUND LENGTH
    257	000604	010014 				MOV	R0,(R4)		;SET NEW LOCAL LENGTH
    258	000606	012465 	000000G			MOV	(R4)+,S$GRO(R5)	;SET LENGTH OF RO SECTIONS
    259	000612	011400 				MOV	(R4),R0		;GET CURRENT VIRTUAL ADDRESS
    260						.IIF  NDF  R$$11M, MOV	#20000,R1 ; SET BOUNDARY VALUE
    261	000614	012701 	000004 			.IIF   DF  R$$11M, MOV	#4,R1	; SET BOUNDARY VALUE
    262	000620					CALL	ADRUND		;ROUND VIRTUAL ADDRESS
    263	000624	010014 				MOV	R0,(R4)		;SET NEW VIRTUAL ADDRESS
    264	000626	005744 				TST	-(R4)		;ADJUST BACK TO LOCAL LENGTH
    265	000630				50$:	CALL	UPMAX		;UPDATE MAXIMUMS
    266	000634	016500 	000000G		60$:	MOV	S$GRO(R5),R0	;CALCULATE NUMBER OF DISK BLOCKS NEEDED
    267	000640	066500 	000000G			ADD	S$GRW(R5),R0	;
    268	000644	000241 				CLC			;CLEAR CARRY
    269	000646	006000 				ROR	R0		;CONVERT TO WORDS
    270	000650	062700 	000377 			ADD	#377,R0		;ROUND TO NEXT BLOCK
    271	000654	105000 				CLRB	R0		;CLEAR LOW BYTE
    272	000656	000300 				SWAB	R0		;DIVIDE BY 256. WORDS
    273	000660	060067 	000000G			ADD	R0,$RLBLK	;UPDATE RELATIVE BLOCK NUMBER
    274	000664	016546 	000000G			MOV	S$GMEM(R5),-(SP) ; GET LENGTH OF PHYSICAL MEMORY
    275	000670	016501 	000000G			MOV	S$GDWN(R5),R1	;GET LINK DOWN
    276	000674	001006 				BNE	65$		;++021 IF NE NOT ROOT
    277	000676	026767 	000000G	000000G		CMP	$CRVSG,$RTSEG	;++021 RESIDENT ROOT?
    278	000704	001406 				BEQ	70$		;++021 IF EQ YES
    279	000706	016701 	177074 			MOV	PRVHG,R1	;++021 GET PREVIOUS HIGH SEGMENT
    280	000712				65$:				;++021
    281	000712					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    282	000716	166016 	000000G			SUB	S$GMEM(R0),(SP)	; CALCULATE LENGTH OF CURRENT SEGMENT
    283	000722				70$:				;
    284	000722	012665 	000000G			MOV	(SP)+,S$GLNG(R5) ; SET LENGTH OF SEGMENT
    285	000726	016765 	177050 	000000G		MOV	LVADR,S$GVAD(R5);SET HIGHEST VIRTUAL ADDRESS
SGALO	MACRO M1108  05-DEC-77 23:11  PAGE 2-5


    286	000734					RETURN			;
    287
    288					;
    289					; UPDATE MAXIMUMS
    290					;
    291
    292	000736	011400 			UPMAX:	MOV	(R4),R0		;GET CURRENT LENGTH
    293	000740	012701 	000004 			MOV	#4,R1		;++001 SET BOUNDARY VALUE
    294	000744					CALL	ADRUND		;ROUND LENGTH
    295	000750	010024 				MOV	R0,(R4)+	;SET NEW LOCAL LENGTH
    296	000752	010001 				MOV	R0,R1		;SET OFFSET VALUE
    297	000754	016500 	000000G			MOV	S$GMEM(R5),R0	;GET LENGTH OF PHYSICAL MEMORY
    298	000760					CALL	ADOFST		;ADD OFFSET VALUE
    299	000764	010065 	000000G			MOV	R0,S$GMEM(R5)	;SET NEW LENGTH OF PHYSICAL MEMORY
    300	000770	020067 	000000G			CMP	R0,$MXLGH	;NEW MAXIMUM?
    301	000774	101402 				BLOS	10$		;IF LOS NO
    302	000776	010067 	000000G			MOV	R0,$MXLGH	;SET NEW MAXIMUM
    303	001002	011400 			10$:	MOV	(R4),R0		;GET CURRENT VIRTUAL ADDRESS
    304	001004	012701 	000004 			MOV	#4,R1		;++001 SET BOUNDARY VALUE
    305	001010					CALL	ADRUND		;ROUND VIRTUAL ADDRESS
    306	001014	010014 				MOV	R0,(R4)		;SET NEW VIRTUAL ADDRESS
    307	001016	005744 				TST	-(R4)		;ADJUST BACK TO LOCAL LENGTH
    308	001020	020067 	000000G			CMP	R0,$HVRTL	;NEW MAXIMUM?
    309	001024	101405 				BLOS	20$		;IF LOS NO
    310	001026	010067 	000000G			MOV	R0,$HVRTL	;SET NEW MAXIMUM
    311	001032	016767 	000000G	176744 		MOV	$CRVSG,HGSEG	;++021 MARK MAX. SEGMENT
    312	001040				20$:	RETURN			;
    313
    314					;
    315					; CONTROL SECTION MEMORY ALLOCATION
    316					;
    317
    318	001042	010500 			CSALO:	MOV	R5,R0		;GET ADDRESS OF CURRENT CONTROL SECTION
    319	001044	032767 	000000G	000000G		BIT	#SE$QA,$SWTCH	;SEQUENCE ALLOCATION?
    320	001052	001404 				BEQ	5$		;IF EQ NO
    321	001054	062700 	000000G			ADD	#S$GSEQ,R0	;POINT TO SEQUENCE ALLOCATION LISTHEAD
    322	001060	010046 				MOV	R0,-(SP)	;SET ADDRESS OF FIRST LINK WORD
    323	001062	000404 				BR	10$		;
    324	001064	062700 	000000G		5$:	ADD	#S$GCST,R0	;POINT TO SECTION TABLE
    325	001070	012746 	000000G			MOV	#$ISED,-(SP)	;SET SYMBOL EDIT ROUTINE ADDRESS
    326	001074	032767 	000000G	000000G	10$:	BIT	#SE$QA,$SWTCH	;SEQUENCE ALLOCATION?
    327	001102	001410 				BEQ	13$		;IF EQ NO
    328	001104	013600 				MOV	@(SP)+,R0	;GET ADDRESS OF NEXT ENTRY
    329	001106	001410 				BEQ	17$		;IF EQ DONE
    330	001110	010046 				MOV	R0,-(SP)	;SET ADDRESS OF NEXT LINK WORD
    331	001112	016001 	000002 			MOV	2(R0),R1	; GET VIRTUAL ADDRESS OF SECTION ENTRY
    332	001116					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    333	001122	000403 				BR	20$		;
    334	001124				13$:	CALL	@(SP)+		;GET NEXT ENTRY
    335	001126	103001 				BCC	20$		;IF CC GOT ONE
    336	001130				17$:	RETURN			;
    337	001132	132760 	000000G	000000G	20$:	BITB	#CS$IND,C$SFLG(R0);INDIRECT ENTRY?
    338	001140	001355 				BNE	10$		;IF NE YES
    339	001142	132760 	000000G	000000G		BITB	#CS$REL,C$SFLG(R0);ABS SECTION?
    340	001150	001751 				BEQ	10$		;IF EQ YES
    341	001152	132760 	000000G	000000G		BITB	#CS$ACC,C$SFLG(R0);WHAT TYPE OF ACCESS?
    342	001160	000164 	001166'			JMP	30$(R4)		;DISPATCH
SGALO	MACRO M1108  05-DEC-77 23:11  PAGE 2-6


    343	001164	001004 				BNE	50$		;IF NE RO
    344	001166	000401 			30$:	BR	40$		;
    345	001170	001402 				BEQ	50$		;IF EQ RW
    346	001172	005203 			40$:	INC	R3		;INCREMENT FOUND ENTRY FLAG
    347	001174	000737 				BR	10$		;
    348	001176				50$:				;
    349	001176					CALL	$LCKPG		; LOCK PAGE IN MEMORY
    350	001202					CALL	$WRMPG		; WRITE-MARK PAGE
    351	001206	010146 				MOV	R1,-(SP)	; SAVE VIRTUAL ADDRESS
    352	001210	010446 				MOV	R4,-(SP)	; SAVE R4 AND R3
    353	001212	010346 				MOV	R3,-(SP)	;
    354	001214	010003 				MOV	R0,R3		;SAVE ADDRESS OF SECTION ENTRY
    355	001216	132763 	000000G	000000G		BITB	#CS$LIB,C$SFLG(R3);LIB SECTION?
    356	001224	001434 				BEQ	55$		;IF EQ NO
    357	001226	016301 	000000G			MOV	C$SELM(R3),R1	; GET BACK POINTER TO ELEMENT DESCRIPTOR
    358	001232					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    359	001236	010004 				MOV	R0,R4		; SAVE REAL ADDRESS
    360	001240	016404 	000000G			MOV	E$LLGH(R4),R4	;GET BACK POINTER TO LIBRARY LIST ENTRY
    361	001244	016400 	000000G			MOV	L$DCUR(R4),R0	;GET CURRENT BASE ADDRESS
    362	001250	016301 	000000G			MOV	C$SBND(R3),R1	;GET BOUNDRY ALIGNMENT VALUE
    363	001254					CALL	ADRUND		;ROUND VIRTUAL ADDRESS
    364	001260	010063 	000000G			MOV	R0,C$SBSE(R3)	;SET BASE ADDRESS OF SECTION
    365	001264	010063 	000000G			MOV	R0,C$SCUR(R3)	;SET CURRENT BASE OF SECTION
    366	001270	016301 	000000G			MOV	C$SLTH(R3),R1	;GET LENGTH OF SECTION
    367	001274					CALL	ADOFST		;ADD OFFSET VALUE
    368	001300	010064 	000000G			MOV	R0,L$DCUR(R4)	;SET CURRENT BASE OF LIBRARY
    369	001304	166300 	000000G			SUB	C$SBSE(R3),R0	;CALCULATE ACTUAL LENGTH
    370	001310	010063 	000000G			MOV	R0,C$SLTH(R3)	;SET ACTUAL LENGTH
    371	001314	000473 				BR	90$		;
    372	001316	012704 	000002'		55$:	MOV	#LVADR,R4	;GET ADDRESS OF CURRENT VIRTUAL ADDRESS
    373	001322	011400 				MOV	(R4),R0		;GET CURRENT VIRTUAL ADDRESS
    374	001324	016301 	000000G			MOV	C$SBND(R3),R1	;GET BOUNDRY VALUE
    375	001330					CALL	ADRUND		;ROUND VIRTUAL ADDRESS
    376	001334	011401 				MOV	(R4),R1		;SAVE CURRENT VIRTUAL ADDRESS
    377	001336	010014 				MOV	R0,(R4)		;SET NEW CURRENT VIRTUAL ADDRESS
    378	001340	160100 				SUB	R1,R0		;CALCULATE NET INCREASE
    379	001342	010001 				MOV	R0,R1		;SET OFFSET VALUE
    380	001344	014400 				MOV	-(R4),R0	;GET CURRENT LENGTH
    381	001346					CALL	ADOFST		;ADD OFFSET VALUE
    382	001352	010046 				MOV	R0,-(SP)	;SAVE CURRENT LENGTH
    383	001354	010301 				MOV	R3,R1		;SET ADDRESS OF SECTION ENTRY
    384	001356	012700 	000000G			MOV	#$SCTHD,R0	;GET ADDRESS OF EXTEND LISTHEAD
    385	001362					CALL	$SRCHR		; SEARCH EXTENSION LIST FOR SECTION
    386	001366	103422 				BCS	80$		;IF CS NO FIND EM
    387	001370	132763 	000000G	000000G		BITB	#CS$ALO,C$SFLG(R3);CONCATENATED SECTION?
    388	001376	001007 				BNE	60$		;IF NE NO
    389	001400	016001 	000000G			MOV	C$SBSE(R0),R1	;GET EXTENSION LENGTH
    390	001404	016300 	000000G			MOV	C$SCUR(R3),R0	;GET CURRENT SECTION LENGTH
    391	001410					CALL	ADOFST		;ADD OFFSET VALUE
    392	001414	000405 				BR	70$		;
    393	001416	016000 	000000G		60$:	MOV	C$SBSE(R0),R0	;GET EXTENSION LENGTH
    394	001422	020063 	000000G			CMP	R0,C$SCUR(R3)	;EXTENSION LENGTH LARGER?
    395	001426	101402 				BLOS	80$		;IF LOS NO
    396	001430	010063 	000000G		70$:	MOV	R0,C$SCUR(R3)	;SET NEW CURRENT SECTION LENGTH
    397	001434	012600 			80$:	MOV	(SP)+,R0	;RETRIEVE CURRENT LENGTH
    398	001436	016301 	000000G			MOV	C$SCUR(R3),R1	;GET LENGTH OF CONTROL SECTION
    399	001442					CALL	ADOFST		;ADD OFFSET VALUE
SGALO	MACRO M1108  05-DEC-77 23:11  PAGE 2-7


    400	001446	010024 				MOV	R0,(R4)+	;SET NEW CURRENT LENGTH
    401	001450	011400 				MOV	(R4),R0		;GET CURRENT VIRTUAL ADDRESS
    402	001452	010063 	000000G			MOV	R0,C$SBSE(R3)	;SET BASE ADDRESS OF SECTION
    403	001456	016301 	000000G			MOV	C$SCUR(R3),R1	;GET LENGTH OF SECTION
    404	001462					CALL	ADOFST		;ADD OFFSET VALUE
    405	001466	011463 	000000G			MOV	(R4),C$SCUR(R3)	;SET CURRENT TO SECTION BASE ADDRESS
    406	001472	010014 				MOV	R0,(R4)		;SET NEW CURRENT VIRTUAL ADDRESS
    407	001474	166300 	000000G			SUB	C$SBSE(R3),R0	;CALCULATE ACTUAL LENGTH
    408	001500	010063 	000000G			MOV	R0,C$SLTH(R3)	;SET SECTION LENGTH
    409	001504	012603 			90$:	MOV	(SP)+,R3	;RESTORE R3 AND R4
    410	001506	012604 				MOV	(SP)+,R4	;
    411	001510	012601 				MOV	(SP)+,R1	; RETRIEVE VIRTUAL ADDRESS OF SECTION
    412	001512					CALL	$UNLPG		; UNLOCK PAGE
    413	001516	000167 	177352 			JMP	10$		; GO AGAIN
    414
    415
    416					;
    417					; SUBROUTINE TO ADD AN OFFSET VALUE TO A BASE ADDRESS AND CHECK FOR
    418					; ADDRESS OVERFLOW. IF OVERFLOW IS DETECTED, THEN THE ORIGINAL BASE
    419					; ADDRESS IS RETURNED TO THE CALLER. ELSE THE UPDATED ADDRESS IS RE-
    420					; TURNED TO THE CALLER.
    421					;
    422
    423	001522	010002 			ADOFST:	MOV	R0,R2		;SAVE BASE ADDRESS
    424	001524	060100 				ADD	R1,R0		;ADD IN OFFSET VALUE
    425	001526	103420 				BCS	OVRFLW		;IF CS OVERFLOW
    426	001530					RETURN			;
    427
    428					;
    429					; SUBROUTINE TO ROUND UP AN ADDRESS TO AN ADDRESS BOUNDRY AND CHECK
    430					; FOR ADDRESS OVERFLOW. IF OVERFLOW IS DETECTED, THEN THE ORIGINAL
    431					; ADDRESS IS RETURNED TO THE CALLER. ELSE THE ROUNDED ADDRESS IS RE-
    432					; TURNED TO THE CALLER.
    433					;
    434
    435	001532	010002 			ADRUND:	MOV	R0,R2		;SAVE BASE ADDRESS
    436	001534	005301 				DEC	R1		;BACK OFF BOUNDRY VALUE BY ONE
    437	001536	060100 				ADD	R1,R0		;ADD BOUNDRY VALUE
    438	001540	103413 				BCS	OVRFLW		;IF CS OVERFLOW
    439	001542	005201 				INC	R1		;ADJUST BACK TO BOUNDRY VALUE
    440	001544	010146 				MOV	R1,-(SP)	;SAVE BOUNDRY VALUE
    441
    442
    443						.IF	NDF	V1145
    444
    445	001546					CALL	$DIV		;
    446
    447						.ENDC
    448
    449
    450						.IF	DF	V1145
    451
    452						MOV	R0,R1		;SET LOW PART OF DIVIDEND
    453						CLR	R0		;CLEAR HIGH PART OF DIVIDEND
    454						DIV	(SP),R0		;DIVIDE EM UP
    455
    456						.ENDC
SGALO	MACRO M1108  05-DEC-77 23:11  PAGE 2-8


    457
    458
    459	001552	012601 				MOV	(SP)+,R1	;RETRIEVE BOUNDRY VALUE
    460
    461
    462						.IF	NDF	V1145
    463
    464	001554					CALL	$MUL		;
    465
    466						.ENDC
    467
    468
    469						.IF	DF	V1145
    470
    471						MUL	R1,R0		;
    472
    473						.ENDC
    474
    475
    476	001560	005700 				TST	R0		;OVERFLOW?
    477	001562	001002 				BNE	OVRFLW		;IF NE YES
    478	001564	010100 				MOV	R1,R0		;SET ROUNDED ADDRESS
    479	001566					RETURN			;
    480
    481					;
    482					; ADDRESS OVERFLOW DETECTED
    483					;
    484
    485	001570	010246 			OVRFLW:	MOV	R2,-(SP)	;SAVE BASE ADDRESS
    486	001572	010502 				MOV	R5,R2		;GET ADDRESS OF CURRENT SEGMENT
    487	001574	062702 	000000G			ADD	#S$GNME,R2	;POINT TO SEGMENT NAME
    488	001600	012701 				MOV	(PC)+,R1	;GET ERROR/SEVERITY
    489	001602	   000G	   000G			.BYTE	E$R23,S$V0	;DIAGNOSTIC
    490	001604					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    491	001610	042767 	000000C	000000G		BIC	#<ST$BF!TS$KF>,$SWTCH ; NO SYMBOL TABLE OR TASK FILES
    492	001616	012600 				MOV	(SP)+,R0	; GET BASE ADDRESS
    493	001620					RETURN			;
    494
    495		000001 				.END
SGALO	MACRO M1108  05-DEC-77 23:11  PAGE 2-9
SYMBOL TABLE

ADOFST  001522R  	E$R22 = ****** GX	SPA   = 000040   	S$V0  = ****** GX	$MXLGH= ****** GX
ADRUND  001532R  	E$R23 = ****** GX	ST$BF = ****** GX	S$ZATL= ****** GX	$NUMSG= ****** GX
CR    = 000015   	FF    = 000014   	S$GATL= ****** GX	TS$KF = ****** GX	$PCTRL= ****** GX
CSALO   001042R  	HGSEG   000004R  	S$GBLK= ****** GX	UPMAX   000736R  	$RLBLK= ****** GX
CS$ACC= ****** GX	HT    = 000011   	S$GCST= ****** GX	VT    = 000013   	$RTSEG= ****** GX
CS$ALO= ****** GX	LCLGH   000000R  	S$GDWN= ****** GX	$CRSEG= ****** GX	$SAVRG= ****** GX
CS$IND= ****** GX	LF    = 000012   	S$GLDA= ****** GX	$CRVSG= ****** GX	$SCTHD= ****** GX
CS$LIB= ****** GX	LVADR   000002R  	S$GLNG= ****** GX	$CVRL = ****** GX	$SGALO  000010RG
CS$REL= ****** GX	L$DCUR= ****** GX	S$GMEM= ****** GX	$DIV  = ****** GX	$SRCHR= ****** GX
C$SBND= ****** GX	OVRFLW  001570R  	S$GNME= ****** GX	$ERMSG= ****** GX	$STACK= ****** GX
C$SBSE= ****** GX	PRVHG   000006R  	S$GRO = ****** GX	$HDSIZ= ****** GX	$SWTCH= ****** GX
C$SCUR= ****** GX	R$$11M= 000000   	S$GRW = ****** GX	$HVRTL= ****** GX	$SZSEG= ****** GX
C$SELM= ****** GX	SE$QA = ****** GX	S$GRWB= ****** GX	$ISED = ****** GX	$UNLPG= ****** GX
C$SFLG= ****** GX	SGALO   000036R  	S$GSEQ= ****** GX	$LCKPG= ****** GX	$WRMPG= ****** GX
C$SLTH= ****** GX	SGALO1  000360R  	S$GVAD= ****** GX	$MUL  = ****** GX	$$    = 000001
E$LLGH= ****** GX

. ABS.	000000	   000
      	001622	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1013 WORDS  ( 4 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:27
[44,10]SGALO,[44,20]SGALO/-SP=[44,30]MACFLM.,SGALO.013
MACFLM	MACRO M1108  05-DEC-77 23:11  PAGE 2


      1		000000 			S$$GTB=0
MACFLM	MACRO M1108  05-DEC-77 23:11  PAGE 3


						.IIF NDF S$$GTB	.NLIST
      2						.IF	DF	S$$GTB
      3
      4						.TITLE	SGTBL
      5
      6						.IFF
      7
      8						.TITLE	SEGDF
      9
     10						.ENDC
     11
     12						.IDENT	/05/
     13					                                                                                ;**NEW**
     14					;                                                                               ;**NEW**
     15					; COPYRIGHT   1975, DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
     16					;                                                                               ;**NEW**
     17					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE               ;**NEW**
     18					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION                ;**NEW**
     19					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT                ;**NEW**
     20					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.                               ;**NEW**
     21					;                                                                               ;**NEW**
     22					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT                ;**NEW**
     23					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL                ;**NEW**
     24					; EQUIPMENT CORPORATION.                                                        ;**NEW**
     25					;                                                                               ;**NEW**
     26					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY                ;**NEW**
     27					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.                 ;**NEW**
     28					;                                                                               ;**NEW**
     29					; VERSION 05
     30					;                                                                               ;**NEW**
     31					; D. N. CUTLER/C. MONIA 16-MAY-74                                               ;**NEW**
     32					;
     33					; MODIFICATIONS:
     34					;
     35					; NO.		DATE		PROGRAMMER
     36					; ---		----		----------
     37					;
     38					; 038		22-MAR-75	C. MONIA
     39					;
     40					;                                                                               ;**-13
     41					; DEFINE SEGMENT DESCRIPTOR OFFSETS AND LENGTHS
     42					;-
     43					;SEGDF$ [DEF$G]
     44					;
     45					; WHERE:
     46					;
     47					;	DEF$G CAUSES SEGMENT DESCRIPTOR PARAMETERS TO BE
     48					;	DEFINED GLOBALLY.
     49					;
     50					; THE FOLLOWING OFFSETS ARE SPECIFIED:
     51					;
     52					; TASK-BUILDER SEGMENT DESCRIPTOR OFFSETS:
     53					;
     54					;
     55					;	S$GSTS = SEGMENT STATUS (LOW BYTE). 0 = RESIDENT IN MEMORY
     56					;		 HIGH BYTE IS RESERVED
     57					;	S$GBLK = DISK BLOCK ADDRESS OF SEGMENT RELATIVE TO HEADER
SGTBL	MACRO M1108  05-DEC-77 23:11  PAGE 3-1


     58					;	S$GLDA = VIRTUAL LOAD ADDRESS OF SEGMENT
     59					;	S$GLNG = LENGTH OF SEGMENT IN BYTES
     60					;	S$GUP  = LINK UP
     61					;	S$GDWN = LINK DOWN
     62					;	S$GNXT = LINK NEXT (LINK RIGHT)
     63					;	S$GPRV = LINK PREVIOUS (LINK LEFT)
     64					;	S$GNME = TWO WORDS CONTAINING RAD. 50 SEGMENT NAME
     65					;	S$GCST = CONTROL SECTION TABLE LISTHEADS. 8 WORDS POINTING
     66					;		 TO SUBLIST FOR EACH LEXICAL PARTITION IN THE
     67					;		 CONTROL SECTION SYMBOL TABLE.
     68					;	S$GRO  = LENGTH OF READ ONLY MEMORY ALLOCATION IN BYTES
     69					;	S$GRW  = LENGTH OF READ/WRITE MEMORY ALLOCATION IN BYTES
     70					;	S$GSTB = SYMBOL TABLE LISTHEADS. 8 WORDS POINTING TO
     71					;		 SUBLIST FOR EACH LEXICAL PARTITION IN THE
     72					;		 TABLE OF GLOBAL SYMBOLS.
     73					;	S$GUND = COUNT OF UNDEFINED SYMBOLS WITHIN THE SEGMENT
     74					;	S$GVAD = HIGHEST VIRTUAL ADDRESS IN THE SEGMENT
     75					;	S$GELT = TWO-WORD ELEMENT DESCRIPTOR LISTHEAD
     76					;	S$GATL = AUTOLOAD LISTHEAD (2 WORDS) AND COUNT OF AUTO-
     77					;		 LOAD ENTRIES (1 WORD)
     78					;	S$GMEM = HIGHEST PHYSICAL ADDRESS IN SEGMENT
     79					;	S$GRWB = CURRENT BASE ADDRESS OF READ/WRITE MEMORY
     80					;	S$GSEG = VIRTUAL ADDRESS OF SEGMENT DESCRIPTOR IN TASK MEMORY
     81					;	S$GSEQ = TWO-WORD SEQUENCE ALLOCATION LISTHEAD
     82					;	S$GLGH = LENGTH OF SEGMENT DESCRIPTOR
     83					;
     84					; TASK-RESIDENT SEGMENT DESCRIPTOR OFFSETS:
     85					;
     86					;	T$RBLK = DISK BLOCK ADDRESS(BITS 11 - 0)
     87					;	        SEGMENT FLAGS(BITS 15 - 12)
     88					;	T$RLDA = VIRTUAL LOAD ADDRESS OF SEGMENT
     89					;	T$RLNG = LENGTH OF SEGMENT IN BYTES
     90					;	T$RUP  = LINK UP
     91					;	T$RDWN = LINK DOWN
     92					;	T$RNXT = LINK NEXT
     93					;	T$RNME = SEGMENT NAME (2-WORD RADIX 50)
     94					;
     95					; SPACE FOR THE SEGMENT NAME IS ONLY ALLOCATED WHEN A REFERENCE
     96					; TO '$LOAD' IS PRESENT.
     97					;
     98					;-
     99					;
    100
    101						.MACRO	SEGDF$,$$$GBL
    102						.ASECT
    103					.=0
    104					S$GSTS:	.BLKW	1
    105					S$GBLK:	.BLKW	1
    106					S$GLDA:	.BLKW	1
    107					S$GLNG:	.BLKW	1
    108					S$GUP:	.BLKW	1
    109					S$GDWN:	.BLKW	1
    110					S$GNXT:	.BLKW	1
    111					S$GPRV:	.BLKW	1
    112					S$GNME:	.BLKW	2
    113					S$GCST:	.BLKW	2.
    114					S$GRO:	.BLKW	1
SGTBL	MACRO M1108  05-DEC-77 23:11  PAGE 3-2


    115					S$GRW:	.BLKW	2
    116					S$GSTB:	.BLKW	33.
    117					S$GUND:	.BLKW	1
    118					S$GVAD:	.BLKW	2
    119					S$GELT:	.BLKW	2
    120					S$GATL:	.BLKW	3
    121					S$GMEM:	.BLKW	1
    122					S$GRWB:	.BLKW	1
    123					S$GSEG:	.BLKW	1
    124					S$GSEQ:	.BLKW	2
    125					S$GLGH:
    126					.=0
    127					T$RBLK:	.BLKW	1
    128					T$RLDA:	.BLKW	1
    129					T$RLNG:	.BLKW	1
    130					T$RUP:	.BLKW	1
    131					T$RDWN:	.BLKW	1
    132					T$RNXT:	.BLKW	1
    133					T$RNME:	.BLKW	2
    134					S$ZSEG:
    135						.PSECT
    136						.IF	IDN	<$$$GBL>,<DEF$G>
    137						.GLOBL	S$GSTS,S$GBLK,S$GLDA,S$GLNG,S$GUP,S$GDWN,S$GNXT
    138						.GLOBL	S$GPRV,S$GNME,S$GCST,S$GRO,S$GRW,S$GSTB,S$GUND
    139						.GLOBL	S$GVAD,S$GELT,S$GATL,S$GMEM,S$GRWB,S$GSEG,S$GSEQ
    140						.GLOBL	S$GLGH
    141						.GLOBL	S$ZSEG
    142						.ENDC
    143						.MACRO	SEGDF$,A
    144						.ENDM
    145						.ENDM
    146
    147						.IF	DF	S$$GTB
    148
    149	000000					SEGDF$	DEF$G
    150
    151						.IFF
    152
    153						SEGDF$
    154
    155						.ENDC
    156
    157		000001 				.IIF DF S$$GTB	.END
SGTBL	MACRO M1108  05-DEC-77 23:11  PAGE 3-3
SYMBOL TABLE

CR    = 000015   	S$GCST  000024 G 	S$GNXT  000014 G 	S$GSTS  000000 G 	T$RDWN  000010
FF    = 000014   	S$GDWN  000012 G 	S$GPRV  000016 G 	S$GUND  000140 G 	T$RLDA  000002
HT    = 000011   	S$GELT  000146 G 	S$GRO   000030 G 	S$GUP   000010 G 	T$RLNG  000004
LF    = 000012   	S$GLDA  000004 G 	S$GRW   000032 G 	S$GVAD  000142 G 	T$RNME  000014
R$$11M= 000000   	S$GLGH  000172 G 	S$GRWB  000162 G 	S$ZSEG  000020 G 	T$RNXT  000012
SPA   = 000040   	S$GLNG  000006 G 	S$GSEG  000164 G 	S$$GTB= 000000   	T$RUP   000006
S$GATL  000152 G 	S$GMEM  000160 G 	S$GSEQ  000166 G 	T$RBLK  000000   	VT    = 000013
S$GBLK  000002 G 	S$GNME  000020 G 	S$GSTB  000036 G

. ABS.	000172	   000
      	000000	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1062 WORDS  ( 5 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:08
[44,10]SGTBL,[44,20]SGTBL/-SP=[44,30]MACFLM.,SGTBL.,SEGDF.005
SNGSG	MACRO M1108  05-DEC-77 23:11  PAGE 3


      1						.TITLE	SNGSG
      2						.IDENT	/09/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1975,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.               ;**NEW**
      6					;                                                                               ;**-2
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 09                                                                    ;**NEW**
     20					;                                                                               ;**-1
     21					;                                                                               ;**NEW**
     22					; MODIFICATIONS:                                                                ;**NEW**
     23					;                                                                               ;**NEW**
     24					; NO.		DATE		PROGRAMMER                                      ;**NEW**
     25					; ---		----		----------                                      ;**NEW**
     26					;                                                                               ;**NEW**
     27					; 031		03-JAN-75	C. MONIA                                        ;**NEW**
     28					;+                                                                              ;**-1
     29					; **-$SNGSG-CREATE SINGLE SEGMENT DESCRIPTION
     30					;
     31					; THIS ROUTINE IS CALLED TO CREATE A SINGLE SEGMENT TASK
     32					; DESCRIPTION.
     33					;
     34					; INPUTS:
     35					;
     36					;	R5=ADDRESS OF TEMP BUFFER AREA.
     37					;	$INPPT RECORD BLOCK.
     38					;
     39					; OUTPUTS:
     40					;
     41					;	A SINGLE SEGMENT TASK DESCRIPTION IS CREATED.
     42					;-
     43
     44	000000				$SNGSG::			;
     45	000000					CALL	PRFND		; PARSE-FIND FILE
     46	000004	012701 				MOV	(PC)+,R1	;ASSUME PARSE-FIND FAILURE
     47	000006	   000G	   000G			.BYTE	E$R57,S$V2	;FATAL-NO RETURN
     48	000010	103450 				BCS	30$		;IF CS YES
     49	000012	016701 	000000G			MOV	$RTSEG,R1	;GET ADDRESS OF ROOT SEGMENT
     50	000016					CALL	$CVRL		; CONVERT TO REAL ADDRESS
     51	000022					CALL	$WRMPG		; WRITE MARK PAGE
     52	000026	016701 	000000G			MOV	$INIPT,R1	; GET INPUT FILE RECORD BLOCK
     53	000032	016160 	000110 	000000G		MOV	F.FNB+N.FNAM(R1),S$GNME(R0) ; SET NAME OF ROOT SEGMENT
     54	000040	016160 	000112 	000002G		MOV	F.FNB+N.FNAM+2(R1),S$GNME+2(R0) ;
     55	000046				10$:	CALL	$ALELD		;ALLOCATE AN ELEMENT DESCRIPTOR
     56	000052	016760 	000000G	000002G		MOV	$LBMOD,E$LIDT+2(R0) ; SET VIRTUAL ADDRESS OF MODULE NAME LIST
     57	000060	016700 	000000G			MOV	$RTSEG,R0	; GET ADDRESS OF ROOT SEGMENT
SNGSG	MACRO M1108  05-DEC-77 23:11  PAGE 3-1


     58	000064	062700 	000000C			ADD	#<S$GELT/2>,R0	; POINT TO VIRTUAL ADDRESS OF LISTHEAD
     59	000070	012702 	000000G			MOV	#E$LNXT,R2	; SET LINK-NEXT OFFSET
     60	000074					CALL	$LNKVM		; LINK DESCRIPTOR TO LIST
     61	000100				20$:				;++031                                          ;**NEW**
     62	000100	016700 	000000G			MOV	$INIPT,R0	; GET INPUT FILE RECORD BLOCK
     63	000104	012760 	000000G	000000G		MOV	#SW$CC,R$SWTH(R0) ; SET DEFAULT TO CONCATENATED FILE
     64	000112					CALL	$NXTFL		;++031 GET NEXT INPUT FILE                      ;**NEW**
     65	000116	103412 				BCS	40$		;IF CS LOGICAL EOF                              ;**-1
     66	000120					CALL	PRFND		; PARSE-FIND FILE
     67	000124	103350 				BCC	10$		;IF CC OKAY
     68	000126	012701 				MOV	(PC)+,R1	;PARSE-FIND FAILURE
     69	000130	   000G	   000G			.BYTE	E$R57,S$V1	;DIAGNOSTIC
     70	000132	016002 	000000G		30$:	MOV	R$NAME(R0),R2	;GET ADDRESS OF NAME STRING
     71	000136					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
     72	000142	000756 				BR	20$		;TRY FOR ANOTHER FILE
     73	000144				40$:	RETURN			;
     74
     75					;
     76					; ESTABLISH DEFAULT FOR LIBRARY FILE (IF REQUESTED), PARSE/FIND
     77					; THE FILE.
     78					;
     79
     80	000146				PRFND:				;
     81	000146	016700 	000000G			MOV	$INIPT,R0	; GET INPUT FILE RECORD BLOCK
     82	000152	016046 	000046 			MOV	F.DFNB(R0),-(SP) ; SAVE DEFAULT NAMEBLOCK
     83	000156	032760 	000000G	000000G		BIT	#SW$LB,R$SWTH(R0) ; LIBRARY FILE?
     84	000164	001403 				BEQ	10$		; IF EQ NO
     85	000166	012760 	000000G	000046 		MOV	#$LIBNB,F.DFNB(R0) ; REPLACE NAMEBLOCK POINTER
     86	000174				10$:				;
     87	000174					CALL	$PRFND		; PARSE-FIND THE FILE
     88	000200	012660 	000046 			MOV	(SP)+,F.DFNB(R0) ; REPLACE NAMEBLOCK
     89	000204					RETURN			;
     90
     91
     92		000001 				.END
SNGSG	MACRO M1108  05-DEC-77 23:11  PAGE 3-2
SYMBOL TABLE

B.BBFS= 000010   	FD.SQD= 000040   	F.FFBY= 000014   	NB.NAM= 000004   	S$V1  = ****** GX
B.BFST= 000015   	FD.TTY= 000004   	F.FNAM= 000110   	NB.SD1= 000400   	S$V2  = ****** GX
B.NXBD= 000012   	FD.WBH= 000002   	F.FNB = 000102   	NB.SD2= 001000   	S.BFHD= 000020
B.VBN = 000004   	FF    = 000014   	F.FTYP= 000116   	NB.SNM= 000040   	S.FATT= 000016
CR    = 000015   	FO.APD= 000106   	F.FVER= 000120   	NB.STP= 000020   	S.FDB = 000140
E$LIDT= ****** GX	FO.MFY= 000002   	F.HIBK= 000004   	NB.SVR= 000010   	S.FNAM= 000006
E$LNXT= ****** GX	FO.RD = 000001   	F.LUN = 000042   	NB.TYP= 000002   	S.FNB = 000036
E$R57 = ****** GX	FO.UPD= 000006   	F.MBCT= 000054   	NB.VER= 000001   	S.FNBW= 000017
FA.APD= 000100   	FO.WRT= 000016   	F.MBC1= 000055   	N.DID = 000024   	S.FNTY= 000004
FA.CRE= 000010   	F.ALOC= 000040   	F.MBFG= 000056   	N.DVNM= 000032   	S.FTYP= 000002
FA.EXT= 000004   	F.BBFS= 000062   	F.NRBD= 000024   	N.FID = 000000   	S.NFEN= 000020
FA.NSP= 000100   	F.BDB = 000070   	F.NREC= 000030   	N.FNAM= 000006   	VT    = 000013
FA.RD = 000001   	F.BGBC= 000057   	F.OVBS= 000030   	N.FTYP= 000014   	$ALELD= ****** GX
FA.SHR= 000040   	F.BKDN= 000026   	F.RACC= 000016   	N.FVER= 000016   	$CVRL = ****** GX
FA.TMP= 000020   	F.BKDS= 000020   	F.RATT= 000001   	N.NEXT= 000022   	$ERMSG= ****** GX
FA.WRT= 000002   	F.BKEF= 000050   	F.RCNM= 000034   	N.STAT= 000020   	$INIPT= ****** GX
FD.BLK= 000010   	F.BKP1= 000051   	F.RCTL= 000017   	N.UNIT= 000034   	$LBMOD= ****** GX
FD.CCL= 000002   	F.BKST= 000024   	F.RSIZ= 000002   	PRFND   000146R  	$LIBNB= ****** GX
FD.CR = 000002   	F.BKVB= 000064   	F.RTYP= 000000   	R$NAME= ****** GX	$LNKVM= ****** GX
FD.DIR= 000010   	F.CNTG= 000034   	F.STBK= 000036   	R$SWTH= ****** GX	$NXTFL= ****** GX
FD.FTN= 000001   	F.DFNB= 000046   	F.UNIT= 000136   	R$$11M= 000000   	$PRFND= ****** GX
FD.INS= 000010   	F.DSPT= 000044   	F.URBD= 000020   	R.FIX = 000001   	$RTSEG= ****** GX
FD.PLC= 000004   	F.DVNM= 000134   	F.VBN = 000064   	R.VAR = 000002   	$SNGSG  000000RG
FD.RAH= 000001   	F.EFBK= 000010   	F.VBSZ= 000060   	SPA   = 000040   	$WRMPG= ****** GX
FD.RAN= 000002   	F.EFN = 000050   	HT    = 000011   	SW$CC = ****** GX	$$    = 000001
FD.REC= 000001   	F.EOBB= 000032   	LF    = 000012   	SW$LB = ****** GX	...GBL= 000000
FD.RWM= 000001   	F.ERR = 000052   	NB.DEV= 000200   	S$GELT= ****** GX	...TPC= 000140
FD.SDI= 000020   	F.FACC= 000043   	NB.DIR= 000100   	S$GNME= ****** GX

. ABS.	000000	   000
      	000206	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2042 WORDS  ( 8 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[44,10]SNGSG,[44,20]SNGSG/-SP=[44,30]MACFLM.,FCSPR.,SNGSG.009
SRCINS	MACRO M1108  05-DEC-77 23:12  PAGE 2


      1						.TITLE	SRCINS
      2						.IDENT	/07/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     17					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 07
     20					;                                                                               ;**-1
     21					; C. MONIA 13-MAR-74
     22					;
     23					; MODIFICATIONS
     24					;
     25					; NO.		DATE		PROGRAMMER
     26					; ---		----		----------
     27					;
     28					; 038		22-MAR-75	C. MONIA
     29					;
     30					;
     31					; VIRTUAL MEMORY SYMBOL TABLE SEARCH AND INSERT SUBROUTINES
     32					;
     33					; EQUATED SYMBOLS
     34					;
     35
     36		000007 			S$CNT==7			; OFFSET TO HIGH BYTE OF SYMBOL FLAG WORD
     37		000002 			S$YM==2				; OFFSET TO SYMBOL DESCRIPTOR
     38
     39					;
     40					; LOCAL DATA
     41					;
     42
     43	000000				LCOUNT:	.BLKW	1		; LISTHEAD COUNT                                ;**NEW**
     44	000002				LHEAD:	.BLKW	1		; CURRENT LISTHEAD                              ;**NEW**
     45	000004	006200 			LIMIT:	.RAD50	/B/		;++038 SUB-LIST LIMITS
     46	000006	014400 				.RAD50	/D/
     47	000010	022600 				.RAD50	/F/
     48	000012	031000 				.RAD50	/H/
     49	000014	037200 				.RAD50	/J/
     50	000016	045400 				.RAD50	/L/
     51	000020	053600 				.RAD50	/N/
     52	000022	062000 				.RAD50	/P/
     53	000024	070200 				.RAD50	/R/
     54	000026	076400 				.RAD50	/T/
     55	000030	104600 				.RAD50	/V/
     56	000032	113000 				.RAD50	/X/
     57	000034	121200 				.RAD50	/Z/
SRCINS	MACRO M1108  05-DEC-77 23:12  PAGE 2-1


     58	000036	124470 				.RAD50	/$C/
     59	000040	124660 				.RAD50	/$F/
     60	000042	125050 				.RAD50	/$I/
     61	000044	125240 				.RAD50	/$L/
     62	000046	125430 				.RAD50	/$O/
     63	000050	125620 				.RAD50	/$R/
     64	000052	126010 				.RAD50	/$U/
     65	000054	126200 				.RAD50	/$X/
     66	000056	126320 				.RAD50	/$Z/
     67	000060	127570 				.RAD50	/.C/
     68	000062	127760 				.RAD50	/.F/
     69	000064	130150 				.RAD50	/.I/
     70	000066	130340 				.RAD50	/.L/
     71	000070	130530 				.RAD50	/.O/
     72	000072	130720 				.RAD50	/.R/
     73	000074	131110 				.RAD50	/.U/
     74	000076	131547 				.RAD50	/..G/
     75	000100	131560 				.RAD50	/..P/
     76	000102	131572 				.RAD50	/..Z/
     77		000040 			L$HCNT==.-LIMIT/2		;++038 LISTHEAD COUNT
     78	000104				LKNXT:	.BLKW	1		; LINK TO NEXT ENTRY
     79	000106				LKPRV:	.BLKW	1		; LINK TO PREVIOUS ENTRY
     80	000110				PVSRC:	.BLKW	1		; VIRTUAL ADDRESS OF LAST SYMBOL FOUND
     81	000112				SYMLOC:	.BLKW	1		; VIRTUAL ADDRESS OF SYMBOL TO INSERT
     82	000114				SYM:	.BLKW	2		; SYMBOL NAME
     83
     84					;
     85					; DATA STRUCTURES
     86					;
     87					; GENERAL SYMBOL TABLE FORMATS
     88					;
     89					;	LISTHEAD: FIRST WORD CONTAINS A COUNT OF THE NUMBER OF
     90					;		  SUBLISTS IN USE. EACH CELL IN THE TABLE REPRESENTS
     91					;		  THE START OF A SUBLIST CONTAINING ALL SYMBOLS WITHIN
     92					;		  THE LEXICAL LIMITS ESTABLISHED BY THE LIMIT TABLE.
     93					;                                                                               ;**-2
     94					;	SYMBOL TABLE ENTRIES:
     95					;
     96					;	SENTRY:	.WORD	LINK	; POINTER TO NEXT ENTRY
     97					;		.WORD	S$YM	; FIRST HALF OF SYMBOL
     98					;		.WORD	S$YM+2	; SECOND HALF OF SYMBOL
     99					;		.WORD	DATA	; ANY DATA
    100					;			.
    101					;			.
    102					;			.
    103					;		.WORD	DATA	; END OF ENTRY
    104					;
    105					; ENTRIES ARE LINKED IN LEXICAL ORDER. A ZERO IN THE LINK
    106					; WORD INDICATES NO FURTHER ENTRIES IN THE LIST.
    107					;
    108					;+
    109					; **-$ISYM-INSERT SYMBOL IN LEXICALLY ORDERED LIST
    110					;
    111					; THIS SUBROUTINE IS CALLED TO INSERT A SYMBOL IN
    112					; A LIST STORED IN VIRTUAL MEMORY. A PREVIOUS CALL
    113					; TO $SRCHI IS REQUIRED TO SCAN THE LIST AND SETUP
    114					; LKPRV AND LKNXT WITH THE VIRTUAL ADDRESSES OF THE
SRCINS	MACRO M1108  05-DEC-77 23:12  PAGE 2-2


    115					; PREDECESSOR AND SUCCESSOR ENTRIES RESPECTIVELY. THE
    116					; ENTRY IS INSERTED AND THE PAGE BUFFERS CONTAINING
    117					; THE PRECEDING AND NEW ENTRIES ARE WRITE MARKED.
    118					;
    119					; INPUTS:
    120					;
    121					;	LKPRV=VIRTUAL ADDRESS OF PRECEDING ENTRY
    122					;	LKNXT=VIRTUAL ADDRESS OF SUCCESSOR TO 'LKPRV'.
    123					;	SYMLOC=VIRTUAL ADDRESS OF SYMBOL TO BE INSERTED
    124					;
    125					; OUTPUTS:
    126					;
    127					;	THE NEW ENTRY IS LINKED TO THE LIST.
    128					;	THE APPROPRIATE PAGE BUFFERS ARE WRITE MARKED
    129					;-
    130
    131	000120				$ISYM::				;
    132	000120	016701 	177766 			MOV	SYMLOC,R1	; GET VIRTUAL ADDRESS OF NEW SYMBOL
    133	000124					CALL	$CVRL		; CONVERT NEW TO REAL ADDRESS
    134	000130					CALL	$WRMPG		; WRITE-MARK PAGE BUFFER
    135	000134	016710 	177744 			MOV	LKNXT,(R0)	; SET LINK TO NEXT
    136	000140	016701 	177742 			MOV	LKPRV,R1	; GET VIRTUAL ADDRESS OF PREVIOUS
    137	000144					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    138	000150					CALL	$WRMPG		; WRITE-MARK PAGE BUFFER
    139	000154	016710 	177732 			MOV	SYMLOC,(R0)	; SET NEW LINK-NEXT
    140	000160					RETURN			;
    141
    142					;+
    143					; **-$SRCHI-SEARCH SYMBOL TABLE FOR INSERT
    144					;
    145					; THIS SUBROUTINE IS CALLED TO SEARCH A SYMBOL TABLE
    146					; IN VIRTUAL MEMORY PRIOR TO PERFORMING AN INSERT.
    147					;
    148					; INPUTS:
    149					;
    150					;	R0=VIRTUAL ADDRESS OF LISTHEAD
    151					;	R1=VIRTUAL ADDRESS OF SYMBOL TO BE INSERTED
    152					;
    153					; OUTPUTS:
    154					;
    155					;	C-SET: SYMBOL NOT IN TABLE
    156					;	       R0 IS CLEARED
    157					;	       R1 IS CLEARED
    158					;
    159					;	C-CLEAR: SYMBOL IS IN TABLE
    160					;	         R0=REAL ADDRESS OF SYMBOL
    161					;		 R1=VIRTUAL ADDRESS OF SYMBOL
    162					;
    163					; IN EITHER CASE 'LKPRV' AND 'LKNXT' CONTAIN
    164					; THE ADDRESS OF THE PRECESSOR AND SUCCESOR EN-
    165					; TRIES AT THE POINT FOR INSERTION.
    166					;-
    167
    168	000162				$SRCHI::			;
    169	000162	010546 				MOV	R5,-(SP)	; SAVE R5                                       ;**NEW**
    170	000164	010046 				MOV	R0,-(SP)	;++038 SAVE VIRTUAL ADDRESS OF LISTHEAD
    171	000166	010146 				MOV	R1,-(SP)	;++038 SAVE VIRTUAL ADDRESS OF NEW ENTRY
SRCINS	MACRO M1108  05-DEC-77 23:12  PAGE 2-3


    172	000170	010001 				MOV	R0,R1		;++038 GET VIRTUAL ADDRESS OF LISTHEAD
    173	000172					CALL	$CVRL		;++038 CONVERT TO REAL
    174	000176	011067 	177576 			MOV	(R0),LCOUNT	; SAVE LIST COUNT
    175	000202	012601 				MOV	(SP)+,R1	; GET ADDRESS OF NEW SYMBOL
    176	000204					CALL	$CVRL		; CONVERT NEW ENTRY TO REAL ADDRESS
    177	000210	010167 	177676 			MOV	R1,SYMLOC	; SAVE VIRTUAL ADDRESS OF NEW
    178	000214	016067 	000002 	177672 		MOV	S$YM(R0),SYM	; SAVE SYMBOL NAME
    179	000222	016067 	000004 	177666 		MOV	S$YM+2(R0),SYM+2 ;
    180	000230	010005 				MOV	R0,R5		; COPY REAL ADDRESS                             ;**NEW**
    181	000232					CALL	FNDSLT		; LOCATE APPROPRIATE SUBLIST                    ;**NEW**
    182	000236	006202 				ASR	R2		; CONVERT TO VIRTUAL OFFSET                     ;**NEW**
    183	000240	012601 				MOV	(SP)+,R1	; RESTORE LISTHEAD ADDRESS                      ;**NEW**
    184	000242	005201 				INC	R1		;++038 POINT TO FIRST SUBLIST
    185	000244	060201 				ADD	R2,R1		; COMPUTE VIRTUAL ADDRESS OF SUBLIST            ;**NEW**
    186	000246				10$:				;                                               ;**-1
    187	000246	010167 	177634 			MOV	R1,LKPRV	; SAVE PREDECESSOR ADDRESS
    188	000252	005002 				CLR	R2		; CLEAR OFFSET TO NEXT
    189	000254					CALL	$GNVI		; GET NEXT ITEM ON LIST
    190	000260	010167 	177620 			MOV	R1,LKNXT	; SAVE LINK TO NEXT
    191	000264	103415 				BCS	30$		; IF C/S END OF LIST
    192	000266	026067 	000002 	177620 		CMP	S$YM(R0),SYM	; COMPARE SYMBOL VALUES
    193	000274	101006 				BHI	20$		; IF HI FOUND PLACE TO INSERT
    194	000276	103763 				BLO	10$		; IF LO CONTINUE SEARCH
    195	000300	026067 	000004 	177610 		CMP	S$YM+2(R0),SYM+2 ; COMPARE SECOND HALF
    196	000306	103757 				BLO	10$		; IF LO CONTINUE SEARCH
    197	000310	001403 				BEQ	30$		; IF EQ HAVE SYMBOL
    198	000312				20$:				;
    199	000312	005000 				CLR	R0		; SET NOT FOUND INDICATORS
    200	000314	005001 				CLR	R1		;
    201	000316	000261 				SEC			;
    202	000320				30$:				;
    203	000320	012605 				MOV	(SP)+,R5	; RESTORE R5                                    ;**NEW**
    204	000322					RETURN			;
    205
    206					;+
    207					; **-$ISED-INITIALIZE SYMBOL TABLE EDIT
    208					;
    209					; THIS CO-ROUTINE IS CALLED TO TO RETRIEVE ENTRIES IN AN
    210					; ORDERED, LINKED LIST STORED IN VIRTUAL MEMORY
    211					;
    212					; INPUTS:
    213					;
    214					;	R0=REAL ADDRESS OF LISTHEAD(ONLY ON FIRST CALL)
    215					;
    216					; OUTPUTS:
    217					;
    218					;	C-SET: NO MORE ENTRIES IN LIST
    219					;
    220					;	C-CLEAR: FOUND NEXT ENTRY
    221					;		 R0=REAL ADDRESS OF ENTRY
    222					;		 R1=VIRTUAL ADDRESS OF ENTRY
    223					;
    224					; ON A SUCCESFUL RETURN A CO-ROUTINE CALL IS MADE
    225					; TO THE CALLER. THE SPECIFIED PAGE IS NOT LOCKED
    226					; IN MEMORY. IF THE SEARCH IS TO BE TERMINATED, THE
    227					; CALLER MUST REMOVE THE RETURN ADDRESS FROM THE
    228					; STACK. WHEN NO MORE SYMBOLS REMAIN '$ISED' PER-
SRCINS	MACRO M1108  05-DEC-77 23:12  PAGE 2-4


    229					; FORMS AN 'RTS PC' TO THE CALLING ROUTINE.
    230					;-
    231
    232	000324				$ISED::				;
    233	000324	012067 	177450 			MOV	(R0)+,LCOUNT	; SET SUBLIST COUNT                             ;**NEW**
    234	000330				ISED:				;                                               ;**NEW**
    235	000330	010067 	177446 			MOV	R0,LHEAD	; SAVE CURRENT LISTHEAD ADDRESS                 ;**NEW**
    236	000334	011001 				MOV	(R0),R1		; GET FIRST VIRTUAL ADDRESS
    237	000336	010100 				MOV	R1,R0		; LIST MAY BE EMPTY
    238	000340	001416 				BEQ	20$		; IF EQ LIST EMPTY
    239	000342					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    240	000346	000241 				CLC			; SET SUCCESS
    241	000350	000404 				BR	15$		;
    242	000352				10$:				;
    243	000352	005002 				CLR	R2		; CLEAR LINK-NEXT OFFSET
    244	000354					CALL	$GNVI		; GET NEXT ITEM
    245	000360	103407 				BCS	30$		; IF C/S END OF LIST
    246	000362				15$:				;
    247	000362	010167 	177522 			MOV	R1,PVSRC	; SAVE VIRTUAL ADDRESS OF NEXT
    248	000366					CALL	@(SP)+		; CALL THE CALLER
    249	000370	016701 	177514 			MOV	PVSRC,R1	; RETRIEVE VIRTUAL ADDRESS OF ENTRY
    250	000374	000766 				BR	10$		; GO AGAIN
    251	000376				20$:				;
    252	000376	000261 				SEC			; INDICATE NO MORE ENTRIES
    253	000400				30$:				;
    254	000400	005367 	177374 			DEC	LCOUNT		; DECREMENT SUBLIST COUNT                       ;**NEW**
    255	000404	002405 				BLT	40$		; IF LT SCANNED ALL SUBLISTS                    ;**NEW**
    256	000406	016700 	177370 			MOV	LHEAD,R0	; GET ADDRESS OF CURRENT LISTHEAD               ;**NEW**
    257	000412	062700 	000002 			ADD	#2,R0		; COMPUTE NEXT ADDRESS                          ;**NEW**
    258	000416	000744 				BR	ISED		; GO AGAIN                                      ;**NEW**
    259	000420				40$:				;                                               ;**NEW**
    260	000420					RETURN			;
    261
    262					;+
    263					; **-$SRCH-SEARCH A LEXICALLY ORDERED LIST FOR SYMBOL
    264					;
    265					; THIS ROUTINE IS CALLED TO SEARCH A LIST IN VIRTUAL
    266					; MEMORY FOR A SYMBOL. THE LIST MUST BE IN LEXICAL OR-
    267					; DER.
    268					;
    269					; INPUTS:
    270					;
    271					;	R0=REAL ADDRESS OF LISTHEAD
    272					;	R1=REAL ADDRESS OF SYMBOL
    273					;
    274					; IT IS ASSUMED THAT THE SYMBOL IS PERMANENTLY RESIDENT
    275					; IN REAL MEMORY.
    276					;
    277					;
    278					; OUTPUTS:
    279					;
    280					;	C-SET:	SYMBOL NOT FOUND
    281					;		R0, R1 CLEARED
    282					;
    283					;	C-CLEAR: SYMBOL FOUND
    284					;		R0=REAL ADDRESS OF SYMBOL
    285					;		R1=VIRTUAL ADDRESS OF SYMBOL
SRCINS	MACRO M1108  05-DEC-77 23:12  PAGE 2-5


    286					;
    287					;-
    288
    289	000422				$SRCH::				;
    290	000422	010546 				MOV	R5,-(SP)	; SAVE R5
    291	000424	010105 				MOV	R1,R5		; SAVE REAL ADDRESS OF SYMBOL
    292	000426	012067 	177346 			MOV	(R0)+,LCOUNT	;++038 SET LISTHEAD COUNT
    293	000432					CALL	FNDSLT		; LOCATE SUBLIST                                ;**NEW**
    294	000436	005067 	177336 			CLR	LCOUNT		;++038 CLEAR LISTHEAD COUNT
    295	000442	060200 				ADD	R2,R0		; COMPUTE SUBLIST ADDRESS                       ;**NEW**
    296	000444	012746 	000330'			MOV	#ISED,-(SP)	; SET ADDRESS OF SYMBOL EDIT ROUTINE            ;**NEW**
    297	000450				10$:				;                                               ;**-1
    298	000450					CALL	@(SP)+		; GET NEXT SYMBOL
    299	000452	103416 				BCS	30$		; IF C/S END OF LIST
    300	000454	026065 	000002 	000002 		CMP	S$YM(R0),S$YM(R5) ; CHECK FIRST HALF OF SYMBOL
    301	000462	101006 				BHI	20$		; IF HI NOT IN LIST
    302	000464	103771 				BLO	10$		; IF LO CHECK NEXT ITEM
    303	000466	026065 	000004 	000004 		CMP	S$YM+2(R0),S$YM+2(R5) ; CHECK SECOND HALF OF SYMBOL
    304	000474	103765 				BLO	10$		; IF LO CHECK NEXT ITEM
    305	000476	001403 				BEQ	25$		; IF EQ HAVE MATCH
    306	000500				20$:				;
    307	000500	005000 				CLR	R0		; SET NOT-FOUND INDICATORS
    308	000502	005001 				CLR	R1		;
    309	000504	000261 				SEC			;
    310	000506				25$:				;
    311	000506	005226 				INC	(SP)+		; CLEAN STACK
    312	000510				30$:				;
    313	000510	012605 				MOV	(SP)+,R5	; RESTORE R5
    314	000512					RETURN			;
    315					                                                                                ;**NEW**
    316					;                                                                               ;**NEW**
    317					; FIND SYMBOL POSITION WITHIN SUBLISTS                                          ;**NEW**
    318					;                                                                               ;**NEW**
    319					                                                                                ;**NEW**
    320	000514				FNDSLT:				;                                               ;**NEW**
    321	000514	012701 	000004'			MOV	#LIMIT,R1	; GET LIMIT TABLE ADDRESS                       ;**NEW**
    322	000520	005002 				CLR	R2		; CLEAR INDEX                                   ;**NEW**
    323	000522				10$:				;                                               ;**NEW**
    324	000522	022165 	000002 			CMP	(R1)+,S$YM(R5)	; CHECK FIRST HALF OF SYMBOL                    ;**NEW**
    325	000526	103005 				BHIS	30$		;++038 IF HIS FOUND SLOT
    326	000530	020267 	177244 			CMP	R2,LCOUNT	;++038 AT LAST SLOT?
    327	000534	103002 				BHIS	30$		;++038 IF HIS YES
    328	000536	005202 				INC	R2		;++038 INCREMENT COUNT
    329	000540	000770 				BR	10$		;++038 GO AGAIN
    330	000542				30$:				;                                               ;**NEW**
    331	000542	006302 				ASL	R2		; CONVERT TO WORD INDEX                         ;**NEW**
    332	000544					RETURN			;                                               ;**NEW**
    333
    334		000001 				.END
SRCINS	MACRO M1108  05-DEC-77 23:12  PAGE 2-6
SYMBOL TABLE

CR    = 000015   	LF    = 000012   	PVSRC   000110R  	S$YM  = 000002 G 	$ISYM   000120RG
FF    = 000014   	LHEAD   000002R  	R$$11M= 000000   	VT    = 000013   	$SRCH   000422RG
FNDSLT  000514R  	LIMIT   000004R  	SPA   = 000040   	$CVRL = ****** GX	$SRCHI  000162RG
HT    = 000011   	LKNXT   000104R  	SYM     000114R  	$GNVI = ****** GX	$WRMPG= ****** GX
ISED    000330R  	LKPRV   000106R  	SYMLOC  000112R  	$ISED   000324RG 	$$    = 000001
LCOUNT  000000R  	L$HCNT= 000040 G 	S$CNT = 000007 G

. ABS.	000000	   000
      	000546	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  702 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[44,10]SRCINS,[44,20]SRCINS/-SP=[44,30]MACFLM.,SRCINS.007
STFDB	MACRO M1108  05-DEC-77 23:12  PAGE 3


      1						.TITLE	STFDB
      2						.IDENT	/02/                                                           ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     17					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     18					; VERSION 02                                                                   ;**NEW**
     19					;                                                                               ;**NEW**
     20					; C. MONIA 04-MAR-74                                                            ;**NEW**
     21					;                                                                               ;**-2
     22					; ROUTINES TO MANAGE OVERLAYED I/O DATA BASE.
     23					;
     24					; MACRO LIBRARY CALLS
     25					;
     26
     27						.MCALL	CLOSE$
     28
     29					;
     30					; LOCAL DATA
     31					;
     32					; STACK OF RESIDENT FDB'S
     33					;
     34
     35						.BLKW	5
     36	000012	000012'			RCBPT:	.WORD	.
     37					;
     38					;+
     39					; **-$POPCL-CLOSE ALL FDB'S ON THE RESIDENT FDB LIST
     40					;
     41					; INPUTS:
     42					;	RCBPT=POINTER TO STACK OF RESIDENT FDB'S
     43					;
     44					; OUTPUTS:
     45					;
     46					;	A POP CLOSE IS PERFORMED ON EACH RESIDENT FDB
     47					;-
     48					;
     49
     50	000014				$POPCL::			;
     51	000014	026727 	177772 	000012'	10$:	CMP	RCBPT,#RCBPT	; ANY FDB'S IN USE
     52	000022	001410 				BEQ	20$		; IF EQ NO
     53	000024	017700 	177762 			MOV	@RCBPT,R0	; GET RECORD BLOCK POINTER
     54	000030					CLOSE$	R0		; CLOSE THE FILE
     55	000034	062767 	000002 	177750 		ADD	#2,RCBPT	; POP FDB
     56	000042	000764 				BR	10$		; GO AGAIN
     57	000044				20$:				;
STFDB	MACRO M1108  05-DEC-77 23:12  PAGE 3-1


     58	000044					RETURN			;
     59					;
     60					;+
     61					; **-$STBLK-SETUP FCS BLOCK BUFFER STORAGE REGION
     62					;
     63					; INPUTS:
     64					;
     65					;	R0=ADDRESS OF BLOCK BUFFER POOL
     66					;
     67					;	BUFFER POOL SETUP AS FOLLOWS:
     68					;
     69					;	POOL: .WORD N
     70					;	      .BLKW N
     71					;
     72					;
     73					; OUTPUTS:
     74					;
     75					;	FILE STORAGE REGION 2 IS SETUP WITH A LISTHEAD POINTING TO THE
     76					;	ABOVE POOL IN THE FORMAT REQUIRED BY $RQCB, $RLCB STORAGE
     77					;	ALLOCATION AND DEALLOCATION ROUTINES.
     78					;
     79					;	***NOTE***
     80					;
     81					; NO FILES MAY BE OPEN WHEN THIS ROUTINE IS CALLED
     82					;
     83					;-
     84					;
     85
     86	000046				$STBLK::			;
     87	000046	013701 	000000G			MOV	@#.FSRPT,R1	; GET FSR2 ADDRESS
     88	000052	012002 				MOV	(R0)+,R2	; GET POOL SIZE
     89	000054	010021 				MOV	R0,(R1)+	; SET BUFFER POINTER
     90	000056	005011 				CLR	(R1)		; CLEAR SECOND WORD OF LISTHEAD
     91	000060	005020 				CLR	(R0)+		; CLEAR LINK TO NEXT
     92	000062	010210 				MOV	R2,(R0)		; SET BLOCK SIZE
     93	000064					RETURN			;
     94
     95					;
     96					;+
     97					; **-$STFNB-SETUP THE NAMEBLOCK PORTION OF THE FDB
     98					;
     99					; INPUTS:
    100					;
    101					;	R0=ADDRESS OF ELEMENT DESCRIPTOR
    102					;	R1=RECORD BLOCK ADDRESS
    103					;
    104					; OUTPUTS:
    105					;
    106					;	THE NAME BLOCK AND FILE SWITCH WORD ARE
    107					;	COPIED INTO THE APPROPRIATE LOCATIONS WITH-
    108					;	IN THE RECORD BLOCK
    109					;
    110					;		*** NOTE ***
    111					;
    112					;	IF E$LNUM IS -2 THEN THE DIRECTORY I/D                                  ;**NEW**
    113					;	IS SETUP INSTEAD OF THE FILE I/D.                                       ;**-1
    114					;-
STFDB	MACRO M1108  05-DEC-77 23:12  PAGE 3-2


    115					;
    116
    117	000066				$STFNB::			;
    118	000066	016046 	000000G			MOV	E$LNUM(R0),-(SP) ; SAVE DIRECTORY INDICATOR                     ;**NEW**
    119	000072					CALL	STFN		; SETUP FILENAME PORTION OF FNB                 ;**-1
    120	000076	062701 	000102 			ADD	#F.FNB+N.FID,R1	; POINT TO FILE I/D
    121	000102	022627 	177776 			CMP	(SP)+,#-2	; TEST DIRECTORY INDICATOR                      ;**NEW**
    122	000106	001002 				BNE	10$		; IF NE SETUP FILE I/D                          ;**NEW**
    123	000110	062701 	000024 			ADD	#<N.DID-N.FID>,R1 ; POINT TO DIRECTORY I/D                      ;**-2
    124	000114				10$:				;
    125	000114	012021 				MOV	(R0)+,(R1)+	; SETUP I/D
    126	000116	012021 				MOV	(R0)+,(R1)+	;
    127	000120	012021 				MOV	(R0)+,(R1)+	;
    128	000122					RETURN			;
    129
    130					;
    131					; SETUP THE FILENAME PORTION OF THE FDB
    132					; LEAVE R0 POINTING TO I/D.
    133					;
    134
    135	000124				STFN:				;
    136	000124	016061 	000000G	000000G		MOV	E$LSWT(R0),R$SWTH(R1) ; SET FILE SWITCH WORD
    137	000132	062700 	000000G			ADD	#E$LMND,R0	; POINT TO MODULE NAME TABLE
    138	000136	012061 	000136 			MOV	(R0)+,F.FNB+N.UNIT(R1) ; SET UNIT NUMBER
    139	000142	012061 	000134 			MOV	(R0)+,F.FNB+N.DVNM(R1) ; SET DEVICE NAME
    140	000146	012061 	000110 			MOV	(R0)+,F.FNB+N.FNAM(R1) ; SET FILE NAME
    141	000152	012061 	000112 			MOV	(R0)+,F.FNB+N.FNAM+2(R1) ;
    142	000156	012061 	000114 			MOV	(R0)+,F.FNB+N.FNAM+4(R1) ;
    143	000162	012061 	000116 			MOV	(R0)+,F.FNB+N.FTYP(R1) ; SET FILE TYPE
    144	000166	012061 	000120 			MOV	(R0)+,F.FNB+N.FVER(R1) ; SET FILE VERSION
    145	000172					RETURN			;
    146					;
    147					;+
    148					; **-$STRCB-SETUP RECORD BLOCK
    149					;
    150					;	THIS ROUTINE IS CALLED TO SETUP A RECORD BLOCK FOR
    151					; A FILE TO BE OPENED. THE BLOCK ADDRESS IS PUSHED ONTO
    152					; A LIST OF OPEN FDB'S SO THAT FILES MAY BE PROPERLY
    153					; CLOSED WHEN A TASK BUILD IS ABORTED. OPTIONALLY, AN FCS
    154					; BLOCK BUFFER POOL IS ESTABLISHED AND THE
    155					; FILENAME BLOCK IS SETUP. A CO-ROUTINE CALL IS MADE TO
    156					; THE CALLER. ON RETURN, THE RECORD BLOCK ADDRESS IS POP-
    157					; PED FROM THE LIST.
    158					;
    159					;	IN THE EVENT OF AN ABORT, A POP-CLOSE IS DONE ON
    160					; EACH POINTER IN THE LIST VIA A CALL TO $POPCL.
    161					;
    162					; INPUTS:
    163					;
    164					;	R0=RECORD BLOCK POINTER
    165					;
    166					; OUTPUTS:
    167					;
    168					;	THE NAME BLOCK AND BUFFER POOL ARE SETUP AS REQUIRED
    169					;	THE RECORD BLOCK ADDRESS IS PUSHED ONTO THE LIST OF RESIDENT BLOCKS.
    170					;-
    171
STFDB	MACRO M1108  05-DEC-77 23:12  PAGE 3-3


    172	000174				$STRCB::			;
    173	000174	010046 				MOV	R0,-(SP)	; SAVE RECORD BLOCK POINTER                     ;**NEW**
    174	000176	017001 	000000G			MOV	@R$NMBK(R0),R1	; GET VIRTUAL ADDRESS OF NAMEBLOCK              ;**NEW**
    175	000202	001405 				BEQ	10$		; IF EQ NONE                                    ;**-3
    176	000204					CALL	$CVRL		; CONVERT TO REAL ADDRESS                       ;**NEW**
    177	000210	011601 				MOV	(SP),R1		; GET ADDRESS OF RECORD BLOCK                   ;**NEW**
    178	000212					CALL	$STFNB		; SETUP FILENAME BLOCK
    179	000216				10$:				;
    180	000216	011600 				MOV	(SP),R0		; RETRIEVE RECORD BLOCK ADDRESS
    181	000220	016000 	000000G			MOV	R$BLKB(R0),R0	; GET ADDRESS OF BLOCK BUFFER
    182	000224	001402 				BEQ	20$		; IF EQ NONE
    183	000226					CALL	$STBLK		; SETUP BLOCK BUFFER POINTER
    184	000232				20$:				;
    185	000232	062767 	177776 	177552 		ADD	#-2,RCBPT	; PUSH RECORD BLOCK POINTER
    186	000240	012677 	177546 			MOV	(SP)+,@RCBPT	; SAVE BLOCK ADDRESS
    187	000244					CALL	@(SP)+		; CALL THE CALLER
    188	000246	062767 	000002 	177536 		ADD	#+2,RCBPT	; POP RECORD BLOCK POINTER
    189	000254					RETURN			;
    190
    191		000001 				.END
STFDB	MACRO M1108  05-DEC-77 23:12  PAGE 3-4
SYMBOL TABLE

B.BBFS= 000010   	FD.SDI= 000020   	F.EOBB= 000032   	F.VBSZ= 000060   	R$SWTH= ****** GX
B.BFST= 000015   	FD.SQD= 000040   	F.ERR = 000052   	HT    = 000011   	R$$11M= 000000
B.NXBD= 000012   	FD.TTY= 000004   	F.FACC= 000043   	LF    = 000012   	R.FIX = 000001
B.VBN = 000004   	FD.WBH= 000002   	F.FFBY= 000014   	NB.DEV= 000200   	R.VAR = 000002
CR    = 000015   	FF    = 000014   	F.FNAM= 000110   	NB.DIR= 000100   	SPA   = 000040
E$LMND= ****** GX	FO.APD= 000106   	F.FNB = 000102   	NB.NAM= 000004   	STFN    000124R
E$LNUM= ****** GX	FO.MFY= 000002   	F.FTYP= 000116   	NB.SD1= 000400   	S.BFHD= 000020
E$LSWT= ****** GX	FO.RD = 000001   	F.FVER= 000120   	NB.SD2= 001000   	S.FATT= 000016
FA.APD= 000100   	FO.UPD= 000006   	F.HIBK= 000004   	NB.SNM= 000040   	S.FDB = 000140
FA.CRE= 000010   	FO.WRT= 000016   	F.LUN = 000042   	NB.STP= 000020   	S.FNAM= 000006
FA.EXT= 000004   	F.ALOC= 000040   	F.MBCT= 000054   	NB.SVR= 000010   	S.FNB = 000036
FA.NSP= 000100   	F.BBFS= 000062   	F.MBC1= 000055   	NB.TYP= 000002   	S.FNBW= 000017
FA.RD = 000001   	F.BDB = 000070   	F.MBFG= 000056   	NB.VER= 000001   	S.FNTY= 000004
FA.SHR= 000040   	F.BGBC= 000057   	F.NRBD= 000024   	N.DID = 000024   	S.FTYP= 000002
FA.TMP= 000020   	F.BKDN= 000026   	F.NREC= 000030   	N.DVNM= 000032   	S.NFEN= 000020
FA.WRT= 000002   	F.BKDS= 000020   	F.OVBS= 000030   	N.FID = 000000   	VT    = 000013
FD.BLK= 000010   	F.BKEF= 000050   	F.RACC= 000016   	N.FNAM= 000006   	$CVRL = ****** GX
FD.CCL= 000002   	F.BKP1= 000051   	F.RATT= 000001   	N.FTYP= 000014   	$POPCL  000014RG
FD.CR = 000002   	F.BKST= 000024   	F.RCNM= 000034   	N.FVER= 000016   	$STBLK  000046RG
FD.DIR= 000010   	F.BKVB= 000064   	F.RCTL= 000017   	N.NEXT= 000022   	$STFNB  000066RG
FD.FTN= 000001   	F.CNTG= 000034   	F.RSIZ= 000002   	N.STAT= 000020   	$STRCB  000174RG
FD.INS= 000010   	F.DFNB= 000046   	F.RTYP= 000000   	N.UNIT= 000034   	$$    = 000001
FD.PLC= 000004   	F.DSPT= 000044   	F.STBK= 000036   	PAR$$$= 000000   	.CLOSE= ****** G
FD.RAH= 000001   	F.DVNM= 000134   	F.UNIT= 000136   	RCBPT   000012R  	.FSRPT= ****** GX
FD.RAN= 000002   	F.EFBK= 000010   	F.URBD= 000020   	R$BLKB= ****** GX	...GBL= 000000
FD.REC= 000001   	F.EFN = 000050   	F.VBN = 000064   	R$NMBK= ****** GX	...TPC= 000140
FD.RWM= 000001

. ABS.	000000	   000
      	000256	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1994 WORDS  ( 8 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:19
[44,10]STFDB,[44,20]STFDB/-SP=[44,30]MACFLM.,FCSPR.,STFDB.002
STINP	MACRO M1108  05-DEC-77 23:12  PAGE 3


      1						.TITLE	STINP
      2						.IDENT	/06/                                                           ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY
     17					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 06                                                                   ;**NEW**
     20					;                                                                               ;**-2
     21					; D.N. CUTLER/C. MONIA	21-JAN-74
     22					;
     23					; MACRO LIBRARY CALLS
     24					;
     25
     26						.MCALL	CLOSE$,GET$S,OFNB$R
     27
     28					;+
     29					; **-$STINP-SET UP INPUT FILE
     30					;
     31					; THIS ROUTINE IS CALLED TO SET UP THE NEXT INPUT FILE FROM THE CUR-
     32					; RENT ELEMENT LIST. THE FILE IS SET UP IN THE $INPPT RECORD BLOCK.
     33					; THE ROUTINE IS A MONITOR DEPENDENT ROUTINE SINCE IT MUST KNOW THE
     34					; FORMAT OF THE MONITOR DEPENDENT DATA IN THE ELEMENT DESCRIPTOR. THE
     35					; CURRENT FILE IS CLOSED, THE NEXT FILE IN THE ELEMENT LIST IS OPEN-
     36					; ED AND $NBYTE IS CLEARED. A COROUTINE CALL IS THEN MADE TO THE CALLER.
     37					;
     38					; INPUTS:
     39					;
     40					;	$INPPT RECORD BLOCK.
     41					;
     42					; OUTPUTS:
     43					;
     44					;	C=1 IF NO MORE FILES ARE IN THE ELEMENT LIST.
     45					;		RETURN IS VIA RETURN.
     46					;	C=0 IF NEXT FILE IS OPENED SUCESSFULLY.
     47					;		RETURN IS VIA CALL @(SP)+.
     48					;-
     49
     50	000000	012600 			$STINP::MOV	(SP)+,R0	;GET RETURN ADDRESS
     51	000002	016701 	000000G			MOV	$CRSEG,R1	;GET ADDRESS OF CURRENT SEGMENT
     52	000006	016146 	000000G			MOV	S$GELT(R1),-(SP);SET ADDRESS OF NEXT ELEMENT
     53	000012	010046 				MOV	R0,-(SP)	;RESTORE RETURN ADDRESS
     54	000014				10$:				;
     55	000014	016601 	000002 			MOV	2(SP),R1	; GET VIRTUAL ADDRESS OF NEXT ELEMENT
     56	000020	001003 				BNE	20$		;IF NE GOT ONE
     57	000022	012616 				MOV	(SP)+,(SP)	;REMOVE ZERO WORD
STINP	MACRO M1108  05-DEC-77 23:12  PAGE 3-1


     58	000024	000261 				SEC			;SET CARRY
     59	000026					RETURN			;
     60	000030				20$:				;
     61	000030					CALL	$CVRL		; CONVERT VIRTUAL TO REAL ADDRESS
     62	000034	016066 	000000G	000002 		MOV	E$LNXT(R0),2(SP) ; SET VIRTUAL ADDRESS OF NEXT                  ;**-1
     63	000042	011646 				MOV	(SP),-(SP)	; COPY RETURN ADDRESS
     64	000044	010166 	000002 			MOV	R1,2(SP)	; SAVE VIRTUAL ADDRESS OF CURRENT ELEMENT
     65	000050	010167 	000000G			MOV	R1,$CRVEL	; SET VIRTUAL ADDRESS OF CURRENT ELEMENT
     66	000054	010067 	000000G			MOV	R0,$CRELM	;SET ADDR OF CURRENT ELEMENT DESCRIPTOR
     67	000060	005067 	000000G			CLR	$NBYTE		;CLEAR BYTE COUNT
     68	000064	016701 	000000G			MOV	$INPPT,R1	; GET INPUT FILE RECORD BLOCK POINTER
     69	000070					CALL	$STFNB		; SETUP FILE NAME BLOCK
     70	000074	016700 	000000G			MOV	$INPPT,R0	;GET INPUT FILE RECORD BLOCK
     71	000100	016701 	000000G			MOV	$CRELM,R1	; GET ELEMENT DESCRIPTOR ADDRESS
     72	000104					OFNB$R	R0		; OPEN INPUT FILE
     73	000116	103006 				BCC	30$		;IF CC OKAY
     74	000120	016002 	000000G			MOV	R$NAME(R0),R2	;GET ADDRESS OF NAME STRING
     75	000124	012701 				MOV	(PC)+,R1	;OPEN FAILURE
     76	000126	   000G	   000G			.BYTE	E$R11,S$V2	;FATAL-NO RETURN
     77	000130					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
     78	000134	022767 	000003 	000000G	30$:	CMP	#3,$PHASE	;PHASE 3?
     79	000142	001507 				BEQ	80$		;IF EQ YES
     80	000144	032761 	000000G	000000G		BIT	#SW$CC,E$LSWT(R1);CONCATENATED FILE?
     81	000152	001004 				BNE	40$		;IF NE YES
     82	000154	032761 	000000G	000000G		BIT	#SW$LB,E$LSWT(R1);LIBRARY FILE?
     83	000162	001477 				BEQ	80$		;IF EQ NO
     84	000164	012600 			40$:	MOV	(SP)+,R0	;GET RETURN ADDRESS
     85	000166	016146 	000000G			MOV	E$LMOD(R1),-(SP);SET ADDRESS OF NEXT ENTRY
     86	000172	010046 				MOV	R0,-(SP)	;RESTORE RETURN ADDRESS
     87	000174				50$:				;
     88	000174	016601 	000002 			MOV	2(SP),R1	; GET VIRTUAL ADDRESS OF NEXT ENTRY
     89	000200	001466 				BEQ	70$		;IF EQ NO MORE
     90	000202					CALL	$CVRL		; CONVERT TO REAL ADDRESS
     91	000206	016066 	000000G	000002 		MOV	E$LNXT(R0),2(SP);SET ADDRESS OF NEXT ENTRY                      ;**-1
     92	000214	011646 				MOV	(SP),-(SP)	; COPY RETURN ADDRESS
     93	000216	010166 	000002 			MOV	R1,2(SP)	; SAVE VIRTUAL ADDRESS OF CURRENT
     94	000222	010167 	000000G			MOV	R1,$CRVEL	; SET VIRTUAL ADDRESS OF CURRENT ELEMENT
     95	000226	010067 	000000G			MOV	R0,$CRELM	;SET ADDR OF CURRENT ELEMENT DESCRIPTOR
     96	000232	005067 	000000G			CLR	$NBYTE		;CLEAR BYTE COUNT
     97	000236	032760 	000000G	000000G		BIT	#SW$CC,E$LSWT(R0);CONCATENATED FILE?
     98	000244	001031 				BNE	60$		;IF NE YES
     99	000246	005001 				CLR	R1		;CLEAR HIGH PART OF VIRTUAL BLOCK NUMBER
    100	000250	016002 	000000G			MOV	E$LMND(R0),R2	;SET LOW PART OF VIRTUAL BLOCK NUMBER
    101	000254	016003 	000002G			MOV	E$LMND+2(R0),R3	;GET BYTE WITHIN BLOCK
    102	000260	016700 	000000G			MOV	$INPPT,R0	;GET INPUT FILE RECORD BLOCK
    103	000264	112760 	000002 	000000 		MOVB	#2,F.RTYP(R0)	;SET VARIABLE LENGTH RECORD TYPE
    104	000272	112760 	000004 	000001 		MOVB	#4,F.RATT(R0)	;SET RECORD ATTRIBUTES
    105	000300					CALL	.POINT		;POINT TO PROPER RECORD
    106	000304	103403 				BCS	55$		;IF CS I/O ERROR
    107	000306					GET$S	R0		; GET MODULE HEADER RECORD
    108	000312	103006 				BCC	60$		;IF CC OKAY
    109	000314	016002 	000000G		55$:	MOV	R$NAME(R0),R2	;GET ADDRESS OF NAME STRING
    110	000320	012701 				MOV	(PC)+,R1	;I/O ERROR
    111	000322	   000G	   000G			.BYTE	E$R10,S$V2	;FATAL-NO RETURN
    112	000324					CALL	$ERMSG		;OUTPUT ERROR MESSAGE
    113	000330				60$:				;                                               ;**NEW**
    114	000330	016601 	000002 			MOV	2(SP),R1	; GET VIRTUAL ADDRESS OF DESCRIPTOR             ;**NEW**
STINP	MACRO M1108  05-DEC-77 23:12  PAGE 3-2


    115	000334					CALL	$LCKPG		; LOCK PAGE IN MEMORY                           ;**NEW**
    116	000340					CALL	@(SP)+		;CALL THE CALLER                                ;**-1
    117	000342	016601 	000002 			MOV	2(SP),R1	; RESTORE VIRTUAL ADDRESS OF CURRENT
    118	000346	012616 				MOV	(SP)+,(SP)	; ADJUST STACK
    119	000350					CALL	$UNLPG		; UNLOCK PAGE FROM CORE
    120	000354	000707 				BR	50$		;GO AGAIN
    121	000356	012616 			70$:	MOV	(SP)+,(SP)	;REMOVE ZERO WORD
    122	000360	000411 				BR	90$		;
    123	000362				80$:				;                                               ;**NEW**
    124	000362	016601 	000002 			MOV	2(SP),R1	; GET VIRTUAL ADDRESS OF DESCRIPTOR             ;**NEW**
    125	000366					CALL	$LCKPG		; LOCK PAGE IN MEMORY                           ;**NEW**
    126	000372					CALL	@(SP)+		;CALL THE CALLER                                ;**-1
    127	000374	016601 	000002 			MOV	2(SP),R1	; GET DESCRIPTOR VIRTUAL ADDRESS                ;**NEW**
    128	000400					CALL	$UNLPG		; UNLOCK DESCRIPTOR FROM MEMORY                 ;**NEW**
    129	000404				90$:	CLOSE$	$INPPT		;CLOSE INPUT FILE
    130	000414	012616 				MOV	(SP)+,(SP)	; REMOVE VIRTUAL ADDRESS FROM STACK             ;**-2
    131	000416	000167 	177372 			JMP	10$		;                                               ;**NEW**
    132					                                                                                ;**-1
    133		000001 				.END
STINP	MACRO M1108  05-DEC-77 23:12  PAGE 3-3
SYMBOL TABLE

B.BBFS= 000010   	FD.RWM= 000001   	F.FACC= 000043   	NB.NAM= 000004   	S.FATT= 000016
B.BFST= 000015   	FD.SDI= 000020   	F.FFBY= 000014   	NB.SD1= 000400   	S.FDB = 000140
B.NXBD= 000012   	FD.SQD= 000040   	F.FNAM= 000110   	NB.SD2= 001000   	S.FNAM= 000006
B.VBN = 000004   	FD.TTY= 000004   	F.FNB = 000102   	NB.SNM= 000040   	S.FNB = 000036
CR    = 000015   	FD.WBH= 000002   	F.FTYP= 000116   	NB.STP= 000020   	S.FNBW= 000017
E$LMND= ****** GX	FF    = 000014   	F.FVER= 000120   	NB.SVR= 000010   	S.FNTY= 000004
E$LMOD= ****** GX	FO.APD= 000106   	F.HIBK= 000004   	NB.TYP= 000002   	S.FTYP= 000002
E$LNXT= ****** GX	FO.MFY= 000002   	F.LUN = 000042   	NB.VER= 000001   	S.NFEN= 000020
E$LSWT= ****** GX	FO.RD = 000001   	F.MBCT= 000054   	N.DID = 000024   	VT    = 000013
E$R10 = ****** GX	FO.UPD= 000006   	F.MBC1= 000055   	N.DVNM= 000032   	$CRELM= ****** GX
E$R11 = ****** GX	FO.WRT= 000016   	F.MBFG= 000056   	N.FID = 000000   	$CRSEG= ****** GX
FA.APD= 000100   	F.ALOC= 000040   	F.NRBD= 000024   	N.FNAM= 000006   	$CRVEL= ****** GX
FA.CRE= 000010   	F.BBFS= 000062   	F.NREC= 000030   	N.FTYP= 000014   	$CVRL = ****** GX
FA.EXT= 000004   	F.BDB = 000070   	F.OVBS= 000030   	N.FVER= 000016   	$ERMSG= ****** GX
FA.NSP= 000100   	F.BGBC= 000057   	F.RACC= 000016   	N.NEXT= 000022   	$INPPT= ****** GX
FA.RD = 000001   	F.BKDN= 000026   	F.RATT= 000001   	N.STAT= 000020   	$LCKPG= ****** GX
FA.SHR= 000040   	F.BKDS= 000020   	F.RCNM= 000034   	N.UNIT= 000034   	$NBYTE= ****** GX
FA.TMP= 000020   	F.BKEF= 000050   	F.RCTL= 000017   	PAR$$$= 000067   	$PHASE= ****** GX
FA.WRT= 000002   	F.BKP1= 000051   	F.RSIZ= 000002   	R$NAME= ****** GX	$STFNB= ****** GX
FD.BLK= 000010   	F.BKST= 000024   	F.RTYP= 000000   	R$$11M= 000000   	$STINP  000000RG
FD.CCL= 000002   	F.BKVB= 000064   	F.STBK= 000036   	R.FIX = 000001   	$UNLPG= ****** GX
FD.CR = 000002   	F.CNTG= 000034   	F.UNIT= 000136   	R.VAR = 000002   	$$    = 000001
FD.DIR= 000010   	F.DFNB= 000046   	F.URBD= 000020   	SPA   = 000040   	.CLOSE= ****** G
FD.FTN= 000001   	F.DSPT= 000044   	F.VBN = 000064   	SW$CC = ****** GX	.GETSQ= ****** G
FD.INS= 000010   	F.DVNM= 000134   	F.VBSZ= 000060   	SW$LB = ****** GX	.OPFNB= ****** G
FD.PLC= 000004   	F.EFBK= 000010   	HT    = 000011   	S$GELT= ****** GX	.POINT= ****** GX
FD.RAH= 000001   	F.EFN = 000050   	LF    = 000012   	S$V2  = ****** GX	...GBL= 000000
FD.RAN= 000002   	F.EOBB= 000032   	NB.DEV= 000200   	S.BFHD= 000020   	...TPC= 000140
FD.REC= 000001   	F.ERR = 000052   	NB.DIR= 000100

. ABS.	000000	   000
      	000422	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2250 WORDS  ( 9 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:24
[44,10]STINP,[44,20]STINP/-SP=[44,30]MACFLM.,FCSPR.,STINP.006
SYALO	MACRO M1108  05-DEC-77 23:13  PAGE 2


      1						.TITLE	SYALO
      2						.IDENT	/03/                                                           ;**NEW**
      3					                                                                                ;**NEW**
      4					;                                                                               ;**NEW**
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.               ;**NEW**
      6					;                                                                               ;**NEW**
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE               ;**NEW**
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE  COPIED (WITH INCLUSION               ;**NEW**
      9					; OF DEC'S COPYRIGHT  NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT               ;**NEW**
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.                               ;**NEW**
     11					;                                                                               ;**NEW**
     12					; THE  INFORMATION  IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT               ;**NEW**
     13					; NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL               ;**NEW**
     14					; EQUIPMENT CORPORATION.                                                        ;**NEW**
     15					;                                                                               ;**NEW**
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR  RELIABILITY               ;**NEW**
     17					; OF  ITS  SOFTWARE ON  EQUIPMENT WHICH  IS  NOT SUPPLIED BY DEC.               ;**NEW**
     18					;                                                                               ;**NEW**
     19					;                                                                               ;**NEW**
     20					; VERSION 03                                                                   ;**NEW**
     21					;                                                                               ;**NEW**
     22					; D. N. CUTLER/C. MONIA  19-APR-74                                              ;**NEW**
     23					;                                                                               ;**-12
     24					;+
     25					; **-$SYALO-SYMBOL ABSOLUTE ADDRESS ALLOCATION
     26					;
     27					; THIS ROUTINE IS CALLED IN PHASE 4 TO ASSIGN ABSOLUTE ADDRESSES TO
     28					; ALL RELOCATABLE SYMBOLS.
     29					;
     30					; INPUTS:
     31					;
     32					;	NONE.
     33					;
     34					; OUTPUTS:
     35					;
     36					;	ABSOLUTE ADDRESSES ARE ASSIGNED TO ALL RELOCATABLE SYMBOLS.
     37					;-
     38
     39	000000	012700 	000074'		$SYALO::MOV	#SYALO,R0	;GET PHASE CONTROL ROUTINE ADDRESS
     40	000004					CALL	$PCTRL		;CALL PHASE CONTROL ROUTINE
     41	000010	012700 	000000G			MOV	#$XFRAD,R0	;GET PRG VECTOR ADDRESS
     42	000014	022720 	000001 			CMP	#1,(R0)+	;PRG SPECIFIED?
     43	000020	001402 				BEQ	10$		;IF EQ NO
     44	000022					CALL	20$		;RELOCATE PRG XFR ADDRESS
     45	000026	012700 	000000G		10$:	MOV	#$ODTAD,R0	;GET ODT VECTOR ADDRESS
     46	000032	022720 	000001 			CMP	#1,(R0)+	;ODT SPECIFIED?
     47	000036	001415 				BEQ	30$		;IF EQ NO
     48	000040	011001 			20$:	MOV	(R0),R1		;GET ADDRESS OF SECTION ENTRY
     49	000042	010046 				MOV	R0,-(SP)	; SAVE VECTOR ADDRESS                           ;**NEW**
     50	000044					CALL	$CVRL		; CONVERT SECTION TO REAL ADDRESS               ;**NEW**
     51	000050	012602 				MOV	(SP)+,R2	; RETRIEVE VECTOR ADDRESS                       ;**NEW**
     52	000052	132760 	000000G	000000G		BITB	#CS$REL,C$SFLG(R0) ; ABS SECTION?                               ;**NEW**
     53	000060	001404 				BEQ	30$		; IF EQ YES                                     ;**NEW**
     54	000062	066042 	000000G			ADD	C$SBSE(R0),-(R2) ; ADD IN SECTION BASE ADDRESS                  ;**NEW**
     55	000066	066712 	000000G			ADD	$OFFST,(R2)	;                                               ;**NEW**
     56	000072				30$:	RETURN			;                                               ;**-4
     57
SYALO	MACRO M1108  05-DEC-77 23:13  PAGE 2-1


     58					;
     59					; SYMBOL ADDRESS ALLOCATION
     60					;
     61					; THIS ROUTINE IS CALLED FOR EACH SEGMENT IN THE ALLOCATION.
     62					;
     63
     64	000074	016700 	000000G		SYALO:	MOV	$CRSEG,R0	;GET ADDRESS OF CURRENT SEGMENT
     65	000100	062700 	000000G			ADD	#S$GSTB,R0	;POINT TO GLOBAL SYM TABLE HEADER
     66	000104	012746 	000000G			MOV	#$ISED,-(SP)	;SET EDIT ROUTINE ADDRESS
     67	000110				10$:	CALL	@(SP)+		;GET NEXT SYMBOL
     68	000112	103001 				BCC	20$		;IF CC GOT ONE
     69	000114					RETURN			;
     70	000116	132760 	000000G	000000G	20$:	BITB	#SY$DEF,S$YFLG(R0);SYMBOL DEFINITION?
     71	000124	001771 				BEQ	10$		;IF EQ NO
     72	000126	132760 	000000G	000000G		BITB	#SY$IND,S$YFLG(R0);INDIRECT SYMBOL?
     73	000134	001365 				BNE	10$		;IF NE YES
     74	000136	132760 	000000G	000000G		BITB	#SY$REL,S$YFLG(R0);RELOCATABLE SYMBOL?
     75	000144	001761 				BEQ	10$		;IF EQ NO
     76	000146					CALL	$WRMPG		; WRITE MARK PAGE                               ;**NEW**
     77	000152					CALL	$LCKPG		; LOCK PAGE IN CORE                             ;**NEW**
     78	000156	010046 				MOV	R0,-(SP)	; SAVE REAL ADDRESS                             ;**NEW**
     79	000160	010146 				MOV	R1,-(SP)	; SAVE VIRTUAL ADDRESS                          ;**NEW**
     80	000162	016001 	000000G			MOV	S$YCMT(R0),R1	; GET VIRTUAL ADDRESS OF SEGMENT                ;**NEW**
     81	000166					CALL	$CVRL		; CONVERT TO REAL                               ;**NEW**
     82	000172	010002 				MOV	R0,R2		; COPY REAL ADDRESS                             ;**NEW**
     83	000174	012601 				MOV	(SP)+,R1	; RESTORE R1                                    ;**NEW**
     84	000176	012600 				MOV	(SP)+,R0	; RESTORE R0                                    ;**NEW**
     85	000200					CALL	$UNLPG		; UNLOCK PAGE                                   ;**NEW**
     86	000204	066260 	000000G	000000G		ADD	C$SBSE(R2),S$YVAL(R0) ; RELOCATE SYMBOL                         ;**NEW**
     87	000212	132762 	000000G	000000G		BITB	#CS$LIB,C$SFLG(R2) ; LIB SECTION?                               ;**NEW**
     88	000220	001733 				BEQ	10$		; IF EQ NO                                      ;**NEW**
     89	000222	142760 	000000G	000000G		BICB	#SY$REL,S$YFLG(R0) ; CONVERT SYMBOL TO ABSOLUTE                 ;**NEW**
     90	000230	000727 				BR	10$		; GO AGAIN                                      ;**NEW**
     91					                                                                                ;**-6
     92		000001 				.END
SYALO	MACRO M1108  05-DEC-77 23:13  PAGE 2-2
SYMBOL TABLE

CR    = 000015   	LF    = 000012   	SY$REL= ****** GX	$CRSEG= ****** GX	$PCTRL= ****** GX
CS$LIB= ****** GX	R$$11M= 000000   	S$GSTB= ****** GX	$CVRL = ****** GX	$SYALO  000000RG
CS$REL= ****** GX	SPA   = 000040   	S$YCMT= ****** GX	$ISED = ****** GX	$UNLPG= ****** GX
C$SBSE= ****** GX	SYALO   000074R  	S$YFLG= ****** GX	$LCKPG= ****** GX	$WRMPG= ****** GX
C$SFLG= ****** GX	SY$DEF= ****** GX	S$YVAL= ****** GX	$ODTAD= ****** GX	$XFRAD= ****** GX
FF    = 000014   	SY$IND= ****** GX	VT    = 000013   	$OFFST= ****** GX	$$    = 000001
HT    = 000011

. ABS.	000000	   000
      	000232	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  662 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:08
[44,10]SYALO,[44,20]SYALO/-SP=[44,30]MACFLM.,SYALO.003
TABLS	MACRO M1108  05-DEC-77 23:13  PAGE 2


      1						.TITLE	TABLS
      2						.IDENT	/22/
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1975,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 22
     20					;                                                                               ;**-1
     21					; D.N. CUTLER/C. MONIA 27-DEC-73
     22					;
     23					;
     24					;
     25					; MODIFICATIONS
     26					;
     27					; NO.		DATE		PROGRAMMER
     28					; ---		----		----------
     29					;
     30					; 003		04-AUG-73	C. MONIA
     31					; 008		17-AUG-73	C. MONIA
     32					; 035		07-JAN-75	C. MONIA
     33					; 036		14-JAN-74	C. MONIA                                        ;**NEW**
     34					; 041		15-MAY-75	C. MONIA
     35					; 042		29-JUL-75	C. MONIA
     36					;
     37					; COMMON DATA AND TABLES
     38					;
     39					; EQUATED SYMBOLS
     40					;
     41					; AUTOLOAD LIST ENTRY SIZE
     42					;
     43
     44		000004 			A$LLST==4			;SIZE OF AUTOLOAD LIST ENTRY
     45
     46					;
     47					; CONTROL SECTION ENTRY FLAG BYTE BIT DEFINITIONS
     48					;
     49
     50		000200 			CS$TYP==000200			;TYPE (1=DATA, 0=INS)
     51		000100 			CS$GBL==000100			;SCOPE (1=GLOBAL, 0=LOCAL)
     52		000040 			CS$REL==000040			;RELOCATABLE (1=REL, 0=ABS)
     53		000020 			CS$ACC==000020			;ACCESS (1=RO, 0=RW)
     54		000010 			CS$IND==000010			;INDIRECT (1=IND, 0=DEF)
     55		000004 			CS$ALO==000004			;ALLOCATION (1=OVR, 0=CON)
     56		000002 			CS$LIB==000002			;LIBRARY SECTION (1=YES)
     57
TABLS	MACRO M1108  05-DEC-77 23:13  PAGE 2-1


     58					;
     59					; 	*** NOTE ***
     60					;
     61					; MEMORY TYPE IS NOT SUPPORTED BY TKB.
     62					; THIS FLAG BIT IS USED INTERNALLY TO
     63					; SPECIFY THE AUTOLOAD ATTRIBUTE.
     64					;
     65
     66		000001 			CS$MEM==000001			;MEMORY TYPE (1=HGH, 0=LOW)
     67		000001 			CS$ATL==000001			; AUTOLOAD FLAG (1=YES)
     68
     69					;
     70					; CONTROL SECTION TABLE ENTRY OFFSET AND LENGTH DEFINITIONS
     71					;
     72
     73		000006 			C$SFLG==6			; OFFSET-FLAG BYTE
     74		000010 			C$SBSE==C$SFLG+2		;OFFSET-BASE ADDRESS
     75		000012 			C$SLTH==C$SBSE+2		;OFFSET-LENGTH OF CONTROL SECTION
     76		000014 			C$SCUR==C$SLTH+2		;OFFSET-CURRENT ADDRESS
     77		000016 			C$SBND==C$SCUR+2		;OFFSET-BOUNDRY ALIGNMENT
     78		000020 			C$SELM==C$SBND+2		; OFFSET-ELEMENT DESCRIPTOR VIRTUAL ADDRESS
     79		000022 			C$SLGH==C$SELM+2		; LENGTH OF CONTROL SECTION ENTRY
     80
     81					;
     82					; ELEMENT DESCRIPTOR OFFSET AND LENGTH DEFINITIONS
     83					;
     84
     85		000000 			E$LNXT==0			;OFFSET-LINK TO NEXT DESCRIPTOR
     86		000002 			E$LCMT==E$LNXT+2		;OFFSET-ADDR CNTRL SECT MAPPING TBL
     87		000004 			E$LNUM==E$LCMT+2		;OFFSET-HIGHEST SECTION NUMBER
     88		000006 			E$LSWT==E$LNUM+2		;OFFSET-ELEMENT SWITCH WORD
     89		000010 			E$LIDT==E$LSWT+2		;OFFSET-VERSION IDENTIFICATION
     90		000014 			E$LMOD==E$LIDT+4		;OFFSET-MODULE NAME (TITLE BLOCK)
     91		000020 			E$LMND==E$LMOD+4		;OFFSET-MONITOR DEPENDENT INFO
     92		000044 			E$LLGH==E$LMND+24		;LENGTH OF ELEMENT DESCRIPTOR
     93
     94					;
     95					; HEADER OFFSET DEFINITIONS
     96					;
     97						.IF	NDF	R$$11M
     98
     99					H$DFLP==000000			; OFFSET-FLOATING POINT SAVE POINTER
    100					H$DPDR==H$DFLP+2		;OFFSET-PDR REGISTERS
    101					H$DPAR==H$DPDR+20		;OFFSET-PAR REGISTERS
    102					H$DPS==H$DPAR+20		;OFFSET-PS WORD
    103					H$DPC==H$DPS+2			;OFFSET-PC WORD
    104					H$DR0==H$DPC+2			;OFFSET-GENERAL REGISTER R0
    105					H$DR1==H$DR0+2			;OFFSET-GENERAL REGISTER R1
    106					H$DR2==H$DR1+2			;OFFSET-GENERAL REGISTER R2
    107					H$DR3==H$DR2+2			;OFFSET-GENERAL REGISTER R3
    108					H$DR4==H$DR3+2			;OFFSET-GENERAL REGISTER R4
    109					H$DR5==H$DR4+2			;OFFSET-GENERAL REGISTER R5
    110					H$DSP==H$DR5+2			;OFFSET-GENERAL REGISTER SP
    111					H$DIPS==H$DSP+2			;OFFSET-INITIAL PS WORD
    112					H$DIPC==H$DIPS+2		;OFFSET-INITIAL PS WORD
    113					H$DISP==H$DIPC+2		;OFFSET-INITIAL SP VALUE
    114					H$DDSV==H$DISP+2		;OFFSET-ODT SST VECTOR
TABLS	MACRO M1108  05-DEC-77 23:13  PAGE 2-2


    115					H$DTSV==H$DDSV+2		;OFFSET-TASK SST VECTOR
    116					H$DDVT==H$DTSV+2		;OFFSET-LENGTH OF ODT SST VECTOR
    117					H$DTVT==H$DDVT+1		;OFFSET-LENGTH OF TASK SST VECTOR
    118					H$DPUN==H$DTVT+1		;OFFSET-POWERFAIL AST NODE ADDRESS
    119					H$DFEN==H$DPUN+2		;OFFSET-FLOATING POINT EXCEPTION AST NOD
    120					H$DDUC==H$DFEN+2		;OFFSET-DEFAULT UIC
    121					H$DUIC==H$DDUC+2		;OFFSET-TASK UIC
    122					H$DSIZ==H$DUIC+2		;OFFSET-HEADER SIZE IN 32W BLOCKS
    123					H$DFZI==H$DSIZ+2		;OFFSET-FILE SIZE INDICATOR
    124					H$DLUT==H$DFZI+2+22		;OFFSET-NUMBER OF LOGICAL UNITS
    125
    126						.IFF
    127
    128		000000 			H$CSP==0			; CURRENT STACK POINTER
    129		000002 			H$DSIZ==H$CSP+2			; LENGTH OF HEADER (BYTES)
    130		000004 			H$PCBT==H$DSIZ+2		; TASK PCB ADDRESS
    131		000014 			H$PCBC==H$PCBT+10		; COMMON/LIBR PCB BLOCKS
    132		000046 			H$DSW==H$PCBC+<3*10>+2		; CONTEXT SAVE-DIRECTIVE STATUS WORD
    133		000050 			H$FSR==H$DSW+2			; CONTEXT SAVE - FCS IMPURE AREA POINTER
    134		000052 			H$FOT==H$FSR+2			; CONTEXT SAVE - FORTRAN OTS IMPURE AREA POINTER
    135		000054 			H$OVLY==H$FOT+2			; CONTEXT SAVE - OVERLAY RUNTIME SYSTEM AREA
    136		000056 			H$RSVD==H$OVLY+2		; CONTEXT SAVE - RESERVED
    137		000060 			H$EFLM==H$RSVD+2		; EVENT FLAG MASK WORDS
    138		000070 			H$CUIC==H$EFLM+10		; CURRENT UIC
    139		000072 			H$DUIC==H$CUIC+2		; DEFAULT UIC
    140		000074 			H$IPS==H$DUIC+2			; INITIAL PS
    141		000076 			H$IPC==H$IPS+2			; INITIAL PC
    142		000100 			H$ISP==H$IPC+2			; INITIAL SP
    143		000102 			H$ODVA==H$ISP+2			; ODT SST VECTOR ADDRESS
    144		000104 			H$ODVL==H$ODVA+2		; ODT SST VECTOR LENGTH
    145		000106 			H$TKVA==H$ODVL+2		; TASK SST VECTOR ADDRESS
    146		000110 			H$TKVL==H$TKVA+2		; TASK SST VECTOR LENGTH
    147		000112 			H$PFVA==H$TKVL+2		; TASK POWER FAIL VECTOR
    148		000114 			H$FPVA==H$PFVA+2		; FLOATING POINT EXCEPTION VECTOR
    149		000116 			H$RCVA==H$FPVA+2		; RECEIVE AST VECTOR
    150		000120 			H$NUS1==H$RCVA+2		; RESERVED
    151		000122 			H$FPSA==H$NUS1+2		; FLOATING POINT/EAE SAVE AREA POINTER
    152		000124 			H$NUS2==H$FPSA+2		; RESERVED
    153		000126 			H$GARD==H$NUS2+2		; ADDRESS OF STACK GUARD WORD
    154		000130 			H$NLUN==H$GARD+2		; NUMBER OF LUNS
    155		000132 			H$LUN==H$NLUN+2			; START OF LUN TABLE (TWO WORDS PER LUN)
    156
    157						.ENDC
    158
    159
    160					;
    161					; LABEL BLOCK OFFSET DEFINITIONS
    162					;
    163
    164
    165						.IF	NDF	R$$11M
    166
    167					L$BTSK==0			;OFFSET-TASK NAME
    168					L$BPAR==L$BTSK+4		;OFFSET-DEFAULT PARTITION NAME
    169					L$BFLG==L$BPAR+4		;OFFSET-TASK FLAG WORD
    170					L$BPRI==L$BFLG+2		;OFFSET-DEFAULT PRIORITY
    171					L$BLDZ==L$BPRI+2		;OFFSET-LOAD SIZE IN 32W BLOCKS
TABLS	MACRO M1108  05-DEC-77 23:13  PAGE 2-3


    172					L$BMXZ==L$BLDZ+2		;OFFSET-MAX SIZE IN 32W BLOCKS
    173					L$BPOL==L$BMXZ+2		;OFFSET-POOL LIMIT
    174					L$BPIC==L$BPOL+2		;OFFSET-POSITION INDEPENDENT FLAG
    175					L$BDAT==L$BPIC+2		;OFFSET-CREATION DATE
    176					L$BLIB==L$BDAT+6		;OFFSET-RESIDENT LIBRARY REQUESTS
    177					L$BASG==512.			;OFFSET-SYMBOLIC DEVICE ASSIGNMENTS
    178
    179						.IFF
    180
    181		000000 			L$BTSK==000000			; OFFSET - TASK NAME
    182		000004 			L$BPAR==L$BTSK+4		; OFFSET - DEFAULT PARTITION NAME
    183		000010 			L$BFLG==L$BPAR+4		; OFFSET - TASK FLAG WORD
    184		000012 			L$BPRI==L$BFLG+2		; OFFSET - DEFAULT PRIORITY
    185		000014 			L$BLDZ==L$BPRI+2		; OFFSET - LOAD SIZE IN WORDS
    186		000016 			L$BMXZ==L$BLDZ+2		; OFFSET - MAX SIZE IN WORDS
    187		000020 			L$BSA==L$BMXZ+2			; OFFSET - TASK IMAGE STARTING ADDRESS
    188		000022 			L$BHRB==L$BSA+2			; RELATIVE BLOCK # OF HEADER
    189		000024 			L$BBLK==L$BHRB+2		; NUMBER OF BLOCKS IN LABEL
    190		000026 			L$BXFR==L$BBLK+2		; OFFSET-TRANSFER ADDRESS
    191		000030 			L$BDAT==L$BXFR+2		; OFFSET-CREATION DATE
    192		000036 			L$BLIB==L$BDAT+6		; OFFSET - 'RESIDENT' LIBRARY REQUESTS
    193		000216 			L$BEXT==L$BLIB+<16.*7>		;++041 OFFSET-TASK EXTEND SIZE
    194		001000 			L$BASG==512.			; OFFSET - SYMBOLIC DEVICE ASSIGNMENTS
    195
    196						.ENDC
    197
    198					;
    199					; LIBRARY LIST FLAG WORD BIT DEFINITIONS
    200					;
    201
    202
    203						.IF	NDF	R$$11M
    204
    205					LD$ACC==100000			;ACCESS REQUEST TYPE (1=RW, 0=RO)
    206					LD$RSV==040000			;APR RESERVATION FLAG (1=YES)
    207					LD$ARW==000020			;NONOWNER RW ACCESS ENABLE (1=YES)
    208					LD$ARO==000010			;NONOWNER RO ACCESS ENABLE (1=YES)
    209					LD$REL==000004			;PIC INDICATOR (1=YES)
    210					LD$TYP==000002			;TYPE OF COMMON BLOCK (0=COM, 1=LIB)
    211					LD$DEF==000001			;BLOCK DEFINED? (0=NO, 1=YES)
    212
    213						.IFF
    214
    215		100000 			LD$ACC==100000			; ACCESS INTENT (1=RW, 0=RO)
    216		040000 			LD$RSV==040000			; RELOCATION BIAS SPECIFIED (1=YES)
    217		000004 			LD$REL==000004			;PIC INDICATOR (1=YES)
    218
    219						.ENDC
    220
    221
    222					;
    223					; LIBRARY LIST OFFSET DEFINITIONS
    224					;
    225					;++003	DELETE 'OWNER UIC' ENTRY
    226					;
    227					;
    228					; 		***NOTE***
TABLS	MACRO M1108  05-DEC-77 23:13  PAGE 2-4


    229					;
    230					; 	WHEN BUILDING RSX-11M TASKS, 'L$DLTH'
    231					; 	CONTAINS LIBRARY SIZE IN BYTES.
    232					;
    233
    234		000000 			L$DNXT==0			;OFFSET-LINK TO NEXT ENTRY
    235		000002 			L$DNME==L$DNXT+2		;OFFSET-NAME OF LIBRARY
    236		000006 			L$DLTH==L$DNME+4		;OFFSET-LENGTH OF LIBRARY IN 32W BLOCKS
    237		000010 			L$DDAT==L$DLTH+2		;OFFSET-CREATION DATE (YEAR, MONTH, DAY)
    238
    239						.IF	NDF	R$$11M
    240
    241					L$DAPR==L$DDAT+6		;++003 OFFSET-STARTING APR NUMBER IF PIC=1
    242
    243						.IFF
    244
    245		000016 			L$DSA==L$DDAT+6			; OFFSET - STARTING ADDRESS
    246		000020 			L$DFLG==L$DSA+2			; OFFSET - FLAG WORD
    247
    248						.IFT
    249
    250					L$DFLG==L$DAPR+2		; OFFSET - FLAG WORD
    251
    252						.ENDC
    253
    254		000022 			L$DBSE==L$DFLG+2		;OFFSET-BASE VIRTUAL ADDRESS
    255		000024 			L$DCUR==L$DBSE+2		;OFFSET-CURRENT BASE ADDRESS OF LIBRARY
    256		000026 			L$DLGH==L$DCUR+2		;LENGTH OF LIBRARY LIST DESCRIPTOR
    257
    258					;
    259					;++008 MODULE HEADER SWITCH BYTE  FLAGS -- LIBRARY MODULE
    260					;
    261
    262		000001 			MH$SS==000001			;++008 SELECTIVE SEARCH LIBRARY MODULE
    263
    264					;
    265					;++008 LIBRARY MODULE OFFSETS -- MODULE HEADER
    266					;
    267
    268		000000 			M$HST==000000			;++008 MODULE STATUS BYTE
    269		000001 			M$HFL==M$HST+1			;++008 MODULE FLAGS BYTE
    270
    271					;
    272					; OPTION SWITCH WORD BIT DEFINITIONS
    273					;
    274
    275		100000 			AB$RT==100000			;ABORT ON ANY ERROR (1=YES)
    276		040000 			MA$PF==040000			;MAP LISTING FILE (1=YES)
    277		020000 			ST$BF==020000			;SYMBOL TABLE FILE (1=YES)
    278		010000 			TS$KF==010000			;TASK IMAGE FILE (1=YES)
    279		004000 			SE$QA==004000			;SEQUENCE ALLOCATION (1=YES)
    280		002000 			LG$SH==002000			;LONG/SHORT MAP FILE
    281		001000 			EN$DR==001000			;END OF RUN FLAG
    282		000400 			SP$OL==000400			;SPOOL MAP OUTPUT (0=YES)
    283
    284						.IF	DF	R$$11M
    285
TABLS	MACRO M1108  05-DEC-77 23:13  PAGE 2-5


    286		000200 			MP$SY==000200			; TARGET SYSTEM IS MAPPED (1=YES)
    287
    288						.ENDC
    289
    290
    291					                                                                                ;**NEW**
    292		000100 			CR$EF==000100			;++036 PRODUCE CREF OUTPUT (1=YES)              ;**NEW**
    293					                                                                                ;**NEW**
    294					;
    295					; SYMBOL TABLE ENTRY FLAG BYTE BIT DEFINTIONS
    296					;
    297
    298		000200 			SY$IND==000200			;INDIRECT (1=IND, 0=DEF)
    299		000100 			SY$GBL==000100			;GLOBAL (1=GLOBAL, 0=INTERNAL)
    300		000040 			SY$REL==000040			;RELOCATION (1=REL, 0=ABS)
    301		000020 			SY$ATL==000020			;AUTOLOAD FLAG (1=YES, 0=NO)
    302		000010 			SY$DEF==000010			;DEFINITION (1=DEF, 0=REF)
    303		000004 			SY$LIB==000004			;SYMBOL DEFINED IN LIBRARY (1=YES)
    304		000002 			SY$ATR==000002			;++036 REFERENCE VIA AUTOLOAD VECTOR (1=YES)    ;**NEW**
    305		000001 			SY$NLB==000001			;++042 SYMBOL NOT IN LIBRARY(1=YES)
    306
    307					;
    308					; SYMBOL TABLE ENTRY OFFSET AND LENGTH DEFINITIONS
    309					;
    310
    311		000006 			S$YFLG==6			; OFFSET-FLAG BYTE
    312		000010 			S$YVAL==S$YFLG+2		;OFFSET-SYMBOL VALUE
    313		000012 			S$YCMT==S$YVAL+2		;OFFSET-CONTROL SECTION ENTRY ADDRESS
    314		000014 			S$YSEG==S$YCMT+2		;OFFSET-ADDRESS OF DEFINITION SEGMENT
    315		000016 			S$YLGH==S$YSEG+2		;LENGTH OF SYMBOL TABLE ENTRY
    316
    317					;
    318					; AUTOLOAD VECTOR AND RESIDENT SEGMENT DESCRIPTOR SIZES
    319					;
    320
    321		000010 			S$ZATL==10			; SIZE OF AUTOLOAD VECTOR
    322		000004 			S$ZSEQ==4			;SIZE OF SEQUENCE ALLOCATION LIST ENTRY
    323
    324						.IF	DF	R$$11M
    325
    326					;
    327					; RSX-11M TASK FLAG WORD BIT DEFINITIONS
    328					;
    329
    330		020000 			TS$ACP==020000			; TASK IS ANCILLARY CONTROL PROCESSOR (1=YES)
    331		000100 			TS$CHK==000100			; TASK IS CHECKPOINTABLE (0=YES)
    332		040000 			TS$NHD==040000			; NO HEADER IN TASK IMAGE (1=YES)
    333		010000 			TS$PMD==010000			;++034 GENERATE POST-MORTEM DUMP(1=YES)
    334		100000 			TS$PIC==100000			; TASK IS PIC (1=YES)
    335		000400 			TS$PRV==000400			; TASK IS PRIVELEGED (1=YES)
    336
    337						.ENDC
    338					;
    339					; LOCAL MACROS
    340					;
    341					; GENERATE DEFAULT LUN ASSIGNMENT
    342					;
TABLS	MACRO M1108  05-DEC-77 23:13  PAGE 2-6


    343					; GDFLUN DEVNAM,DEVUNT,LOGUNT
    344					;
    345					; WHERE:
    346					;
    347					;	DEVNAM=A TWO CHARACTER DEVICE NAME.
    348					;	DEVUNT=PHYSICAL UNIT.
    349					;	LOGUNT=LUN DEVICE IS TO BE ASSIGNED TO.
    350					;
    351
    352						.MACRO	GDFLUN DEVNAM,DEVUNT,LOGUNT
    353						.BLKW	1
    354						.ASCII	/DEVNAM/
    355						.BYTE	DEVUNT,1
    356						.WORD	LOGUNT
    357						.ENDM
    358
    359					;
    360					; GLOBAL DATA
    361					;
    362					; DUMMY ABSOLUTE SECTION ENTRY
    363					;
    364
    365	000000				$ABSCT::.BLKW	1		;
    366	000002	127401 	007624 		$ABSNM::.RAD50	/. ABS./	;DEFAULT ABS SECTION NAME
    367	000006	000104 				.WORD	CS$GBL!CS$ALO	;DEFAULT FLAGS
    368		000005 				.REPT	<C$SLGH-6.-2>/2
    369						.WORD	0		;
    370						.ENDR
    371
    372					;
    373					; NUMBER OF ACTIVE FILES
    374					;
    375
    376	000022				$ACTFL::.BLKW	1		;
    377
    378					;
    379					; VIRTUAL ADDRESS OF ABSOLUTE SECTION
    380					;
    381
    382	000024				$ASCT::	.BLKW	1		;
    383
    384					;
    385					; BITMAP DESCRIPTOR FOR TASK IMAGE FILE BITMAP
    386					;
    387
    388	000026				$BITMP::.BLKW	2		;
    389
    390					;
    391					; SEGMENT ADDRESS LIMITS AND BIAS VALUES
    392					;
    393
    394	000000					.PSECT	IMG$D,D,GBL
    395
    396	000000				$BEGRO::.BLKW	1		; BEGINNING OF RO AREA
    397	000002				$BEGRW::.BLKW	1		; BEGINNING OF RW AREA
    398	000004				$BFFLG::.BLKW	1		; BUFFER TRUE/FALSE FLAG
    399
TABLS	MACRO M1108  05-DEC-77 23:13  PAGE 2-7


    400						.IF	NDF	R$$11M
    401
    402					$BIAS::.BLKW	1		; RO ADDRESS BIAS
    403
    404						.ENDC
    405
    406	000006				$ENDRO::.BLKW	1		; END OF RO AREA
    407	000010				$ENDRW::.BLKW	1		; END OF RW AREA
    408
    409						.IF	DF	R$$11M
    410
    411	000012				$LOWRW::.BLKW	1		; LOW R/W MEMORY LIMIT
    412
    413						.IFF
    414
    415					$HDOFF::.BLKW	1		; HEADER OFFSET BIAS
    416
    417						.ENDC
    418
    419	000032					.PSECT
    420
    421					;
    422					; COMMAND INPUT FLAG
    423					;
    424
    425	000032	000000 			$CMFLG::.WORD	0		;
    426
    427					;
    428					; CURRENT STATE POINTERS (REAL ADDRESSES)
    429					;
    430
    431	000034				$CRELM::.BLKW	1		;CURRENT ELEMENT
    432	000036				$CRSEG::.BLKW	1		;CURRENT SEGMENT
    433	000040				$CRSRC::.BLKW	1		;CURRENT SEGMENT BEING SEARCHED
    434	000042				$CRSYM::.BLKW	1		;CURRENT SYMBOL
    435
    436					;
    437					; CURRENT STATE POINTERS (VIRTUAL ADDRESSES)
    438					;
    439
    440	000044				$CRVEL::.BLKW	1		; VIRTUAL ADDRESS-CURRENT ELEMENT
    441	000046				$CRVSG::.BLKW	1		; VIRTUAL ADDRESS-CURRENT SEGMENT
    442	000050				$CRVSR::.BLKW	1		; VIRTUAL ADDRESS-CURRENT SEGMENT SEARCHED
    443	000052				$CRVSM::.BLKW	1		; VIRTUAL ADDRESS-CURRENT SYMBOL
    444					                                                                                ;**NEW**
    445					;++036                                                                          ;**NEW**
    446					;++036 CREF OUTPUT DEVICE                                                       ;**NEW**
    447					;++036                                                                          ;**NEW**
    448					                                                                                ;**NEW**
    449	000054				$CRODV::.BLKW	1		;++036                                          ;**NEW**
    450					                                                                                ;**NEW**
    451					;++036                                                                          ;**NEW**
    452					;++036 CREF OUTPUT UNIT                                                         ;**NEW**
    453					;++036                                                                          ;**NEW**
    454					                                                                                ;**NEW**
    455	000056				$CROUN::.BLKW	1		;++036                                          ;**NEW**
    456
TABLS	MACRO M1108  05-DEC-77 23:13  PAGE 2-8


    457					;
    458					; DEFAULT DEVICE ASSIGNMENTS
    459					;
    460
    461	000060	000006 			$DFASG::.WORD	<DFASG-$DFASG>/10;NUMBER OF DEFAULT ASSIGNMENTS
    462
    463	000062					GDFLUN	SY,0,1
    464	000072					GDFLUN	SY,0,2
    465	000102					GDFLUN	SY,0,3
    466	000112					GDFLUN	SY,0,4
    467	000122					GDFLUN	TI,0,5
    468	000132					GDFLUN	CL,0,6
    469
    470	000142				DFASG:				;REF LABEL
    471
    472
    473					;
    474					; COUNT OF NON-FATAL LINK ERRORS DETECTED
    475					;
    476
    477	000142				$ERRCT::.BLKW	1		;
    478
    479					;
    480					; FREE SPACE POOL HEADER AND POOL
    481					;
    482
    483	000144				$FRHD::	.BLKW	2		;HEADER
    484	000000					.PSECT	FRSIZ1
    485	000000				$FRSZ1::
    486	000000					.PSECT	FRSIZ2
    487	000000				$FRSZ2::
    488	000150					.PSECT
    489
    490					;
    491					; FILE SIZE INDICATOR
    492					;
    493
    494	000150				$FSIZI::.BLKW	1		;
    495
    496
    497						.IF	NDF	R$$11M
    498
    499					;
    500					; TASK IMAGE PAGE ADDRESS REGISTERS (PAR)
    501					;
    502
    503					$HDPAR::.BLKW	8.		;
    504
    505					;
    506					; TASK IMAGE PAGE DESCRIPTOR REGISTERS (PDR)
    507					;
    508
    509					$HDPDR::.BLKW	8.		;
    510
    511						.IFTF
    512
    513					;
TABLS	MACRO M1108  05-DEC-77 23:13  PAGE 2-9


    514					; SIZE OF TASK HEADER
    515					;
    516
    517	000152				$HDSIZ::.BLKW	1		;
    518
    519					;
    520					; RELATIVE DISK BLOCK ADDRESS OF HEADER
    521					;
    522
    523	000154				$HDRBN::.BLKW	1		;
    524
    525						.IFF
    526
    527					;
    528					; MAXIMUM ALLOWABLE TASK ADDRS+1
    529					;
    530
    531	000156				$HGHAD::.BLKW	1		;
    532
    533
    534					;
    535					; FCS IMPURE AREA POINTER - LOC.2 CONTEXT SAVE
    536					;
    537
    538	000160				$HFSR::	.BLKW	1		;
    539
    540					;
    541					; FORTRAN OTS IMPURE AREA POINTER - LOC. 40 CONTEXT SAVE.
    542					;
    543
    544	000162				$HOTV::	.BLKW	1		;
    545
    546					;
    547					; OVERLAY RUNTIME SYSTEM IMPURE AREA POINTER - LOC. 42 CONTEXT SAVE
    548					;
    549
    550	000164				$HOVLY::.BLKW	1		;
    551
    552						.ENDC
    553
    554					;
    555					; HIGHEST VIRTUAL ADDRESS IN TASK
    556					;
    557
    558	000166				$HVRTL::.BLKW	1		;
    559
    560					;
    561					; VERSION IDENTIFICATION
    562					;
    563
    564	000170				$IDENT::.BLKW	2		;
    565
    566
    567					;
    568					; NO. OF DISK BLOCKS IN LABEL
    569					;
    570
TABLS	MACRO M1108  05-DEC-77 23:13  PAGE 2-10


    571	000174				$LBBLK::.BLKW	1		;
    572
    573					;
    574					; TASK EXTENSION SIZE IN 32 W BLOCKS
    575					;
    576
    577	000176				$LBEXT::.BLKW	1		;++041
    578
    579					;
    580					; SIZE OF LABEL BLOCK (BYTES)
    581					;
    582
    583	000200				$LBLSZ::.BLKW	1		;
    584
    585					;
    586					; RESIDENT LIBRARY REQUEST LISTHEAD
    587					;
    588
    589	000202				$LBRHD::.BLKW	3		;
    590
    591
    592					;
    593					; COMMAND LINE BUFFER
    594					;
    595
    596	000000					.PSECT	LNB$D,D,GBL
    597
    598	000000				$LNBUF::.BLKW	42.		;
    599
    600					;
    601					; COMMAND LINE DESCRIPTOR
    602					;
    603
    604	000124				$LNDES::.BLKW	2		;
    605
    606	000210					.PSECT
    607
    608					;
    609					; DEFAULT LOGICAL UNIT ASSIGNMENT LISTHEAD
    610					;
    611
    612	000210				$LUNHD::.BLKW	2		;
    613
    614					                                                                                ;**NEW**
    615					;                                                                               ;**NEW**
    616					; VIRTUAL ADDRESS OF NAME BLOCK FOR REAL MAP                                    ;**NEW**
    617					; OUTPUT FILE                                                                   ;**NEW**
    618					;                                                                               ;**NEW**
    619					                                                                                ;**NEW**
    620	000214				$MPFIL::.BLKW	1		;++036                                          ;**NEW**
    621					                                                                                ;**NEW**
    622					;
    623					; MASTER UNDEFINED SYMBOL COUNT
    624					;
    625
    626	000216				$MSYMC::.BLKW	1		;
    627
TABLS	MACRO M1108  05-DEC-77 23:13  PAGE 2-11


    628					;
    629					; MAXIMUM PHYSICAL MEMORY NEEDED
    630					;
    631
    632	000220				$MXLGH::.BLKW	1		;
    633
    634					;
    635					; NUMBER OF SEGMENTS IN ALLOCATION
    636					;
    637
    638	000222				$NUMSG::.BLKW	1		;
    639
    640					;
    641					; NUMBER OF LOGICAL UNITS
    642					;
    643
    644	000224				$NUNIT::.BLKW	1		;
    645
    646					;
    647					; ODT TRANSFER ADDRESS VECTOR
    648					;
    649
    650	000226				$ODTAD::.BLKW	2		;
    651
    652					;
    653					; ODT AND TASK SST VECTORS - ADJACENCY ASSUMED
    654					;
    655
    656						.IF	NDF	R$$11M
    657
    658					$ODTV::	.BLKW	2		;
    659					$ODTSZ::.BLKB	1		;
    660					$TSKSZ::.BLKB	1		;
    661					$TSKV::	.BLKW	2		;
    662
    663						.IFF
    664
    665	000232				$ODTV:: .BLKW	2		;
    666	000236				$ODTSZ::.BLKW	1		;
    667	000240				$TSKV:: .BLKW	2		;
    668	000244				$TSKSZ::.BLKW	1		;
    669
    670						.ENDC
    671
    672
    673					;
    674					; OFFSET BIAS CALCULATED FROM /BS (BASE) OR /TP (TOP) SWITCH VALUE
    675					;
    676
    677	000246				$OFFST::.BLKW	1		;
    678
    679					;
    680					; OUTPUT BUFFER-LOAD MAP/ERROR MESSAGES
    681					;
    682
    683	000250				$OUTBF::.BLKB	90.		;
    684	000402				$TBUF::	.BLKB	80.		; TEMP. ERROR TEXT STORAGE (ADJ. REQUIRED)
TABLS	MACRO M1108  05-DEC-77 23:13  PAGE 2-12


    685
    686					;
    687					; TASK PARTITION SIZE (32W BLOCKS)
    688					;
    689
    690	000522				$PARSZ::.BLKW	1		;
    691
    692					;
    693					; PATCH LISTHEAD
    694					;
    695
    696	000524				$PATHD::.BLKW	2		;
    697
    698					;
    699					; PHASE NUMBER
    700					;
    701
    702	000530				$PHASE::.BLKW	1		;
    703
    704					;
    705					; DEFAULT PARTITION NAME
    706					;
    707
    708	000532				$PNAME::.BLKW	2		;
    709
    710					;
    711					; POOL USAGE
    712					;
    713
    714						.IF	NDF	R$$11M
    715
    716					$POOL::	.BLKW	1		;
    717
    718						.ENDC
    719
    720					;
    721					; DEFAULT PRIORITX
    722					;
    723
    724	000536				$PRIOR::.BLKW	1		;
    725
    726					;
    727					; HIGHEST RELATIVE DISK BLOCK NUMBER
    728					;
    729
    730	000540				$RLBLK::.BLKW	1		;
    731
    732
    733					;
    734					; SYSTEM INDICATOR
    735					;
    736
    737	000542				$RSXSY::.BLKW	1		;
    738
    739					;
    740					; ROOT SEGMENT POINTER
    741					;
TABLS	MACRO M1108  05-DEC-77 23:13  PAGE 2-13


    742
    743	000544				$RTSEG::.BLKW	1		;
    744
    745					;
    746					; CONTROL SECTION EXTENSION LISTHEAD
    747					;
    748
    749	000546	000546'			$SCTHD::.WORD	$SCTHD		;
    750						.BLKW	3		;
    751	000556	   000 	   017 			.BYTE	0,15.		;
    752
    753					;
    754					; STACK SPACE REQUIRED
    755					;
    756
    757	000560				$STACK::.BLKW	1		;
    758
    759					;
    760					; SWITCH OPTION WORD
    761					;
    762
    763	000562				$SWTCH::.BLKW	1		;
    764
    765					;
    766					; SIZE OF RESIDENT SEGMENT DESCRIPTOR
    767					;
    768
    769	000564				$SZSEG::.BLKW	1		;
    770
    771					;
    772					; TASK UIC
    773					;
    774
    775	000566				$TKUIC::.BLKW	1		;
    776
    777					;
    778					; TASK NAME
    779					;
    780
    781	000570				$TNAME::.BLKW	2		;
    782
    783					;
    784					; SEGMENT CURRENTLY BEING WRITTEN INTO
    785					;
    786
    787	000574				$WRSEG::.BLKW	1		;
    788
    789					;
    790					; TASK TRANSFER ADDRESS VECTOR
    791					;
    792
    793	000576				$XFRAD::.BLKW	2		;
    794
    795		000001 				.END
TABLS	MACRO M1108  05-DEC-77 23:13  PAGE 2-14
SYMBOL TABLE

AB$RT = 100000 G 	H$FPSA= 000122 G 	L$BXFR= 000026 G 	TS$PIC= 100000 G 	$IDENT  000170RG
A$LLST= 000004 G 	H$FPVA= 000114 G 	L$DBSE= 000022 G 	TS$PMD= 010000 G 	$LBBLK  000174RG
CR    = 000015   	H$FSR = 000050 G 	L$DCUR= 000024 G 	TS$PRV= 000400 G 	$LBEXT  000176RG
CR$EF = 000100 G 	H$GARD= 000126 G 	L$DDAT= 000010 G 	VT    = 000013   	$LBLSZ  000200RG
CS$ACC= 000020 G 	H$IPC = 000076 G 	L$DFLG= 000020 G 	$ABSCT  000000RG 	$LBRHD  000202RG
CS$ALO= 000004 G 	H$IPS = 000074 G 	L$DLGH= 000026 G 	$ABSNM  000002RG 	$LNBUF  000000RG    005
CS$ATL= 000001 G 	H$ISP = 000100 G 	L$DLTH= 000006 G 	$ACTFL  000022RG 	$LNDES  000124RG    005
CS$GBL= 000100 G 	H$LUN = 000132 G 	L$DNME= 000002 G 	$ASCT   000024RG 	$LOWRW  000012RG    002
CS$IND= 000010 G 	H$NLUN= 000130 G 	L$DNXT= 000000 G 	$BEGRO  000000RG    002	$LUNHD  000210RG
CS$LIB= 000002 G 	H$NUS1= 000120 G 	L$DSA = 000016 G 	$BEGRW  000002RG    002	$MPFIL  000214RG
CS$MEM= 000001 G 	H$NUS2= 000124 G 	MA$PF = 040000 G 	$BFFLG  000004RG    002	$MSYMC  000216RG
CS$REL= 000040 G 	H$ODVA= 000102 G 	MH$SS = 000001 G 	$BITMP  000026RG 	$MXLGH  000220RG
CS$TYP= 000200 G 	H$ODVL= 000104 G 	MP$SY = 000200 G 	$CMFLG  000032RG 	$NUMSG  000222RG
C$SBND= 000016 G 	H$OVLY= 000054 G 	M$HFL = 000001 G 	$CRELM  000034RG 	$NUNIT  000224RG
C$SBSE= 000010 G 	H$PCBC= 000014 G 	M$HST = 000000 G 	$CRODV  000054RG 	$ODTAD  000226RG
C$SCUR= 000014 G 	H$PCBT= 000004 G 	R$$11M= 000000   	$CROUN  000056RG 	$ODTSZ  000236RG
C$SELM= 000020 G 	H$PFVA= 000112 G 	SE$QA = 004000 G 	$CRSEG  000036RG 	$ODTV   000232RG
C$SFLG= 000006 G 	H$RCVA= 000116 G 	SPA   = 000040   	$CRSRC  000040RG 	$OFFST  000246RG
C$SLGH= 000022 G 	H$RSVD= 000056 G 	SP$OL = 000400 G 	$CRSYM  000042RG 	$OUTBF  000250RG
C$SLTH= 000012 G 	H$TKVA= 000106 G 	ST$BF = 020000 G 	$CRVEL  000044RG 	$PARSZ  000522RG
DFASG   000142R  	H$TKVL= 000110 G 	SY$ATL= 000020 G 	$CRVSG  000046RG 	$PATHD  000524RG
EN$DR = 001000 G 	LD$ACC= 100000 G 	SY$ATR= 000002 G 	$CRVSM  000052RG 	$PHASE  000530RG
E$LCMT= 000002 G 	LD$REL= 000004 G 	SY$DEF= 000010 G 	$CRVSR  000050RG 	$PNAME  000532RG
E$LIDT= 000010 G 	LD$RSV= 040000 G 	SY$GBL= 000100 G 	$DFASG  000060RG 	$PRIOR  000536RG
E$LLGH= 000044 G 	LF    = 000012   	SY$IND= 000200 G 	$ENDRO  000006RG    002	$RLBLK  000540RG
E$LMND= 000020 G 	LG$SH = 002000 G 	SY$LIB= 000004 G 	$ENDRW  000010RG    002	$RSXSY  000542RG
E$LMOD= 000014 G 	L$BASG= 001000 G 	SY$NLB= 000001 G 	$ERRCT  000142RG 	$RTSEG  000544RG
E$LNUM= 000004 G 	L$BBLK= 000024 G 	SY$REL= 000040 G 	$FRHD   000144RG 	$SCTHD  000546RG
E$LNXT= 000000 G 	L$BDAT= 000030 G 	S$YCMT= 000012 G 	$FRSZ1  000000RG    003	$STACK  000560RG
E$LSWT= 000006 G 	L$BEXT= 000216 G 	S$YFLG= 000006 G 	$FRSZ2  000000RG    004	$SWTCH  000562RG
FF    = 000014   	L$BFLG= 000010 G 	S$YLGH= 000016 G 	$FSIZI  000150RG 	$SZSEG  000564RG
HT    = 000011   	L$BHRB= 000022 G 	S$YSEG= 000014 G 	$HDRBN  000154RG 	$TBUF   000402RG
H$CSP = 000000 G 	L$BLDZ= 000014 G 	S$YVAL= 000010 G 	$HDSIZ  000152RG 	$TKUIC  000566RG
H$CUIC= 000070 G 	L$BLIB= 000036 G 	S$ZATL= 000010 G 	$HFSR   000160RG 	$TNAME  000570RG
H$DSIZ= 000002 G 	L$BMXZ= 000016 G 	S$ZSEQ= 000004 G 	$HGHAD  000156RG 	$TSKSZ  000244RG
H$DSW = 000046 G 	L$BPAR= 000004 G 	TS$ACP= 020000 G 	$HOTV   000162RG 	$TSKV   000240RG
H$DUIC= 000072 G 	L$BPRI= 000012 G 	TS$CHK= 000100 G 	$HOVLY  000164RG 	$WRSEG  000574RG
H$EFLM= 000060 G 	L$BSA = 000020 G 	TS$KF = 010000 G 	$HVRTL  000166RG 	$XFRAD  000576RG
H$FOT = 000052 G 	L$BTSK= 000000 G 	TS$NHD= 040000 G

. ABS.	000000	   000
      	000602	   001
IMG$D 	000014	   002
FRSIZ1	000000	   003
FRSIZ2	000000	   004
LNB$D 	000130	   005
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1518 WORDS  ( 6 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:19
[44,10]TABLS,[44,20]TABLS/-SP=[44,30]MACFLM.,TABLS.022
TASKB	MACRO M1108  05-DEC-77 23:13  PAGE 2


      1						.TITLE	TASKB
      2						.IDENT	/M14/
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1975, DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.                ;**NEW**
      6					;                                                                               ;**-1
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION M14
     20					;                                                                               ;**-1
     21					; D. N. CUTLER/C. MONIA 14-FEB-74
     22					;
     23					; RSX-11D/M TASK BUILDER
     24					;
     25					;
     26					;
     27					; MODIFICATIONS
     28					;
     29					;
     30					; NO.		DATE		PROGRAMMER
     31					; ---		----		----------
     32					;
     33					; 002		3-JUL-73	C. MONIA
     34					; 006		4-AUG-73	C. MONIA
     35					; 034		07-JAN-75	C. MONIA
     36					; 036		14-JAN-75	C. MONIA
     37					; 037		15-MAR-75	C. MONIA                                        ;**NEW**
     38					; 040		24-APR-75	C. MONIA
     39					; 041		15-APR-75	C. MONIA
     40					; 042		29-JUL-75	C. MONIA
     41					;
     42					;
     43					;
     44					;
     45					; MACRO LIBRARY CALLS
     46					;
     47
     48						.IF	NDF	R$$11M
     49
     50						.MCALL	CLOSE$,EXIT$S,OPEN$W
     51
     52						.IFF
     53
     54						.MCALL	CLOSE$,EXIT$S
     55
     56						.ENDC
     57					;
TASKB	MACRO M1108  05-DEC-77 23:13  PAGE 2-1


     58					; LOCAL DATA
     59					;
     60
     61	000000				SPSAV:	.BLKW	1		;SAVED INITIAL STACK POINTER
     62	000002	000000 			$VERSN::.WORD	0		;++037 VERSION IDENTIFICATION                   ;**NEW**
     63	000004	000000 				.WORD	0		;++037                                          ;**NEW**
     64						.EVEN                                                                   ;**-11
     65
     66					;+
     67					; **-$TASKB-ENTRY TO TASK BUILDER
     68					;-
     69
     70	000006				$TASKB::
     71	000006	012700 	000002'			MOV	#$VERSN,R0	;++037 GET ADDRESS OF VERSION NUMBER            ;**NEW**
     72	000012	005710 				TST	(R0)		;++037 RESTART?                                 ;**NEW**
     73	000014	001002 				BNE	10$		;++037 IF NE NO                                 ;**NEW**
     74	000016	010320 				MOV	R3,(R0)+	;++037 SET FIRST HALF OF VERSION                ;**NEW**
     75	000020	010410 				MOV	R4,(R0)		;++037 SET SECOND HALF OF VERSION               ;**NEW**
     76	000022				10$:				;++037                                          ;**NEW**
     77
     78						.IF	NDF	R$$11M
     79
     80						OPEN$W	$CMOPT		; OPEN COMMAND OUTPUT FILE
     81						BCS	$QUIT		; IF C/S LEAVE QUIETELY
     82
     83						.ENDC
     84
     85	000022	010667 	177752 			MOV	SP,SPSAV	;SAVE INITIAL STACK POINTER
     86	000026	016706 	177746 		TASKB1:	MOV	SPSAV,SP	;RETRIEVE SAVED STACK POINTER
     87	000032	012705 	000000G			MOV	#$SWTCH,R5	;GET ADDRESS OF SWITCH OPTION WORD
     88	000036	012704 	000000G			MOV	#$PHASE,R4	;GET ADDRESS OF PHASE NUMBER
     89	000042					CALL	$BLDSG		;BUILD SEGMENT DESCRIPTION
     90	000046	062714 	000002 			ADD	#2,(R4)		;UPDATE PHASE NUMBER
     91	000052					CALL	$P2OPT		;PROCESS OPTIONS
     92	000056	005214 				INC	(R4)		;INCREMENT PHASE NUMBER
     93	000060					CALL	$P3MDS		;CALL PHASE 3 MODULE SCAN
     94	000064	005214 				INC	(R4)		;INCREMENT PHASE NUMBER
     95	000066					CALL	$P4MAL		;CALL PHASE 4 MEMORY ALLOCATION
     96	000072	005214 				INC	(R4)		;INCREMENT PHASE NUMBER
     97	000074	032715 	000000G			BIT	#TS$KF,(R5)	;TASK IMAGE FILE SPECIFIED?
     98	000100	001402 				BEQ	20$		;IF EQ NO
     99	000102				10$:	CALL	$P5MDS		;CALL PHASE 5 MODULE SCAN
    100	000106				20$:				;
    101	000106					CALL	$P5MAP		; OUTPUT MAP FILE, UNDEFINED SYMBOLS
    102	000112				30$:				;
    103	000112	005214 				INC	(R4)		; INCREMENT PHASE NUMBER
    104	000114	032715 	000000G			BIT	#ST$BF,(R5)	;SYMBOL FILE SPECIFIED?
    105	000120	001402 				BEQ	$RSTRT		;IF EQ NO
    106	000122					CALL	$P6STB		;CALL PHASE 6 SYMBOL TABLE ROUTINE
    107	000126				$RSTRT::			;
    108	000126					CLOSE$	$WRKPT		; CLOSE WORK FILE
    109	000136	032767 	000000G	000000G		BIT	#EN$DR,$SWTCH	; END OF RUN?
    110	000144	001730 				BEQ	TASKB1		;IF EQ NO
    111	000146				$QUIT::
    112
    113						.IF	NDF	R$$11M
    114
TASKB	MACRO M1108  05-DEC-77 23:13  PAGE 2-2


    115						CLOSE$	$CMOPT		; CLOSE COMMAND OUTPUT FILE
    116
    117						.ENDC
    118
    119	000146					CLOSE$	$CMIPT		;CLOSE COMMAND INPUT FILE
    120	000156					CLOSE$	$WRKPT		; CLOSE WORK FILE
    121	000166					EXIT$S			;EXIT TO SYSTEM
    122
    123		000006'				.END	$TASKB
TASKB	MACRO M1108  05-DEC-77 23:13  PAGE 2-3
SYMBOL TABLE

CR    = 000015   	R$$11M= 000000   	VT    = 000013   	$P4MAL= ****** GX	$SWTCH= ****** GX
EN$DR = ****** GX	SPA   = 000040   	$BLDSG= ****** GX	$P5MAP= ****** GX	$TASKB  000006RG
FF    = 000014   	SPSAV   000000R  	$CMIPT= ****** GX	$P5MDS= ****** GX	$VERSN  000002RG
HT    = 000011   	ST$BF = ****** GX	$PHASE= ****** GX	$P6STB= ****** GX	$WRKPT= ****** GX
LF    = 000012   	TASKB1  000026R  	$P2OPT= ****** GX	$QUIT   000146RG 	$$    = 000001
PAR$$$= 000067   	TS$KF = ****** GX	$P3MDS= ****** GX	$RSTRT  000126RG 	.CLOSE= ****** G

. ABS.	000000	   000
      	000174	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1010 WORDS  ( 4 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[44,10]TASKB,[44,20]TASKB/-SP=[44,30]MACFLM.,TASKB.022
VMDAT	MACRO M1108  05-DEC-77 23:14  PAGE 2


      1						.TITLE	VMDAT
      2						.IDENT	/01/
      3
      4					;
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 01
     20					;
     21					; C. MONIA 17-AUG-74
     22					;
     23					; TABLES AND DEFINITIONS FOR VIRTUAL MEMORY ROUTINES
     24					;
     25					; MACRO LIBRARY CALLS
     26					;
     27
     28						.MCALL	FCSBT$,FDAT$A,FDBDF$,FDOP$A,FDRC$A
     29
     30					;
     31					; EQUATED SYMBOLS
     32					;
     33					;
     34					; DEFINE PAGE BUFFER OFFSETS
     35					;
     36
     37	000000					.PSECT	$$VMDF,ABS
     38
     39	000000				P$GNXT::.BLKW	1		; LINK TO NEXT PAGE
     40	000002				P$GBLK::.BLKB	1		; PAGE RELATIVE BLOCK NUMBER
     41	000003				P$GSTS::.BLKB	1		; PAGE STATUS BYTE
     42	000004				P$GTIM::.BLKW	1		; 'TIME' OF LAST REFERENCE
     43	000006				P$GLOK::.BLKB	1		; PAGE LOCK COUNT
     44
     45						.EVEN
     46
     47	000010				P$GHD::				; SIZE OF PAGE HEADER
     48
     49						.BLKW	256.
     50
     51	001010				P$GSIZ::			; SIZE OF PAGE
     52
     53
     54					;
     55					; PAGE STATUS BITS
     56					;
     57
VMDAT	MACRO M1108  05-DEC-77 23:14  PAGE 2-1


     58		000001 			PG$WRT==000001			; PAGE WRITTEN INTO (1=YES)
     59
     60	000000					.PSECT
     61
     62					;
     63					; GLOBAL DATA
     64					;
     65					; NEXT AVAILABLE VIRTUAL ADDRESS
     66					;
     67
     68	000000				$HGVAD::.BLKW	1		;
     69
     70					;
     71					; POINTER TO RESIDENT PAGE LIST
     72					;
     73
     74	000002				$PAGLS::.BLKW	1		;
     75
     76					;
     77					; RESIDENT PAGE LISTHEAD
     78					;
     79
     80	000004				$PAGHD::.BLKW	1		;
     81
     82					;
     83					; PAGE BUFFER TIME OF LAST USE
     84					;
     85
     86	000006				$TIME::	.BLKW	1		;
     87
     88					;
     89					; WORK FILE FDB
     90					;
     91
     92	000010	000012'			$WRKPT::.WORD	WRKPT		; ADDRESS OF FDB
     93
     94	000012				WRKPT:	FDBDF$			; ALLOCATE SPACE FOR FDB
     95	000152					FCSBT$			; DEFINE FCS BITS
     96	000152					FDAT$A	R.FIX,,512.	; FIXED LENGTH, 512.BYTE RECORDS
     97	000152					FDRC$A	FD.RWM!FD.RAN	; READ/WRITE MODE, RANDOM ACCESS
     98	000152					FDOP$A	W$KLUN		; I/O VIA LUN DEFINED AT TASK BUILD TIME
     99
    100					;+
    101					;
    102					; **-VMDAT- DEFINE VIRTUAL MEMORY STORAGE PARAMETERS AND
    103					;	    TABLES
    104					;
    105					;	THIS MODULES CONTAINS ALL GLOBALLY REFERENCED
    106					; DEFINITIONS AND STORAGE FOR THE VIRTUAL MEMORY MANAGEMENT
    107					; SUBROUTINES.
    108					;
    109					;-
    110
    111		000001 				.END
VMDAT	MACRO M1108  05-DEC-77 23:14  PAGE 2-2
SYMBOL TABLE

CR    = 000015   	FO.MFY= 000002   	F.FNB = 000102   	NB.DIR= 000100   	P$GTIM  000004 G    002
FA.APD= 000100   	FO.RD = 000001   	F.FTYP= 000116   	NB.NAM= 000004   	R$$11M= 000000
FA.CRE= 000010   	FO.UPD= 000006   	F.FVER= 000120   	NB.SD1= 000400   	R.FIX = 000001
FA.EXT= 000004   	FO.WRT= 000016   	F.HIBK= 000004   	NB.SD2= 001000   	R.VAR = 000002
FA.NSP= 000100   	F.ALOC= 000040   	F.LUN = 000042   	NB.SNM= 000040   	SPA   = 000040
FA.RD = 000001   	F.BBFS= 000062   	F.MBCT= 000054   	NB.STP= 000020   	S.FATT= 000016
FA.SHR= 000040   	F.BDB = 000070   	F.MBC1= 000055   	NB.SVR= 000010   	S.FDB = 000140
FA.TMP= 000020   	F.BGBC= 000057   	F.MBFG= 000056   	NB.TYP= 000002   	S.FNAM= 000006
FA.WRT= 000002   	F.BKDN= 000026   	F.NRBD= 000024   	NB.VER= 000001   	S.FNB = 000036
FD.BLK= 000010   	F.BKDS= 000020   	F.NREC= 000030   	N.DID = 000024   	S.FNBW= 000017
FD.CCL= 000002   	F.BKEF= 000050   	F.OVBS= 000030   	N.DVNM= 000032   	S.FNTY= 000004
FD.CR = 000002   	F.BKP1= 000051   	F.RACC= 000016   	N.FID = 000000   	S.FTYP= 000002
FD.DIR= 000010   	F.BKST= 000024   	F.RATT= 000001   	N.FNAM= 000006   	S.NFEN= 000020
FD.FTN= 000001   	F.BKVB= 000064   	F.RCNM= 000034   	N.FTYP= 000014   	VT    = 000013
FD.INS= 000010   	F.CNTG= 000034   	F.RCTL= 000017   	N.FVER= 000016   	WRKPT   000012R
FD.PLC= 000004   	F.DFNB= 000046   	F.RSIZ= 000002   	N.NEXT= 000022   	W$KLUN= ****** GX
FD.RAH= 000001   	F.DSPT= 000044   	F.RTYP= 000000   	N.STAT= 000020   	$HGVAD  000000RG
FD.RAN= 000002   	F.DVNM= 000134   	F.STBK= 000036   	N.UNIT= 000034   	$PAGHD  000004RG
FD.REC= 000001   	F.EFBK= 000010   	F.UNIT= 000136   	PG$WRT= 000001 G 	$PAGLS  000002RG
FD.RWM= 000001   	F.EFN = 000050   	F.URBD= 000020   	P$GBLK  000002 G    002	$TIME   000006RG
FD.SDI= 000020   	F.EOBB= 000032   	F.VBN = 000064   	P$GHD   000010 G    002	$WRKPT  000010RG
FD.SQD= 000040   	F.ERR = 000052   	F.VBSZ= 000060   	P$GLOK  000006 G    002	...GBL= 000000
FD.TTY= 000004   	F.FACC= 000043   	HT    = 000011   	P$GNXT  000000 G    002	...PC1= 000012R
FD.WBH= 000002   	F.FFBY= 000014   	LF    = 000012   	P$GSIZ  001010 G    002	...PC2= 000152R
FF    = 000014   	F.FNAM= 000110   	NB.DEV= 000200   	P$GSTS  000003 G    002	...TPC= 000140
FO.APD= 000106

. ABS.	000000	   000
      	000152	   001
$$VMDF	001010	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2826 WORDS  ( 12 PAGES)
DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:00:22
[44,10]VMDAT,[44,20]VMDAT/-SP=[44,30]MACFLM.,VMDAT
VMUTL	MACRO M1108  05-DEC-77 23:14  PAGE 2


      1						.TITLE	VMUTL
      2						.IDENT	/03/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					;
      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     11					;
     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     14					; EQUIPMENT CORPORATION.
     15					;
     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     18					;
     19					; VERSION 03                                                                    ;**NEW**
     20					;                                                                               ;**-1
     21					; C. MONIA 03-MAR-74
     22					;
     23					; VIRTUAL MEMORY UTILITIES
     24					;
     25					;+
     26					; **-$CVLOK-SUBROUTINE TO CONVERT AND LOCK A PAGE IN MEMORY
     27					;
     28					; INPUTS:
     29					;
     30					;	R1=VIRTUAL ADDRESS TO BE CONVERTED
     31					;
     32					; OUTPUTS:
     33					;
     34					;	R0=CONVERTED (REAL) ADDRESS
     35					;	R1=VIRTUAL ADDRESS
     36					;	   SPECIFIED PAGE IS LOCKED IN CORE
     37					;
     38					; THE CONTENTS OF R2 ARE PRESERVED
     39					;-
     40
     41	000000				$CVLOK::			;
     42	000000	010246 				MOV	R2,-(SP)	; SAVE R2
     43	000002					CALL	$CVRL		; CONVERT TO REAL ADDRESS
     44	000006					CALL	$LCKPG		; LOCK PAGE IN MEMORY
     45	000012	012602 				MOV	(SP)+,R2	; RESTORE R2
     46	000014					RETURN			;
     47
     48					;+
     49					; **-$LNKVM-SUBROUTINE TO LINK AN ITEM TO A LIST IN VIRTUAL STORE
     50					;
     51					;
     52					; THIS ROUTINE IS CALLED TO LINK AN ITEM TO A LIST IN VIRTUAL STORE.
     53					; THE LISTHEAD IS ASSUMED TO HAVE THE FOLLOWING FORMAT:
     54					;
     55					;	LSTHD:	.WORD	FIRST	; POINTER TO FIRST (0 IF NONE)
     56					;		.WORD	LAST	; POINTER TO LAST (LISTHEAD IF NONE)
     57					;
VMUTL	MACRO M1108  05-DEC-77 23:14  PAGE 2-1


     58					; INPUTS:
     59					;
     60					;	R0=VIRTUAL LISTHEAD ADDRESS
     61					;	R1=VIRTUAL ADDRESS OF ITEM TO BE LINKED
     62					;	R2=REAL OFFSET OF LINK TO NEXT
     63					;
     64					; OUTPUTS:
     65					;
     66					;	THE ITEM IS LINKED AT THE END OF THE SPECIFIED
     67					;	LIST. THE OLD LAST ITEM IS WRITE MARKED.
     68					;
     69					; ALL REGISTER CONTENTS ARE PRESERVED
     70					;-
     71
     72	000016				$LNKVM::			;
     73	000016					SAVVR			; SAVE VOLATILE REGISTERS
     74
     75					;
     76					; AT THIS POINT THE STACK CONTAINS THE FOLLOWING:
     77					;
     78					;	SP:	ADDRESS OF REGISTER RESTORE ROUTINE
     79					;	SP+2:	SAVED R0-VIRTUAL ADDRESS OF LISTHEAD
     80					;	SP+4:	SAVED R1-VIRTUAL ADDRESS OF NEW LAST
     81					;	SP+6:	SAVED R2-REAL OFFSET OF LINK-TO-NEXT
     82					;
     83
     84	000022	005200 				INC	R0		; POINT TO SECOND WORD OF VIRTUAL LISTHEAD
     85	000024	010001 				MOV	R0,R1		; SET VIRTUAL ADDRESS
     86	000026					CALL	$CVRL		; CONVERT TO REAL ADDRESS
     87	000032					CALL	$WRMPG		; WRITE MARK THE PAGE
     88	000036	011001 				MOV	(R0),R1		; GET VIRTUAL ADDRESS OF LAST
     89	000040	016610 	000004 			MOV	4(SP),(R0)	; SET NEW LAST
     90	000044	020166 	000002 			CMP	R1,2(SP)	; LIST EMPTY?
     91	000050	001003 				BNE	10$		; IF NE NO
     92	000052	016640 	000004 			MOV	4(SP),-(R0)	; SET THIS ENTRY AS FIRST
     93	000056	000410 				BR	20$		;
     94	000060				10$:				;
     95	000060					CALL	$CVRL		; CONVERT OLD LAST TO REAL
     96	000064					CALL	$WRMPG		; WRITE-MARK PAGE
     97	000070	066600 	000006 			ADD	6(SP),R0	; POINT TO REAL ADDRESS OF NEXT LINK
     98	000074	016610 	000004 			MOV	4(SP),(R0)	; SET NEW LAST
     99	000100				20$:				;
    100	000100					RETURN			;
    101
    102					;+
    103					; **-$GNVI-SUBROUTINE TO FETCH NEXT ITEM FROM A LINKED LIST IN VIRTUAL STORE
    104					;
    105					; INPUTS:
    106					;
    107					;	R1=VIRTUAL ADDRESS OF CURRENT ITEM
    108					;	R2=REAL OFFSET OF LINK TO NEXT.
    109					;
    110					; OUTPUTS:
    111					;
    112					;	C-CLEAR
    113					;	R0=REAL ADDRESS OF NEXT ITEM
    114					;	R1=VIRTUAL ADDRESS OF NEXT ITEM
VMUTL	MACRO M1108  05-DEC-77 23:14  PAGE 2-2


    115					;
    116					;	C-SET
    117					;
    118					;	NO MORE ITEMS IN LIST
    119					;	R0,R1 CLEARED
    120					;-
    121
    122	000102				$GNVI::				;
    123	000102	000241 				CLC			; CLEAR CARRY                                   ;**NEW**
    124	000104	006002 				ROR	R2		; CONVERT REAL OFFSET TO VIRTUAL                ;**NEW**
    125	000106	060201 				ADD	R2,R1		; COMPUTE VIRTUAL ADDRESS OF LINK NEXT          ;**-1
    126	000110					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    127	000114	011001 				MOV	(R0),R1		; GET VIRTUAL ADDRESS OF NEXT
    128	000116	000261 				SEC			; ASSUME NO MORE ENTRIES
    129	000120	010100 				MOV	R1,R0		; COPY VIRTUAL ADDRESS (MAY BE ZERO)
    130	000122	001403 				BEQ	10$		; IF EQ, NO MORE ENTRIES
    131	000124					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    132	000130	000241 				CLC			; SET SUCCESS
    133	000132				10$:				;
    134	000132					RETURN			;
    135
    136		000001 				.END
VMUTL	MACRO M1108  05-DEC-77 23:14  PAGE 2-3
SYMBOL TABLE

CR    = 000015   	LF    = 000012   	VT    = 000013   	$GNVI   000102RG 	$SAVVR= ****** GX
FF    = 000014   	R$$11M= 000000   	$CVLOK  000000RG 	$LCKPG= ****** GX	$WRMPG= ****** GX
HT    = 000011   	SPA   = 000040   	$CVRL = ****** GX	$LNKVM  000016RG 	$$    = 000001

. ABS.	000000	   000
      	000134	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  567 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:08
[44,10]VMUTL,[44,20]VMUTL/-SP=[44,30]MACFLM.,VMUTL.003
WSRCH	MACRO M1108  05-DEC-77 23:14  PAGE 2


      1						.TITLE	WSRCH
      2						.IDENT	/06/                                                            ;**NEW**
      3					                                                                                ;**-1
      4					;
      5					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      6					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					;
      8					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
      9					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     10					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     11					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     12					;
     13					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     14					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     15					; EQUIPMENT CORPORATION.
     16					;
     17					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY
     18					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.
     19					;
     20					; VERSION 06                                                                    ;**NEW**
     21					;                                                                               ;**-1
     22					; D. N. CUTLER/C. MONIA 11-JAN-73
     23					;
     24					;
     25					; MODIFICATIONS:
     26					;
     27					; NO.		DATE		PROGRAMMER
     28					; ---		----		----------
     29					;
     30					; 021		11-JAN-74	C. MONIA
     31					;
     32					; WHOLE SEARCH TABLE ROUTINE
     33					;
     34					; EQUATED SYMBOLS
     35					;
     36
     37		000100 			STKSIZ=32.*2			; SIZE OF SEGMENT STACK (BYTES)
     38
     39					;
     40					; LOCAL DATA
     41					;
     42
     43	000000				OFFSET:	.BLKW	1		;OFFSET TO TABLE HEADER
     44	000002				PASSF:	.BLKW	1		;++021 UP-TREE SEARCH TOGGLE
     45	000004				ROOT:	.BLKW	1		;++021 ADDRESS OF ROOT SEGMENT ON THIS PATH
     46	000006				SYMSRC:	.BLKW	1		;ADDR OF INPUT SYMBOL DESCRIPTOR
     47	000010				SGSTAK:				;REFERENCE LABEL BOTTOM OF SEG STACK
     48						.BLKB	STKSIZ		;SEGMENT STACK AREA
     49	000110				TOPSTK:	.BLKW	1		;TOP OF SEGMENT STACK (TOS)
     50
     51					;+
     52					; **-$WSRCC-WHOLE SEARCH FOR CONTROL SECTION NAME
     53					; **-$WSRCS-WHOLE SEARCH FOR GLOBAL SYMBOL NAME
     54					;
     55					; THIS ROUTINE IS CALLED TO PERFORM A TABLE SEARCH OF ALL TABLES ON
     56					; THE CURRENT PATH. THE CURRENT SEGMENT TABLE IS SEARCHED FIRST, FOL-
     57					; LOWED BY THE PATH DOWN TO THE ROOT AND THEN ALL PATHS UP. AT EACH
WSRCH	MACRO M1108  05-DEC-77 23:14  PAGE 2-1


     58					; OCCURANCE OF A SYMBOL DEFINITION, A CO-ROUTINE CALL IS MADE TO THE
     59					; CALLER WITH AN INDICATION OF WHERE THE SYMBOL WAS FOUND. THE CALLER
     60					; MAY CONTINUE THE SEARCH BY MAKING A CO-ROUTINE CALL OR MAY TERM-
     61					; INATE IT BY SIMPLY REMOVING THE RETURN ADDRESS FROM THE TOP OF THE
     62					; STACK.
     63					;
     64					; INPUTS:
     65					;
     66					; 	R1=ADDRESS OF INPUT SYMBOL DESCRIPTOR.
     67					;
     68					; OUTPUTS:
     69					;
     70					;	C=1 IF NO MORE OCCURANCES OF THE SYMBOL CAN BE FOUND.
     71					;		R0=ZERO.
     72					;		NOTE: RETURN IS VIA A RETURN.
     73					;	C=0 IF SYMBOL OCCURANCE HAS BEEN FOUND.
     74					;		R0=ADDRESS OF TABLE ENTRY SYMBOL DESCRIPTOR
     75					;		R1=PATH FLAG SET AS FOLLOWS:
     76					;
     77					;		R1 < 0 - FOUND ON PATH DOWN
     78					;		R1 = 0 - FOUND IN CURRENT SEGMENT
     79					;		R1 = 1 - FOUND ON PATH UP
     80					;		R1 = 2 - FOUND IN CO-TREE
     81					;
     82					;		$CRVSR=VIRTUAL ADDRESS OF SEGMENT CONTAINING SYMBOL
     83					;		$CRSRC=REAL ADDRESS OF SEGMENT CONTAINING SYMBOL
     84					;			(PAGE IS NOT LOCKED IN MEMORY)
     85					;
     86
     87					;
     88					; ** NOTE - RETURN IS VIA 'CALL @(SP)+' WITH CONDITION CODES
     89					;		SET FOR DISPATCH.
     90					;
     91					;-
     92
     93	000112	012767 	000000G	177660 	$WSRCC::MOV	#S$GCST,OFFSET	;CONTROL SECTION TABLE
     94	000120	000403 				BR	WSRCH1		;
     95	000122	012767 	000000G	177650 	$WSRCS::MOV	#S$GSTB,OFFSET	;GLOBAL SYMBOL TABLE
     96
     97					;
     98					; SEARCH CURRENT SEGMENT FIRST
     99					;
    100
    101	000130				WSRCH1:				;
    102	000130	016700 	000000G			MOV	$CRSEG,R0	; GET REAL ADDRESS OF CURRENT SEGMENT
    103	000134	010067 	000000G			MOV	R0,$CRSRC	;SET SEGMENT BEING SEARCHED
    104	000140	016767 	000000G	000000G		MOV	$CRVSG,$CRVSR	; SET VIRTUAL ADDRESS OF SEGMENT BEING SEARCHED
    105	000146	066700 	177626 			ADD	OFFSET,R0	;CALCULATE ADDR OF TABLE HEADER
    106	000152	010167 	177630 			MOV	R1,SYMSRC	;SET ADDR OF INPUT SYMBOL DESCRIPTOR
    107	000156					CALL	$SRCH		;SEARCH TABLE
    108	000162	103404 				BCS	10$		;IF CS NO FIND EM
    109	000164	010167 	000000G			MOV	R1,$CRVSM	; SAVE VIRTUAL ADDRESS OF ENTRY
    110	000170	005001 				CLR	R1		;SET FLAG=CURRENT SEGMENT
    111	000172					CALL	@(SP)+		;CALL THE CALLER
    112
    113					;
    114					; SEARCH PATH DOWN
WSRCH	MACRO M1108  05-DEC-77 23:14  PAGE 2-2


    115					;
    116
    117	000174				10$:				;
    118	000174	016701 	000000G			MOV	$CRVSR,R1	; GET VIRTUAL ADDRESS OF SEARCH SEGMENT
    119	000200					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    120	000204	016001 	000000G			MOV	S$GDWN(R0),R1	; GET LINK DOWN
    121	000210	001433 				BEQ	20$		; IF EQ NO MORE
    122	000212					CALL	$CVLOK		; CONVERT TO REAL ADDRESS, LOCK IN MEMORY
    123	000216	010067 	000000G			MOV	R0,$CRSRC	; SET REAL ADDRESS OF SEGMENT BEING SEARCHED
    124	000222	010167 	000000G			MOV	R1,$CRVSR	; SET VIRTUAL ADDRESS OF SEGMENT BEING SEARCHED
    125	000226	066700 	177546 			ADD	OFFSET,R0	; POINT TO LISTHEAD
    126	000232	016701 	177550 			MOV	SYMSRC,R1	;GET ADDR OF SYMBOL DESCRIPTOR
    127	000236					CALL	$SRCH		;SEARCH TABLE
    128	000242	010146 				MOV	R1,-(SP)	; SAVE VIRTUAL ADDRESS OF ENTRY
    129	000244	006102 				ROL	R2		; SAVE C-BIT
    130	000246	016701 	000000G			MOV	$CRVSR,R1	; GET VIRTUAL ADDRESS OF CURRENT
    131	000252					CALL	$UNLPG		; UNLOCK PAGE
    132	000256	006002 				ROR	R2		; RESTORE C-BIT
    133	000260	012601 				MOV	(SP)+,R1	; RESTORE ENTRY VIRTUAL ADDRESS
    134	000262	103744 				BCS	10$		; IF C/S NOT FOUND
    135	000264	010167 	000000G			MOV	R1,$CRVSM	; SET VIRTUAL ADDRESS OF ENTRY
    136	000270	012701 	177777 			MOV	#-1,R1		;SET FLAG=PATH DOWN
    137	000274					CALL	@(SP)+		;CALL THE CALLER
    138	000276	000736 				BR	10$		;GO AGAIN
    139
    140					;
    141					; SEARCH ALL PATHS UP
    142					;
    143
    144	000300				20$:				;
    145	000300	016767 	000000G	177476 		MOV	$CRVSR,ROOT	; MARK VIRTUAL ADDRESS OF ROOT
    146	000306	005067 	177470 			CLR	PASSF		; CLEAR CO-TREE FLAG
    147	000312	012702 	000110'			MOV	#TOPSTK,R2	; GET STACK POINTER
    148	000316	005042 				CLR	-(R2)		; CLEAR TOP-OF-STACK
    149	000320	016701 	000000G			MOV	$CRVSG,R1	; GET VIRTUAL ADDRESS OF CURRENT SEGMENT
    150	000324				30$:				;
    151	000324	010246 				MOV	R2,-(SP)	; SAVE STACK POINTER                            ;**NEW**
    152	000326					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    153	000332	012602 				MOV	(SP)+,R2	; RESTORE STACK POINTER                         ;**NEW**
    154	000334	016001 	000000G			MOV	S$GUP(R0),R1	; GET LINK UP
    155	000340	001014 				BNE	50$		; IF NE HAVE IT
    156	000342				40$:				;
    157	000342	012201 				MOV	(R2)+,R1	; GET TOS SEGMENT
    158	000344	001473 				BEQ	90$		; IF EQ DONE
    159	000346	010246 				MOV	R2,-(SP)	; SAVE STACK POINTER
    160	000350					CALL	$CVRL		; CONVERT TO REAL ADDRESS
    161	000354	012602 				MOV	(SP)+,R2	; RESTORE SP
    162	000356	016001 	000000G			MOV	S$GNXT(R0),R1	; GET LINK NEXT
    163	000362	020112 				CMP	R1,(R2)		; CHECK AGAINST SENTINEL
    164	000364	001017 				BNE	70$		; IF NE HAVE NEXT SEARCH SEGMENT
    165	000366	005722 				TST	(R2)+		; DONE ALL SEGMENTS AT THIS LEVEL
    166	000370	000764 				BR	40$		; GO AGAIN
    167	000372				50$:				;
    168	000372	020227 	000012'			CMP	R2,#SGSTAK+2	; TEST IF ROOM ON STACK
    169	000376	103011 				BHIS	60$		; IF HIS YES
    170	000400					CALL	$CVRL		; CONVERT VIRTUAL SEGMENT ADDRESS TO REAL       ;**NEW**
    171	000404	010002 				MOV	R0,R2		; SET REAL ADDRESS OF SEGMENT                   ;**NEW**
WSRCH	MACRO M1108  05-DEC-77 23:14  PAGE 2-3


    172	000406	062702 	000000G			ADD	#S$GNME,R2	; POINT TO SEGMENT NAME                         ;**NEW**
    173	000412	012701 	000000C			MOV	#<S$V2*400!E$R12>,R1 ; GET ERROR/SEVERITY
    174	000416					CALL	$ERMSG		; FATAL - NO RETURN                             ;**-1
    175	000422				60$:				;
    176	000422	010142 				MOV	R1,-(R2)	; SET SENTINEL AT THIS LEVEL
    177	000424				70$:				;
    178	000424	010142 				MOV	R1,-(R2)	; SAVE LINK-UP
    179	000426	010267 	177456 			MOV	R2,TOPSTK	; SAVE STACK POINTER
    180	000432					CALL	$CVLOK		; CONVERT TO REAL ADDRESS, LOCK PAGE
    181	000436	010067 	000000G			MOV	R0,$CRSRC	; SAVE REAL ADDRESS OF CURRENT
    182	000442	010167 	000000G			MOV	R1,$CRVSR	; SAVE VIRTUAL ADDRESS OF CURRENT
    183	000446	066700 	177326 			ADD	OFFSET,R0	; OFFSET TO LISTHEAD
    184	000452	016701 	177330 			MOV	SYMSRC,R1	; GET SYMBOL DESCRIPTOR
    185	000456					CALL	$SRCH		; SEARCH FOR SYMBOL
    186	000462	010146 				MOV	R1,-(SP)	; SAVE VIRTUAL ADDRESS OF ENTRY
    187	000464	006146 				ROL	-(SP)		; SAVE C-BIT
    188	000466	017701 	177416 			MOV	@TOPSTK,R1	; GET TOS
    189	000472					CALL	$UNLPG		; UNLOCK PAGE
    190	000476	006026 				ROR	(SP)+		; RESTORE C-BIT
    191	000500	012601 				MOV	(SP)+,R1	; RESTORE VIRTUAL ADDRESS OF ENTRY
    192	000502	103410 				BCS	80$		; IF C/S SYMBOL NOT IN SEGMENT
    193	000504	010167 	000000G			MOV	R1,$CRVSM	; SET ENTRY VIRTUAL ADDRESS
    194	000510	012701 	000001 			MOV	#1,R1		; SET UP TREE INDICATION
    195	000514	166701 	177262 			SUB	PASSF,R1	; INCLUDE CO-TREE FLAG
    196	000520	000241 				CLC			; SET SUCCESS
    197	000522					CALL	@(SP)+		; CALL CALLER
    198	000524				80$:				;
    199	000524	016702 	177360 			MOV	TOPSTK,R2	; GET SP
    200	000530	011201 				MOV	(R2),R1		; GET TOS SEGMENT
    201	000532	000674 				BR	30$		; GO AGAIN
    202	000534				90$:				;
    203	000534	005167 	177242 			COM	PASSF		; TOGGLE PASS FLAG
    204	000540	001405 				BEQ	100$		; IF EQ DONE
    205	000542	005042 				CLR	-(R2)		; CLEAR TOS
    206	000544	016742 	177234 			MOV	ROOT,-(R2)	; PUSH ROOT ON THIS CO-TREE
    207	000550	011242 				MOV	(R2),-(R2)	; SET TOS
    208	000552	000673 				BR	40$		; GO AGAIN
    209	000554				100$:				;
    210	000554	005000 				CLR	R0		; SET FAILURE CONDITIONS
    211	000556	000261 				SEC			;
    212	000560					RETURN			;
    213
    214		000001 				.END
WSRCH	MACRO M1108  05-DEC-77 23:14  PAGE 2-4
SYMBOL TABLE

CR    = 000015   	R$$11M= 000000   	S$GNME= ****** GX	WSRCH1  000130R  	$CVRL = ****** GX
E$R12 = ****** GX	SGSTAK  000010R  	S$GNXT= ****** GX	$CRSEG= ****** GX	$ERMSG= ****** GX
FF    = 000014   	SPA   = 000040   	S$GSTB= ****** GX	$CRSRC= ****** GX	$SRCH = ****** GX
HT    = 000011   	STKSIZ= 000100   	S$GUP = ****** GX	$CRVSG= ****** GX	$UNLPG= ****** GX
LF    = 000012   	SYMSRC  000006R  	S$V2  = ****** GX	$CRVSM= ****** GX	$WSRCC  000112RG
OFFSET  000000R  	S$GCST= ****** GX	TOPSTK  000110R  	$CRVSR= ****** GX	$WSRCS  000122RG
PASSF   000002R  	S$GDWN= ****** GX	VT    = 000013   	$CVLOK= ****** GX	$$    = 000001
ROOT    000004R

. ABS.	000000	   000
      	000562	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  757 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[44,10]WSRCH,[44,20]WSRCH/-SP=[44,30]MACFLM.,WSRCH.006