Google
 

Trailing-Edge - PDP-10 Archives - BB-H311B-RM - rsx20f-swskit/listings/fcs.lis
There are no other files named fcs.lis in the archive.
ALERR	MACRO M1108  05-DEC-77 23:40  PAGE 3


      1						.TITLE	ALERR
      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 09-JUN-74
     22					;
     23					; MACRO LIBRARY CALLS
     24					;
     25
     26						.MCALL	DRERR$,WSIG$S
     27
     28					;
     29					; DEFINE DIRECTIVE STATUS ERROR CODES
     30					;
     31
     32	000000					DRERR$
     33
     34					;+
     35					; **-$ALERR-SUBROUTINE TO HANDLE AUTOLOAD ERRORS
     36					;
     37					; THIS ROUTINE IS CALLED TO PERFORM PARTIAL ERROR RECOVERY WHENEVER A
     38					; SEQMENT LOAD FAILURE OCCURS WHILE AN AUTOLOAD REQUEST IS IN PROGRESS.
     39					; IT IS ONE OF THE OVERLAY RUNTIME ROUTINES.
     40					;
     41					; INPUTS:
     42					;
     43					;	R2 = ADDRESS OF SEGMENT DESCRIPTOR OF SEGMENT
     44					;		WHERE LOAD FAILURE OCCURED.
     45					;
     46					; THE ROUTINE EXECUTES A 'WAITFOR SIGNIFICANT EVENT' DIRECTIVE IF THE DIRECTIVE
     47					; STATUS WORD CONTAINS ERROR CODE 'IE.UPN' (UNAVAILABLE POOL NODE) ELSE A
     48					; BPT INSTRUCTION IS EXECUTED. ON COMPLETION OF THE WAIT A RETURN WILL CAUSE
     49					; THE RUNTIME SYSTEM TO RE-TRY THE LOAD OVERLAY REQUEST. THE CONTENTS OF ALL
     50					; REGISTERS MUST BE PRESERVED.
     51					;
     52					; A RETURN IN-LINE FROM THE BPT SST WILL CAUSE A RE-TRY AS DESCRIBED ABOVE.
     53					;-
     54
     55	000000					.PSECT	$$ALER
     56
     57	000000				$ALERR::			;
ALERR	MACRO M1108  05-DEC-77 23:40  PAGE 3-1


     58	000000	023727 	000000G	177777 		CMP	@#$DSW,#IE.UPN	; UNAVAILABLE POOL NODE?
     59	000006	001004 				BNE	10$		; IF NE CAUSE BPT SST
     60	000010					WSIG$S			; WAIT FOR SIGNIFICANT EVENT
     61	000016	000401 				BR	20$		; EXIT TO RE-TRY
     62	000020				10$:				;
     63	000020	000003 				BPT			; GENERATE BPT SST
     64	000022				20$:				;
     65	000022					RETURN			; EXIT AND RE-TRY LOAD
     66
     67		000001 				.END
ALERR	MACRO M1108  05-DEC-77 23:40  PAGE 3-2
SYMBOL TABLE

CR    = 000015   	IE.IPR= 177641   	S$GATL  000152   	S$GRO   000030   	T$RDWN  000010
FF    = 000014   	IE.ITI= 177643   	S$GBLK  000002   	S$GRW   000032   	T$RLDA  000002
HT    = 000011   	IE.ITS= 177770   	S$GCST  000024   	S$GRWB  000162   	T$RLNG  000004
IE.ACT= 177771   	IE.LNL= 177646   	S$GDWN  000012   	S$GSEG  000164   	T$RNME  000014
IE.ADP= 177636   	IE.SDP= 177635   	S$GELT  000146   	S$GSEQ  000166   	T$RNXT  000012
IE.AST= 177660   	IE.ULN= 177773   	S$GLDA  000004   	S$GSTB  000036   	T$RUP   000006
IE.CKP= 177766   	IE.UPN= 177777   	S$GLGH  000172   	S$GSTS  000000   	VT    = 000013
IE.HWR= 177772   	IS.CLR= 000000   	S$GLNG  000006   	S$GUND  000140   	$ALERR  000000RG    002
IE.IDU= 177644   	IS.SET= 000002   	S$GMEM  000160   	S$GUP   000010   	$DSW  = ****** GX
IE.IEF= 177637   	LF    = 000012   	S$GNME  000020   	S$GVAD  000142   	$$MSG = 000000
IE.ILU= 177640   	R$$11M= 000000   	S$GNXT  000014   	S$ZSEG  000020   	...GBL= 000000
IE.INS= 177776   	SPA   = 000040   	S$GPRV  000016   	T$RBLK  000000

. ABS.	000172	   000
      	000000	   001
$$ALER	000024	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1544 WORDS  ( 7 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[46,10]ALERR,[46,20]ALERR/-SP=[46,30]MACFLM.,SEGDF.005,ALERR.000
ARITH	MACRO M1108  05-DEC-77 23:43  PAGE 1


      1						.TITLE	ARITH
      2						.IDENT	/03/
      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 03
     20					;
     21					; D. N. CUTLER 10-FEB-72
     22
     23
     24						.MCALL	RETURN
     25
     26
     27					;+
     28					; **-$MUL-INTEGER MULTIPLY MAGNITUDE NUMBERS
     29					;
     30					; INPUTS:
     31					;
     32					;	R0=MULTIPLIER.
     33					;	R1=MULTIPLICAND.
     34					;
     35					; OUTPUTS:
     36					;
     37					;	DOUBLE WORD RESULT IS RETURNED WITH THE
     38					;	HIGH PART IN R0 AND THE LOW PART IN R1.
     39					;
     40					;	REGISTERS R2, R3, R4, AND R5 ARE PRESERVED ACROSS CALL.
     41					;-
     42
     43						.ENABL	LSB
     44	000000	010046 			$MUL::	MOV	R0,-(SP)	;SAVE R0 FOR ADDS
     45	000002	012746 	000021 			MOV	#21,-(SP)	;SET REPEAT COUNT
     46	000006	005000 				CLR	R0		;CLEAR HIGH PART
     47	000010	006000 			10$:	ROR	R0		;DOUBLE RIGHT SHIFT
     48	000012	006001 				ROR	R1		;
     49	000014	103003 				BCC	20$		;IF CC DO NOT ADD
     50	000016	066600 	000002 			ADD	2(SP),R0	;
     51	000022	000241 				CLC			;CLEAR CARRY INDICATOR
     52	000024	005316 			20$:	DEC	(SP)		;DECREMENT REPEAT COUNT
     53	000026	003370 				BGT	10$		;IF GT MORE TO GO
     54	000030	000415 				BR	50$		;EXIT TO CALLER
     55
     56					;+
     57					; **-$DIV-INTEGER DIVIDE MAGNITUDE NUMBERS
ARITH	MACRO M1108  05-DEC-77 23:43  PAGE 1-1


     58					;
     59					; INPUTS:
     60					;
     61					;	R0=DIVIDEND.
     62					;	R1=DIVISOR.
     63					;
     64					; OUTPUTS:
     65					;
     66					;	QUOTIENT IS RETURNED IN R0 AND REMAINDER IN R1.
     67					;
     68					;	REGISTERS R2, R3, R4, AND R5 ARE PRESERVED ACROSS CALL.
     69					;-
     70
     71	000032	012746 	000020 		$DIV::	MOV	#20,-(SP)	;SET LOOP COUNT
     72	000036	010146 				MOV	R1,-(SP)	;SAVE DIVISOR FOR SUBTRACTS
     73	000040	005001 				CLR	R1		;CLEAR REMAINDER
     74	000042	006300 			30$:	ASL	R0		;DOUBLE LEFT SHIFT
     75	000044	006101 				ROL	R1		;
     76	000046	020116 				CMP	R1,(SP)		;SUBTRACT OUT DIVISOR?
     77	000050	103402 				BLO	40$		;IF LO NO
     78	000052	161601 				SUB	(SP),R1		;SUBTRACT OUT DIVISOR
     79	000054	005200 				INC	R0		;ADD IN LOW BIT
     80	000056	005366 	000002 		40$:	DEC	2(SP)		;DECREMENT REPEAT COUNT
     81	000062	003367 				BGT	30$		;IF GT MORE TO GO
     82	000064	022626 			50$:	CMP	(SP)+,(SP)+	;CLEAN STACK
     83	000066					RETURN			;
     84						.DSABL	LSB
     85
     86		000001 				.END
ARITH	MACRO M1108  05-DEC-77 23:43  PAGE 1-2
SYMBOL TABLE

$DIV    000032RG 	$MUL    000000RG

. ABS.	000000	   000
      	000070	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  126 WORDS  ( 1 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:04
[46,10]ARITH,[46,20]ARITH/-SP=[46,30]ARITH
ASCPPN 0104MS, TRANSLATE ASCII 	MACRO M1108  05-DEC-77 22:05  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
ASCPPN 0104MS, TRANSLATE ASCII 	MACRO M1108  05-DEC-77 22:05  PAGE 7


						.TITLE	ASCPPN 0104MS, TRANSLATE ASCII FORM OF PPN TO BINARY
						.IDENT	/0104MS/
      2					;                             COPYRIGHT (C) 1974, 1978 BY
      3					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      4					;
      5					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      6					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      7					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      8					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
      9					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     10					;
     11					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     12					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     13					;       CORPORATION.
     14					;
     15					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     16					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     17					;
     18					;
     19					; PETER H. LIPMAN
     20					; ALTERED BY SHAO-SUN CHIEN	22 JULY 1974
ASCPPN 0104MS, TRANSLATE ASCII 	MACRO M1108  05-DEC-77 22:05  PAGE 8


     22					;+
     23					; TRANSLATE THE ASCII FORM OF PPN, [200,210] TO THE BINARY
     24					; CALLING SEQUENCE:
     25					;	CALL	.ASCPP
     26					; INPUTS:
     27					;	R2=DESCRIPTOR OF PPN STRING
     28					;	R3=ADDRESS TO RETURN PPN
     29					; OUTPUTS:
     30					;	C=0 IF OK, C=1 IF BAD SYNTAX
     31					;	ALL REGISTERS PRESERVED
     32					; OPERATION:
     33					;	THE ASCII INPUT IS OF THE FORM [PROJ,PROG], WHERE THE
     34					; NUMBERS ARE STANDARD NUMERIC SYNTAX, IN PARTICULAR
     35					; A TRAILING DECIMAL POINT IS USED TO DENOTE DECIMAL, OTHERWISE OCTAL
     36					; PPN OUTPUT IS OF THE FORM .BYTE PROG,PROJ
     37					;-
     38
     39						.ENABL	LSB
     40	000000				.ASCPP::.SAVR1
     41	000004	011201 				MOV	@R2,R1		;R1=SIZE OF DIRECTORY STRING
     42	000006	016202 	000002 			MOV	2(R2),R2	;R2=ADDRESS OF STRING
     43	000012	005301 				DEC	R1		;COUNT THE [
     44	000014	003431 				BLE	15$
     45	000016	122722 	000133 			CMPB	#'[,(R2)+
     46	000022	001026 				BNE	15$		;BRANCH IF SYNTAX ERROR
     47	000024	012704 	000054 			MOV	#',,R4
     48	000030					CALL	SCNCVT		;SCAN FIRST NUMBER, STORE @R3
     49	000034	103421 				BCS	15$		;BRANCH IF SYNTAX ERROR
     50	000036	011346 				MOV	@R3,-(SP)	;SAVE CONVERTED NUMBER
     51	000040	012704 	000135 			MOV	#'],R4
     52	000044					CALL	SCNCVT
     53	000050	012605 				MOV	(SP)+,R5	;R5=PROJECT
     54	000052	103412 				BCS	15$		;BRANCH IF SYNTAX ERROR
     55	000054	005701 				TST	R1		;COUNT MUST BE ZERO
     56	000056	001010 				BNE	15$		;BRANCH IF NOT
     57					; 0(R3) ALREADY CONTAINS THE PROGRAMMER NUMBER, JUST STORE THE PROJECT
     58	000060	110563 	000001 			MOVB	R5,1(R3)
     59	000064					RETURN
ASCPPN 0104MS, TRANSLATE ASCII 	MACRO M1108  05-DEC-77 22:05  PAGE 9


     61					;+
     62					; SCAN ASCII STRING UNTIL SPECIFIED TERMINATOR AND CONVERT TO A NUMBER
     63					; CALLING SEQUENCE:
     64					;	CALL	SCNCVT
     65					; INPUTS:
     66					;	R1=STRING SIZE
     67					;	R2=STRING ADDRESS
     68					;	R3=ADDRESS TO RETURN NUMBER IN
     69					;	R4=CHARACTER TO TERMINATE SCAN
     70					; OUTPUTS:
     71					;	C=0 IF OK, C=1 IF SYNTAX ERROR
     72					;	NUMBER RETURNED @R3
     73					;	R1,R2 UPDATED TO  POINT AT TERMINATING CHARACTER
     74					;	R0,R3 PRESERVED, R4,R5 DESTROYED
     75					;-
     76	000066	010205 			SCNCVT:	MOV	R2,R5		;SAVE ADR OF BEGINING OF NUMBER
     77	000070	120422 			10$:	CMPB	R4,(R2)+
     78	000072	001404 				BEQ	20$		;BRANCH IF MATCHED TERMINATOR
     79	000074					SOB	R1,10$
     80					; END OF STRING AND TERMINATOR WAS NOT FOUND
     81	000100	000261 			15$:	SEC
     82	000102					RETURN			;RAN OUT OF CHARACTERS, SYNTAX ERROR
     83	000104	005301 			20$:	DEC	R1		;COUNT THE DELIMITER TOO
     84	000106	010204 				MOV	R2,R4		;CALCULATE BYTES IN STRING
     85	000110	160504 				SUB	R5,R4
     86	000112	005304 				DEC	R4
     87	000114					CALLR	.ODCVT
     88						.DSABL	LSB
     89					;
     90					;
     91	000120					$END	ASCPPN
     92					;
     93		000001 				.END
ASCPPN 0104MS, TRANSLATE ASCII 	MACRO M1108  05-DEC-77 22:05  PAGE 9-1
SYMBOL TABLE

BD.FRE= 000001   	HA.NAM= 000005   	N.DVPT= 000002   	R$$EIS= 000000   	SYDEV = 054523
DIRTYP= 015172   	HA.TYP= 000006   	N.DVSZ= 000000   	R$$LCL= 000000   	SYUNIT= 000000
FCSEFN= 000040   	HA.UAT= 000004   	N.FNPT= 000012   	R$$MUL= 000000   	WI.DLK= 000002
FD.DVR= 000020   	HA.UI = 000001   	N.FNSZ= 000010   	R$$OPF= 000000   	WI.LCK= 000001
FD.EFB= 000004   	HA.VER= 000007   	PP.SEP= 000002   	R$$RSL= 000000   	$$    = 000067
FD.EF1= 000010   	NB.DOT= 100000   	PP.ZER= 000001   	R$$SEQ= 000000   	.ASCPP  000000RG
FD.EOF= 000002   	NB.SMI= 040000   	R$$ANI= 000000   	R$$SPL= 000000   	.ODCVT= ****** GX
FD.WRT= 000001   	N.DRPT= 000006   	R$$BBF= 000000   	R$$11M= 000001   	.SAVR1= ****** GX
HA.CHU= 000003   	N.DRSZ= 000004   	R$$DPB= 000001   	SCNCVT  000066R  	...CTL= 000001
HA.FP = 000002

. ABS.	000000	   000
      	000120	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2549 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]ASCPPN,[41,20]ASCPPN/-SP=[41,30]FCSPRE,ASCPPN
ASCR50 0104MS, CONVERT ASCII ST	MACRO M1108  05-DEC-77 22:05  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
ASCR50 0104MS, CONVERT ASCII ST	MACRO M1108  05-DEC-77 22:05  PAGE 7


						.TITLE	ASCR50 0104MS, CONVERT ASCII STRING TO RAD50
						.IDENT	/0104MS/
      2					;
      3					;                             COPYRIGHT (C) 1975, 1978 BY
      4					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      5					;
      6					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      7					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      8					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      9					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     10					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     11					;
     12					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     13					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     14					;       CORPORATION.
     15					;
     16					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     17					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     18					;
     19					; PETER H. LIPMAN
ASCR50 0104MS, CONVERT ASCII ST	MACRO M1108  05-DEC-77 22:05  PAGE 8


     21					;+
     22					; CONVERT ASCII STRING TO RAD50
     23					; CALLING SEQUENCE:
     24					;	CALL	..SGR5
     25					; INPUTS:
     26					;	R2=ADDRESS OF ASCII STRING
     27					;	R3=SIZE OF STRING
     28					;	R4=ADDRESS TO STORE RAD50 STRING - AREA PREVIOUSLY ZEROED
     29					; OUTPUTS:
     30					;	C=0 IF OK, C=1 IF ASCII CHAR IS NOT ALPHANUMERIC
     31					;	R4=UPDATED POINTER TO LAST WORD WRITTEN WITH RAD50 CHARS
     32					;	R0,R1 PRESERVED
     33					;	R2,R3,R5 ALTERED
     34					;-
     35	000000	010046 			..SGR5::MOV	R0,-(SP)
     36	000002	010700 				MOV	PC,R0
     37	000004	062700 	000110 			ADD	#CVTBL-.,R0
     38	000010	012746 	000003 			MOV	#3,-(SP)
     39
     40	000014	112205 			4$:	MOVB	(R2)+,R5	;R5=NEXT ASCII CHARACTER
     41	000016					CALL	ASCR50		;CONVERT ONE CHARACTER TO RAD50
     42	000022	103421 				BCS	20$		;BRANCH IF ILLEGAL CHARACTER
     43						.IF	GT,R$$EIS
     44						MUL	(R0)+,R5
     45						.IFF
     46	000024	005720 				TST	(R0)+		;CHECK FOR WHICH TYPE MULTIPLY
     47	000026	001405 				BEQ	30$		;MULTIPLY BY 1, THAT IS EASY
     48	000030	003002 				BGT	25$		;MULTIPLY BY 50 ONCE
     49	000032					CALL	40$
     50	000036				25$:	CALL	40$		;GO MULTIPLY BY 50
     51	000042				30$:
     52						.IFTF
     53	000042	060514 				ADD	R5,@R4		;PUT THIS RAD50 CHAR IN STRING
     54	000044	005316 				DEC	@SP		;3RD CHARACTER DONE?
     55	000046	003005 				BGT	6$		;BRANCH IF NO
     56	000050	162700 	000006 			SUB	#6,R0		;RESET RAD50 MULTIPLIER
     57	000054	005724 				TST	(R4)+		;POINT TO NEXT WORD TO PUT RAD50 STRING
     58	000056	012716 	000003 			MOV	#3,@SP
     59	000062				6$:	SOB	R3,4$
     60	000066	005226 			20$:	INC	(SP)+		;POP ONE WORD, DON'T ALTER C BIT
     61	000070	012600 				MOV	(SP)+,R0
     62	000072					RETURN
     63					;
     64						.IFT
     65					CVTBL:	.WORD	50*50,50,1
     66						.IFF
     67	000074	006305 			40$:	ASL	R5		;TIMES 2
     68	000076	006305 				ASL	R5		;TIMES 4
     69	000100	006305 				ASL	R5		;TIMES 10
     70	000102	010546 				MOV	R5,-(SP)	;SAVE TIMES 10
     71	000104	006305 				ASL	R5		;TIMES 20
     72	000106	006305 				ASL	R5		;TIMES 40
     73	000110	062605 				ADD	(SP)+,R5	;TIMES 50 NOW
     74	000112					RETURN
     75
     76	000114	177777 	000001 	000000 	CVTBL:	.WORD	-1,1,0
     77						.ENDC
ASCR50 0104MS, CONVERT ASCII ST	MACRO M1108  05-DEC-77 22:05  PAGE 9


     79					;+
     80					; ASCII TO RAD50 CONVERSION ROUTINE
     81					; CALLING SEQUENCE
     82					;	CALL	ASCR50
     83					; INPUTS:
     84					;	R5=1 ASCII CHARACTER,MUST BE ALPHANUMERIC
     85					; OUTPUTS:
     86					;	R5=RAD50 CONVERSION OF CHARACTER
     87					;	C=0 IF SUCCESSFUL
     88					;	C=1 IF CHARACTER WAS NOT ALPHANUMERIC
     89					;	R0-R4 PRESERVED
     90					;-
     91
     92	000122	020527 	000132 		ASCR50:	CMP	R5,#'Z		;IS THE CHARACTER ALPHABETIC
     93	000126	101016 				BHI	6$		;BRANCH IF LARGER THAN Z
     94	000130	020527 	000101 			CMP	R5,#'A
     95	000134	103010 				BHIS	4$		;BRANCH IF ALPHABETIC
     96	000136	020527 	000071 			CMP	R5,#'9		;IS CHARACTER NUMERIC
     97	000142	101010 				BHI	6$		;BRANCH IF NO
     98	000144	020527 	000060 			CMP	R5,#'0
     99	000150	103405 				BLO	6$		;BRANCH IF NOT NUMERIC
    100					; CHARACTER IS NUMERIC
    101	000152	162705 	177722 			SUB	#22-100,R5
    102
    103					; CHARACTER IS ALPHABETIC
    104	000156	162705 	000100 		4$:	SUB	#100,R5
    105	000162					RETURN
    106
    107	000164	000261 			6$:	SEC
    108	000166					RETURN
    109					;
    110					;
    111	000170					$END	ASCR50
    112					;
    113		000001 				.END
ASCR50 0104MS, CONVERT ASCII ST	MACRO M1108  05-DEC-77 22:05  PAGE 9-1
SYMBOL TABLE

ASCR50  000122R  	FD.WRT= 000001   	NB.SMI= 040000   	R$$ANI= 000000   	R$$SPL= 000000
BD.FRE= 000001   	HA.CHU= 000003   	N.DRPT= 000006   	R$$BBF= 000000   	R$$11M= 000001
CVTBL   000114R  	HA.FP = 000002   	N.DRSZ= 000004   	R$$DPB= 000001   	SYDEV = 054523
DIRTYP= 015172   	HA.NAM= 000005   	N.DVPT= 000002   	R$$EIS= 000000   	SYUNIT= 000000
FCSEFN= 000040   	HA.TYP= 000006   	N.DVSZ= 000000   	R$$LCL= 000000   	WI.DLK= 000002
FD.DVR= 000020   	HA.UAT= 000004   	N.FNPT= 000012   	R$$MUL= 000000   	WI.LCK= 000001
FD.EFB= 000004   	HA.UI = 000001   	N.FNSZ= 000010   	R$$OPF= 000000   	$$    = 000067
FD.EF1= 000010   	HA.VER= 000007   	PP.SEP= 000002   	R$$RSL= 000000   	..SGR5  000000RG
FD.EOF= 000002   	NB.DOT= 100000   	PP.ZER= 000001   	R$$SEQ= 000000   	...CTL= 000001

. ABS.	000000	   000
      	000170	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2565 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[41,10]ASCR50,[41,20]ASCR50/-SP=[41,30]FCSPRE,ASCR50
ASSLUN 0102MS, ASSIGN LOGICAL U	MACRO M1108  05-DEC-77 22:05  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
ASSLUN 0102MS, ASSIGN LOGICAL U	MACRO M1108  05-DEC-77 22:05  PAGE 7


						.TITLE	ASSLUN 0102MS, ASSIGN LOGICAL UNIT TO DEVICE
						.IDENT	/0102MS/
      2					; ALTERED TUESDAY 4-JUNE-74 14:35
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 17-AUG-73
     21					;
ASSLUN 0102MS, ASSIGN LOGICAL U	MACRO M1108  05-DEC-77 22:05  PAGE 8


     23	000000				.ASLUN::.SAVR1
     24					; ENTER HERE WITH R0=FDB, R1=FNB, RETURNS R0,R1 UNCHANGED, R2-R5 DESTROYED
     25	000004	010146 			..ALUN::MOV	R1,-(SP)
     26	000006	016102 	000000G			MOV	N.UNIT(R1),R2	;R2=UNIT NUMBER
     27	000012	016103 	000000G			MOV	N.DVNM(R1),R3	;R3=DEVICE NAME
     28	000016	001411 				BEQ	20$		;BRANCH IF DEFAULT DEVICE
     29
     30					; R3 = DEVICE NAME, R2 = UNIT NUMBER - ASSIGN THE LUN
     31	000020	116004 	000000G		10$:	MOVB	F.LUN(R0),R4
     32	000024					ALUN$S	R4,R3,R2	;LUN, DEVICE NAME, UNIT
     33	000040	103410 				BCS	30$		;BRANCH IF ERROR
     34	000042				20$:	CALL	CHRLUN
     35	000046	103012 				BCC	40$		;BRANCH IF LUN IS ASSIGNED OK
     36	000050	012702 	000000 			MOV	#SYUNIT,R2	;ASSIGN LUN TO DEFAULT DEVICE
     37	000054	012703 	054523 			MOV	#SYDEV,R3
     38	000060	000757 				BR	10$
     39	000062	012601 			30$:	MOV	(SP)+,R1
     40	000064	013760 	000000G	000000G		MOV	@#$DSW,F.ERR(R0)
     41	000072					RETURN
     42	000074	010305 			40$:	MOV	R3,R5		;SAVE UNIT NO. IN R5
     43	000076	110260 	000000G			MOVB	R2,F.RCTL(R0)	;INIT CONTROL BYTES
     44	000102	010160 	000000G			MOV	R1,F.VBSZ(R0)	;SIZE OF VIRTUAL BLOCKS
     45	000106	010160 	000000G			MOV	R1,F.BBFS(R0)	;SET BLOCK SIZE
     46	000112	012601 				MOV	(SP)+,R1
     47	000114	010561 	000000G			MOV	R5,N.UNIT(R1)	;STORE UNIT IN FNB
     48	000120	010461 	000000G			MOV	R4,N.DVNM(R1)	;STORE DEVICE NAME IN FNB
     49	000124					RETURN
ASSLUN 0102MS, ASSIGN LOGICAL U	MACRO M1108  05-DEC-77 22:05  PAGE 9


     51					;+
     52					; GET INFORMATION PER LUN
     53					; CALLING SEQUENCE:
     54					;	CALL	CHRLUN
     55					; INPUTS:
     56					;	R0=FDB, ONLY NEEDED FOR THE LUN
     57					; OUTPUTS:
     58					;	C=0 FOR SUCCESS, C=1 FOR FAILURE (FROM GLUN$S)
     59					;	R1=DEFAULT BLOCK SIZE
     60					;	R2=DEVICE CHARACTERISTICS BITS FOR F.RCTL
     61					;	R3=UNIT NUMBER IN BINARY
     62					;	R4=DEVICE NAME IN ASCII
     63					;	R0, R5 PRESERVED
     64					;-
     65	000126	013701 	000000G		CHRLUN:	MOV	@#.FSRPT,R1
     66	000132	062701 	000000G			ADD	#A.DPB,R1	;R1=ADDRESS TO STORE GLUN INOFRMATION
     67	000136	116002 	000000G			MOVB	F.LUN(R0),R2
     68	000142					GLUN$S	R2,R1
     69	000154	103406 				BCS	10$
     70	000156	012104 				MOV	(R1)+,R4	;ASCII NAME
     71	000160	111103 				MOVB	(R1),R3		;UNIT NUMBER
     72	000162	016102 	000002 			MOV	2(R1),R2	;DEVICE CHARACTERISTICS
     73	000166	016101 	000010 			MOV	8.(R1),R1	;DEFAULT BLOCK SIZE
     74	000172				10$:	RETURN
     75					;
     76					;
     77	000174					$END	ASSLUN
     78					;
     79					;
     80		000001 				.END
ASSLUN 0102MS, ASSIGN LOGICAL U	MACRO M1108  05-DEC-77 22:05  PAGE 9-1
SYMBOL TABLE

A.DPB = ****** GX	F.RCTL= ****** GX	NB.DOT= 100000   	R$$ANI= 000000   	SYUNIT= 000000
BD.FRE= 000001   	F.VBSZ= ****** GX	NB.SMI= 040000   	R$$BBF= 000000   	WI.DLK= 000002
CHRLUN  000126R  	G.LUCW= 000004   	N.DRPT= 000006   	R$$DPB= 000001   	WI.LCK= 000001
DIRTYP= 015172   	G.LUFB= 000003   	N.DRSZ= 000004   	R$$EIS= 000000   	$DSW  = ****** GX
FCSEFN= 000040   	G.LUNA= 000000   	N.DVNM= ****** GX	R$$LCL= 000000   	$$    = 000067
FD.DVR= 000020   	G.LUNU= 000002   	N.DVPT= 000002   	R$$MUL= 000000   	$$$ARG= 000003
FD.EFB= 000004   	HA.CHU= 000003   	N.DVSZ= 000000   	R$$OPF= 000000   	$$$OST= 000014
FD.EF1= 000010   	HA.FP = 000002   	N.FNPT= 000012   	R$$RSL= 000000   	.ASLUN  000000RG
FD.EOF= 000002   	HA.NAM= 000005   	N.FNSZ= 000010   	R$$SEQ= 000000   	.FSRPT= ****** GX
FD.WRT= 000001   	HA.TYP= 000006   	N.UNIT= ****** GX	R$$SPL= 000000   	.SAVR1= ****** GX
F.BBFS= ****** GX	HA.UAT= 000004   	PP.SEP= 000002   	R$$11M= 000001   	..ALUN  000004RG
F.ERR = ****** GX	HA.UI = 000001   	PP.ZER= 000001   	SYDEV = 054523   	...CTL= 000001
F.LUN = ****** GX	HA.VER= 000007

. ABS.	000000	   000
      	000174	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  3200 WORDS  ( 13 PAGES)
DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:00:16
[41,10]ASSLUN,[41,20]ASSLUN/-SP=[41,30]FCSPRE,ASSLUN
AUTO	MACRO M1108  05-DEC-77 23:40  PAGE 3


      1						.TITLE	AUTO
      2						.IDENT	/07/                                                            ;**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 07
     21					;                                                                               ;**-1
     22					; D. N. CUTLER/C. MONIA 11-JAN-74
     23					;
     24					; MODIFICATIONS:
     25					;
     26					; NO.		DATE		PROGRAMMER
     27					; ---		----		----------
     28					;
     29					; 021		11-JAN-74	C. MONIA
     30					;
     31					;+
     32					; **-$AUTO-AUTOLOAD SEGMENT                                                     ;**-13
     33					;
     34					; THIS ROUTINE IS CALLED VIA A JSR INSTRUCTION FROM AN AUTOLOAD VEC-
     35					; TOR TO TRANSPARENTLY LOAD A SEGMENT. IT IS ONE OF THE RUN TIME
     36					; OVERLAY ROUTINES. IF THE SPECIFIED SEGMENT IS IN MEMORY, THEN CON-
     37					; TROL IS TRANSFERED DIRECTLY TO THE AUTOLOAD ENTRY POINT. ELSE ALL
     38					; APPROPRIATE SEGMENTS ARE MARKED OUT OF MEMORY AND THE PATH TO THE
     39					; SPECIFIED SEGMENT IS LOADED. CONTROL IS THEN TRANSFERED TO THE AUTO-
     40					; LOAD ENTRY POINT.
     41					;
     42					; INPUTS:
     43					;
     44					;	(SP) = ADDRESS OF 2 WORD AUTOLOAD PACKET                                ;**NEW**
     45					;                                                                               ;**-1
     46					; 	PACKET FORMAT:
     47					;
     48					;	.WORD	CALL SEG
     49					;	.WORD	AUTO ENT                                                        ;**-1
     50					;
     51					;	WHERE:
     52					;
     53					;	CALL SEG=ADDRESS OF SEGMENT DESCRIPTOR OF THE SEGMENT THAT CON-
     54					;		TROL IS TO BE TRANSFERED INTO.
     55					;	AUTO ENT=ADDRESS OF THE AUTOLOAD ENTRY POINT IN THE CALLED SEG-         ;**-1
     56					;		MENT.
     57					;
AUTO	MACRO M1108  05-DEC-77 23:40  PAGE 3-1


     58					; OUTPUTS:
     59					;
     60					;	THE APPROPRIATE SEGMENTS ARE MARKED OUT OF MEMORY, THE PATH IS
     61					;	LOADED TO THE CALLED SEGMENT, AND CONTROL IS TRANSFERED TO THE
     62					;	AUTOLOAD ENTRY POINT.
     63					;
     64					;	NOTE:	IF A LOAD ERROR OCCURS THEN A CALL TO '$ALERR' IS EXECUTED      ;**NEW**
     65					;		TO ACCOMPLISH ERROR RECOVERY. ON RETURN, THE REQUEST TO         ;**NEW**
     66					;		READ THE SEGMENT IS REPEATED. THE RECOVERY ROUTINE IS           ;**NEW**
     67					;		SUPPLIED WITH THE FOLLOWING INPUTS:                             ;**NEW**
     68					;                                                                               ;**NEW**
     69					;		R2 = ADDRESS OF SEGMENT DESCRIPTOR BEING PROCESSED WHEN         ;**NEW**
     70					;		      LOAD ERROR OCCURRED.                                      ;**NEW**
     71					;                                                                               ;**NEW**
     72					;		'$ALERR' IS NORMALLY INCLUDED DIRECTLY IN THE TASK IMAGE        ;**NEW**
     73					;		RATHER THAN WITHIN A RESIDENT LIBRARY TO FACILITATE SUBSTITU-   ;**NEW**
     74					;		TION OF A USER-WRITTEN RECOVERY PROCEDURE AT LINK TIME          ;**NEW**
     75					;-                                                                              ;**-6
     76
     77	000000					.PSECT	$$AUTO
     78	000000	017646 	000000 		$AUTO::	MOV	@(SP),-(SP)	;GET ADDR OF CALLED SEGMENT DESCRIPTOR
     79	000004	032736 	010000 			BIT	#10000,@(SP)+	; SEGMENT IN MEMORY?
     80	000010	001003 				BNE	AUTO1		; IF NE NO                                      ;**NEW**
     81	000012	062716 	000002 			ADD	#2,(SP)		; POINT TO ENTRY POINT ADDRESS                  ;**NEW**
     82	000016	013607 				MOV	@(SP)+,PC	;TRANSFER CONTROL TO ENTRY POINT                ;**-2
     83	000020				AUTO1:				;                                               ;**NEW**
     84	000020					SAVRG			; SAVE R3,R4,R5                                 ;**NEW**
     85					                                                                                ;**NEW**
     86					;                                                                               ;**NEW**
     87					; AT THIS POINT STACK CONTENTS ARE:                                             ;**NEW**
     88					;                                                                               ;**NEW**
     89					;	SP+10 = ADDRESS OF 2-WORD PACKET                                        ;**NEW**
     90					;	SP+06 = SAVED R5                                                        ;**NEW**
     91					;	SP+04 = SAVED R4                                                        ;**NEW**
     92					;	SP+02 = SAVED R3                                                        ;**NEW**
     93					;	SP+00 = RETURN TO REGISTER RESTORE ROUTINE                              ;**NEW**
     94					;                                                                               ;**NEW**
     95					                                                                                ;**NEW**
     96	000024	010246 				MOV	R2,-(SP)	; SAVE R2                                       ;**NEW**
     97	000026	016605 	000012 			MOV	12(SP),R5	; GET ADDRESS OF PACKET                         ;**NEW**
     98	000032	012502 				MOV	(R5)+,R2	; GET SEGMENT DESCRIPTOR ADDRESS                ;**NEW**
     99	000034	011566 	000012 			MOV	(R5),12(SP)	; SET RETURN TO ENTRY POINT                     ;**NEW**
    100	000040					CALL	$MARKS		; MARK APPROPRIATE SEGMENTS OUT OF MEMORY       ;**NEW**
    101	000044				20$:				;                                               ;**NEW**
    102	000044	005005 				CLR	R5		; NO AST TRAP ADDRESS                           ;**NEW**
    103	000046	005004 				CLR	R4		; NO I/O STATUS DOUBLEWORD                      ;**NEW**
    104	000050	005003 				CLR	R3		; SYNCHRONOUS LOAD REQUEST                      ;**NEW**
    105	000052				30$:				;                                               ;**NEW**
    106	000052	005762 	000004 			TST	T$RLNG(R2)	; TEST FOR ZERO LENGTH SEGMENT                  ;**NEW**
    107	000056	001004 				BNE	40$		; IF NE READ IN SEGMENT                         ;**NEW**
    108	000060	042762 	010000 	000000 		BIC	#10000,T$RBLK(R2) ; ELSE MARK SEGMENT IN MEMORY                   ;**NEW**
    109	000066	000403 				BR	50$		; PROCESS NEXT SEGMENT                          ;**NEW**
    110	000070				40$:				;                                               ;**NEW**
    111	000070					CALL	$RDSEG		; READ IN SEGMENT                               ;**NEW**
    112	000074	103412 				BCS	70$		; IF C/S ERROR                                  ;**NEW**
    113	000076				50$:				;                                               ;**NEW**
    114	000076	016202 	000010 			MOV	T$RDWN(R2),R2	; GET NEXT LINK DOWN                            ;**NEW**
AUTO	MACRO M1108  05-DEC-77 23:40  PAGE 3-2


    115	000102	001405 				BEQ	60$		; IF EQ ROOT SEGMENT                            ;**NEW**
    116	000104	032762 	010000 	000000 		BIT	#10000,T$RBLK(R2) ; SEGMENT IN MEMORY ?
    117	000112	001354 				BNE	20$		; IF NE NO                                      ;**NEW**
    118	000114	000770 				BR	50$		; GET NEXT LINK DOWN                            ;**NEW**
    119	000116				60$:				;                                               ;**NEW**
    120	000116	012602 				MOV	(SP)+,R2	; RESTORE R2                                    ;**NEW**
    121	000120					RETURN			; ENTER CALLER'S ROUTINE                        ;**NEW**
    122					                                                                                ;**NEW**
    123					;                                                                               ;**NEW**
    124					; LOAD REQUEST ERROR                                                            ;**NEW**
    125					;                                                                               ;**NEW**
    126					                                                                                ;**NEW**
    127	000122				70$:				;                                               ;**NEW**
    128	000122	013703 	000000G			MOV	@#N.OVPT,R3	; GET WORK AREA VECTOR                          ;**NEW**
    129	000126					CALL	@N.ALER(R3)	; CALL ERROR RECOVERY ROUTINE                   ;**NEW**
    130	000132	000744 				BR	20$		; RETRY LOAD REQUEST                            ;**NEW**
    131					                                                                                ;**-49
    132		000001 				.END
AUTO	MACRO M1108  05-DEC-77 23:40  PAGE 3-3
SYMBOL TABLE

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

. ABS.	000172	   000
      	000000	   001
$$AUTO	000134	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1153 WORDS  ( 5 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[46,10]AUTO,[46,20]AUTO/-SP=[46,30]MACFLM.,SEGDF.005,AUTO.007
BDBREC 0100MS, SET BUF DESCRIPT	MACRO M1108  05-DEC-77 22:05  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
BDBREC 0100MS, SET BUF DESCRIPT	MACRO M1108  05-DEC-77 22:05  PAGE 7


						.TITLE	BDBREC 0100MS, SET BUF DESCRIPTOR AND REC POINTERS
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					; COPYRIGHT 1973, DIGITAL EQUIPMENT CORP., MAYNARD MASS.
      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					; PETER H. LIPMAN 16-AUG-73
     20					;
     21					;+
     22					; SET BUFFER DESCRIPTOR AND RECORD POINTERS FOR NEXT VBN
     23					; CALLING SEQUENCE
     24					;	CALL	..BDRC
     25					; INPUTS:
     26					;	R0=FDB
     27					;	R1=BUFFER DESCRIPTOR
     28					; OUTPUTS:
     29					;	R0,R2-R5 PRESERVED R1 ALTERED
     30					;	B.VBN,B.BBFS,F.NREC,F.EOBB SET UP
     31					;-
     32	000000				..BDRC::
     33	000000	016061 	000000G	000000G		MOV	F.VBN(R0),B.VBN(R1)
     34	000006	016061 	000002G	000002G		MOV	F.VBN+2(R0),B.VBN+2(R1)
     35	000014	016061 	000000G	000000G		MOV	F.BBFS(R0),B.BBFS(R1)
     36	000022	062701 	000000G			ADD	#S.BFHD,R1
     37	000026	010160 	000000G			MOV	R1,F.NREC(R0)
     38	000032	132760 	000000G	000000G		BITB	#FD.REC,F.RCTL(R0) ;IF RECORD ORIENTED
     39	000040	001403 				BEQ	10$
     40	000042	066001 	000000G			ADD	F.BBFS(R0),R1	;USE BUFFER SIZE
     41	000046	000402 				BR	20$
     42	000050	066001 	000000G		10$:	ADD	F.VBSZ(R0),R1	;OTHERWISE USE VB SIZE
     43	000054	010160 	000000G		20$:	MOV	R1,F.EOBB(R0)
     44	000060					RETURN
     45					;
     46					;
     47	000062					$END	BDBREC
     48					;
     49					;
     50		000001 				.END
BDBREC 0100MS, SET BUF DESCRIPT	MACRO M1108  05-DEC-77 22:05  PAGE 7-1
SYMBOL TABLE

BD.FRE= 000001   	F.BBFS= ****** GX	HA.UI = 000001   	PP.SEP= 000002   	R$$SEQ= 000000
B.BBFS= ****** GX	F.EOBB= ****** GX	HA.VER= 000007   	PP.ZER= 000001   	R$$SPL= 000000
B.VBN = ****** GX	F.NREC= ****** GX	NB.DOT= 100000   	R$$ANI= 000000   	R$$11M= 000001
DIRTYP= 015172   	F.RCTL= ****** GX	NB.SMI= 040000   	R$$BBF= 000000   	SYDEV = 054523
FCSEFN= 000040   	F.VBN = ****** GX	N.DRPT= 000006   	R$$DPB= 000001   	SYUNIT= 000000
FD.DVR= 000020   	F.VBSZ= ****** GX	N.DRSZ= 000004   	R$$EIS= 000000   	S.BFHD= ****** GX
FD.EFB= 000004   	HA.CHU= 000003   	N.DVPT= 000002   	R$$LCL= 000000   	WI.DLK= 000002
FD.EF1= 000010   	HA.FP = 000002   	N.DVSZ= 000000   	R$$MUL= 000000   	WI.LCK= 000001
FD.EOF= 000002   	HA.NAM= 000005   	N.FNPT= 000012   	R$$OPF= 000000   	..BDRC  000000RG
FD.REC= ****** GX	HA.TYP= 000006   	N.FNSZ= 000010   	R$$RSL= 000000   	...CTL= 000001
FD.WRT= 000001   	HA.UAT= 000004

. ABS.	000000	   000
      	000062	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2575 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[41,10]BDBREC,[41,20]BDBREC/-SP=[41,30]FCSPRE,BDBREC
BIGBUF 0100MS, INMBB, RSTEOF - 	MACRO M1108  05-DEC-77 22:06  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
BIGBUF 0100MS, INMBB, RSTEOF - 	MACRO M1108  05-DEC-77 22:06  PAGE 7


						.TITLE	BIGBUF 0100MS, INMBB, RSTEOF - BIG BUFFER ROUTINES
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 16-AUG-73
     21					;
BIGBUF 0100MS, INMBB, RSTEOF - 	MACRO M1108  05-DEC-77 22:06  PAGE 8


     23						.IF	GT,R$$BBF	;BUFFERS GREATER THAN 1 BLOCK
     24					;+
     25					; IS THE SPECIFIED VBN IN THE CURRENT BLOCK BUFFER
     26					; CALLING SEQUENCE:
     27					;	CALL	INMBB
     28					; INPUTS:
     29					;	R0=FDB
     30					;	F.VBN(R0)=DESIRED VBN
     31					; ALTERNATE ENTRY POINT:
     32					;	CALL	INMBB1
     33					; INPUTS:
     34					;	R0=FDB
     35					;	R4,R5=DESIRED VBN
     36					; OUTPUTS:
     37					;	R0-R3 PRESERVED R4-R5 ALTERED
     38					;	C=0 IF VBN IS IN BLOCK BUFFER IN WHICH CASE
     39					;	F.NREC F.EOBB SET TO POINT INTO BUFFER.
     40					;	C=1 IF VBN IS NOT IN BLOCK BUFFER
     41					;-
     42					INMBB::	MOV	F.VBN(R0),R4
     43						MOV	F.VBN+2(R0),R5
     44					; R4,R5=VBN TO CHECK TO SEE IF IT IS IN CURRENT BLOCK BUFFER
     45					INMBB1::MOV	R1,-(SP)
     46						MOV	F.BDB(R0),R1
     47						SUB	B.VBN+2(R1),R5
     48						SBC	R4
     49						BCS	30$		;BRANCH IF NOT IN RANGE
     50						SUB	B.VBN(R1),R4
     51						BNE	40$
     52						MOVB	F.BGBC(R0),R4
     53						CMP	R5,R4
     54						BHIS	40$
     55						MUL	F.VBSZ(R0),R5
     56						ADD	F.BDB(R0),R5
     57						ADD	#S.BFHD,R5
     58						MOV	R5,F.NREC(R0)
     59						ADD	F.VBSZ(R0),R5
     60						MOV	R5,F.EOBB(R0)
     61						CLC
     62					30$:	MOV	(SP)+,R1
     63						RETURN
     64					40$:	SEC
     65						BR	30$
     66						.ENDC
     67						.IF	GT,R$$BBF
     68					;+
     69					; RESET EOF ERROR
     70					; CALLING SEQUENCE:
     71					;	CALL	RSTEOF
     72					; INPUTS:
     73					;	R0=FDB
     74					;	R1=I/O STATUS BLOCK ADDRESS
     75					; OUTPUTS:
     76					;	C=0 IF NO ERORR, C=1 IF ERROR
     77					;	ALL REGISTERS PRESERVED
     78					;	I/O STATUS RESET TO 1 IF WAS IE.EOF.
     79					;	ALSO F.ERR (R0) IS RESET TO 1
BIGBUF 0100MS, INMBB, RSTEOF - 	MACRO M1108  05-DEC-77 22:06  PAGE 8-1


     80					;-
     81					RSTEOF::
     82						CMPB	#IE.EOF,@R1
     83						BNE	10$
     84						BITB	#FD.BGB,F.MBFG(R0)
     85						BEQ	10$
     86						MOVB	#1,@R1
     87						MOV	#1,F.ERR(R0)
     88					10$:	CALLR	..FCSX
     89						.ENDC
     90					;
     91					;
     92	000000					$END	BIGBUF
     93					;
     94					;
     95		000001 				.END
BIGBUF 0100MS, INMBB, RSTEOF - 	MACRO M1108  05-DEC-77 22:06  PAGE 8-2
SYMBOL TABLE

BD.FRE= 000001   	HA.FP = 000002   	N.DRPT= 000006   	R$$ANI= 000000   	R$$SEQ= 000000
DIRTYP= 015172   	HA.NAM= 000005   	N.DRSZ= 000004   	R$$BBF= 000000   	R$$SPL= 000000
FCSEFN= 000040   	HA.TYP= 000006   	N.DVPT= 000002   	R$$DPB= 000001   	R$$11M= 000001
FD.DVR= 000020   	HA.UAT= 000004   	N.DVSZ= 000000   	R$$EIS= 000000   	SYDEV = 054523
FD.EFB= 000004   	HA.UI = 000001   	N.FNPT= 000012   	R$$LCL= 000000   	SYUNIT= 000000
FD.EF1= 000010   	HA.VER= 000007   	N.FNSZ= 000010   	R$$MUL= 000000   	WI.DLK= 000002
FD.EOF= 000002   	NB.DOT= 100000   	PP.SEP= 000002   	R$$OPF= 000000   	WI.LCK= 000001
FD.WRT= 000001   	NB.SMI= 040000   	PP.ZER= 000001   	R$$RSL= 000000   	...CTL= 000001
HA.CHU= 000003

. ABS.	000000	   000
      	000000	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2509 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[41,10]BIGBUF,[41,20]BIGBUF/-SP=[41,30]FCSPRE,BIGBUF
BKRG 0100MS, SET UP REGISTERS F	MACRO M1108  05-DEC-77 22:06  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
BKRG 0100MS, SET UP REGISTERS F	MACRO M1108  05-DEC-77 22:06  PAGE 7


						.TITLE	BKRG 0100MS, SET UP REGISTERS FOR ..RBLK, ..WBLK
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 21-AUG-73
     21					;
     22					; SET UP REGISTERS FOR ..RBLK,..WBLK USING THE
     23					; BLOCK BUFFER DEFINITION IN THE FDB
     24	000000	016001 	000000G		..BKRG::MOV	F.BDB(R0),R1	;ADDRESS OF I/O STATUS BLOCK
     25	000004	062701 	000000G			ADD	#S.BFHD,R1	;CALCULATE BUFFER ADDRESS
     26	000010	016002 	000000G			MOV	F.BBFS(R0),R2	;BLOCK BUFFER SIZE
     27	000014	005003 				CLR	R3		;NO CARRIAGE CONTROL
     28	000016					RETURN
     29					;
     30					;
     31	000020					$END	BKRG
     32					;
     33					;
     34		000001 				.END
BKRG 0100MS, SET UP REGISTERS F	MACRO M1108  05-DEC-77 22:06  PAGE 7-1
SYMBOL TABLE

BD.FRE= 000001   	F.BDB = ****** GX	NB.SMI= 040000   	R$$ANI= 000000   	R$$SPL= 000000
DIRTYP= 015172   	HA.CHU= 000003   	N.DRPT= 000006   	R$$BBF= 000000   	R$$11M= 000001
FCSEFN= 000040   	HA.FP = 000002   	N.DRSZ= 000004   	R$$DPB= 000001   	SYDEV = 054523
FD.DVR= 000020   	HA.NAM= 000005   	N.DVPT= 000002   	R$$EIS= 000000   	SYUNIT= 000000
FD.EFB= 000004   	HA.TYP= 000006   	N.DVSZ= 000000   	R$$LCL= 000000   	S.BFHD= ****** GX
FD.EF1= 000010   	HA.UAT= 000004   	N.FNPT= 000012   	R$$MUL= 000000   	WI.DLK= 000002
FD.EOF= 000002   	HA.UI = 000001   	N.FNSZ= 000010   	R$$OPF= 000000   	WI.LCK= 000001
FD.WRT= 000001   	HA.VER= 000007   	PP.SEP= 000002   	R$$RSL= 000000   	..BKRG  000000RG
F.BBFS= ****** GX	NB.DOT= 100000   	PP.ZER= 000001   	R$$SEQ= 000000   	...CTL= 000001

. ABS.	000000	   000
      	000020	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2529 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[41,10]BKRG,[41,20]BKRG/-SP=[41,30]FCSPRE,BKRG
CATB	MACRO M1108  05-DEC-77 23:41  PAGE 2


      1						.TITLE	CATB
      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					;                                                                               ;**-11
     22					; D.N. CUTLER 22-AUG-72
     23					;                                                                               ;**NEW**
     24					;                                                                               ;**NEW**
     25					; MODIFICATIONS                                                                 ;**NEW**
     26					;                                                                               ;**NEW**
     27					; NO.		DATE		PROGRAMMER                                      ;**NEW**
     28					; ---		----		----------                                      ;**NEW**
     29					;                                                                               ;**NEW**
     30					; 019		07-JAN-74	C. MONIA                                        ;**NEW**
     31					;                                                                               ;**NEW**
     32					;
     33					; ASCII TO BINARY CONVERSION ROUTINES
     34					;
     35					                                                                                ;**-4
     36					;+
     37					; **-$CDTB-CONVERT DECIMAL TO BINARY
     38					; **-$COTB-CONVERT OCTAL TO BINARY
     39					;
     40					; INPUTS:
     41					;
     42					;	R0=ADDRESS OF NEXT BYTE IN INPUT BUFFER.
     43					;
     44					; OUTPUTS:
     45					;
     46					;		R0=ADDRESS OF NEXT BYTE IN INPUT BUFFER.
     47					;		R1=CONVERTED NUMBER.
     48					;		R2=TERMINAL CHARACTER.
     49					;-
     50
     51	000000				$CDTB::				;                                               ;**NEW**
     52	000000	012702 	000012 			MOV	#10.,R2		;SET BASE 10. CONVERSION RADIX                  ;**-1
     53	000004	000402 				BR	COTB		;
     54	000006				$COTB::				;                                               ;**NEW**
     55	000006	012702 	000010 			MOV	#8.,R2		;SET BASE 8. CONVERSION RADIX                   ;**-1
     56	000012				COTB:	SAVRG			;SAVE NONVOLITILE REGISTERS
     57	000016	005001 				CLR	R1		;CLEAR ACCUMULATED VALUE
CATB	MACRO M1108  05-DEC-77 23:41  PAGE 2-1


     58	000020	112005 			1$:	MOVB	(R0)+,R5	;GET NEXT BYTE
     59	000022	122705 	000040 			CMPB	#' ,R5		;BLANK?
     60	000026	001774 				BEQ	1$		;IF EQ YES
     61	000030	122705 	000011 			CMPB	#HT,R5		;HT?
     62	000034	001771 				BEQ	1$		;IF EQ YES
     63	000036				2$:				;                                               ;**NEW**
     64	000036	162705 	000060 			SUB	#'0,R5		;++019 SUBTRACT CHARACTER BIAS                  ;**NEW**
     65	000042	120502 				CMPB	R5,R2		;++019 CHECK AGAINST BASE                       ;**NEW**
     66	000044	103010 				BHIS	3$		;++019 IF HIS OUT OF RANGE                      ;**NEW**
     67					                                                                                ;**NEW**
     68						.IF	DF	V1145                                                   ;**NEW**
     69					                                                                                ;**NEW**
     70						MUL	R2,R1		;++019 MULTIPLY RESULT BY BASE                  ;**NEW**
     71					                                                                                ;**NEW**
     72						.IFF                                                                    ;**NEW**
     73					                                                                                ;**NEW**
     74	000046	010004 				MOV	R0,R4		;++019 SAVE STRING POINTER                      ;**NEW**
     75	000050	010200 				MOV	R2,R0		;++019 SET MULTIPLICAND                         ;**NEW**
     76	000052					CALL	$MUL		;++019 MULTIPLY EM UP                           ;**NEW**
     77	000056	010400 				MOV	R4,R0		;++019 RESTORE POINTER                          ;**NEW**
     78					                                                                                ;**NEW**
     79						.ENDC                                                                   ;**NEW**
     80					                                                                                ;**NEW**
     81	000060	060501 				ADD	R5,R1		;++019 ACCUMULATE RESULT                        ;**NEW**
     82	000062	112005 				MOVB	(R0)+,R5	;++019 FETCH NEXT CHARACTER                     ;**NEW**
     83	000064	000764 				BR	2$		;++019 GO AGAIN                                 ;**NEW**
     84	000066				3$:				;++019                                          ;**NEW**
     85	000066	116002 	177777 			MOVB	-1(R0),R2	;++019 GET TERMINAL CHARACTER                   ;**NEW**
     86	000072					RETURN                                                                  ;**NEW**
     87					                                                                                ;**-29
     88		000001 				.END
CATB	MACRO M1108  05-DEC-77 23:41  PAGE 2-2
SYMBOL TABLE

COTB    000012R  	HT    = 000011   	SPA   = 000040   	$COTB   000006RG 	$SAVRG= ****** GX
CR    = 000015   	LF    = 000012   	VT    = 000013   	$MUL  = ****** GX	$$    = 000001
FF    = 000014   	R$$11M= 000000   	$CDTB   000000RG

. ABS.	000000	   000
      	000074	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  562 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
[46,10]CATB,[46,20]CATB/-SP=[46,30]MACFLM.,CATB.003
CAT2B - CONVERT FROM ASCII TO T	MACRO M1108  05-DEC-77 23:44  PAGE 2


      1						.TITLE	CAT2B - CONVERT FROM ASCII TO TWO BINARY WORDS
      2
      3						.IDENT	"V0102"
      4					;
      5					;
      6					; COPYRIGHT (C)   1975,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					; COPYRIGHT (C)   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
     22					;
     23					; ANDREW C. GOLDSTEIN  28 JUN 1974
     24					;
     25						.MCALL	RETURN
CAT2B - CONVERT FROM ASCII TO T	MACRO M1108  05-DEC-77 23:44  PAGE 3


     27					;+
     28					;
     29					; *** - $CDT2B - CONVERT A DECIMAL NUMBER TO TWO BINARY WORDS.
     30					;		 THIS SUBROUTINE CONVERTS AN ASCII DECIMAL NUMBER STRING
     31					;		 TO A DOUBLE LENGTH BINARY NUMBER.
     32					;
     33					; *** - $COT2B - CONVERT AN OCTAL NUMBER TO TWO BINARY WORDS.
     34					;		 THIS SUBROUTINE CONVERTS AN ASCII OCTAL NUMBER STRING
     35					;		 TO A DOUBLE LENGTH BINARY NUMBER.
     36					;
     37					; INPUT:
     38					;	R0 - ADDRESS OF NEXT CHARACTER IN BUFFER (DIGIT)
     39					;	R1 - ADDRESS OF TWO WORD FIELD TO HOLD CONVERTED NUMBER
     40					;		WORD 1 - HIGH ORDER 16 BITS
     41					;		WORD 2 - LOW ORDER 16 BITS
     42					;
     43					; OUTPUT:
     44					;	R0 - UPDATED BUFFER POINTER (NEXT CHARACTER + 1)
     45					;	R1 - REMAINS UNCHANGED
     46					;	R2 - NEXT CHARACTER IN STRING
     47					;
     48					;	CC-C
     49					;	     CLEAR - 16 BIT NUMBER ONLY
     50					;	     SET   - 32 BIT NUMBER
     51					;
     52					; ALL OTHER REGISTERS ARE PRESERVED
     53					;
     54					;-
     55
     56						.ENABL	LSB
     57
     58	000000	012746 	000007 		$COT2B::MOV	#7.,-(SP)	; SET UP FOR OCTAL CONVERT
     59	000004	000402 				BR	10$
     60
     61	000006	012746 	000011 		$CDT2B::MOV	#9.,-(SP)	; SET UP FOR DECIMAL CONVERT
     62
     63	000012	005021 			10$:	CLR	(R1)+		; ZERO HIGH ORDER 16 BITS
     64	000014	005011 				CLR	(R1)		; ZERO LOW ORDER 16 BITS
     65
     66	000016	112002 			20$:	MOVB	(R0)+,R2	; GET NEXT CHARACTER
     67	000020	162702 	000060 			SUB	#'0,R2		; CONVERT DIGIT TO VALUE
     68	000024	103430 				BLO	50$		; NOT A LEGAL DIGIT CHARACTER
     69
     70	000026	020216 				CMP	R2,(SP)		; LAST CHANCE TO BE IN RANGE
     71	000030	101026 				BHI	50$		; DEFINITELY NOT LEGAL
     72	000032	006311 				ASL	(R1)		; MULTIPLY CURRENT BINARY NUMBER BY 2
     73	000034	006141 				ROL	-(R1)		; USE FULL 32 BIT ACCURACY
     74	000036	012146 				MOV	(R1)+,-(SP)	; SAVE HIGH ORDER BITS
     75	000040	011146 				MOV	(R1),-(SP)	; SAVE LOW ORDER BITS
     76	000042	006311 				ASL	(R1)		; MULTIPLY AGAIN BY 2
     77	000044	006141 				ROL	-(R1)		; KEEP THOSE BITS MOVING
     78	000046	006361 	000002 			ASL	2(R1)		; MAKE TOTAL MULTIPLICATION BY 8
     79	000052	006121 				ROL	(R1)+		; NOW HAVE (NEW NUMBER) = (OLD NUMBER)*8
     80
     81	000054	026627 	000004 	000011 		CMP	4(SP),#9.	; CHECK WHAT RADIX WE'RE IN
     82	000062	001402 				BEQ	30$		; EQUAL IF DECIMAL
     83	000064	022626 				CMP	(SP)+,(SP)+	; OCTAL - THROW AWAY (OLD NUMBER)*2
CAT2B - CONVERT FROM ASCII TO T	MACRO M1108  05-DEC-77 23:44  PAGE 3-1


     84	000066	000403 				BR	40$
     85
     86	000070	062611 			30$:	ADD	(SP)+,(R1)	; ADD BACK (OLD NUMBER)*2
     87	000072	005541 				ADC	-(R1)		; ADD ANY OVERFLOW TO HIGH ORDER
     88	000074	062621 				ADD	(SP)+,(R1)+	; NOW HAVE (NEW NUMBER) = (OLD NUMBER)*10
     89
     90	000076	060211 			40$:	ADD	R2,(R1)		; ADD THIS DIGIT TO MAKE NEW TOTAL
     91	000100	005561 	177776 			ADC	-2(R1)		; MAKE SURE OVERFLOW IS CONSIDERED
     92	000104	000744 				BR	20$		; GO GET NEXT DIGIT
     93
     94	000106	005726 			50$:	TST	(SP)+		; THROW AWAY RADIX VALUE
     95	000110	062702 	000060 			ADD	#'0,R2		; RESTORE CHARACTER IN R2
     96	000114	005741 				TST	-(R1)		; MORE THAN 16 BITS IN CONVERTED NUMBER?
     97	000116	001401 				BEQ	60$		; YES
     98	000120	000261 				SEC			; NO, SO SET THE 32-BIT FLAG
     99	000122				60$:	RETURN			; RETURN TO CALLER
    100
    101						.DSABL	LSB
    102
    103		000001 				.END
CAT2B - CONVERT FROM ASCII TO T	MACRO M1108  05-DEC-77 23:44  PAGE 3-2
SYMBOL TABLE

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

. ABS.	000000	   000
      	000124	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  542 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
[46,10]CAT2B,[46,20]CAT2B/-SP=[46,30]MACFLM.,CAT2B
CAT5	MACRO M1108  05-DEC-77 23:41  PAGE 2


      1						.TITLE	CAT5
      2						.IDENT	/02/							;**NEW**
      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 02                                                                   ;**NEW**
     20					;
     21					; D. N. CUTLER/C. MONIA 13-MAY-74
     22					;
     23					; ASCII TO RAD50 CONVERSION ROUTINE
     24					;
     25					; LOCAL DATA
     26					;
     27
     28	000000	   132 	   101 	   071 	CNTRL:	.BYTE	'Z,'A,'9,'0,'$,' ,'. ;CONTROL BYTE STRING
	000003	   060 	   044 	   040
	000006	   056
     29
     30						.EVEN
     31
     32	000010	003100 			CVTBL:	.WORD	50*50		;RAD50 PACK MULTIPLICATION
     33	000012	000050 				.WORD	50		;
     34	000014	000001 				.WORD	1		;
     35
     36					;+
     37					; **-$CAT5-CONVERT ASCII TO RAD50
     38					;
     39					; INPUTS:
     40					;
     41					;	R0=ADDRESS OF NEXT CHARACTER IN INPUT BUFFER.
     42					;	R1=PERIOD DISPOSITION FLAG.
     43					;		IF R1 EQ 0, THEN PERIOD IS A TERMINATOR.
     44					;		IF R1 NE 0, THEN PERIOD IS A RAD50 CHARACTER.
     45					;
     46					; OUTPUTS:
     47					;
     48					;	C=1 IF SCAN WAS TERMINATED BY A NON-RAD50 CHARACTER.
     49					;	C=0 IF THREE RAD50 CHARACTERS WERE CONVERTED.
     50					;	NOTE: IF EITHER CASE THE FOLLOWING VALUES ARE RETURNED.
     51					;		R0=ADDRESS OF NEXT CHARACTER IN INPUT BUFFER.
     52					;		R1=PACKED RAD50 CHARACTERS.
     53					;		R2=TERMINAL CHARACTER.
     54					;-
     55
CAT5	MACRO M1108  05-DEC-77 23:41  PAGE 2-1


     56	000016				$CAT5::	SAVRG			;SAVE NONVOLITILE REGISTERS
     57	000022	010146 				MOV	R1,-(SP)	;SAVE PERIOD DISPOSITION FLAG
     58	000024	005001 				CLR	R1		;CLEAR ACCUMULATION
     59	000026	012703 	000010'			MOV	#CVTBL,R3	;GET ADDRESS OF CONVERSION TABLE
     60	000032	112005 			10$:	MOVB	(R0)+,R5	;GET NEXT CHARACTER
     61	000034	012704 	000000'			MOV	#CNTRL,R4	;GET ADDRESS OF CONTROL STRING
     62	000040	122405 				CMPB	(R4)+,R5	;RAD50 CHARACTER?
     63	000042	103446 				BLO	60$		;IF LO NO
     64	000044	122405 				CMPB	(R4)+,R5	;ALPHABETIC?
     65	000046	101423 				BLOS	50$		;IF LOS YES
     66	000050	122405 				CMPB	(R4)+,R5	;RAD50 CHARACTER?
     67	000052	103442 				BLO	60$		;IF LO NO
     68	000054	122405 				CMPB	(R4)+,R5	;NUMERIC?
     69	000056	101415 				BLOS	40$		;IF LOS YES
     70	000060					JOL	30$		;"$" SIGN?
     71	000064					JOL	60$		;"SPACE"?
     72	000070	005716 				TST	(SP)		;PERIOD RAD50 CHARACTER?
     73	000072	001432 				BEQ	60$		;IF EQ NO
     74	000074					JOL	40$		;"."?
     75	000100	000427 				BR	60$		;
     76	000102	162705 	000027 		20$:	SUB	#' -11,R5	;SPACE
     77	000106	162705 	177767 		30$:	SUB	#11-22,R5	;"$"
     78	000112	162705 	177722 		40$:	SUB	#22-100,R5	;PERIOD/DIGIT
     79	000116	162705 	000100 		50$:	SUB	#100,R5		;ALPHABETIC
     80
     81
     82						.IF	DF	V1145
     83
     84						MUL	(R3)+,R5	;SCALE RAD50 CHARACTER
     85
     86						.ENDC
     87
     88
     89						.IF	NDF	V1145
     90
     91	000122	010046 				MOV	R0,-(SP)	;SAVE NEXT BYTE ADDRESS
     92	000124	012300 				MOV	(R3)+,R0	;GET CONVERSION CONSTANT
     93	000126	010146 				MOV	R1,-(SP)	;SAVE ACCUMULATION
     94	000130	010501 				MOV	R5,R1		;SET MULTIPLIER
     95	000132					CALL	$MUL		;SCALE RAD50 CHARACTER
     96	000136	010105 				MOV	R1,R5		;RESULT TO R5
     97	000140	012601 				MOV	(SP)+,R1	;RETRIEVE PREVIOUS ACCUMULATION
     98	000142	012600 				MOV	(SP)+,R0	;RETRIEVE NEXT BYTE ADDRESS
     99
    100						.ENDC
    101
    102
    103	000144	060501 				ADD	R5,R1		;ACCUMULATE RESULT
    104	000146	020327 	000016'			CMP	R3,#CVTBL+6	;CONVERTED THREE YET?
    105	000152	103727 				BLO	10$		;IF LO NO
    106	000154	005726 				TST	(SP)+		;CLEAN STACK-CLEAR CARRY
    107	000156	000402 				BR	70$		;
    108	000160	005726 			60$:	TST	(SP)+		;CLEAN STACK
    109	000162	000261 				SEC			;SET CARRY
    110	000164	116002 	177777 		70$:	MOVB	-1(R0),R2	;GET TERMINAL CHARACTER
    111	000170					RETURN			;
    112
CAT5	MACRO M1108  05-DEC-77 23:41  PAGE 2-2


    113		000001 				.END
CAT5	MACRO M1108  05-DEC-77 23:41  PAGE 2-3
SYMBOL TABLE

CNTRL   000000R  	FF    = 000014   	R$$11M= 000000   	$CAT5   000016RG 	$SAVRG= ****** GX
CR    = 000015   	HT    = 000011   	SPA   = 000040   	$MUL  = ****** GX	$$    = 000001
CVTBL   000010R  	LF    = 000012   	VT    = 000013

. ABS.	000000	   000
      	000172	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  587 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
[46,10]CAT5,[46,20]CAT5/-SP=[46,30]MACFLM.,CAT5.002
CBTA	MACRO M1108  05-DEC-77 23:41  PAGE 2


      1						.TITLE	CBTA
      2						.IDENT	/03/                                                            ;**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 03                                                                    ;**NEW**
     20					;                                                                               ;**-1
     21					; D. N. CUTLER/C. MONIA 06-APR-74
     22					;                                                                               ;**NEW**
     23					; MODIFICATIONS:                                                                ;**NEW**
     24					;                                                                               ;**NEW**
     25					; NO.		DATE		PROGRAMMER                                      ;**NEW**
     26					; ---		----		----------                                      ;**NEW**
     27					;                                                                               ;**NEW**
     28					; 030		07-JAN-75	C. MONIA                                        ;**NEW**
     29					;                                                                               ;**NEW**
     30					;+
     31					; **-$CBDAT-CONVERT DATE TO TWO DIGIT DECIMAL MAGNITUDE
     32					; **-$CBDMG-CONVERT BINARY TO DECIMAL MAGNITUDE
     33					; **-$CBDSG-CONVERT BINARY TO DECIMAL SIGNED
     34					; **-$CBOMG-CONVERT BINARY TO OCTAL MAGNITUDE
     35					; **-$CBOSG-CONVERT BINARY TO OCTAL SIGNED
     36					; **-$CBTMG-CONVERT BINARY BYTE TO OCTAL MAGNITUDE                              ;**NEW**
     37					;
     38					; INPUTS:
     39					;
     40					;	R0=ADDRESS TO STORE FIRST BYTE IN OUTPUT STRING.
     41					;	R1=NUMBER TO BE CONVERTED.
     42					;	R2=ZERO SUPPRESSION INDICATOR.
     43					;		IF R2 EQ 0, THEN SUPPRESS ZEROS.
     44					;		IF R2 NE 0, THEN DO NOT SUPPRESS ZEROS.
     45					;
     46					; OUTPUTS:
     47					;
     48					;	R0=ADDRESS OF NEXT BYTE AFTER LAST DIGIT STORED.
     49					;-
     50
     51	000000				$CBTMG::			;                                               ;**NEW**
     52	000000					SAVRG			;++030 SAVE NONVOLATILE REGISTERS               ;**NEW**
     53	000004	042701 	177400 			BIC	#177400,R1	;++030 CLEAR HIGH BYTE                          ;**NEW**
     54	000010	012703 	000003 			MOV	#3,R3		;++030 SET MAXIMUM DIGITS                       ;**NEW**
     55	000014	000432 				BR	CBOM1		;++030                                          ;**NEW**
     56	000016				$CBDAT::			;
     57	000016					SAVRG			; SAVE NONVOLATILE REGISTERS
CBTA	MACRO M1108  05-DEC-77 23:41  PAGE 2-1


     58	000022	012703 	000002 			MOV	#2,R3		; SET MAXIMUM DIGITS
     59	000026	000411 				BR	CBD		;
     60	000030	005701 			$CBDSG::TST	R1		;NEGATIVE NUMBER?
     61	000032	100003 				BPL	$CBDMG		;IF PL NO
     62	000034	112720 	000055 			MOVB	#'-,(R0)+	;INSERT A MINUS SIGN
     63	000040	005401 				NEG	R1		;MAKE VALUE POSITIVE
     64	000042				$CBDMG::SAVRG			;SAVE NONVOLITILE REGISTERS
     65	000046	012703 	000005 			MOV	#5,R3		;SET MAXIMUM DIGITS
     66	000052				CBD:				;
     67	000052	012705 	000012 			MOV	#10.,R5		;SET BASE 10. CONVERSION RADIX
     68	000056	000413 				BR	CBO		;
     69	000060	005701 			$CBOSG::TST	R1		;NEGATIVE NUMBER?
     70	000062	100003 				BPL	$CBOMG		;IF PL NO
     71	000064	112720 	000055 			MOVB	#'-,(R0)+	;INSERT A MINUS SIGN
     72	000070	005401 				NEG	R1		;MAKE VALUE POSITIVE
     73	000072				$CBOMG::SAVRG			;SAVE NONVOLITILE REGISTERS
     74	000076	012703 	000006 			MOV	#6,R3		;SET MAXIMUM DIGITS
     75	000102				CBOM1:				;++030                                          ;**NEW**
     76	000102	012705 	000010 			MOV	#8.,R5		;SET BASE 8. CONVERSION RADIX
     77	000106	010004 			CBO:	MOV	R0,R4		;SAVE NEXT BYTE ADDRESS
     78	000110	010100 				MOV	R1,R0		;DIVIDEND TO R0
     79
     80
     81						.IF	DF	V1145
     82
     83					1$:	MOV	R0,R1		;DIVIDEND TO R1
     84						CLR	R0		;CLEAR HIGH PART
     85						DIV	R5,R0		;DIVIDE EM UP
     86
     87						.ENDC
     88
     89
     90						.IF	NDF	V1145
     91
     92	000112	010501 			1$:	MOV	R5,R1		;SET CONVERSION RADIX
     93	000114					CALL	$DIV		;DIVIDE EM UP
     94
     95						.ENDC
     96
     97
     98	000120	010146 				MOV	R1,-(SP)	;SAVE REMAINDER
     99	000122	005303 				DEC	R3		;ANY DIGITS LEFT?
    100	000124	003406 				BLE	3$		;IF LE NO
    101	000126	005702 				TST	R2		;COMPRESS ZEROS?
    102	000130	001002 				BNE	2$		;IF NE NO
    103	000132	005700 				TST	R0		;ZERO QUOTIENT?
    104	000134	001402 				BEQ	3$		;IF EQ ALL DONE
    105	000136				2$:	CALL	1$		;DIVIDE AGAIN
    106	000142	062716 	000060 		3$:	ADD	#'0,(SP)	;ADD CHARACTER BIAS
    107	000146	112624 				MOVB	(SP)+,(R4)+	;STORE A DIGIT
    108	000150	010400 				MOV	R4,R0		;STORE TERMINAL ADDRESS
    109	000152					RETURN			;
    110
    111		000001 				.END
CBTA	MACRO M1108  05-DEC-77 23:41  PAGE 2-2
SYMBOL TABLE

CBD     000052R  	FF    = 000014   	SPA   = 000040   	$CBDSG  000030RG 	$DIV  = ****** GX
CBO     000106R  	HT    = 000011   	VT    = 000013   	$CBOMG  000072RG 	$SAVRG= ****** GX
CBOM1   000102R  	LF    = 000012   	$CBDAT  000016RG 	$CBOSG  000060RG 	$$    = 000001
CR    = 000015   	R$$11M= 000000   	$CBDMG  000042RG 	$CBTMG  000000RG

. ABS.	000000	   000
      	000154	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  587 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
[46,10]CBTA,[46,20]CBTA/-SP=[46,30]MACFLM.,CBTA.003
CKALOC 0103MS, ALLOCATE SPACE I	MACRO M1108  05-DEC-77 22:06  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
CKALOC 0103MS, ALLOCATE SPACE I	MACRO M1108  05-DEC-77 22:06  PAGE 7


						.TITLE	CKALOC 0103MS, ALLOCATE SPACE IF NECESSARY
						.IDENT	/0103MS/
      2					; ALTERED THURSDAY 2-MAY-74 14:40
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19
     20					;
     21					; PETER H. LIPMAN 11-AUG-73
     22					;
CKALOC 0103MS, ALLOCATE SPACE I	MACRO M1108  05-DEC-77 22:06  PAGE 8


     24					;+
     25					; ALLOCATE MORE FILE SPACE IF SPECIFIED VBN IS ABOVE HIBK
     26					; CALLING SEQUENCE
     27					;	CALL	..ALOC
     28					; INPUTS:
     29					;	R0=FDB
     30					;	F.EFBK(R0),F.EFBK+2(R0) CONTAINS SPECIFIED VBN
     31					; ALTERNATE ENTRY:
     32					;	CALL	..ALC1
     33					; INPUTS:
     34					;	R0=FDB
     35					;	R1,R2=SPECIFIED VBN
     36					; OUTPUTS:
     37					;	C=0 IF NO SPACE NEEDED OR ENOUGH SPACE WAS
     38					;	SUCCESSFULLY ALLOCATED NECESARY SPACE,
     39					;	C=1 IF FAILED TO ALOCATE NECESSARY SPACE
     40					;	F.ERR(R0) SET IF ERROR
     41					;	ALL REGISTERS PRESERVED
     42					; OPERATION:
     43					;	COMPARES SPECIFIED VBN AGAINST F.HIBK
     44					; TO SEE IF THE SPECIFIED BLOCK IS BEYOND THE END OF
     45					; ALLOCATED SPACE. IF IT IS, AN ATTEMPT IS MADE TO
     46					; EXTEND THE FILE. THE FOLLOWING ALGORITH IS USED. IF
     47					; THE SPACE NEEDED IS ONLY 1 BLOCK, INDICATING A SEQUENTAIL
     48					; WRITE GENRATION, THEN THE SYSTEM DEFAULT EXTENSION IS
     49					; REQUESTED. OTHERWISE THE NUMBER OF BLOCKS ALLOCATED IS
     50					; THE ADDITIONAL NUMBER NEEDED.
     51					;-
     52	000000	026060 	000000G	000000G	..ALOC::CMP	F.EFBK(R0),F.HIBK(R0)
     53	000006	001003 				BNE	10$
     54	000010	026060 	000002G	000002G		CMP	F.EFBK+2(R0),F.HIBK+2(R0)
     55	000016	101426 			10$:	BLOS	CKALX1		;BRANCH IF EFBK <= HIBK
     56	000020	010146 				MOV	R1,-(SP)	;SET UP TO EXTEND FILE, SAVE R1,R2
     57	000022	010246 				MOV	R2,-(SP)
     58	000024	016001 	000000G			MOV	F.EFBK(R0),R1
     59	000030	016002 	000002G			MOV	F.EFBK+2(R0),R2
     60	000034					CALL	..EXTD
     61	000040	012602 				MOV	(SP)+,R2
     62	000042	012601 				MOV	(SP)+,R1
     63	000044	103355 				BCC	..ALOC		;BRANCH IF OK, SEE IF GOT ENOUGH
     64	000046					RETURN			;FAILED TO ALLOCATE ENOUGH SPACE
     65					;
     66	000050	020160 	000000G		..ALC1::CMP	R1,F.HIBK(R0)
     67	000054	001002 				BNE	10$
     68	000056	020260 	000002G			CMP	R2,F.HIBK+2(R0)
     69	000062	101404 			10$:	BLOS	CKALX1		;NO NEED TO EXTEND IF R1,R2 <= HIBK
     70	000064					CALL	..EXTD
     71	000070	103367 				BCC	..ALC1		;VERIFY THAT ENOUGH WAS ALLOCATED
     72	000072					RETURN			;FAILED  TO EXTEND FILE
     73					;
     74	000074	000241 			CKALX1:	CLC			;THERE'S ENOUGH ROOM
     75	000076					RETURN
CKALOC 0103MS, ALLOCATE SPACE I	MACRO M1108  05-DEC-77 22:06  PAGE 9


     77					; EXTEND THE FILE IF POSSIBLE
     78					; THIS ENTRY USED BY FCS INTERNALLY
     79	000100				..EXTD::.SAVR1			;SAVE REGISTER R1-R5
     80	000104	016004 	000000G			MOV	F.ALOC(R0),R4	;CLUSTER SIZE TO ALLOCATE?
     81	000110	001407 				BEQ	20$		;BRANCH IF NO
     82						.IF	EQ,R$$DPB
     83						MOV	#1,R1		;ASSUME CONTIGUOUS ALLOCATION
     84						.IFF
     85	000112	012701 	000201 			MOV	#200!1,R1	;ASSUME CONTIGUOUS ALLOCATION
     86						.ENDC
     87	000116	010402 				MOV	R4,R2		;R2=NO. OF BLOCKS
     88	000120	003015 				BGT	30$		;BRANCH IF CONTIGUOUS REQUEST
     89	000122	005402 				NEG	R2		;NEGATE TO GET NON CONTIG BLOCKS
     90	000124	005001 				CLR	R1		;INIDCATE NON-CONTIG ALLOCATION
     91	000126	000412 				BR	30$
     92	000130	166001 	000000G		20$:	SUB	F.HIBK(R0),R1	;CALCULATE SPACE NEEDED
     93	000134	166002 	000002G			SUB	F.HIBK+2(R0),R2
     94	000140	005601 				SBC	R1
     95	000142	001044 				BNE	EXTDX1		;BRANCH IF TOO MUCH SPACE REQUIRED
     96					; NOTE R1 CONTAINS ZERO AT THIS POINT AND IS USED BELOW
     97	000144	022702 	000001 			CMP	#1,R2		;IF NEED ONLY 1 BLOCK
     98	000150	002401 				BLT	..EXT1
     99	000152	005002 				CLR	R2		;USE SYSTEM DEFAULT ALLOCATION
    100	000154				30$:
    101	000154				..EXT1::CALL	..IDPB		;INIT DPB, SET R5 TO PARAM BLOCK
    102	000160	010015 				MOV	R0,(R5)
    103	000162	062725 	000000G			ADD	#F.FNB,(R5)+	;STORE FILE NAME BLOCK ADDRESS
    104						.IF	EQ,R$$DPB
    105						MOV	R2,(R5)+	;NO. OF BLOCKS TO ALLOCATE
    106						MOV	R1,(R5)+	;TYPE OF ALLOCATION
    107						.IFF
    108	000166	005025 				CLR	(R5)+		;CLEAR ATTRIBUTE LIST POINTER
    109	000170	000301 				SWAB	R1		;MOVE TYPE OF EXTEND TO HIGH BYTE
    110	000172	005701 				TST	R1
    111	000174	100407 				BMI	5$		;IF ENABLE BIT IS SET, ASSUME ITS OK
    112	000176	052701 	100000 			BIS	#100000,R1	;OTHERWISE FORCE THE ENABLE BIT
    113	000202	032701 	000400 			BIT	#1*400,R1	;AND IF EXTEND IS CONTIGUOUS
    114	000206	001402 				BEQ	5$
    115	000210	052701 	002000 			BIS	#4*400,R1	;SAY THAT FILE MUST BE TOO
    116	000214	010125 			5$:	MOV	R1,(R5)+	;AND SET EXTEND CONTROL BITS
    117	000216	010215 				MOV	R2,(R5)		;NOW SET THE SIZE CHANGE
    118	000220	001002 				BNE	10$		;A SIZE WAS SPECIFIED
    119	000222	152745 	000010 			BISB	#10,-(R5)	;NO SIZE, SO USE THE DEFAULT
    120	000226				10$:
    121						.ENDC
    122	000226	012704 	000000G			MOV	#IO.EXT,R4	;EXTEND FILE I/O FUNCTION CODE
    123	000232					CALL	..QIOW		;ISSUE THE EXTEND QI/O AND WAIT
    124	000236	103405 				BCS	20$		;BRANCH IF ERROR
    125	000240	066160 	000002 	000002G		ADD	2(R1),F.HIBK+2(R0) ;ADD ALLOCATED SPACE TO HIBK
    126	000246	005560 	000000G			ADC	F.HIBK(R0)	;CLEARS CARRY
    127	000252				20$:	RETURN
    128	000254	112760 	000000G	000000G	EXTDX1:	MOVB	#IE.NBK,F.ERR(R0) ;FAILED TO ALLOCATE REQUESTED SPACE
    129	000262	000261 				SEC
    130	000264					RETURN
    131					;
    132					;
    133	000266					$END	CKALOC
CKALOC 0103MS, ALLOCATE SPACE I	MACRO M1108  05-DEC-77 22:06  PAGE 9-1


    134					;
    135					;
    136		000001 				.END
CKALOC 0103MS, ALLOCATE SPACE I	MACRO M1108  05-DEC-77 22:06  PAGE 9-2
SYMBOL TABLE

BD.FRE= 000001   	F.ERR = ****** GX	NB.DOT= 100000   	R$$DPB= 000001   	WI.DLK= 000002
CKALX1  000074R  	F.FNB = ****** GX	NB.SMI= 040000   	R$$EIS= 000000   	WI.LCK= 000001
DIRTYP= 015172   	F.HIBK= ****** GX	N.DRPT= 000006   	R$$LCL= 000000   	$$    = 000067
EXTDX1  000254R  	HA.CHU= 000003   	N.DRSZ= 000004   	R$$MUL= 000000   	.SAVR1= ****** GX
FCSEFN= 000040   	HA.FP = 000002   	N.DVPT= 000002   	R$$OPF= 000000   	..ALC1  000050RG
FD.DVR= 000020   	HA.NAM= 000005   	N.DVSZ= 000000   	R$$RSL= 000000   	..ALOC  000000RG
FD.EFB= 000004   	HA.TYP= 000006   	N.FNPT= 000012   	R$$SEQ= 000000   	..EXTD  000100RG
FD.EF1= 000010   	HA.UAT= 000004   	N.FNSZ= 000010   	R$$SPL= 000000   	..EXT1  000154RG
FD.EOF= 000002   	HA.UI = 000001   	PP.SEP= 000002   	R$$11M= 000001   	..IDPB= ****** GX
FD.WRT= 000001   	HA.VER= 000007   	PP.ZER= 000001   	SYDEV = 054523   	..QIOW= ****** GX
F.ALOC= ****** GX	IE.NBK= ****** GX	R$$ANI= 000000   	SYUNIT= 000000   	...CTL= 000001
F.EFBK= ****** GX	IO.EXT= ****** GX	R$$BBF= 000000

. ABS.	000000	   000
      	000266	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2625 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:15
[41,10]CKALOC,[41,20]CKALOC/-SP=[41,30]FCSPRE,CKALOC
CLOSE 0102S, FCS CLOSE FILE ROU	MACRO M1108  05-DEC-77 22:06  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
CLOSE 0102S, FCS CLOSE FILE ROU	MACRO M1108  05-DEC-77 22:06  PAGE 7


						.TITLE	CLOSE 0102S, FCS CLOSE FILE ROUTINE
						.IDENT	/0102S/
      2					; ALTERED TUESDAY 05-MAR-74 10:20 BY MARK BRAMHALL
      3					;
      4					;                             COPYRIGHT (C) 1975, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 13-JULY-73
     21					;
CLOSE 0102S, FCS CLOSE FILE ROU	MACRO M1108  05-DEC-77 22:06  PAGE 8


     23					;+
     24					; CLOSE A FILE
     25					; CALLING SEQUENCE:
     26					;	CALL	.CLOSE
     27					; INPUTS:
     28					;	R0=FDB
     29					; OUTPUTS:
     30					;	ALL REGISTERS PRESERVED
     31					;	C=0 IF SUCCESSFUL, C=1 IF AN ERROR OCCURRED WRITING THE HEADER
     32					;	F.BDB, F.BBFS, F.FNB=0
     33					; OPERATION:
     34					;	IF THE FILE IS OPEN, THEN F.BDB IS NON-ZERO.  IF THERE IS
     35					; A PARTIAL BLOCK BUFFER THEN IT IS WRITTEN, THEN THE HEADER IS WRITTEN
     36					; TO VIRTUAL BLOCK ZERO.  FINALLY THE BLOCK BUFFER IS RELEASED.
     37					;-
     38
     39	000000				.CLOSE::.SAVR1			;SAVE REGISTER R1-R5
     40	000004	012760 	000001 	000000G		MOV	#1,F.ERR(R0)	;INIT ERROR RETURN CODE
     41	000012	005760 	000000G			TST	F.BDB(R0)	;FILE ALREADY CLOSED?
     42	000016	001503 				BEQ	70$		;BRANCH IF YES
     43	000020	132760 	000000G	000000G		BITB	#FD.RWM,F.RACC(R0) ;IF READ/WRITE MODE, SKIP THIS
     44	000026	001027 				BNE	30$
     45	000030	132760 	000001 	000000G		BITB	#FD.WRT,F.BKP1(R0) ;DOES THE CURRENT BLOCK NEED TO BE WRITTEN
     46	000036	001423 				BEQ	10$		;BRANCH IF NO
     47					;
     48						.IF	GT,R$$BBF	;IF BIG BUFFERS ALLOWED
     49						BISB	#FD.BGD,F.MBFG(R0) ;FORCE ENTIRE BUFFER OUT
     50						.ENDC
     51					;
     52	000040					CALL	..BKRG
     53	000044	132760 	000000G	000000G		BITB	#FD.SQD,F.RCTL(R0) ;IS IT A SEQUENTIAL DEVICE
     54	000052	001413 				BEQ	8$		;BRANCH IF NO
     55					;
     56					; FOR FIXED LENGTH RECORDS, WRITE A SHORT BLOCK (ONLY DATA ACTUALLY PUT)
     57					; FOR VARIABLE LENGTH RECORDS, PUT AN EOF RECORD AND WRITE
     58					; THE FULL BLOCK
     59	000054	122760 	000000G	000000G		CMPB	#R.FIX,F.RTYP(R0)
     60	000062	001404 				BEQ	6$
     61	000064	012770 	177777 	000000G		MOV	#-1,@F.NREC(R0)	;NOTE LAST RECORD IN THIS BLOCK
     62	000072	000403 				BR	8$
     63	000074	016002 	000000G		6$:	MOV	F.NREC(R0),R2
     64	000100	160102 				SUB	R1,R2		;CALCULATE R2=SIZE OF SHORT BLOCK
     65	000102				8$:	CALL	..WTW1
     66					;
     67						.IF	GT,R$$MBF	;IF MULTIPLE BUFFERING
     68						MOV	F.BDB(R0),R1	;MUST WAIT FOR I/O DONE
     69						CALL	..WAIT
     70						.ENDC
     71					;
     72	000106				10$:
     73						.IF	GT,R$$MBF	;IF MULTIPLE BUFFERING
     74						MOV	F.BDB(R0),R1	;BE WARY OF 2ND PATH TO THIS POINT
     75						MOVB	F.ERR(R0),R2	;SAVE CURRENT STATUS
     76						CLR	R5
     77						BISB	F.MBC1(R0),R5	;NO. OF BUFFERS
     78						BR	25$
     79					;
CLOSE 0102S, FCS CLOSE FILE ROU	MACRO M1108  05-DEC-77 22:06  PAGE 8-1


     80					20$:	CALL	..WAIT		;WAIT FOR I/O DONE
     81						BCC	25$		;BRANCH IF NO ERROR
     82						TST	R2		;ALREADY HAVE AN ERROR?
     83						BLT	25$		;BRANCH IF YES, REPORT 1ST
     84						BITB	#FD.WBH,F.MBFG(R0) ;WRITE BEHIND ERROR?
     85						BEQ	25$		;BRANCH IF NO
     86						MOVB	@R1,R2		;YES, REPORT IT
     87					25$:	MOV	B.NXBD(R1),R1
     88						SOB	R5,20$		;SCAN ALL BUFFERS
     89						MOVB	R2,F.ERR(R0) ;SET ERROR BYTE
     90						.ENDC
     91					;
     92					; IF THIS WAS A NEW FILE AND THE VERSION NUMBER WAS DEFAULTED, THEN
     93					; WRITE THE ATTRIBUTES SO THE VERSION IS ON THE FILE HEADER
     94					; THIS SHOULD BE FIXED SO THAT IT CAN BE DONE AT DEACCESS.
     95					; CAN'T WRITE ATTRIBUTES IF RECORD OR SEQUENTIAL DEVICE
     96	000106				30$:
     97						.IF	EQ,R$$DPB
     98						BITB	#FD.SQD!FD.REC,F.RCTL(R0)
     99						BNE	40$
    100						BITB	#FD.DVR,F.BKP1(R0) ;CREATING DEFAULT VERSION
    101						BEQ	40$		;BRANCH IF NO
    102						MOVB	F.ERR(R0),-(SP)	;SAVE ERROR STATUS
    103					; PUSH THE ATTRIBUTE BLOCK ON THE STACK
    104						CLR	-(SP)		;END OF ATTRIBUTE BLOCK
    105						MOV	R0,-(SP)
    106						ADD	#F.FVER,@SP	;ADDRESS OF VERSION NUMBER
    107						MOV	(PC)+,-(SP)	;ATTRIBUTE CODE TO WRITE VERSION NUMBER
    108						.BYTE	HA.VER,2
    109					;
    110					; PUSH THE "EXTRA" QI/O DPB PARAMETERS
    111						CALL	..IDPB		;INIT THE DPB, SET R5 TO PARAM BLOCK
    112						MOV	R0,(R5)
    113						ADD	#F.FNB,(R5)+	;STORE ADDRESS OF FILE ID
    114						MOV	SP,(R5)+	;ADDRESS OF ATTRIBUTE CONTROL BLOCK
    115						MOV	#IO.WAT,R4	;I/O FUNCTION CODE FOR WRITE ATTRIBUTES
    116						CALL	..QIOW		;ISSUE THE WRT ATTRIBUTES QI/O AND WAIT
    117						ADD	#6,SP		;POP THE ATTRIBUTE BLOCK
    118						MOVB	(SP)+,R1	;POP THE SAVED ERROR CODE
    119						BGT	40$
    120						MOVB	R1,F.ERR(R0)	;RESTORE IT IF IT SHOWED ERROR
    121					;
    122					; ISSUE THE DEACCESS QI/O
    123					40$:	MOVB	F.ERR(R0),-(SP) ;SAVE STATUS IN CASE IT WAS ERROR
    124						CALL	..IDPB		;INIT THE DPB, SET R5 TO PARAM BLOCK
    125						BITB	#FA.RD,F.FACC(R0) ;UNLESS ACCESS IS READ ONLY
    126						BNE	45$
    127						MOV	R0,(R5)		;STORE ADDRESS OF RECORD ATTRIBUTES
    128						.IFF
    129	000106	116046 	000000G			MOVB	F.ERR(R0),-(SP)	;SAVE STATUS IN CASE IT WAS AN ERROR
    130	000112					CALL	..IDPB		;INIT THE DPB, SET R5 TO PARAM BLOCK
    131	000116	005025 				CLR	(R5)+		;NEVER A FILE ID POINTER
    132	000120	162706 	000012 			SUB	#12,SP		;MAKE ROOM FOR AN ATTRIBUTE LIST
    133	000124	010604 				MOV	SP,R4		;NOW POINT TO THE LIST
    134	000126	010425 				MOV	R4,(R5)+	;AND HAVE DPB POINT TO THE LIST ALSO
    135	000130	132760 	000000C	000000G		BITB	#FD.SQD!FD.REC,F.RCTL(R0) ;SEQUENTIAL OR RECORD DEVICE?
    136	000136	001011 				BNE	35$		;YES, NO VERSION ATT WRITE
CLOSE 0102S, FCS CLOSE FILE ROU	MACRO M1108  05-DEC-77 22:06  PAGE 8-2


    137	000140	132760 	000020 	000000G		BITB	#FD.DVR,F.BKP1(R0) ; CREATING DEFAULT VERSION?
    138	000146	001405 				BEQ	35$		;NO
    139	000150	012724 				MOV	(PC)+,(R4)+	;YES, SO SET THE WRITE ATTRIBUTE
    140	000152	   007 	   002 			.BYTE	HA.VER,2
    141	000154	010014 				MOV	R0,(R4)		;SET FDB ADDRESS
    142	000156	062724 	000000G			ADD	#F.FVER,(R4)+	;AND POINT TO THE VERSION NUMBER
    143	000162	132760 	000000G	000000G	35$:	BITB	#FA.RD,F.FACC(R0) ;IS ACCESS READ ONLY?
    144	000170	001003 				BNE	40$		;YES
    145	000172	012724 				MOV	(PC)+,(R4)+	;NO, SO WRITE RECORD I/O ATTRIBUTE
    146	000174	   004 	   000G			.BYTE	HA.UAT,S.FATT
    147	000176	010024 				MOV	R0,(R4)+	;ADDRESS OF DATA
    148	000200	005014 			40$:	CLR	(R4)		;END OF ATTRIBUTE LIST
    149						.IFTF
    150	000202	012704 	000000G		45$:	MOV	#IO.DAC,R4	;DEACCESS I/O FUNCTION CODE
    151	000206					CALL	..QIOW		;ISSUE THE DEACCESS QI/O AND WAIT
    152						.IFF
    153	000212	062706 	000012 			ADD	#12,SP		;POP THE STACK ITEMS
    154						.ENDC
    155	000216	112601 				MOVB	(SP)+,R1	;RECOVER SAVED ERROR STATUS
    156	000220	003002 				BGT	70$		;BRANCH IF SAVED STATUS WAS NOT AN ERR
    157	000222	110160 	000000G			MOVB	R1,F.ERR(R0)	;REPORT THIS ERROR
    158	000226				70$:	CALL	..RFDB
    159	000232					CALLR	..FCSX
    160					;
    161					;
    162	000236					$END	CLOSE
    163					;
    164					;
    165		000001 				.END
CLOSE 0102S, FCS CLOSE FILE ROU	MACRO M1108  05-DEC-77 22:06  PAGE 8-3
SYMBOL TABLE

BD.FRE= 000001   	F.ERR = ****** GX	IO.DAC= ****** GX	R$$DPB= 000001   	S.FATT= ****** GX
DIRTYP= 015172   	F.FACC= ****** GX	NB.DOT= 100000   	R$$EIS= 000000   	WI.DLK= 000002
FA.RD = ****** GX	F.FVER= ****** GX	NB.SMI= 040000   	R$$LCL= 000000   	WI.LCK= 000001
FCSEFN= 000040   	F.NREC= ****** GX	N.DRPT= 000006   	R$$MBF= 000000   	$$    = 000067
FD.DVR= 000020   	F.RACC= ****** GX	N.DRSZ= 000004   	R$$MUL= 000000   	.CLOSE  000000RG
FD.EFB= 000004   	F.RCTL= ****** GX	N.DVPT= 000002   	R$$OPF= 000000   	.SAVR1= ****** GX
FD.EF1= 000010   	F.RTYP= ****** GX	N.DVSZ= 000000   	R$$RSL= 000000   	..BKRG= ****** GX
FD.EOF= 000002   	HA.CHU= 000003   	N.FNPT= 000012   	R$$SEQ= 000000   	..FCSX= ****** GX
FD.REC= ****** GX	HA.FP = 000002   	N.FNSZ= 000010   	R$$SPL= 000000   	..IDPB= ****** GX
FD.RWM= ****** GX	HA.NAM= 000005   	PP.SEP= 000002   	R$$11M= 000001   	..QIOW= ****** GX
FD.SQD= ****** GX	HA.TYP= 000006   	PP.ZER= 000001   	R.FIX = ****** GX	..RFDB= ****** GX
FD.WRT= 000001   	HA.UAT= 000004   	R$$ANI= 000000   	SYDEV = 054523   	..WTW1= ****** GX
F.BDB = ****** GX	HA.UI = 000001   	R$$BBF= 000000   	SYUNIT= 000000   	...CTL= 000001
F.BKP1= ****** GX	HA.VER= 000007

. ABS.	000000	   000
      	000236	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2640 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:15
[41,10]CLOSE,[41,20]CLOSE/-SP=[41,30]FCSPRE,CLOSE
COMMON 0101MS, COMMON ROUTINES 	MACRO M1108  05-DEC-77 22:07  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
COMMON 0101MS, COMMON ROUTINES 	MACRO M1108  05-DEC-77 22:07  PAGE 7


						.TITLE	COMMON 0101MS, COMMON ROUTINES USED EVERYWHERE
						.IDENT	/0101MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					; ALTERED MONDAY 14-JUL-75 13:00
      4					;
      5					;                             COPYRIGHT (C) 1973, 1978 BY
      6					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      7					;
      8					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      9					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     10					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     11					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     12					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     13					;
     14					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     15					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     16					;       CORPORATION.
     17					;
     18					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     19					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     20					;
     21					; PETER H. LIPMAN 17-AUG-73
     22					;
     23					;+
     24					; SET C BIT ACCORDING TO F.ERR(R0) IN PREPARATION TO EXIT FROM FCS
     25					; CALLLING SEQUENCE:
     26					;	CALL	..FCSX
     27					; INPUTS:
     28					;	R0=FDB
     29					; OUTPUTS:
     30					;	C=0 IF F.ERR(R0) IS POSITIVE
     31					;	C=1 IF F.ERR(R0) IS  .LE. 0
     32					;	ALL REGISTERS PRESERVED
     33					;-
     34	000000	105760 	000000G		..FCSX::TSTB	F.ERR(R0)	;CLEARS CARRY
     35	000004	003001 				BGT	10$
     36	000006	000261 				SEC
     37	000010				10$:	RETURN
     38					;+
     39					; SUBROUTINE TO REPORT FATAL ERROR
     40					; CALLING SEQUENCE:
     41					;	JSR PC,.FATAL
     42					; INPUT:
     43					;	NONE
     44					; OUTPUTS:
     45					;	HALTS PROGRAM
     46					;-
     47	000012	000003 			.FATAL::BPT
     48					;
     49					;
     50	000014					$END	COMMON
     51					;
     52					;
     53		000001 				.END
COMMON 0101MS, COMMON ROUTINES 	MACRO M1108  05-DEC-77 22:07  PAGE 7-1
SYMBOL TABLE

BD.FRE= 000001   	HA.CHU= 000003   	N.DRPT= 000006   	R$$BBF= 000000   	R$$11M= 000001
DIRTYP= 015172   	HA.FP = 000002   	N.DRSZ= 000004   	R$$DPB= 000001   	SYDEV = 054523
FCSEFN= 000040   	HA.NAM= 000005   	N.DVPT= 000002   	R$$EIS= 000000   	SYUNIT= 000000
FD.DVR= 000020   	HA.TYP= 000006   	N.DVSZ= 000000   	R$$LCL= 000000   	WI.DLK= 000002
FD.EFB= 000004   	HA.UAT= 000004   	N.FNPT= 000012   	R$$MUL= 000000   	WI.LCK= 000001
FD.EF1= 000010   	HA.UI = 000001   	N.FNSZ= 000010   	R$$OPF= 000000   	.FATAL  000012RG
FD.EOF= 000002   	HA.VER= 000007   	PP.SEP= 000002   	R$$RSL= 000000   	..FCSX  000000RG
FD.WRT= 000001   	NB.DOT= 100000   	PP.ZER= 000001   	R$$SEQ= 000000   	...CTL= 000001
F.ERR = ****** GX	NB.SMI= 040000   	R$$ANI= 000000   	R$$SPL= 000000

. ABS.	000000	   000
      	000014	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2521 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[41,10]COMMON,[41,20]COMMON/-SP=[41,30]FCSPRE,COMMON
CREATE 0103MS, ISSUE THE CREATE	MACRO M1108  05-DEC-77 22:07  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
CREATE 0103MS, ISSUE THE CREATE	MACRO M1108  05-DEC-77 22:07  PAGE 7


						.TITLE	CREATE 0103MS, ISSUE THE CREATE FILE QI/O
						.IDENT	/0103MS/
      2					; ALTERED THURSDAY 13-JUN-74 9:15
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 17-AUG-73
     21					;
     22						.MCALL	FSROF$
     23	000000					FSROF$	DEF$L		;FORCE LOCAL DEFINITIONS OF THE FSR OFFSET
CREATE 0103MS, ISSUE THE CREATE	MACRO M1108  05-DEC-77 22:07  PAGE 8


     25					;+
     26					; ISSUE THE CREATE FILE QI/O
     27					; CALLING SEQUENCE:
     28					;	CALL	..CREA
     29					; INPUTS:
     30					;	R0 = FDB ADDRESS
     31					;	R1 = FILE NAME BLOCK ADDRESS
     32					; OUTPUTS:
     33					;	C=0 IF OK, C=1 IF ERROR, F.ERR SET TO WHY
     34					;	R0,R1 PRESERVED, R2-R5 ALTERED
     35					; OPERATION:
     36					;	F.CNTG IS USED AS THE NUMBER OF CONTIGUOUS BLOCKS
     37					; TO ALLOCATE AT CREATE TIME.  CAUSES FILE TO BE CONTIGUOUS
     38					; IF F.CNTG IS NON-ZERO AND SETS F.HIBK+2
     39					;-
     40	000000				..CREA::
     41	000000	132760 	000000G	000000G		BITB	#FD.REC,F.RCTL(R0)
     42	000006	001060 				BNE	20$		;SKIP THIS IF RECORD DEVICE
     43	000010	010146 				MOV	R1,-(SP)	;SAVE FNB ADDRESS
     44	000012	013702 	000000G			MOV	@#.FSRPT,R2	;R2=ADDRESS OF FSR CONTROL BLOCK
     45
     46					; PUSH ATTRIBUTE BLOCK ONTO THE STACK
     47	000016	005046 				CLR	-(SP)		;END OF ATTRIBUTE BLOCK
     48	000020	010246 				MOV	R2,-(SP)
     49	000022	062716 	000010 			ADD	#A.OWUI,(SP)	;ADDRESS OF OWNER'S UIC
     50	000026	012746 				MOV	(PC)+,-(SP)	;WRITE THE UIC
     51	000030	   001 	   002 			.BYTE	HA.UI,2
     52	000032					ASSUME	A.FIPR,A.OWUI+2 ;THESE MUST BE ADJACENT
     53	000032	022762 	177777 	000012 		CMP	#-1,A.FIPR(R2)	;IF USER SPECIFIED PROTECTION
     54	000040	001402 				BEQ	10$
     55	000042	062716 	001000 			ADD	#2*400,(SP)	;WRITE PROTECTION WITH UIC
     56	000046	010046 			10$:	MOV	R0,-(SP)	;ADDRESS OF RECORD ATTRIBUTES
     57	000050	012746 				MOV	(PC)+,-(SP)	;WRITE RECORD ATTRIBUTES
     58	000052	   004 	   000G			.BYTE	HA.UAT,S.FATT
     59	000054	010046 				MOV	R0,-(SP)
     60	000056	062716 	000000G			ADD	#F.FNAM,@SP	;ADDRESS OF FILE NAME
     61	000062	012746 				MOV	(PC)+,-(SP)	;WRITE FILE NAME, TYPE, AND VERSION
     62	000064	   005 	   012 			.BYTE	HA.NAM,10.
     63					;
     64					; ATTRIBUTE BLOCK IS NOW ON THE STACK
     65					; SET UP CREATE QI/O DPB
     66					;
     67	000066					CALL	..IDPB		;INIT DPB AND SET R5 TO PARAM BLOCK
     68	000072	010125 				MOV	R1,(R5)+	;ADDRESS OF FILE ID TO BE RETURNED
     69						.IF	EQ,R$$DPB
     70						MOV	F.CNTG(R0),(R5)+ ;CONTIGUOUS SPACE DESIRED IF ANY
     71						MOV	SP,(R5)		;ADDRESS OF WRT ATTRIBUTES CONTROL BLOCK
     72						.IFF
     73	000074	010625 				MOV	SP,(R5)+	;ADDRESS OF WRT ATTRIBUTES CONTROL BLOCK
     74	000076	012702 	102400 			MOV	#<200!4!1>*400,R2 ;R2=EXTEND CONTIG, FILE CONTIG
     75	000102	016003 	000000G			MOV	F.CNTG(R0),R3
     76	000106	001406 				BEQ	15$		;BRANCH IF NO INITIAL SIZE DESIRED
     77	000110	003003 				BGT	12$		;BRANCH IF CONTIGUOUS FILE DESIRED
     78	000112	005403 				NEG	R3		;GET POSITIVE SIZE
     79	000114	042702 	002400 			BIC	#<4!1>*400,R2	;FILE NOT CONTIGUOUS, EXTEND NON CONTIGUOUS
     80	000120	010225 			12$:	MOV	R2,(R5)+
     81	000122	010315 				MOV	R3,(R5)
CREATE 0103MS, ISSUE THE CREATE	MACRO M1108  05-DEC-77 22:07  PAGE 8-1


     82	000124				15$:
     83						.ENDC
     84	000124	012704 	000000G			MOV	#IO.CRE,R4	;I/O FUNCTION CODE FOR CREATE QI/O
     85	000130					CALL	..QIOW		;ISSUED THE CREATE QI/O AND WAIT
     86	000134	016160 	000002 	000002G		MOV	2(R1),F.HIBK+2(R0)  ;NO. OF BLOCK ALLOCATED IF ANY
     87	000142	062706 	000016 			ADD	#7*2,SP		;POP ATTRIBUTE BLOCK OFF STACK
     88	000146	012601 				MOV	(SP)+,R1	;RESTORE FILE NAME BLOCK ADR
     89	000150	005761 	000000G		20$:	TST	N.FID(R1)
     90	000154	001002 				BNE	30$		;IF NO FILE ID RETURNED
     91	000156	005261 	000000G			INC	N.FID(R1)	;MAKE IT 1
     92	000162				30$:	CALLR	..FCSX
     93					;
     94					;
     95	000166					$END	CREATE
     96					;
     97					;
     98		000001 				.END
CREATE 0103MS, ISSUE THE CREATE	MACRO M1108  05-DEC-77 22:07  PAGE 8-2
SYMBOL TABLE

A.BFSR= 000004   	FD.DVR= 000020   	HA.UAT= 000004   	PP.ZER= 000001   	SYUNIT= 000000
A.DFBC= 000100   	FD.EFB= 000004   	HA.UI = 000001   	R$$ANI= 000000   	S.FATT= ****** GX
A.DFDR= 000050   	FD.EF1= 000010   	HA.VER= 000007   	R$$BBF= 000000   	S.FSR2= 000102
A.DPB = 000014   	FD.EOF= 000002   	IO.CRE= ****** GX	R$$DPB= 000001   	WI.DLK= 000002
A.EFSR= 000006   	FD.REC= ****** GX	NB.DOT= 100000   	R$$EIS= 000000   	WI.LCK= 000001
A.FIPR= 000012   	FD.WRT= 000001   	NB.SMI= 040000   	R$$LCL= 000000   	$$    = 000067
A.IOST= 000044   	F.CNTG= ****** GX	N.DRPT= 000006   	R$$MUL= 000000   	.FSRPT= ****** GX
A.OWUI= 000010   	F.FNAM= ****** GX	N.DRSZ= 000004   	R$$OPF= 000000   	..CREA  000000RG
BD.FRE= 000001   	F.HIBK= ****** GX	N.DVPT= 000002   	R$$RSL= 000000   	..FCSX= ****** GX
DIRTYP= 015172   	F.RCTL= ****** GX	N.DVSZ= 000000   	R$$SEQ= 000000   	..IDPB= ****** GX
D.DFDV= 000024   	HA.CHU= 000003   	N.FID = ****** GX	R$$SPL= 000000   	..QIOW= ****** GX
D.DFID= 000016   	HA.FP = 000002   	N.FNPT= 000012   	R$$11M= 000001   	...CTL= 000001
D.DFUN= 000026   	HA.NAM= 000005   	N.FNSZ= 000010   	SYDEV = 054523   	...TPC= 000030
FCSEFN= 000040   	HA.TYP= 000006   	PP.SEP= 000002

. ABS.	000000	   000
      	000166	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2737 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:15
[41,10]CREATE,[41,20]CREATE/-SP=[41,30]FCSPRE,CREATE
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 1


      1						.MCALL	CSI$
      2	000000					CSI$
      3					;
      4		000002 			C.BFLN=C.CMLD
      5		000004 			C.BFAD=C.CMLD+2
      6		000016 			C.FNLN=C.FILD
      7		000020 			C.FNAD=C.FILD+2
      8		000006 			C.DVLN=C.DEVD
      9		000010 			C.DVAD=C.DEVD+2
     10		000012 			C.DILN=C.DIRD
     11		000014 			C.DIAD=C.DIRD+2
     12					;
     13		000032 			C.IDVA=	32	;INPUT LAST DEVICE NAME FOUND PTR
     14		000030 			C.IDVL=	30	;INPUT LAST DEVICE NAME FOUND LENGTH
     15		000036 			C.ODVA=	36	;OUTPUT LAST DEVICE NAME FOUND PTR
     16		000034 			C.ODVL=	34	;OUTPUT LAST DEVICE FOUND LENGTH
     17		000042 			C.IDIA=	42	;INPUT LAST DIR INFO PTR FOUND
     18		000040 			C.IDIL=	40	;INPUT LAST DIR INFO FOUND LENGTH
     19		000046 			C.ODIA=	46	;OUTPUT LAST DIR INFO FOUND PTR
     20		000044 			C.ODIL=	44	;OUTPUT LAST DIR INFO FOUND LENGTH
     21		000050 			C.ISTR=	50	;INPUT NEXT STRING SECTION ADDR
     22		000052 			C.OSTR=	52	;OUTPUT NEXT STRING SECTION ADDR
     23					;
     24					;	COMMAND STRING DELIMITERS
     25					;
     26		000072 			COLON=	72	;	:
     27		000054 			COMMA=	54	;	,
     28		000057 			SLASH=	57	;	/
     29		000075 			EQUAL=	75	;	=
     30		000073 			SEMIC=	73	;	;
     31		000135 			RBRAC=	135	;	]
     32		000133 			LBRAC=	133	;	[
     33					;
     34					;	CHARS DELETED FROM COMMAND STRINGS
     35					;
     36		000040 			BLANK=	40
     37		000011 			TAB=	11
     38		000000 			NULL=	0
     39		000177 			RUBOUT=	177
     40					;
     41					;	OTHER RELEVANT CHARS
     42					;
     43		000101 			CHARA=	101	;	A
     44		000132 			CHARZ=	132	;	Z
     45		000060 			CHAR0=	60	;	0
     46		000071 			CHAR9=	71	;	9
     47		000056 			DOT=	56	;	.
     48		000052 			STAR=	52	;	*
     49		000055 			MINUS=	55	;	-
     50		000053 			PLUS=	53	;	+
     51		000044 			DOLLAR=	44	;	$
     52					;
     53					;
     54					;
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 2


      1						.TITLE	.CSI1
      2						.IDENT	/05/
      3
      4					; COPYRIGHT 1973, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
      5					; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
      6					;
      7					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
      8					; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
      9					;
     10					; THIS SOFTWARE IS FURNSIHED TO PURCHASER UNDER A LICENSE FOR USE
     11					; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     12					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     13					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     14					;
     15					; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     16					; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     17					; EQUIPMENT CORPORATION.
     18					;
     19					; VERSION 05
     20					;
     21					; WRITTEN BY:
     22					; 	A. MAROTTO  (CCA)
     23					;
     24					; MODIFIED BY:
     25					;	C.A. D'ELIA	19-OCT-73	001
     26					;	C.A. D'ELIA	15-JAN-74	002
     27					; 	C.A. D'ELIA	11-FEB-74	003
     28					;	C.A. D'ELIA	23-MAY-74	004
     29					;	C.A. D'ELIA	07-JUN-74	005
     30					;	C.A. D'ELIA	01-AUG-74	006
     31					;	C.A. D'ELIA	04-OCT-74	007
     32					;
     33					;
     34					;	COMMAND STRING INTERPRETER-SYNTAX ANALYZER
     35					;
     36					;
     37
     38					;++003
     39					;
     40					; DEFINITION OF MACRO TO GENERATE STATE TABLE ENTRIES
     41					;
     42					;--003
     43
     44						.MACRO	GENDSP	LIST
     45						.IRP	X,<LIST>
     46						.BYTE	X'DSP
     47						.ENDM
     48						.ENDM	GENDSP
     49
     50
     51					;
     52					;
     53					;
     54					;
     55					;
     56	000000				.CSI1::				;++004
     57	000000	004567 	000000G			JSR	R5,.SAVR1	;++004 SAVE REGISTERS
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 2-1


     58					;
     59					;	CLEAR CSI CMMD BLOCK
     60					;
     61	000004	010003 				MOV	R0,R3		;COMMAND BLOCK ADDR
     62	000006	016001 	000004 			MOV	C.BFAD(R0),R1	;GET BUFF ADDR
     63	000012	016002 	000002 			MOV	C.BFLN(R0),R2	;AND BUFF LENGTH
     64	000016	012704 	000026 			MOV	#<C.SIZE/2>,R4	;++003 SET SIZE OF CSI BLOCK (WDS)
     65	000022	005023 			CSICLR:	CLR	(R3)+		;CLEAR BLOCK
     66	000024	005304 				DEC	R4
     67	000026	001375 				BNE	CSICLR
     68	000030	010160 	000004 			MOV	R1,C.BFAD(R0)	;RESTORE BUFF ADDR
     69	000034	010160 	000052 			MOV	R1,C.OSTR(R0)	;SET OUTPUT SIDE STRING PTR
     70					;
     71					;	COMPRESS COMMAND STRING(ELIMINATE NULLS, STABS, RUBOUTS AND BLANKS)
     72					;	ALSO ESTABLISH THAT THERE IS AT MOST 1 EQUALS AND SAVE ITS LOCN+1
     73					;
     74	000040	010103 				MOV	R1,R3		;SET PTRS FOR COMPRESS
     75	000042	010004 				MOV	R0,R4		;++003 SET R4 TO THE ...
     76	000044	062704 	000050 			ADD	#C.ISTR,R4	;++003 ... INPUT STRING POINTER
     77	000050	005702 				TST	R2
     78	000052	001002 				BNE	COMPRS		;BRANCH IF NOT NULL LINE
     79	000054	010114 				MOV	R1,(R4)		;++003 ELSE, SET INPUT STRING POINTER
     80	000056	000207 				RTS	PC		;++003 RETURN -- CC-C ALREADY CLEAR
     81	000060	105713 			COMPRS:	TSTB	(R3)		;++003 BRANCH IF NULL, RUBOUT ...
     82	000062	001431 				BEQ	ELIM		;TAB OR BLANK
     83	000064	122713 	000011 			CMPB	#TAB,(R3)
     84	000070	001426 				BEQ	ELIM
     85	000072	122713 	000177 			CMPB	#RUBOUT,(R3)
     86	000076	001423 				BEQ	ELIM
     87	000100	122713 	000040 			CMPB	#BLANK,(R3)
     88	000104	001420 				BEQ	ELIM
     89	000106	111321 				MOVB	(R3),(R1)+	;ELSE MOVE CHAR TO COMPRESSED STRING
     90	000110	122713 	000075 			CMPB	#EQUAL,(R3)	;BRANCH IF NOT EQUALS
     91	000114	001014 				BNE	ELIM
     92	000116	005714 				TST	(R4)		;++003 ERROR IF ALREADY FOUND EQUAL SIGN
     93	000120	001406 				BEQ	SETINP		;ELSE BRANCH
     94	000122	010360 	000020 			MOV	R3,C.FNAD(R0)	;SET LOCN OF BAD SYNTAX
     95	000126	010260 	000016 			MOV	R2,C.FNLN(R0)	;SET LENGTH
     96	000132	000261 				SEC			;SET ERROR
     97	000134	000207 				RTS	PC		;EXIT
     98	000136	010114 			SETINP:	MOV	R1,(R4)		;++003 SET INPUT STRING POINTER
     99	000140	152760 	000040 	000001 		BISB	#CS.EQU,C.STAT(R0)  ;++005 INDICATE EQUAL SIGN SEEN
    100	000146	005203 			ELIM:	INC	R3		;NEXT UNCOMPRESSED CHARS ADDR
    101	000150	005302 				DEC	R2		;BRANCH IF MORE TO CHECK
    102	000152	001342 				BNE	COMPRS
    103					;
    104	000154	005714 				TST	(R4)		;++003 BRANCH IF EQUAL SIGN ALREADY FOUND
    105	000156	001001 				BNE	INPSET
    106	000160	010114 				MOV	R1,(R4)		;++003 ELSE, SET INPUT STRING POINTER
    107	000162	016002 	000004 		INPSET:	MOV	C.BFAD(R0),R2	;++003 GET STRING ADDRESS
    108	000166	160201 				SUB	R2,R1		;++003 SET COMPRESSED STRING LENGTH
    109	000170	010160 	000002 			MOV	R1,C.BFLN(R0)
    110					;
    111					;	COMMAND BLOCK IS SET UP AND STRING IS COMPRESSED
    112					;	PREPARE FOR SYNTAX SCAN OF COMPRESSED STRING
    113					;
    114	000174	010046 				MOV	R0,-(SP)	;SAVE CMMD BLOCK ADDR
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 2-2


    115	000176	005000 				CLR	R0		;SET SCAN STATE
    116	000200	060201 				ADD	R2,R1		;END OF STRING ADDR
    117	000202	010204 				MOV	R2,R4
    118	000204	020401 			SCAN:	CMP	R4,R1		;BRANCH IF DONE
    119	000206	001415 				BEQ	DONE
    120	000210	004767 	000132 			JSR	PC,GETDEL	;SCAN TO A DELIMITER
    121					;
    122					;	GO TO PROPER ROUTINE VIA STATE TABLE
    123					;
    124	000214	010503 				MOV	R5,R3
    125	000216	062703 	000265'			ADD	#STAT0,R3	;BASE OF TABLES
    126	000222	005300 			NXTAB:	DEC	R0		;BRANCH IF IN PROPER TABLE
    127	000224	100403 				BMI	JUMP
    128	000226	062703 	000007 			ADD	#7.,R3		;++003 ADVANCE TO NEXT TABLE
    129	000232	000773 				BR	NXTAB
    130					;
    131	000234	111303 			JUMP:	MOVB	(R3),R3		;++003 LOAD OFFSET INTO DISP TBL
    132	000236	000173 	000250'			JMP	@DSPTBL(R3)	;++003 JUMP TO PROPER ROUTINE
    133					;
    134					;
    135					;
    136	000242	012600 			DONE:	MOV	(SP)+,R0	;RESTORE CSI BLK ADDR
    137	000244	000241 				CLC
    138	000246	000207 				RTS	PC
    139					;++003
    140					;
    141					; GENERATE THE OFFSET SYMBOLS TO USE THE DISPATCH TABLE
    142					;
    143					;--003
    144
    145		000000 			XTMPX=0
    146						.IRP	X,<FN,DV,PP,ER,VR,SW>
    147					X'DSP=XTMPX
    148					XTMPX=XTMPX+2
    149						.ENDM
    150
    151
    152
    153					;++003
    154					;
    155					; TABLE OF ROUTINE ADDRESSES
    156					;
    157					;--003
    158
    159	000250				DSPTBL:				;++003
    160	000250	001116'				.WORD	FNSCAN		;++003 SCAN FILE NAME
    161	000252	000554'				.WORD	DVSCAN		;++003 SCAN DEVICE NAME (AND NUMBER)
    162	000254	000634'				.WORD	PPSCAN		;++003 SCAN UIC SPECIFICATION
    163	000256	000526'				.WORD	ERROR		;++003 DECLARE SYNTAX ERROR
    164	000260	000766'				.WORD	VRSCAN		;++003 SCAN VERSION NUMBER
    165	000262	001024'				.WORD	SWSCAN		;++003 SCAN SWITCHES
    166
    167
    168					;
    169					;	STATE TABLES FOR SYNTAX SCAN
    170					;
    171	000264	   000 				.BYTE	FNDSP		;++003
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 2-3


    172
    173	000265				STAT0:	GENDSP	<FN,DV,PP,FN,FN,ER,FN> ;++003
    174
    175	000274				STAT1:	GENDSP	<FN,ER,PP,FN,FN,ER,FN> ;++003
    176
    177	000303				STAT2:	GENDSP	<FN,ER,ER,FN,FN,ER,VR> ;++003
    178
    179	000312				STAT3:	GENDSP	<VR,ER,ER,ER,VR,ER,SW> ;++003
    180
    181	000321				STAT4:	GENDSP	<SW,SW,ER,ER,SW,ER> ;++003
    182
    183						.EVEN			;++003
    184					;
    185					;
    186					;
    187					;	SCAN TO A DELIMITER
    188					;
    189					;	DELIMITERS ARE-
    190					;	COLON, COMMA, SLASH, EQUALS(OR END OF STRING), SEMICOLON, RIGHT BRACKET,
    191					;	LEFT BRACKET
    192					;	CALL SEQUENCE-
    193					;
    194					;	R1=END OF STRING ADDR
    195					;	R2=CURRENT STRING PTR
    196					;	JSR PC,GETDEL
    197					;
    198					;	RETURNS-
    199					;
    200					;	R4=ADDR OF DELIMITER FOUND
    201					;	R5=VALUE OF DELIMITER
    202					;
    203					;	VALUE OF DELIMITERS-
    204					;	1, 0, 4, -1, 3, 5, 2 RESPECTIVELY(SEE DELIMITERS ABOVE)
    205					;
    206	000330				DELTAB:
    207	000330	   075 	   377 			.BYTE	EQUAL,-1	;++003
    208	000332	   135 	   005 			.BYTE	RBRAC,5		;++003
    209	000334	   057 	   004 			.BYTE	SLASH,4		;++003
    210	000336	   073 	   003 			.BYTE	SEMIC,3		;++003
    211	000340	   133 	   002 			.BYTE	LBRAC,2		;++003
    212	000342	   072 	   001 			.BYTE	COLON,1		;++003
    213	000344	   054 	   000 			.BYTE	COMMA,0		;++003
    214					;
    215	000346	010204 			GETDEL:	MOV	R2,R4		;ADDR DELIM
    216	000350	012705 	000330'		GD:	MOV	#DELTAB,R5	;ADDR DELIMITER TABLE
    217	000354	020401 				CMP	R4,R1		;BRANCH IF NOT AT END OF STRING
    218	000356	001002 				BNE	GD1
    219	000360	005205 				INC	R5		;++003 SET END-OF-STR VALUE POINTER
    220	000362	000402 				BR	GDX		;++003 BRANCH TO GET THE VALUE
    221					;
    222	000364	121425 			GD1:	CMPB	(R4),(R5)+	;IS THIS CHAR THIS DELIM
    223	000366	001002 				BNE	GD2		;BRANCH IF NOT
    224	000370	111505 			GDX:	MOVB	(R5),R5		;++003 GET DELIMITER VALUE
    225	000372	000207 				RTS	PC		;EXIT
    226					;
    227	000374	105725 			GD2:	TSTB	(R5)+		;++003 BRANCH IF NOT AT END OF
    228	000376	001372 				BNE	GD1		;DELIMITER TABLE
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 2-4


    229					;
    230	000400	005204 				INC	R4		;ADVANCE TO NEXT CHAR
    231	000402	000762 				BR	GD		;GO CHECK
    232					;
    233					;
    234					;
    235					;
    236					;	GIVEN CHAR(ADDR IN R0) DETERMINE ITS CLASS(RETURN IN R3)
    237					;
    238					;	CLASSES ARE:
    239					;	NUMER, ALPHA, DOLSGN, PERIOD, ASTER,  OTHER
    240					;
    241	000404	012703 	000005 		CHRTYP:	MOV	#OTHER,R3
    242	000410	020004 				CMP	R0,R4
    243	000412	103043 				BHIS	TYPEX
    244	000414	121027 	000132 			CMPB	(R0),#CHARZ
    245	000420	101040 				BHI	TYPEX
    246	000422	121027 	000101 			CMPB	(R0),#CHARA
    247	000426	103403 				BLO	CT1
    248	000430	012703 	000001 			MOV	#ALPHA,R3
    249	000434	000432 				BR	TYPEX
    250	000436	121027 	000071 		CT1:	CMPB	(R0),#CHAR9
    251	000442	101027 				BHI	TYPEX
    252	000444	121027 	000060 			CMPB	(R0),#CHAR0
    253	000450	103403 				BLO	CT2
    254	000452	012703 	000000 			MOV	#NUMER,R3
    255	000456	000421 				BR	TYPEX
    256	000460	121027 	000052 		CT2:	CMPB	(R0),#STAR
    257	000464	001003 				BNE	CT3
    258	000466	012703 	000004 			MOV	#ASTER,R3
    259	000472	000413 				BR	TYPEX
    260	000474	121027 	000056 		CT3:	CMPB	(R0),#DOT
    261	000500	001003 				BNE	CT4
    262	000502	012703 	000003 			MOV	#PERIOD,R3
    263	000506	000405 				BR	TYPEX
    264	000510	121027 	000044 		CT4:	CMPB	(R0),#DOLLAR
    265	000514	001002 				BNE	TYPEX
    266	000516	012703 	000002 			MOV	#DOLSGN,R3
    267	000522	005200 			TYPEX:	INC	R0
    268	000524	000207 				RTS	PC
    269					;
    270		000000 			NUMER=0
    271		000001 			ALPHA=1
    272		000002 			DOLSGN=2
    273		000003 			PERIOD=3
    274		000004 			ASTER=4
    275		000005 			OTHER=5
    276					;
    277					;
    278					;
    279					;
    280					;	SYNTAX ERROR COMES HERE
    281					;
    282	000526	012600 			ERROR:	MOV	(SP)+,R0	;GET CMMD BLOCK
    283	000530	010260 	000020 			MOV	R2,C.FNAD(R0)	;SET ERROR STRING ADDR
    284	000534	020401 				CMP	R4,R1		;IF AT END OF STRING,
    285	000536	103001 				BHIS	ERR1		;DONT RETURN DELIM
.CSI1	MACRO M1108  05-DEB-77 23:44  PAGE 2-5


    "86	000540	005204 				INC	R4
    287	000542	160204 			ERR1:	SUB	R2,R4		;SET ERROR STRING LENGTH
    288	000544	010460 	000016 			MOV	R4,C.FNLN(R0)
    289	000550	000261 				SEC			;SET ERROR
    290	000552	000207 				RTS	PC		;EXIT
    291					;
    292					;
    293					;
    294					;	VALIDATE DEVICE NAME SYNTAX
    295					;
    296	000554	010200 			DVSCAN:	MOV	R2,R0		;SET START CHAR
    297	000556	004767 	177622 			JSR	PC,CHRTYP	;GET CHAR TYPE
    298	000562	022703 	000001 			CMP	#ALPHA,R3	;IF FIRST 2 CHARS NOT ALPHA
    299	000566	001357 				BNE	ERROR		;OR LESS THAN 2 CHARS - ERROR
    300	000570	004767 	177610 			JSR	PC,CHRTYP
    301	000574	022703 	000001 			CMP	#ALPHA,R3
    302	000600	001352 				BNE	ERROR
    303	000602	020004 			DVS:	CMP	R0,R4		;EXIT IF AT END OF STRING
    304	000604	001406 				BEQ	DVSX
    305	000606	004767 	177572 			JSR	PC,CHRTYP
    306	000612	022703 	000000 			CMP	#NUMER,R3	;IF ALL SUBSEQUENT CHARS ARE
    307	000616	001771 				BEQ	DVS		;NOT NUMERIC
    308	000620	000742 				BR	ERROR		;ERROR
    309	000622	010500 			DVSX:	MOV	R5,R0		;++003 SET NEXT STATE
    310	000624				DVSX1:				;++003
    311	000624	010402 				MOV	R4,R2		;SET NEW SCAN PTR
    312	000626	005202 				INC	R2
    313	000630				DVSX2:				;++003
    314	000630	000167 	177350 			JMP	SCAN		;GO SCAN NEXT SECTION
    315					;
    316					;
    317					;	VALIDATE PROJECT/PROGRAMMER NUMBER SYNTAX
    318					;
    319	000634	020204 			PPSCAN:	CMP	R2,R4		;IF CHARS PRECEED [
    320	000636	001333 				BNE	ERROR		;ERROR
    321	000640	005202 				INC	R2		;STEP OVER DELIM
    322	000642	004767 	177500 			JSR	PC,GETDEL	;GET NEXT DELIM
    323	000646	005705 				TST	R5
    324	000650	001326 				BNE	ERROR		;ERROR IF NOT COMMA
    325	000652	010205 			PP1:	MOV	R2,R5		;SET UP FOR CALL TO CONVERT RTN
    326	000654	010446 				MOV	R4,-(SP)	;++003 SAVE POINTER
    327	000656	160204 				SUB	R2,R4
    328	000660	005046 				CLR	-(SP)
    329	000662	010603 				MOV	SP,R3
    330	000664	004767 	000000G			JSR	PC,.ODCVT	;CONVERT NUM
    331	000670	012603 				MOV	(SP)+,R3
    332	000672	100432 				BMI	PVER2		;++003 ERROR IF NEGATIVE NUMBER
    333	000674	103002 				BCC	PPOK		;++003 ELSE, BRANCH IF NO BAD CHARS
    334	000676	004767 	000042 			JSR	PC,PVER		;++003 ELSE, CHECK FOR WILD FIELD SPEC
    335	000702	020327 	000377 		PPOK:	CMP	R3,#377		;++006 COMPARE RESULT W/ MAX UIC
    336	000706	003024 				BGT	PVER2		;++006 ERROR IF IT'S GREATER
    337	000710	012602 				MOV	(SP)+,R2	;++003 ELSE, SET NEXT SCAN POINTER
    338	000712	010204 				MOV	R2,R4
    339	000714	122227 	000135 			CMPB	(R2)+,#RBRAC	;DID LAST SECTION END WITH ]
    340	000720	001406 				BEQ	PPX		;DONE IF SO
    341	000722	004767 	177420 			JSR	PC,GETDEL	;GET DELIM
    342	000726	020527 	000005 			CMP	R5,#5		;ERROR IF NOT ]
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 2-6


    343	000732	001747 				BEQ	PP1		;ELSE GO CVT NUM
    344	000734	000674 				BR	ERROR
    345	000736	012700 	000002 		PPX:	MOV	#2,R0		;++003 SET NEXT STATE
    346	000742	000732 				BR	DVSX2		;++003 BRANCH TO SCAN NEXT FIELD
    347					;++003
    348					;
    349					;  BAD CHAR FOUND IN PPN OR VERSION -- CHECK FOR WILD (*)
    350					;
    351					;--003
    352	000744	005304 			PVER:	DEC	R4		;++003 NO ERROR IF FIELD IS ...
    353	000746	001003 				BNE	PVER1		;++003 ... ONE CHAR LONG ...
    354	000750	122712 	000052 			CMPB	#STAR,(R2)	;AND IS *
    355	000754	001403 				BEQ	PVOK		;++003
    356	000756	005726 			PVER1:	TST	(SP)+		;++003 ERROR -- PURGE RETURN ADDRESS
    357	000760	012604 			PVER2:	MOV	(SP)+,R4	;++003 SET POINTER
    358	000762	000661 				BR	ERROR
    359	000764	000207 			PVOK:	RTS	PC		;++003 NO ERROR -- RETURN
    360					;
    361					;
    362					;	VALIDATE VERSION NUMBER SYNTAX
    363					;
    364	000766	010500 			VRSCAN:	MOV	R5,R0		;SET NEXT STATE
    365	000770	010446 				MOV	R4,-(SP)	;SAVE NEXT PTR
    366	000772	010205 				MOV	R2,R5		;SET ADDR
    367	000774	005046 				CLR	-(SP)
    368	000776	160204 				SUB	R2,R4		;++001 CALC LENGTH OF STRING
    369	001000	001403 				BEQ	1$		;++001 BRANCH IF NULL
    370	001002	010603 				MOV	SP,R3		;SET RESULT ADDR
    371	001004	004767 	000000G			JSR	PC,.DCCVT	;++003 GO CONVERT NUMBER (DECIMAL DEFAULT)
    372	001010				1$:				;++001
    373	001010	012603 				MOV	(SP)+,R3
    374	001012	103002 				BCC	VRCK		;++003 NO ERRORS DETECTED
    375	001014	004767 	177724 			JSR	PC,PVER		;++003 CHECK FOR WILD FIELD SPEC
    376	001020	012604 			VRCK:	MOV	(SP)+,R4	;++007 SET NEXT FIELD POINTER
    377	001022	000700 				BR	DVSX1		;++003 BRANCH TO SCAN NEXT SECTION
    378					;
    379					;
    380					;
    381					;	VALIDATE SWITCH SYNTAX
    382					;
    383	001024	010200 			SWSCAN:	MOV	R2,R0
    384	001026	121027 	000055 			CMPB	(R0),#MINUS	;STEP OVER LEADING MINUS
    385	001032	001001 				BNE	SW1
    386	001034	005200 				INC	R0
    387	001036	020004 			SW1:	CMP	R0,R4		;BRANCH IF AT END OF NAME
    388	001040	001406 				BEQ	SW2
    389	001042	004767 	177336 			JSR	PC,CHRTYP	;GET NEXT CHARS TYPE
    390	001046	020327 	000003 			CMP	R3,#PERIOD	;IF NOT RAD50 CHAR
    391	001052	101771 				BLOS	SW1
    392	001054	000624 			SWER:	BR	ERROR		;++003 ELSE, REPORT ERROR DETECTED
    393	001056	022705 	000001 		SW2:	CMP	#1,R5		;++003 IS COLON THE DELIMITER?
    394	001062	001257 				BNE	DVSX		;++003 NO, BRANCH TO SCAN NEXT
    395	001064	010402 				MOV	R4,R2		;++003 SET POINTER
    396	001066	005202 				INC	R2		;++003
    397	001070	004767 	177252 			JSR	PC,GETDEL	;++003 SKIP THE SWITCH VALUE
    398	001074	010503 				MOV	R5,R3		;++004 COPY DELIMITER VALUE INTO R3
    399	001076	162703 	000002 			SUB	#2,R3		;++004 IF DELIMITER IS '[' THEN ...
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 2-7


    400	001102	001611 				BEQ	ERROR		;++004 ... DECLARE SYNTAX ERROR
    401	001104	005303 				DEC	R3		;++004 IF DELIMITER IS ';' THEN ...
    402	001106	001607 				BEQ	ERROR		;++004 ... DECLARE SYNTAX ERROR
    403	001110	005303 				DEC	R3		;++004 IF DELIMITER IS ']' THEN ...
    404	001112	003205 				BGT	ERROR		;++004 ... DECLARE SYNTAX ERROR
    405	001114	000760 				BR	SW2		;++003 TRY TO LEAVE AGAIN
    406					;
    407					;	VALIDATE FILE NAME SYNTAX
    408					;	NOTE: 0 CHARS AND WILD CARD SWITCHES ALLOWED
    409					;
    410	001116	020204 			FNSCAN:	CMP	R2,R4		;++003 IF FILE NAME STRING IS NULL, ...
    411	001120	001640 				BEQ	DVSX		;++003 ... BRANCH TO SCAN NEXT SECTION
    412	001122	005046 				CLR	-(SP)		;++003 RESERVE LENGTH WORD ON STACK
    413	001124	010200 				MOV	R2,R0		;++003 SET POINTER
    414	001126	004767 	177252 		FN1:	JSR	PC,CHRTYP	;GET CHAR TYPE
    415	001132	005216 				INC	(SP)		;++003 INCREMENT FILE NAME LENGTH
    416	001134	162703 	000003 			SUB	#PERIOD,R3
    417	001140	100772 				BMI	FN1		;GET NEXT IF RAD50 CHAR
    418	001142	001417 				BEQ	FNP		;BRANCH IF PERIOD
    419	001144	005303 				DEC	R3
    420	001146	001407 				BEQ	FNS		;BRANCH IF STAR
    421	001150	022726 	000012 			CMP	#10.,(SP)+	;++003 IF MORE THAN 10 CHARS ...
    422	001154	002737 				BLT	SWER		;++003 ... FILE NAME IS IN ERROR
    423	001156	005300 				DEC	R0		;++003 IF CHAR IS NOT THE DELIMITER ...
    424	001160	020004 				CMP	R0,R4		;++003 ... THEN THE FILE NAME ...
    425	001162	001334 				BNE	SWER		;++003 ... IS IN ERROR
    426	001164	000616 			FDONE:	BR	DVSX		;++003 ELSE, FILE SCAN IS DONE
    427					;++003   STAR WAS DETECTED
    428	001166	005326 			FNS:	DEC	(SP)+		;++003 IF MORE THAN ONE CHAR ...
    429	001170	001331 				BNE	SWER		;++003 ... THEN * IS IN ERROR
    430	001172	122720 	000056 			CMPB	#DOT,(R0)+	;++003 IF NEXT CHAR IS NOT A DOT ...
    431	001176	001326 				BNE	SWER		;++003 ... THEN * IS IN ERROR
    432	001200	000403 				BR	FNP1		;++003 ELSE, LOOK AT FILE TYPE
    433					;++003   DOT WAS DETECTED
    434	001202	022726 	000012 		FNP:	CMP	#10.,(SP)+	;++003 IF MORE THAN 10 CHARS ...
    435	001206	002722 				BLT	SWER		;++003 ... FILE NAME IS IN ERROR
    436	001210	010403 			FNP1:	MOV	R4,R3		;++003 SET POINTER
    437	001212	160003 				SUB	R0,R3		;IF NO FILE TYPE
    438	001214	001763 				BEQ	FDONE		;++006 ... THEN JUST RETURN
    439	001216	022703 	000003 			CMP	#3,R3		;OR IF LONGER THAN 3 CHARS
    440	001222	103714 				BLO	SWER		;++003 ... FILE TYPE IS IN ERROR
    441	001224	005303 				DEC	R3		;IF 1 CHAR
    442	001226	001003 				BNE	FN2
    443	001230	122710 	000052 			CMPB	#STAR,(R0)	;CHECK IF STAR
    444	001234	001753 				BEQ	FDONE		;++004 IF SO, DONE
    445	001236	004767 	177142 		FN2:	JSR	PC,CHRTYP	;GET CHAR TYPE
    446	001242	162703 	000003 			SUB	#PERIOD,R3	;IF RAD50 CHAR BRANCH
    447	001246	100773 				BMI	FN2
    448	001250	020004 				CMP	R0,R4		;ELSE IF DELIM,
    449	001252	101344 				BHI	FDONE		;++003 DONE
    450	001254	000677 				BR	SWER		;++003 ELSE, ERROR
    451					;
    452					;
    453					;
    454		000001 				.END
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 2-8
SYMBOL TABLE

ALPHA = 000001   	C.CMLD= 000002   	C.TYPR= 000000   	GD      000350R  	SCAN    000204R
ASTER = 000004   	C.DEVD= 000006   	DELTAB  000330R  	GDX     000370R  	SEMIC = 000073
BLANK = 000040   	C.DIAD= 000014   	DOLLAR= 000044   	GD1     000364R  	SETINP  000136R
CHARA = 000101   	C.DILN= 000012   	DOLSGN= 000002   	GD2     000374R  	SLASH = 000057
CHARZ = 000132   	C.DIRD= 000012   	DONE    000242R  	GETDEL  000346R  	STAR  = 000052
CHAR0 = 000060   	C.DSDS= 000006   	DOT   = 000056   	INPSET  000162R  	STAT0   000265R
CHAR9 = 000071   	C.DVAD= 000010   	DSPTBL  000250R  	JUMP    000234R  	STAT1   000274R
CHRTYP  000404R  	C.DVLN= 000006   	DVDSP = 000002   	LBRAC = 000133   	STAT2   000303R
COLON = 000072   	C.FILD= 000016   	DVS     000602R  	MINUS = 000055   	STAT3   000312R
COMMA = 000054   	C.FNAD= 000020   	DVSCAN  000554R  	NULL  = 000000   	STAT4   000321R
COMPRS  000060R  	C.FNLN= 000016   	DVSX    000622R  	NUMER = 000000   	SWDSP = 000012
CSICLR  000022R  	C.IDIA= 000042   	DVSX1   000624R  	NXTAB   000222R  	SWER    001054R
CS.DIF= 000002   	C.IDIL= 000040   	DVSX2   000630R  	OTHER = 000005   	SWSCAN  001024R
CS.DVF= 000004   	C.IDVA= 000032   	ELIM    000146R  	PERIOD= 000003   	SW1     001036R
CS.EQU= 000040   	C.IDVL= 000030   	EQUAL = 000075   	PLUS  = 000053   	SW2     001056R
CS.INP= 000001   	C.ISTR= 000050   	ERDSP = 000006   	PPDSP = 000004   	TAB   = 000011
CS.MOR= 000020   	C.MKW1= 000024   	ERROR   000526R  	PPOK    000702R  	TYPEX   000522R
CS.NMF= 000001   	C.MKW2= 000026   	ERR1    000542R  	PPSCAN  000634R  	VRCK    001020R
CS.OUT= 000002   	C.ODIA= 000046   	FDONE   001164R  	PPX     000736R  	VRDSP = 000010
CS.WLD= 000010   	C.ODIL= 000044   	FNDSP = 000000   	PP1     000652R  	VRSCAN  000766R
CT1     000436R  	C.ODVA= 000036   	FNP     001202R  	PVER    000744R  	XTMPX = 000014
CT2     000460R  	C.ODVL= 000034   	FNP1    001210R  	PVER1   000756R  	.CSI1   000000RG
CT3     000474R  	C.OSTR= 000052   	FNS     001166R  	PVER2   000760R  	.DCCVT= ****** GX
CT4     000510R  	C.SIZE= 000054   	FNSCAN  001116R  	PVOK    000764R  	.ODCVT= ****** GX
C.BFAD= 000004   	C.STAT= 000001   	FN1     001126R  	RBRAC = 000135   	.SAVR1= ****** GX
C.BFLN= 000002   	C.SWAD= 000022   	FN2     001236R  	RUBOUT= 000177

. ABS.	000000	   000
      	001256	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1008 WORDS  ( 4 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:16
[46,10]CSI1,[46,20]CSI1/-SP=[46,30]CSIDEF,CSI1
.CSI2	MACRO M1108  05-DEC-77 23:44  PAGE 1


      1						.MCALL	CSI$
      2	000000					CSI$
      3					;
      4		000002 			C.BFLN=C.CMLD
      5		000004 			C.BFAD=C.CMLD+2
      6		000016 			C.FNLN=C.FILD
      7		000020 			C.FNAD=C.FILD+2
      8		000006 			C.DVLN=C.DEVD
      9		000010 			C.DVAD=C.DEVD+2
     10		000012 			C.DILN=C.DIRD
     11		000014 			C.DIAD=C.DIRD+2
     12					;
     13		000032 			C.IDVA=	32	;INPUT LAST DEVICE NAME FOUND PTR
     14		000030 			C.IDVL=	30	;INPUT LAST DEVICE NAME FOUND LENGTH
     15		000036 			C.ODVA=	36	;OUTPUT LAST DEVICE NAME FOUND PTR
     16		000034 			C.ODVL=	34	;OUTPUT LAST DEVICE FOUND LENGTH
     17		000042 			C.IDIA=	42	;INPUT LAST DIR INFO PTR FOUND
     18		000040 			C.IDIL=	40	;INPUT LAST DIR INFO FOUND LENGTH
     19		000046 			C.ODIA=	46	;OUTPUT LAST DIR INFO FOUND PTR
     20		000044 			C.ODIL=	44	;OUTPUT LAST DIR INFO FOUND LENGTH
     21		000050 			C.ISTR=	50	;INPUT NEXT STRING SECTION ADDR
     22		000052 			C.OSTR=	52	;OUTPUT NEXT STRING SECTION ADDR
     23					;
     24					;	COMMAND STRING DELIMITERS
     25					;
     26		000072 			COLON=	72	;	:
     27		000054 			COMMA=	54	;	,
     28		000057 			SLASH=	57	;	/
     29		000075 			EQUAL=	75	;	=
     30		000073 			SEMIC=	73	;	;
     31		000135 			RBRAC=	135	;	]
     32		000133 			LBRAC=	133	;	[
     33					;
     34					;	CHARS DELETED FROM COMMAND STRINGS
     35					;
     36		000040 			BLANK=	40
     37		000011 			TAB=	11
     38		000000 			NULL=	0
     39		000177 			RUBOUT=	177
     40					;
     41					;	OTHER RELEVANT CHARS
     42					;
     43		000101 			CHARA=	101	;	A
     44		000132 			CHARZ=	132	;	Z
     45		000060 			CHAR0=	60	;	0
     46		000071 			CHAR9=	71	;	9
     47		000056 			DOT=	56	;	.
     48		000052 			STAR=	52	;	*
     49		000055 			MINUS=	55	;	-
     50		000053 			PLUS=	53	;	+
     51		000044 			DOLLAR=	44	;	$
     52					;
     53					;
     54					;
.CSI2	MACRO M1108  05-DEC-77 23:44  PAGE 2


      1						.TITLE	.CSI2
      2						.IDENT	/04/
      3
      4					; COPYRIGHT 1973, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
      5					; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
      6					;
      7					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
      8					; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
      9					;
     10					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
     11					; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     12					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     13					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     14					;
     15					; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     16					; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     17					; EQUIPMENT CORPORATION.
     18					;
     19					; VERSION X04
     20					;
     21					;
     22					; WRITTEN BY:
     23					;	A. MAROTTO  (CCA)
     24					;
     25					; MODIFIED BY:
     26					;	C.A. D'ELIA	31-JAN-74	001
     27					;	C.A. D'ELIA	15-MAR-74	002
     28					;	C.A. D'ELIA	04-JUN-74	003
     29					;
     30					;
     31					;
     32					;	COMMAND STRING INTERPRETER - SEMANTIC PARSER
     33					;
     34					;
     35					;
     36					;
     37		000001 			ASVAL=1		;SWITCH VALUE TABLE ASCII CVT CODE
     38		000003 			DECVAL=3		;++003 SWITCH TABLE VALUE FOR DECIMAL CONVERT
     39					;
     40					;
     41					;
     42	000000				.CSI2::				;++002
     43	000000	004567 	000000G			JSR	R5,.SAVR1	;++002 SAVE REGISTERS
     44	000004	105060 	000001 			CLRB	C.STAT(R0)		;CLEAR STATUS
     45	000010	005060 	000024 			CLR	C.MKW1(R0)		;CLEAR SWITCHES MASK
     46	000014	005060 	000026 			CLR	C.MKW2(R0)
     47	000020	005001 				CLR	R1			;SET INPUT SWITCHES
     48	000022	016002 	000050 			MOV	C.ISTR(R0),R2		;GET INPUT STRING ADDR
     49	000026	122710 	000001 			CMPB	#CS.INP,(R0)		;BRANCH IF INPUT REQUEST
     50	000032	001410 				BEQ	CSI21
     51	000034	122710 	000002 			CMPB	#CS.OUT,(R0)		;BRANCH IF OUTPUT REQUEST
     52	000040	001402 				BEQ	CSI20
     53	000042	000261 				SEC				;SET ERROR
     54	000044	000207 				RTS	PC			;EXIT
     55	000046	005201 			CSI20:	INC	R1			;SET OUTPUT SWITCH
     56	000050	016002 	000052 			MOV	C.OSTR(R0),R2		;GET OUTPUT STRING ADDR
     57	000054	004767 	000760 		CSI21:	JSR	PC,DELSCN		;SCAN TO A DELIM
.CSI2	MACRO M1108  05-DEC-77 23:44  PAGE 2-1


     58	000060	012703 	000102'			MOV	#DVVECT,R3		;ADDR DEV INFO CTL VECT
     59	000064	004767 	000032 			JSR	PC,DIDVSN		;DO DEV PROCESSING
     60	000070	012703 	000112'			MOV	#DIVECT,R3		;ADDR DIR INFO CTL VECT
     61	000074	004767 	000022 			JSR	PC,DIDVSN		;DO DIR PROCESSING
     62	000100	000463 				BR	CSI26			;DO FILENAME PROCESSING
     63					;
     64	000102	   030 	   072 	   000 	DVVECT:	.BYTE	C.IDVL,COLON,0,0,CS.DVF,C.DVLN,0,COLON
	000105	   000 	   004 	   006
	000110	   000 	   072
     65					;
     66	000112	   040 	   135 	   001 	DIVECT:	.BYTE	C.IDIL,RBRAC,1,0,CS.DIF,C.DILN,1,RBRAC
	000115	   000 	   002 	   012
	000120	   001 	   135
     67					;
     68	000122	010446 			DIDVSN:	MOV	R4,-(SP)		;SAVE STRING SEG END
     69	000124	010246 				MOV	R2,-(SP)		;AND START PTRS
     70	000126	010546 				MOV	R5,-(SP)		;SAVE DELIM
     71	000130	112305 				MOVB	(R3)+,R5		;DISP TO 4WD I/O SAVE PTRS
     72	000132	060005 				ADD	R0,R5			;ADDR OF INPUT SAVE PTRS
     73	000134	005701 				TST	R1			;BRANCH IF INPUT
     74	000136	001401 				BEQ	CSI22
     75	000140	022525 				CMP	(R5)+,(R5)+	;++001 INCR R5 TO PNT TO OUTPUT
     76	000142	122316 			CSI22:	CMPB	(R3)+,(SP)		;BRANCH IF NOT DEV/DIR INFO
     77	000144	001005 				BNE	CSI23
     78	000146	062304 				ADD	(R3)+,R4		;ADJUSTMENT FOR DIR INFO
     79	000150	160204 				SUB	R2,R4			;CALC LEN OF SEG
     80	000152	152360 	000001 			BISB	(R3)+,C.STAT(R0)	;SET FOUND THIS SEG
     81	000156	000405 				BR	CSI24
     82	000160	062703 	000003 		CSI23:	ADD	#3,R3			;STEP OVER CTL VECT BYTES
     83	000164	011504 				MOV	(R5),R4		;GET PREVIOUS LEN
     84	000166	016502 	000002 			MOV	2(R5),R2		;AND ADDR
     85	000172	010425 			CSI24:	MOV	R4,(R5)+	;++001 SAVE LENGTH/ADDR INFO IN ...
     86	000174	010215 				MOV	R2,(R5)		;++001 ... LAST FOUND WORDS
     87	000176	112305 				MOVB	(R3)+,R5		;CALC ADDR OF
     88	000200	060005 				ADD	R0,R5			;RETURN LEN AND ADDR
     89	000202	010425 				MOV	R4,(R5)+		;RETURN LENGTH AND ADDR
     90	000204	010215 				MOV	R2,(R5)
     91	000206	105723 				TSTB	(R3)+			;FALL THRU FOR DIR INFO
     92	000210	001405 				BEQ	CSI25			;ONLY
     93	000212	005704 				TST	R4
     94	000214	001403 				BEQ	CSI25			;BRANCH IF NO DIR INFO
     95	000216	060204 				ADD	R2,R4
     96	000220	004767 	000706 			JSR	PC,WILDCK		;WILD CARD SCAN
     97	000224	012605 			CSI25:	MOV	(SP)+,R5		;RESTORE DELIM
     98	000226	012602 				MOV	(SP)+,R2		;SEG LEN AND ADDR
     99	000230	012604 				MOV	(SP)+,R4
    100	000232	121305 				CMPB	(R3),R5		;BRANCH IF WAS NOT
    101	000234	001004 				BNE	CSI25X			;DEV(OR DIR) INFO
    102	000236	010402 				MOV	R4,R2			;ELSE SET NEW PTRS
    103	000240	005202 				INC	R2
    104	000242	004767 	000572 			JSR	PC,DELSCN		;SCAN TO DELIM
    105	000246	000207 			CSI25X:	RTS	PC
    106					;
    107					;
    108	000250	010260 	000020 		CSI26:	MOV	R2,C.FNAD(R0)		;SET FILE NAME ADDR
    109	000254	010403 				MOV	R4,R3
    110	000256	160203 				SUB	R2,R3			;CALC FILE NAME LEN
.CSI2	MACRO M1108  05-DEC-77 23:44  PAGE 2-2


    111	000260	010360 	000016 			MOV	R3,C.FNLN(R0)		;SET FILE NAME LENGTH
    112	000264	001405 				BEQ	CSI27			;BRANCH IF NONE
    113	000266	152760 	000001 	000001 		BISB	#CS.NMF,C.STAT(R0)	;SET FILE NAME FOUND STATUS
    114	000274	004767 	000632 			JSR	PC,WILDCK
    115	000300	010402 			CSI27:	MOV	R4,R2			;POINT TO LAST FOUND DELIM
    116	000302	005004 				CLR	R4			;CLEAR ERROR SWITCH
    117	000304	122705 	000057 			CMPB	#SLASH,R5
    118	000310	001002 				BNE	CSI28			;BRANCH IF NO SWITCHES
    119	000312	004767 	000040 			JSR	PC,SWITCH		;GO PROCESS SWITCHES
    120	000316	122705 	000075 		CSI28:	CMPB	#EQUAL,R5		;BRANCH IF AT END OF STRING
    121	000322	001404 				BEQ	CSI29
    122	000324	152760 	000020 	000001 		BISB	#CS.MOR,C.STAT(R0)	;ELSE SET MORE STRINGS FOLLOW
    123	000332	005202 				INC	R2			;STEP OVER LAST DELIMITER
    124	000334	005701 			CSI29:	TST	R1
    125	000336	001003 				BNE	CSI30			;BRANCH IF OUTPUT
    126	000340	010260 	000050 			MOV	R2,C.ISTR(R0)		;SAVE INPUT STRING PTR
    127	000344	000402 				BR	CSIXIT
    128	000346	010260 	000052 		CSI30:	MOV	R2,C.OSTR(R0)		;SAVE OUTPUT STRING PTR
    129	000352	006004 			CSIXIT:	ROR	R4			;SET ERROR VALUE(C-BIT ON IF ERROR)
    130	000354	000207 				RTS	PC			;EXIT
    131					;
    132					;
    133					;	PROCESS SWITCHES HERE
    134					;
    135					;	R2 = STRING PTR(POINTS TO /)(RETURNED AT END OF STRING)
    136					;	R4 = RETURNED 0=NO ERROR, 1=ERROR
    137					;	R5 = DELIMTER AT END OF THIS STRING
    138					;
    139	000356	016003 	000022 		SWITCH:	MOV	C.SWAD(R0),R3		;GET SWITCH TABLE ADDR
    140	000362	001523 				BEQ	SWER			;ERROR IF NONE SPECIFIED
    141	000364	005202 				INC	R2			;STEP OVER CURRENT DELIM
    142	000366	004767 	000446 			JSR	PC,DELSCN		;GET NEXT DELIM
    143	000372	010446 				MOV	R4,-(SP)		;SAVE DELIM PTR
    144	000374	010546 				MOV	R5,-(SP)		;AND DELIM CHAR
    145	000376	005046 				CLR	-(SP)			;SETUP SWITCH NEG FLAG
    146	000400	122712 	000055 			CMPB	#MINUS,(R2)	;++001 IS SWITCH NEGATED BY MINUS?
    147	000404	001410 				BEQ	10$		;++001 IF SO, SKIP TO INDICATE NEGATE
    148	000406	122712 	000116 			CMPB	#'N,(R2)	;++001 ELSE, TEST FOR THE ALTERNATE ...
    149	000412	001007 				BNE	SW		;++001 ... FORM OF NEGATE -- ...
    150	000414	122762 	000117 	000001 		CMPB	#'O,1(R2)	;++001 ... /NOSW
    151	000422	001003 				BNE	SW		;++001 SKIP IF NOT TRUE
    152	000424	005202 				INC	R2		;++001 INCREMENT POINTER (R2) PAST NEGATE
    153	000426				10$:				;++001
    154	000426	005202 				INC	R2
    155	000430	005216 				INC	(SP)
    156	000432	160204 			SW:	SUB	R2,R4
    157	000434	001473 				BEQ	SWER1			;IF SWITCH LEN 0, ERROR
    158	000436	005005 				CLR	R5
    159	000440	152205 				BISB	(R2)+,R5		;SET FIRST SWITCH CHAR
    160	000442	005304 				DEC	R4
    161	000444	001403 				BEQ	SW1			;BRANCH IF ONLY 1 CHAR
    162	000446	000305 				SWAB	R5
    163	000450	151205 				BISB	(R2),R5			;SET SECOND SWITCH CHAR
    164	000452	000305 				SWAB	R5
    165	000454	010304 			SW1:	MOV	R3,R4			;ADDR SWITCH TABLE
    166	000456	005714 			SW2:	TST	(R4)			;ERROR IF END OF TABLE
    167	000460	001461 				BEQ	SWER1
.CSI2	MACRO M1108  05-DEC-77 23:44  PAGE 2-3


    168	000462	020524 				CMP	R5,(R4)+	;++001 BR IF SWITCH FND IN TABLE
    169	000464	001403 				BEQ	SW3
    170	000466	062704 	000006 			ADD	#6.,R4		;++001 SET ADDR OF NEXT ENTRY
    171	000472	000771 				BR	SW2
    172	000474	051460 	000024 		SW3:	BIS	(R4),C.MKW1(R0)	;++001 SET 'OR' OF MASK WORDS
    173	000500	005716 				TST	(SP)			;BRANCH IF NEG SWITCH
    174	000502	001003 				BNE	SW3A
    175	000504	051460 	000026 			BIS	(R4),C.MKW2(R0)	;++001 SET SWITCH ON
    176	000510	000406 				BR	SW3B
    177	000512	032764 	000001 	000004 	SW3A:	BIT	#1,4(R4)	;++001 IS NEGATIVE SWITCH ALLOWED?
    178	000520	001441 				BEQ	SWER1			;ERROR IF NOT
    179	000522	041460 	000026 			BIC	(R4),C.MKW2(R0)	;++001 SET SWITCH OFF
    180	000526	016405 	000002 		SW3B:	MOV	2(R4),R5	;++001 ADDR OF LOCN TO BE MASKED
    181	000532	000241 				CLC
    182	000534	006005 				ROR	R5
    183	000536	001413 				BEQ	SW5			;BRANCH IF NO MASK ADDR
    184	000540	103405 				BCS	SW4			;BRANCH IF TO CLEAR LOCN WITH MASK
    185	000542	006105 				ROL	R5
    186	000544	005716 				TST	(SP)			;BRANCH IF NEG SW TO CLEAR
    187	000546	001006 				BNE	SW4A
    188	000550	051415 			SW3C:	BIS	(R4),(R5)	;++001 CLEAR MASK IN LOCN
    189	000552	000405 				BR	SW5
    190	000554	000241 			SW4:	CLC
    191	000556	006105 				ROL	R5
    192	000560	005716 				TST	(SP)			;BRANCH IF NEG SW TO SET
    193	000562	001372 				BNE	SW3C
    194	000564	041415 			SW4A:	BIC	(R4),(R5)	;++001 CLEAR MASK IN LOCN
    195	000566	005726 			SW5:	TST	(SP)+
    196	000570	012605 				MOV	(SP)+,R5		;LAST DELIMITER SCANNED
    197	000572	012602 				MOV	(SP)+,R2		;ADDR OF IT
    198	000574	016404 	000004 			MOV	4(R4),R4	;++001 ADDR OF VALUE TABLE (IF ANY)
    199	000600	042704 	000001 			BIC	#1,R4			;DEL NEG SW ALLOWED BIT
    200	000604	120527 	000057 		SW6:	CMPB	R5,#SLASH		;DOES ANOTHER SWITCH FOLLOW
    201	000610	001662 				BEQ	SWITCH			;BRANCH IF SO
    202	000612	120527 	000072 			CMPB	R5,#COLON		;DOES A SWITCH VALUE FOLLOW
    203	000616	001422 				BEQ	SWVAL			;GO PROCESS
    204	000620	005004 				CLR	R4			;SET NO ERROR
    205	000622	000207 				RTS	PC			;EXIT
    206					;
    207	000624	005726 			SWER1:	TST	(SP)+
    208	000626	012605 				MOV	(SP)+,R5		;GET LAST DELIM FOUND
    209	000630	012602 				MOV	(SP)+,R2		;GET ITS ADDR
    210	000632	120527 	000075 		SWER:	CMPB	R5,#EQUAL		;IS IT END OF CURRENT SECTION
    211	000636	001407 				BEQ	SWERX
    212	000640	120527 	000054 			CMPB	R5,#COMMA
    213	000644	001404 				BEQ	SWERX			;BRANCH IF SO
    214	000646	005202 				INC	R2			;ELSE STEP OVER IT
    215	000650	004767 	000164 			JSR	PC,DELSCN		;GET NEXT DELIM
    216	000654	000766 				BR	SWER			;LOOP UNTIL END OF CURRENT SECTION
    217	000656	012704 	000001 		SWERX:	MOV	#1,R4			;SET ERROR
    218	000662	000207 				RTS	PC			;EXIT
    219					;
    220					;
    221	000664	010403 			SWVAL:	MOV	R4,R3
    222	000666	001761 				BEQ	SWER			;ERROR IF NO VALUE TABLE
    223	000670	005713 				TST	(R3)
    224	000672	001757 				BEQ	SWER			;ERROR IF NO MORE ENTRIES
.CSI2	MACRO M1108  05-DEC-77 23:44  PAGE 2-4


    225	000674	005202 				INC	R2			;STEP OVER LAST DELIM
    226	000676	004767 	000136 			JSR	PC,DELSCN		;SCAN TO NEXT
    227	000702	010446 				MOV	R4,-(SP)		;SAVE PTR TO DELIM
    228	000704	010546 				MOV	R5,-(SP)		;AND DELIM CHAR
    229	000706	016305 	000002 			MOV	2(R3),R5	;++001 GET RESULT ADDR
    230	000712	122327 	000001 			CMPB	(R3)+,#ASVAL	;++001 SHOULD SW-VALUE BE ASCII?
    231	000716	001025 				BNE	SVNUM			;BRANCH IF NUMBERIC CVT REQUIRED
    232	000720	160204 				SUB	R2,R4			;GET VALUE LEN
    233	000722	121304 				CMPB	(R3),R4		;++001 CMPR WITH ALLOWED LENGTH
    234	000724	103001 				BHIS	SWVL1			;BRANCH IF SAME OR SMALLER THAN ALLOWED
    235	000726	111304 				MOVB	(R3),R4		;++001 SET LENGTH ALLOWED
    236	000730	010446 			SWVL1:	MOV	R4,-(SP)		;SAVE LEN
    237	000732	001403 				BEQ	SWVL3			;BRANCH IF NONE TO MOVE
    238	000734	112225 			SWVL2:	MOVB	(R2)+,(R5)+		;MOVE CHARS
    239	000736	005304 				DEC	R4			;UNTIL COUNT EXHAUSTED
    240	000740	001375 				BNE	SWVL2
    241	000742	111304 			SWVL3:	MOVB	(R3),R4		;++001 GET ALLOWED LENGTH
    242	000744	162604 				SUB	(SP)+,R4		;CALC SPACE LEFT TO PAD
    243	000746	001403 				BEQ	SWVL5			;BRANCH IF NONE
    244	000750	105025 			SWVL4:	CLRB	(R5)+			;PAD WITH NULLS
    245	000752	005304 				DEC 	R4
    246	000754	001375 				BNE	SWVL4
    247	000756	062703 	000003 		SWVL5:	ADD	#3,R3		;++001 ADDR OF NEXT VAL TABLE ENTRY
    248	000762	012605 				MOV	(SP)+,R5		;GET LAST DELIM CHAR
    249	000764	012602 				MOV	(SP)+,R2		;GET ADDR OF DELIM CHAR
    250	000766	010304 				MOV	R3,R4
    251	000770	000705 				BR	SW6			;GO DECIDE WHAT TO DO
    252					;
    253	000772	010346 			SVNUM:	MOV	R3,-(SP)
    254	000774	012746 	000000G			MOV	#.ODCVT,-(SP)	;++003 ASSUME NUMERIC CONVERT (OCTAL DFLT)
    255	001000	122743 	000003 			CMPB	#DECVAL,-(R3)	;++003 IS DECIMAL DEFAULT DESIRED?
    256	001004	001002 				BNE	10$		;++003 BRANCH IF NOT
    257	001006	012716 	000000G			MOV	#.DCCVT,(SP)	;++003 ELSE, SPECIFY DECIMAL DEFAULT
    258	001012				10$:				;++003
    259	001012	010503 				MOV	R5,R3		;++001 SET RESULT ADDR
    260	001014	005013 				CLR	(R3)
    261	001016	160204 				SUB	R2,R4			;LENGTH OF DIGIT STRING
    262	001020	001404 				BEQ	SVNMX			;SKIP NULL STRING
    263	001022	010205 				MOV	R2,R5			;SET STRING ADDR
    264	001024	004736 				JSR	PC,@(SP)+	;++003 CALL NUMERIC CONVERT
    265	001026	103676 				BCS	SWER1			;BRANCH IF ERROR
    266	001030	000401 				BR	SVNMX2		;++003 BRANCH TO LEAVE
    267	001032	005726 			SVNMX:	TST	(SP)+		;++003 PURGE CONVERT ADDR FROM STACK
    268	001034	012603 			SVNMX2:	MOV	(SP)+,R3	;++003 RESTORE R3
    269	001036	000747 				BR	SWVL5
    270					;
    271					;
    272					;	SCAN COMMAND STRING FOR : / = , ] OR END OF STRING
    273					;	RETURN ADDR IN R4, DELIMETER IN R5(END OF STRING BECOMES=)
    274					;
    275					;	NOTE: CHARS INSIDE [] IGNORED.
    276					;
    277	001040	016046 	000004 		DELSCN:	MOV	C.BFAD(R0),-(SP)	;ADDRESS END OF STRING
    278	001044	066016 	000002 			ADD	C.BFLN(R0),(SP)
    279	001050	010204 				MOV	R2,R4			;ADDR FOR SCAN START
    280	001052	012705 	001122'		DEL:	MOV	#DELTAB,R5		;ADDR DELIMITER TABLE
    281	001056	020416 				CMP	R4,(SP)		;++001 CMPR WITH END OF STRING
.CSI2	MACRO M1108  05-DEC-77 23:44  PAGE 2-5


    282	001060	001414 				BEQ	DEL3			;BRANCH IF AT END OF STRING
    283	001062	121425 				CMPB	(R4),(R5)+	;++001 IGNORE CHARS INSIDE []
    284	001064	001004 				BNE	DEL2
    285	001066	005204 			DEL1:	INC	R4		;++001 INCR TO NEXT CHAR
    286	001070	121415 				CMPB	(R4),(R5)	;++001 IS IT R-BRACKET?
    287	001072	001375 				BNE	DEL1		;++001 NO, TRY NEXT CHAR
    288	001074	000407 				BR	DELX
    289	001076	121415 			DEL2:	CMPB	(R4),(R5)	;++001 CMPR CHAR WITH DELIMITER
    290	001100	001405 				BEQ	DELX		;++001 BRANCH IF DELIMITER FOUND
    291	001102	105725 				TSTB	(R5)+		;++001 LAST DELIMITER IS NULL
    292	001104	001374 				BNE	DEL2			;BRANCH IF NOT AT END OF TABLE
    293	001106	005204 				INC	R4			;ADVANCE STRING PTR
    294	001110	000760 				BR	DEL			;GO CHECK NEXT CHAR
    295	001112	122525 			DEL3:	CMPB	(R5)+,(R5)+	;++001 POINT R5 TO EQUAL SIGN
    296	001114	111505 			DELX:	MOVB	(R5),R5		;++001 SET THE DELIMITER FOUND
    297	001116	005726 				TST	(SP)+		;++001 CLEAN STACK
    298	001120	000207 				RTS	PC			;EXIT
    299	001122	   133 	   135 	   075 	DELTAB:	.BYTE	LBRAC,RBRAC,EQUAL,COLON,SLASH,COMMA,NULL ;++001
	001125	   072 	   057 	   054
	001130	   000
    300						.EVEN
    301					;
    302					;	CHECK IF WILD CARD VALUE IN FILE NAME JUST FOUND
    303					;
    304	001132	122722 	000052 		WILDCK:	CMPB	#STAR,(R2)+
    305	001136	001403 				BEQ	WILDEX			;BRANCH IF WILD CARD FOUND
    306	001140	020204 				CMP	R2,R4
    307	001142	001373 				BNE	WILDCK			;BRANCH IF NOT AT END OF NAME
    308	001144	000207 				RTS	PC			;EXIT
    309	001146	152760 	000010 	000001 	WILDEX:	BISB	#CS.WLD,C.STAT(R0)	;SET WILD CARD STATUS
    310	001154	000207 				RTS	PC			;EXIT
    311					;
    312		000001 				.END
.CSI2	MACRO M1108  05-DEC-77 23:44  PAGE 2-6
SYMBOL TABLE

ASVAL = 000001   	CS.EQU= 000040   	C.ISTR= 000050   	DOLLAR= 000044   	SWVL1   000730R
BLANK = 000040   	CS.INP= 000001   	C.MKW1= 000024   	DOT   = 000056   	SWVL2   000734R
CHARA = 000101   	CS.MOR= 000020   	C.MKW2= 000026   	DVVECT  000102R  	SWVL3   000742R
CHARZ = 000132   	CS.NMF= 000001   	C.ODIA= 000046   	EQUAL = 000075   	SWVL4   000750R
CHAR0 = 000060   	CS.OUT= 000002   	C.ODIL= 000044   	LBRAC = 000133   	SWVL5   000756R
CHAR9 = 000071   	CS.WLD= 000010   	C.ODVA= 000036   	MINUS = 000055   	SW1     000454R
COLON = 000072   	C.BFAD= 000004   	C.ODVL= 000034   	NULL  = 000000   	SW2     000456R
COMMA = 000054   	C.BFLN= 000002   	C.OSTR= 000052   	PLUS  = 000053   	SW3     000474R
CSIXIT  000352R  	C.CMLD= 000002   	C.SIZE= 000054   	RBRAC = 000135   	SW3A    000512R
CSI20   000046R  	C.DEVD= 000006   	C.STAT= 000001   	RUBOUT= 000177   	SW3B    000526R
CSI21   000054R  	C.DIAD= 000014   	C.SWAD= 000022   	SEMIC = 000073   	SW3C    000550R
CSI22   000142R  	C.DILN= 000012   	C.TYPR= 000000   	SLASH = 000057   	SW4     000554R
CSI23   000160R  	C.DIRD= 000012   	DECVAL= 000003   	STAR  = 000052   	SW4A    000564R
CSI24   000172R  	C.DSDS= 000006   	DEL     001052R  	SVNMX   001032R  	SW5     000566R
CSI25   000224R  	C.DVAD= 000010   	DELSCN  001040R  	SVNMX2  001034R  	SW6     000604R
CSI25X  000246R  	C.DVLN= 000006   	DELTAB  001122R  	SVNUM   000772R  	TAB   = 000011
CSI26   000250R  	C.FILD= 000016   	DELX    001114R  	SW      000432R  	WILDCK  001132R
CSI27   000300R  	C.FNAD= 000020   	DEL1    001066R  	SWER    000632R  	WILDEX  001146R
CSI28   000316R  	C.FNLN= 000016   	DEL2    001076R  	SWERX   000656R  	.CSI2   000000RG
CSI29   000334R  	C.IDIA= 000042   	DEL3    001112R  	SWER1   000624R  	.DCCVT= ****** GX
CSI30   000346R  	C.IDIL= 000040   	DIDVSN  000122R  	SWITCH  000356R  	.ODCVT= ****** GX
CS.DIF= 000002   	C.IDVA= 000032   	DIVECT  000112R  	SWVAL   000664R  	.SAVR1= ****** GX
CS.DVF= 000004   	C.IDVL= 000030

. ABS.	000000	   000
      	001156	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  923 WORDS  ( 4 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[46,10]CSI2,[46,20]CSI2/-SP=[46,30]CSIDEF,CSI2
CVTUC	MACRO M1108  05-DEC-77 23:41  PAGE 2


      1						.TITLE	CVTUC
      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  QUBJECT 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 23-JAN-75
     22					;
     23					; CONVERT ASCII TEXT TO UPPER CASE
     24					;
     25					;+
     26					; **-$CVTUC-CONVERT TEXT TO UPPER CASE
     27					;
     28					; THIS SUBROUTINE IS CALLED TO PERFORM A BYTE BY BYTE TRANSFER
     29					; OF AN ASCII STRING CONVERTING ALL ALPHABETIC CHARACTERS
     30					; TO UPPER CASE.
     31					;
     32					; INPUTS:
     33					;
     34					;	R0=SOURCE ADDRESS
     35					;	R1=DESTINATION ADDRESS
     36					;	R2=BYTE COUNT
     37					;
     38					;	IF R0=R1 THEN THE STRING IS CONVERTED IN PLACE.
     39					;
     40					;
     41					; OUTPUTS:
     42					;
     43					;	R0=ADDRESS OF NEXT BYTE AFTER INPUT STRING
     44					;	R1=ADDRESS OF NEXT BYTE AFTER OUTPUT STRING
     45					;
     46					;	THE STRING IS MOVED FROM THE LOCATIONS POINTED TO BY
     47					; R0 TO THE LOCATIONS SPECIFIED BY R1. ALL CHARACTERS BETWEEN
     48					; LOWER CASE 'A' AND LOWER CASE 'Z' ARE CONVERTED TO UPPER CASE
     49					;
     50					; R2 IS DESTROYED, R3 - R5 ARE PRESERVED
     51					;
     52					;-
     53
     54	000000				$CVTUC::			;
     55	000000	121027 	000141 			CMPB	(R0),#141	; CHARACTER IN LOWER CASE RANGE?
     56	000004	103405 				BLO	10$		; IF LO NO
     57	000006	121027 	000172 			CMPB	(R0),#172	; CHARACTER OUTSIDE LOWER CASE RANGE?
CVTUC	MACRO M1108  05-DEC-77 23:41  PAGE 2-1


     58	000012	101002 				BHI	10$		; IF HI YES
     59	000014	142710 	000040 			BICB	#40,(R0)	; CONVERT TO UPPER CASE
     60	000020				10$:				;
     61	000020	112021 				MOVB	(R0)+,(R1)+	; MOVE CHARACTER
     62	000022					SOB	R2,$CVTUC	; REPEAT
     63	000026					RETURN			;
     64
     65		000001 				.END
CVTUC	MACRO M1108  05-DEC-77 23:41  PAGE 2-2
SYMBOL TABLE

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

. ABS.	000000	   000
      	000030	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  512 WORDS  ( 2 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:05
[46,10]CVTUC,[46,20]CVTUC/-SP=[46,30]MACFLM.,CVTUC
C5TA	MACRO M1108  05-DEC-77 23:41  PAGE 2


      1						.TITLE	C5TA
      2						.IDENT	/02/							;**NEW**
      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 02
     20					;
     21					; D.N. CUTLER 11-SEP-72
     22					;+
     23					; **-$C5TA-RADIX 50 TO ASCII CONVERSION
     24					;
     25					; INPUTS:
     26					;
     27					;	R0=ADDRESS TO STORE FIRST BYTE IN OUTPUT STRING.
     28					;	R1=RAD50 WORD TO BE CONVERTED
     29					;
     30					; OUTPUTS:
     31					;
     32					;	NUMBER IS CONVERTED TO DECIMAL AND STORED IN CONSECUTIVE BYTES.
     33					;	R0=ADDRESS OF NEXT BYTE AFTER LAST DIGIT STORED.
     34					;-
     35
     36	000000	010002 			$C5TA::	MOV	R0,R2		;SAVE BYTE ADDRESS
     37	000002					CALL	CVTC		;CONVERT FIRST CHAR
     38	000006	010046 				MOV	R0,-(SP)	;SAVE IT
     39	000010					CALL	CVTC		;CONVERT SECOND CHAR
     40	000014	010046 				MOV	R0,-(SP)	;SAVE IT
     41	000016					CALL	CVTC		;CONVERT THIRD CHAR
     42	000022	110022 				MOVB	R0,(R2)+	;STORE IT
     43	000024	112622 				MOVB	(SP)+,(R2)+	;STORE SECOND CHAR
     44	000026	112622 				MOVB	(SP)+,(R2)+	;STORE FIRST CHARACTER
     45	000030	010200 				MOV	R2,R0		;SAVE TERMINAL ADDRESS
     46	000032					RETURN			;
     47
     48					;
     49					;	CONVERT RAD50 CHARACTER
     50					;
     51
     52
     53						.IF	DF	V1145
     54
     55					CVTC:	CLR	R0		;CLEAR UPPER PART
     56						DIV	#50,R0		;DIVIDE EM UP
     57
C5TA	MACRO M1108  05-DEC-77 23:41  PAGE 2-1


     58						.ENDC
     59
     60
     61						.IF	NDF	V1145
     62
     63	000034	010100 			CVTC:	MOV	R1,R0		;DIVIDEND TO R0
     64	000036	012701 	000050 			MOV	#50,R1		;DIVISOR TO R1
     65	000042					CALL	$DIV		;DIVIDE EM UP
     66
     67						.ENDC
     68
     69
     70	000046	010146 				MOV	R1,-(SP)	;SAVE REMAINDER
     71	000050	010001 				MOV	R0,R1		;QUOTIENT TO R1
     72	000052	012600 				MOV	(SP)+,R0	;RETRIEVE REMAINDER
     73	000054	001412 				BEQ	3$		;IF EQ BLANK
     74	000056	020027 	000033 			CMP	R0,#33		;TEST MIDDLE
     75	000062	002405 				BLT	2$		;IF LT ALPHA
     76	000064	001402 				BEQ	1$		;IF EQ DOLLAR
     77	000066	062700 	000011 			ADD	#22-11,R0	;
     78	000072	062700 	177711 		1$:	ADD	#11-100,R0	;
     79	000076	062700 	000040 		2$:	ADD	#100-40,R0	;
     80	000102	062700 	000040 		3$:	ADD	#40,R0		;
     81	000106					RETURN			;
     82
     83		000001 				.END
C5TA	MACRO M1108  05-DEC-77 23:41  PAGE 2-2
SYMBOL TABLE

CR    = 000015   	HT    = 000011   	R$$11M= 000000   	VT    = 000013   	$DIV  = ****** GX
CVTC    000034R  	LF    = 000012   	SPA   = 000040   	$C5TA   000000RG 	$$    = 000001
FF    = 000014

. ABS.	000000	   000
      	000110	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  557 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
[46,10]C5TA,[46,20]C5TA/-SP=[46,30]MACFLM.,C5TA.002
DARITH - DOUBLE PRECISION MUL, 	MACRO M1108  05-DEC-77 23:44  PAGE 1


      1						.TITLE	DARITH - DOUBLE PRECISION MUL, DIV
      2						.IDENT	/0004/
      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 0004
     19					;
     20					; PETER H. LIPMAN	27-FEB-74
     21					;
     22					; DOUBLE PRECISION MULTIPLY AND DIVIDE
     23					;
     24
     25
     26						.MCALL	RETURN
     27
     28	000000					.PSECT	$$RESL
     29
     30
     31					;+
     32					; **-$DMUL-DOUBLE PRECISION MULTIPLY
     33					;
     34					; INPUTS:
     35					;
     36					;	R0=SINGLE PRECISION MAGNITUDE MULTIPLIER
     37					;	R2,R3=DOUBLE PRECISION MAGNITUDE MULTIPLICAND
     38					;
     39					; OUTPUTS:
     40					;
     41					;	C=0
     42					;	R0,R1=DOUBLE PRECISION MAGNITUDE RESULT
     43					;	R2,R3 ALTERED
     44					;	R4,R5 PRESERVED
     45					;-
     46	000000				$DMUL::
     47	000000	010046 				MOV	R0,-(SP)	;SINGLE PRECISION MULTIPLIER
     48	000002	005000 				CLR	R0		;INIT THE RESULT
     49	000004	005001 				CLR	R1		;
     50	000006	005716 			10$:	TST	(SP)		;IF REMAINING MULTIPLIER IS ZERO
     51	000010	001410 				BEQ	30$		;THEN ALL THROUGH
     52	000012	006016 				ROR	(SP)		;IF NEXT BIT IS A ONE
     53	000014	103003 				BCC	20$		;
     54	000016	060301 				ADD	R3,R1		;THEN ADD MULTIPLICAND TO RESULT
     55	000020	005500 				ADC	R0
     56	000022	060200 				ADD	R2,R0
     57	000024	006303 			20$:	ASL	R3		;IN EITHER CASE, DOUBLE THE MULTIPLICAND
DARITH - DOUBLE PRECISION MUL, 	MACRO M1108  05-DEC-77 23:44  PAGE 1-1


     58	000026	006102 				ROL	R2
     59	000030	000766 				BR	10$		;AND SEE IF ANY MORE MULTIPLIER
     60	000032	005726 			30$:	TST	(SP)+		;CLEAN UP THE STACK, RETURN C=0
     61	000034					RETURN			;AND RETURN
DARITH - DOUBLE PRECISION MUL, 	MACRO M1108  05-DEC-77 23:44  PAGE 2


     63					;+
     64					;
     65					; **-$DDIV-DOUBLE PRECISION DIVIDE ROUTINE
     66					;
     67					; INPUTS:
     68					;
     69					;	R2=LOW ORDER OF DIVIDEND
     70					;	R1=HIGH ORDER OF DIVIDEND
     71					;	R0=DIVISOR, (15 BITS UNSIGNED)
     72					;
     73					; OUTPUTS:
     74					;
     75					;	R2=LOW ORDER OF QUOTIENT
     76					;	R1=HIGH ORDER OF QUOTIENT
     77					;	R0=REMAINDER
     78					;
     79					;-
     80
     81	000036	010346 			$DDIV::	MOV	R3,-(SP)	;SAVE R3
     82	000040	012703 	000040 			MOV	#32.,R3		;SET ITERATION COUNT IN R3
     83	000044	010046 				MOV	R0,-(SP)	;PUT DIVISOR IN STACK
     84	000046	005000 				CLR	R0		;SET REMAINDER TO ZERO
     85	000050	006302 			1$:	ASL	R2		;SHIFT THE ENTIRE DIVIDEND...
     86	000052	006101 				ROL	R1		;... ONE BIT TO THE LEFT AND ...
     87	000054	006100 				ROL	R0		;... INTO THE REMAINDER
     88	000056	020016 				CMP	R0,(SP)		;IS REMAINDER .GE. DIVISOR?
     89	000060	103402 				BLO	2$		;NO, SKIP TO ITERATION CONTROL
     90	000062	161600 				SUB	(SP),R0		;YES, SUBTRACT DIVISOR OUT
     91	000064	005202 				INC	R2		;AND INCREMENT THE QUOTIENT
     92	000066	005303 			2$:	DEC	R3		;REPEAT AS LONG AS NECESSARY
     93	000070	003367 				BGT	1$
     94	000072	005726 				TST	(SP)+		;PURGE DIVISOR FROM STACK
     95	000074	012603 				MOV	(SP)+,R3	;RESTORE R3
     96	000076					RETURN			;
     97					;
     98					;
     99		000001 				.END
DARITH - DOUBLE PRECISION MUL, 	MACRO M1108  05-DEC-77 23:44  PAGE 2-1
SYMBOL TABLE

$DDIV   000036RG    002	$DMUL   000000RG    002

. ABS.	000000	   000
      	000000	   001
$$RESL	000100	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  132 WORDS  ( 1 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:04
[46,10]DARITH,[46,20]DARITH/-SP=[46,30]DARITH
DEL 0100MS, DELETE FILE IN FNB	MACRO M1108  05-DEC-77 22:07  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
DEL 0100MS, DELETE FILE IN FNB	MACRO M1108  05-DEC-77 22:07  PAGE 7


						.TITLE	DEL 0100MS, DELETE FILE IN FNB
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 14-OCT-73
     21					;
DEL 0100MS, DELETE FILE IN FNB	MACRO M1108  05-DEC-77 22:07  PAGE 8


     23					;+
     24					; DELETE FILE BY FILE NAME BLOCK
     25					; CALLING SEQUENCE:
     26					;	CALL	..DEL1
     27					; INPUTS:
     28					;	R0=FDB ADDRESS
     29					;	R1=FILE NAME BLOCK ADDRESS, ALL SET UP
     30					; OUTPUTS:
     31					;	C=0 IF SUCCESSFUL, C=1 IF ERROR, F.ERR SET
     32					;	R0,R1 PRESERVED, R2-R5 ALTERED
     33					; OPERATION:
     34					;	REMOVES FILE FROM DIRECTORY (DID IN FILE NAME BLOCK)
     35					; EXIT  IF FAIL TO REMOVE. MARK FILE FOR DELETE IF SUCCESSFUL.
     36					; IF MARK FOR DELETE FAILS, RE-ENTER FILE NAME IN DIRECTORY.
     37					;-
     38	000000				..DEL1::CALL	..RMOV
     39	000004	103414 				BCS	20$		;CAN'T REMOVE, DON'T MARK FOR DELETE
     40					; ISSUE THE MARK FILE FOR DELETE QI/O
     41	000006	010146 				MOV	R1,-(SP)
     42	000010					CALL	..MKDL
     43	000014	012601 				MOV	(SP)+,R1
     44	000016	103007 				BCC	20$
     45					; FAILED TO MARK FILE FOR DELETE, REENTER THE REMOVED DIRECTORY ENTRY
     46	000020	116046 	000000G			MOVB	F.ERR(R0),-(SP)	;SAVE THE ERROR CODE
     47	000024					CALL	..ENTR
     48	000030	112660 	000000G			MOVB	(SP)+,F.ERR(R0)	;IGNORE POSSIBLE FAILURE FROM ..ENTR
     49	000034	000261 				SEC
     50	000036				20$:	RETURN
     51					;
     52					;
     53	000040					$END	DEL
     54					;
     55					;
     56		000001 				.END
DEL 0100MS, DELETE FILE IN FNB	MACRO M1108  05-DEC-77 22:07  PAGE 8-1
SYMBOL TABLE

BD.FRE= 000001   	HA.FP = 000002   	N.DVPT= 000002   	R$$EIS= 000000   	SYUNIT= 000000
DIRTYP= 015172   	HA.NAM= 000005   	N.DVSZ= 000000   	R$$LCL= 000000   	WI.DLK= 000002
FCSEFN= 000040   	HA.TYP= 000006   	N.FNPT= 000012   	R$$MUL= 000000   	WI.LCK= 000001
FD.DVR= 000020   	HA.UAT= 000004   	N.FNSZ= 000010   	R$$OPF= 000000   	$$    = 000067
FD.EFB= 000004   	HA.UI = 000001   	PP.SEP= 000002   	R$$RSL= 000000   	..DEL1  000000RG
FD.EF1= 000010   	HA.VER= 000007   	PP.ZER= 000001   	R$$SEQ= 000000   	..ENTR= ****** GX
FD.EOF= 000002   	NB.DOT= 100000   	R$$ANI= 000000   	R$$SPL= 000000   	..MKDL= ****** GX
FD.WRT= 000001   	NB.SMI= 040000   	R$$BBF= 000000   	R$$11M= 000001   	..RMOV= ****** GX
F.ERR = ****** GX	N.DRPT= 000006   	R$$DPB= 000001   	SYDEV = 054523   	...CTL= 000001
HA.CHU= 000003   	N.DRSZ= 000004

. ABS.	000000	   000
      	000040	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2504 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]DEL,[41,20]DEL/-SP=[41,30]FCSPRE,DEL
DELETE 0101MS, DELETE THE FILE	MACRO M1108  05-DEC-77 22:07  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
DELETE 0101MS, DELETE THE FILE	MACRO M1108  05-DEC-77 22:07  PAGE 7


						.TITLE	DELETE 0101MS, DELETE THE FILE
						.IDENT	/0101MS/
      2					; ALTERED THURSDAY 2-MAY-74 14:30
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 17-AUG-73
     21					;
DELETE 0101MS, DELETE THE FILE	MACRO M1108  05-DEC-77 22:07  PAGE 8


     23					;+
     24					; DELETE A FILE - EITHER OPEN OR CLOSED
     25					;
     26					; CALLING SEQUENCE:
     27					;
     28					;	CALL	.DELET
     29					;
     30					; INPUTS:
     31					;
     32					;	R0=FDB ADDRESS
     33					;
     34					; OUTPUTS:
     35					;
     36					;	C=0 IF SUCCESSFUL, C=1 IF ERROR, F.ERR SET WITH ERROR CODE
     37					;	ALL REGISTERS PRESERVED
     38					;
     39					; OPERATION:
     40					;
     41					;	IF THE FILE WAS OPEN, IT IS CLOSED, REMOVED FROM THE DIRECTORY
     42					; AND MARKED FOR DELETE.
     43					;	IF THE FILE WAS CLOSED, A PARSE IS PERFORMED USING F.DSPT,
     44					; F.DFNB AND THEN THE FILE IS REMOVED AND MARKED FOR DELETE.
     45					;-
     46	000000				.DELET::.SAVR1
     47	000004	012760 	000001 	000000G		MOV	#1,F.ERR(R0)
     48	000012	005760 	000000G			TST	F.BDB(R0)	;IF FILE IS OPEN, CLOSE IT
     49	000016	001407 				BEQ	DELCLS
     50	000020	016001 	000000G			MOV	F.FNB(R0),R1	;PRESERVE THE FILE ID
     51	000024					CLOSE$
     52	000030	103417 				BCS	DELX2		;BRANCH IF CLOSE FAILED
     53	000032	010160 	000000G			MOV	R1,F.FNB(R0)	;RESTORE FILE ID
     54	000036				DELCLS:	CALL	..STFN		;SET UP FNB IF NOT ALREADY SET
     55	000042	103406 				BCS	DELX
     56	000044	132760 	000000G	000000G		BITB	#FD.DIR,F.RCTL(R0)
     57	000052	001402 				BEQ	DELX		;IF NOT DIRECTORY DEVICE, THEN NOP
     58	000054					CALL	..DEL1
     59	000060	005060 	000000G		DELX:	CLR	F.FNB(R0)	;RESET THE FILE ID
     60	000064					CALL	..FCSX
     61	000070				DELX2:	RETURN
     62					;
     63					;
     64	000072					$END	DELETE
     65					;
     66					;
     67		000001 				.END
DELETE 0101MS, DELETE THE FILE	MACRO M1108  05-DEC-77 22:07  PAGE 8-1
SYMBOL TABLE

BD.FRE= 000001   	F.BDB = ****** GX	NB.DOT= 100000   	R$$BBF= 000000   	SYUNIT= 000000
DELCLS  000036R  	F.ERR = ****** GX	NB.SMI= 040000   	R$$DPB= 000001   	WI.DLK= 000002
DELX    000060R  	F.FNB = ****** GX	N.DRPT= 000006   	R$$EIS= 000000   	WI.LCK= 000001
DELX2   000070R  	F.RCTL= ****** GX	N.DRSZ= 000004   	R$$LCL= 000000   	$$    = 000067
DIRTYP= 015172   	HA.CHU= 000003   	N.DVPT= 000002   	R$$MUL= 000000   	.CLOSE= ****** G
FCSEFN= 000040   	HA.FP = 000002   	N.DVSZ= 000000   	R$$OPF= 000000   	.DELET  000000RG
FD.DIR= ****** GX	HA.NAM= 000005   	N.FNPT= 000012   	R$$RSL= 000000   	.SAVR1= ****** GX
FD.DVR= 000020   	HA.TYP= 000006   	N.FNSZ= 000010   	R$$SEQ= 000000   	..DEL1= ****** GX
FD.EFB= 000004   	HA.UAT= 000004   	PP.SEP= 000002   	R$$SPL= 000000   	..FCSX= ****** GX
FD.EF1= 000010   	HA.UI = 000001   	PP.ZER= 000001   	R$$11M= 000001   	..STFN= ****** GX
FD.EOF= 000002   	HA.VER= 000007   	R$$ANI= 000000   	SYDEV = 054523   	...CTL= 000001
FD.WRT= 000001

. ABS.	000000	   000
      	000072	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2728 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[41,10]DELETE,[41,20]DELETE/-SP=[41,30]FCSPRE,DELETE
DIDFND 0105MS, FIND DEFAULT DIR	MACRO M1108  05-DEC-77 22:07  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
DIDFND 0105MS, FIND DEFAULT DIR	MACRO M1108  05-DEC-77 22:07  PAGE 7


						.TITLE	DIDFND 0105MS, FIND DEFAULT DIRECTORY ID
						.IDENT	/0105MS/
      2					;
      3					;                             COPYRIGHT (C) 1974, 1978 BY
      4					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      5					;
      6					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      7					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      8					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      9					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     10					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     11					;
     12					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     13					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     14					;       CORPORATION.
     15					;
     16					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     17					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     18					;
     19					;
     20					; SHAO-SUN CHIEN	28-JUN-74
     21					;
     22					;+
     23					; THE ONLY DIFFERENCE BETWEEN THIS MODULE AND DIRFND IS THAT
     24					; THIS MODULE CALLS PPNR50 TO CONVERT THE BINARY FORM OF PPN
     25					; DIRECTLY INTO RAD50 FORM.
     26					;
     27					; INPUTS:
     28					;	R0=FDB ADDRESS
     29					;	R1=FILE NAME BLOCK ADDRESS
     30					;	R2=FSR2 - FILE STORAGE CONTROL BLOCK
     31					; OUTPUTS:
     32					;	RAD50 FORM OF PPN ESTABLISHED IN FNB, AND CONTROL IS
     33					;	TRANSFERRED TO THE SECOND HALF OF FIND DIRECTORY ID ROUTINE
     34					;	(DIFND); R1-R3 RESTORED AND CONTROL RETURNED
     35					;	TO CALLER THERE.
     36					;-
     37	000000	010346 			..DIDF::MOV	R3,-(SP)
     38	000002	010246 				MOV	R2,-(SP)
     39	000004	010146 				MOV	R1,-(SP)
     40	000006	016202 	000000C			MOV	A.OWUI-A.DFDR(R2),R2	;R2=PPN, I.E., TASK UIC
     41	000012	010261 	000004G			MOV	R2,N.DID+4(R1)	;STORE BINARY PPN AS 3RD WORD OF DIR. ID
     42	000016	062701 	000000G			ADD	#N.FNAM,R1	;R1 POINTS TO LOC. TO STORE RAD50 FILE NAME
     43	000022					CALL	.PPR50		;CONVERT PPN INTO RAD50 FORM
     44	000026	012601 				MOV	(SP)+,R1	;R1 POINTS TO FNB AGAIN
     45	000030					CALLR	..DID		;JUMP TO DIFND
     46					;
     47					;
     48	000034					$END	DIDFND
     49					;
     50		000001 				.END
DIDFND 0105MS, FIND DEFAULT DIR	MACRO M1108  05-DEC-77 22:07  PAGE 7-1
SYMBOL TABLE

A.DFDR= ****** GX	HA.CHU= 000003   	N.DRPT= 000006   	R$$BBF= 000000   	SYDEV = 054523
A.OWUI= ****** GX	HA.FP = 000002   	N.DRSZ= 000004   	R$$DPB= 000001   	SYUNIT= 000000
BD.FRE= 000001   	HA.NAM= 000005   	N.DVPT= 000002   	R$$EIS= 000000   	WI.DLK= 000002
DIRTYP= 015172   	HA.TYP= 000006   	N.DVSZ= 000000   	R$$LCL= 000000   	WI.LCK= 000001
FCSEFN= 000040   	HA.UAT= 000004   	N.FNAM= ****** GX	R$$MUL= 000000   	$$    = 000067
FD.DVR= 000020   	HA.UI = 000001   	N.FNPT= 000012   	R$$OPF= 000000   	.PPR50= ****** GX
FD.EFB= 000004   	HA.VER= 000007   	N.FNSZ= 000010   	R$$RSL= 000000   	..DID = ****** GX
FD.EF1= 000010   	NB.DOT= 100000   	PP.SEP= 000002   	R$$SEQ= 000000   	..DIDF  000000RG
FD.EOF= 000002   	NB.SMI= 040000   	PP.ZER= 000001   	R$$SPL= 000000   	...CTL= 000001
FD.WRT= 000001   	N.DID = ****** GX	R$$ANI= 000000   	R$$11M= 000001

. ABS.	000000	   000
      	000034	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2533 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[41,10]DIDFND,[41,20]DIDFND/-SP=[41,30]FCSPRE,DIDFND
DIFND 0105MS, FIND DIRECTORY ID	MACRO M1108  05-DEC-77 22:08  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
DIFND 0105MS, FIND DIRECTORY ID	MACRO M1108  05-DEC-77 22:08  PAGE 7


						.TITLE	DIFND 0105MS, FIND DIRECTORY ID - 2ND HALF
						.IDENT	/0105MS/
      2					;
      3					;                             COPYRIGHT (C) 1974, 1978 BY
      4					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      5					;
      6					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      7					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      8					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      9					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     10					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     11					;
     12					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     13					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     14					;       CORPORATION.
     15					;
     16					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     17					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     18					;
     19					; PETER H. LIPMAN
     20					; SHAO-SUN CHIEN	28-JUN-74
     21					;
     22					;+
     23					; THIS SECOND HALF OF THE FIND DIRECTORY ROUTINE IS CALLED
     24					; EITHER BY DIRFND, OR BY DIDFND.
     25					;
     26					; INPUTS:
     27					;	R0=FDB
     28					;	R1=FNB
     29					;	N.DID+4(R1)=BINARY PPN OF DESIRED DIRECTORY OR 0
     30					;	(SP)=SAVED R2
     31					;	2(SP)=SAVED R3
     32					;	4(SP)=RETURN LOCATION
     33					; OUTPUT:
     34					;	C=0 IF SUCCESSFUL, C=1 IF FAILURE, F.ERR SET TO REASON
     35					;	R2,R3 RESTORED FROM STACK
     36					;	RETURNS THROUGH 4(SP)	;SP AT ENTRY POINT
     37					;	DIRECTORY ID, DEVICE AND UNIT ESTABLISHED IN FNB
     38					;	ALL OTHER ENTRIES ZEROED IF SUCCESSFUL.
     39					;-
     40	000000	005061 	000004G		..DID:: CLR	N.FNAM+4(R1)
     41	000004	012761 	000001 	000000G		MOV	#1,N.FVER(R1)	;VERSION IS 1
     42	000012	012761 	015172 	000000G		MOV	#DIRTYP,N.FTYP(R1)
     43	000020	012761 	177777 	000000G		MOV	#-1,N.DID(R1)	;START SEARCH AT MFD
     44	000026	012761 	177777 	000002G		MOV	#-1,N.DID+2(R1)
     45	000034					CALL	..FIND		;FIND THE ID FOR THIS DIRECTORY NAME
     46	000040	103433 				BCS	1$		;BRANCH IF NOT FOUND OR OTHER ERROR
     47	000042	016161 	000000G	000000G		MOV	N.FID(R1),N.DID(R1) ;MOVE THE ID TO THE DIR ID FIELD
     48	000050	016161 	000002G	000002G		MOV	N.FID+2(R1),N.DID+2(R1)
     49	000056	016161 	000004G	000004G		MOV	N.FID+4(R1),N.DID+4(R1)
     50	000064	005061 	000000G			CLR	N.FID(R1)	;REINIT THE FILE ID
     51	000070	005061 	000002G			CLR	N.FID+2(R1)
     52	000074	005061 	000004G			CLR	N.FID+4(R1)
     53	000100	005061 	000000G			CLR	N.FNAM(R1)	;CLEAN UP THE FNB FOR PARSE FILE NAME
     54	000104	005061 	000002G			CLR	N.FNAM+2(R1)
     55	000110	005061 	000004G			CLR	N.FNAM+4(R1)
     56	000114	005061 	000000G			CLR	N.FTYP(R1)
DIFND 0105MS, FIND DIRECTORY ID	MACRO M1108  05-DEC-77 22:08  PAGE 7-1


     57	000120	005061 	000000G			CLR	N.FVER(R1)
     58	000124	005061 	000000G			CLR	N.NEXT(R1)
     59	000130	012602 			1$:	MOV	(SP)+,R2
     60	000132	012603 				MOV	(SP)+,R3
     61	000134					RETURN
     62					;
     63					;
     64	000136					$END	DIFND
     65					;
     66		000001 				.END
DIFND 0105MS, FIND DIRECTORY ID	MACRO M1108  05-DEC-77 22:08  PAGE 7-2
SYMBOL TABLE

BD.FRE= 000001   	HA.NAM= 000005   	N.DVPT= 000002   	PP.ZER= 000001   	R$$SPL= 000000
DIRTYP= 015172   	HA.TYP= 000006   	N.DVSZ= 000000   	R$$ANI= 000000   	R$$11M= 000001
FCSEFN= 000040   	HA.UAT= 000004   	N.FID = ****** GX	R$$BBF= 000000   	SYDEV = 054523
FD.DVR= 000020   	HA.UI = 000001   	N.FNAM= ****** GX	R$$DPB= 000001   	SYUNIT= 000000
FD.EFB= 000004   	HA.VER= 000007   	N.FNPT= 000012   	R$$EIS= 000000   	WI.DLK= 000002
FD.EF1= 000010   	NB.DOT= 100000   	N.FNSZ= 000010   	R$$LCL= 000000   	WI.LCK= 000001
FD.EOF= 000002   	NB.SMI= 040000   	N.FTYP= ****** GX	R$$MUL= 000000   	$$    = 000067
FD.WRT= 000001   	N.DID = ****** GX	N.FVER= ****** GX	R$$OPF= 000000   	..DID   000000RG
HA.CHU= 000003   	N.DRPT= 000006   	N.NEXT= ****** GX	R$$RSL= 000000   	..FIND= ****** GX
HA.FP = 000002   	N.DRSZ= 000004   	PP.SEP= 000002   	R$$SEQ= 000000   	...CTL= 000001

. ABS.	000000	   000
      	000136	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2551 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]DIFND,[41,20]DIFND/-SP=[41,30]FCSPRE,DIFND
DIRECT 0101MS, ISSUE THE DIRECT	MACRO M1108  05-DEC-77 22:08  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
DIRECT 0101MS, ISSUE THE DIRECT	MACRO M1108  05-DEC-77 22:08  PAGE 7


						.TITLE	DIRECT 0101MS, ISSUE THE DIRECTORY PRIMITIVES
						.IDENT	/0101MS/
      2					; ALTERED TUESDAY 05-MAR-74 10:20 BY MARK BRAMHALL
      3					;
      4					;                             COPYRIGHT (C) 1975, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 17-AUG-73
     21					;
DIRECT 0101MS, ISSUE THE DIRECT	MACRO M1108  05-DEC-77 22:08  PAGE 8


     23					;+
     24					; ENTER, FIND, REMOVE A DIRECTORY ENTRY
     25					; CALLING SEQUENCE:
     26					;	CALL	..ENTR
     27					;	CALL	..FIND
     28					;	CALL	..RMOV
     29					; INPUTS:
     30					;	R0=FDB ADDRESS
     31					;	R1=FILE NAME BLOCK ADDRESS
     32					;	LUN IN F.LUN(R0) IS ASSIGNED TO DEV IN FNB
     33					;	FILE NAME BLOCK ALL SET FOR DIRECTORY PRIMITIVE CALL
     34					; OUTPUTS:
     35					;	C=0 IF SUCCESSFUL, FNB FILLED IN BY DIR PRIMITIVE
     36					;	C=1 IF FAILED, F.ERR(R0) TELLS WHY
     37					;	R0,R1 PRESERVED, R2-R5 ALTERED
     38					;-
     39	000000	012704 	000000G		..ENTR::MOV	#IO.ENA,R4
     40	000004	000405 				BR	DIRCOM
     41					;
     42	000006	012704 	000000G		..RMOV::MOV	#IO.RNA,R4
     43	000012	000402 				BR	DIRCOM
     44					;
     45	000014	012704 	000000G		..FIND::MOV	#IO.FNA,R4
     46	000020	132760 	000000G	000000G	DIRCOM:	BITB	#FD.DIR,F.RCTL(R0)
     47	000026	001411 				BEQ	20$		;NOP IF NOT DIRECTORY DEVICE
     48	000030	010146 				MOV	R1,-(SP)	;SAVE FILE NAME BLOCK ADDRESS
     49	000032					CALL	..IDPB		;INIT DPB, SET R5 TO PARAM BLOCK
     50						.IF	EQ,R$$DPB
     51						MOV	R1,(R5)		;STORE FILE NAME BLOCK ADDRESS
     52						.IFF
     53	000036	010165 	000012 			MOV	R1,12(R5)	;STORE FILE NAME BLOCK ADDRESS
     54						.ENDC
     55	000042					CALL	..QIOW		;ISSUE DIRECTORY QI/O AND WAIT
     56	000046	012601 				MOV	(SP)+,R1	;RESTORE THE SAVED FILE NAME BLOCK ADR
     57	000050					RETURN
     58	000052	005761 	000000G		20$:	TST	N.FID(R1)	;CLEAR CARRY TOO
     59	000056	001002 				BNE	30$		;BRANCH IF FILE ID NON ZERO
     60	000060	005261 	000000G			INC	N.FID(R1)	;FORCE IT TO 1
     61	000064				30$:	RETURN
     62					;
     63					;
     64	000066					$END	DIRECT
     65					;
     66					;
     67		000001 				.END
DIRECT 0101MS, ISSUE THE DIRECT	MACRO M1108  05-DEC-77 22:08  PAGE 8-1
SYMBOL TABLE

BD.FRE= 000001   	HA.CHU= 000003   	NB.SMI= 040000   	R$$BBF= 000000   	SYUNIT= 000000
DIRCOM  000020R  	HA.FP = 000002   	N.DRPT= 000006   	R$$DPB= 000001   	WI.DLK= 000002
DIRTYP= 015172   	HA.NAM= 000005   	N.DRSZ= 000004   	R$$EIS= 000000   	WI.LCK= 000001
FCSEFN= 000040   	HA.TYP= 000006   	N.DVPT= 000002   	R$$LCL= 000000   	$$    = 000067
FD.DIR= ****** GX	HA.UAT= 000004   	N.DVSZ= 000000   	R$$MUL= 000000   	..ENTR  000000RG
FD.DVR= 000020   	HA.UI = 000001   	N.FID = ****** GX	R$$OPF= 000000   	..FIND  000014RG
FD.EFB= 000004   	HA.VER= 000007   	N.FNPT= 000012   	R$$RSL= 000000   	..IDPB= ****** GX
FD.EF1= 000010   	IO.ENA= ****** GX	N.FNSZ= 000010   	R$$SEQ= 000000   	..QIOW= ****** GX
FD.EOF= 000002   	IO.FNA= ****** GX	PP.SEP= 000002   	R$$SPL= 000000   	..RMOV  000006RG
FD.WRT= 000001   	IO.RNA= ****** GX	PP.ZER= 000001   	R$$11M= 000001   	...CTL= 000001
F.RCTL= ****** GX	NB.DOT= 100000   	R$$ANI= 000000   	SYDEV = 054523

. ABS.	000000	   000
      	000066	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2580 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]DIRECT,[41,20]DIRECT/-SP=[41,30]FCSPRE,DIRECT
DIRFND 0104MS, FIND DIRECTORY I	MACRO M1108  05-DEC-77 22:08  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
DIRFND 0104MS, FIND DIRECTORY I	MACRO M1108  05-DEC-77 22:08  PAGE 7


						.TITLE	DIRFND 0104MS, FIND DIRECTORY ID - INTERNAL
						.IDENT	/0104MS/
      2					; ALTERED THURSDAY 13-JUN-74 9:10 BY PETER H. LIPMAN
      3					; ALTERED THURSDAY 21-MAR-74 15:10 BY MARK BRAMHALL
      4					; ALTERED FRIDAY 28-JUN-74 17:30 BY SHAO-SUN CHIEN
      5					;
      6					;                             COPYRIGHT (C) 1973, 1978 BY
      7					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      8					;
      9					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
     10					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     11					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     12					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     13					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     14					;
     15					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     16					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     17					;       CORPORATION.
     18					;
     19					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     20					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     21					;
     22					; PETER H. LIPMAN 1-OCT-73
     23					;
     24					;+
     25					; FIND THE DIRECTORY ID - FIRST HALF
     26					; CALLING SEQUENCE:
     27					;	CALL	..DIRF
     28					; INPUTS:
     29					;	R0=FDB ADDRESS
     30					;	R1=FILE NAME BLOCK ADDRESS
     31					;	R2=DIRECTORY STRING DESCRIPTOR
     32					; OUTPUTS:
     33					;	C=0 IF SUCCESSFUL
     34					;	C=1 IF FAILURE, F.ERR SET TO REASON
     35					;	R0-R3 PRESERVED, R4-R5 DESTROYED
     36					;	DIRECTORY ID IS SET UP IN FNB IF SUCCESSFUL
     37					;-
     38	000000	010346 			..DIRF::MOV	R3,-(SP)
     39	000002	010246 				MOV	R2,-(SP)
     40	000004	010103 				MOV	R1,R3
     41	000006	062703 	000004G			ADD	#N.DID+4,R3	;R3=ADDRESS TO STORE PPN
     42	000012					CALL	.ASCPP		;CONVERT ASCII TO PPN
     43	000016	103427 				BCS	1$		;BRANCH IF BAD SYNTAX
     44					; NOW CONVERT BACK TO ASCII IN THE NORMALIZED FORM FOR A UFD DIR NAME
     45	000020	012704 	000003 			MOV	#PP.ZER!PP.SEP,R4  ;DON'T SUPPRESS LEAD 0'S,
     46									;DON'T INSERT SEPARATORS
     47	000024	010102 				MOV	R1,R2
     48	000026	062702 	000004G			ADD	#N.FNAM+4,R2	 ;R2=ADDRESS TO STORE ASCII STRING
     49	000032	011303 				MOV	@R3,R3		;R3=PPN
DIRFND 0104MS, FIND DIRECTORY I	MACRO M1108  05-DEC-77 22:08  PAGE 8


     51					; THIS ROUTINE WILL STORE OVER THE 3RD WORD OF THE FILE NAME
     52					; THE FILE TYPE, AND THE FILE VERSION SLOT.
     53	000034	010246 				MOV	R2,-(SP)
     54	000036					CALL	.PPASC		;TRANSLATE PPN TO ASCII
     55	000042	012602 				MOV	(SP)+,R2
     56	000044	012703 	000006 			MOV	#6,R3		;R3=SIZE IN BYTES OF ASCII STRING
     57	000050	010104 				MOV	R1,R4
     58	000052	062704 	000000G			ADD	#N.FNAM,R4	;R4=ADDRESS TO PUT RAD50 STRING
     59	000056	005014 				CLR	@R4		;ZERO TWO RAD50 FILE NAME LOCATIONS
     60	000060	005064 	000002 			CLR	2(R4)
     61	000064					CALL	..SGR5		;CONVERT ASCII STRING TO RAD50
     62	000070	103402 				BCS	1$
     63	000072					CALLR	..DID		;JUMP TO DIFND
     64					;
     65					; EXITS FROM ..DIRF
     66	000076	112760 	000000G	000000G	1$:	MOVB	#IE.BDI,F.ERR(R0) ;BAD DIRECTORY SYNTAX
     67	000104	012602 				MOV	(SP)+,R2
     68	000106	012603 				MOV	(SP)+,R3
     69	000110					RETURN
     70					;
     71					;
     72	000112					$END	DIRFND
     73					;
     74		000001 				.END
DIRFND 0104MS, FIND DIRECTORY I	MACRO M1108  05-DEC-77 22:08  PAGE 8-1
SYMBOL TABLE

BD.FRE= 000001   	HA.NAM= 000005   	N.DRSZ= 000004   	R$$DPB= 000001   	SYUNIT= 000000
DIRTYP= 015172   	HA.TYP= 000006   	N.DVPT= 000002   	R$$EIS= 000000   	WI.DLK= 000002
FCSEFN= 000040   	HA.UAT= 000004   	N.DVSZ= 000000   	R$$LCL= 000000   	WI.LCK= 000001
FD.DVR= 000020   	HA.UI = 000001   	N.FNAM= ****** GX	R$$MUL= 000000   	$$    = 000067
FD.EFB= 000004   	HA.VER= 000007   	N.FNPT= 000012   	R$$OPF= 000000   	.ASCPP= ****** GX
FD.EF1= 000010   	IE.BDI= ****** GX	N.FNSZ= 000010   	R$$RSL= 000000   	.PPASC= ****** GX
FD.EOF= 000002   	NB.DOT= 100000   	PP.SEP= 000002   	R$$SEQ= 000000   	..DID = ****** GX
FD.WRT= 000001   	NB.SMI= 040000   	PP.ZER= 000001   	R$$SPL= 000000   	..DIRF  000000RG
F.ERR = ****** GX	N.DID = ****** GX	R$$ANI= 000000   	R$$11M= 000001   	..SGR5= ****** GX
HA.CHU= 000003   	N.DRPT= 000006   	R$$BBF= 000000   	SYDEV = 054523   	...CTL= 000001
HA.FP = 000002

. ABS.	000000	   000
      	000112	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2556 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]DIRFND,[41,20]DIRFND/-SP=[41,30]FCSPRE,DIRFND
DLFNB 0001MS, DELETE FILE USING	MACRO M1108  05-DEC-77 22:08  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
DLFNB 0001MS, DELETE FILE USING	MACRO M1108  05-DEC-77 22:08  PAGE 7


						.TITLE	DLFNB 0001MS, DELETE FILE USING FNB
						.IDENT	/0001MS/
      2
      3					;                             COPYRIGHT (C) 1974, 1978 BY
      4					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      5					;
      6					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      7					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      8					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      9					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     10					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     11					;
     12					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     13					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     14					;       CORPORATION.
     15					;
     16					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     17					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     18					;
     19					;
     20					; PETER H. LIPMAN	29-APR-74
     21					;
     22					;+
     23					; DELETE A FILE BY FILE NAME BLOCK - EITHER OPEN OR CLOSED
     24					;
     25					; CALLING SEQUENCE:
     26					;
     27					;	CALL	.DLFNB
     28					;
     29					; INPUTS:
     30					;
     31					;	R0=FDB ADDRESS
     32					;
     33					; OUTPUTS:
     34					;
     35					;	C=0 IF SUCCESSFUL, C=1 IF ERROR, F.ERR SET TO ERROR CODE
     36					;  ALL REGISTERS PRESERVED
     37					;
     38					; OPERATION:
     39					;
     40					;	IF THE FILE WAS OPEN, IT IS CLOSED, REMOVED FROM THE DIRECTORY,
     41					; AND MARKED FOR DELETE.
     42					;	IF THE FILE WAS CLOSED, THE FILE NAME BLOCK PORTION OF THE FDB IS
     43					; ASSUMED TO BE ALL SET UP WITH FILE NAME, TYPE, VERSION (MUST BE EXPLICIT),
     44					; DIRECTORY ID, DEVICE NAME, AND UNIT. THE FILE IS REMOVED FROM THE DIRECTORY
     45					; AND MARKED FOR DELETE.
     46					;-
     47	000000				.DLFNB::.SAVR1			;SAVE THE REGISTERS
     48	000004	012760 	000001 	000000G		MOV	#1,F.ERR(R0)	;INITIALIZE ERROR BYTE
     49	000012	010001 				MOV	R0,R1		;
     50	000014	062701 	000000G			ADD	#F.FNB,R1	;R1=FNB ADDRESS
     51	000020	005760 	000000G			TST	F.BDB(R0)	;IS FILE OPEN?
     52	000024	001003 				BNE	10$		;BRANCH IF YES
     53	000026					CALL	..ALUN		;ASSIGN THE LUN
     54	000032	103413 				BCS	20$		;BRANCH IF ERROR
     55	000034				10$:	CLOSE$	R0		;CLOSE THE FILE
     56	000040	103410 				BCS	20$		;BRANCH IF ERROR
DLFNB 0001MS, DELETE FILE USING	MACRO M1108  05-DEC-77 22:08  PAGE 7-1


     57	000042	132760 	000000G	000000G		BITB	#FD.DIR,F.RCTL(R0) ;IF NOT A DIRECTORY DEVICE
     58	000050	001404 				BEQ	20$		;THEN SUCCESSFUL NOP, C=0
     59	000052					CALL	..DEL1		;REMOVE AND MARK FOR DELETE
     60	000056	012711 	000000 			MOV	#0,(R1)		;ZERO THE FID (SET BY REMOVE), PRESERVE C
     61	000062				20$:	RETURN			;
     62					;
     63					;
     64	000064					$END	DLFNB
     65					;
     66					;
     67		000001 				.END
DLFNB 0001MS, DELETE FILE USING	MACRO M1108  05-DEC-77 22:08  PAGE 7-2
SYMBOL TABLE

BD.FRE= 000001   	F.FNB = ****** GX	N.DRPT= 000006   	R$$DPB= 000001   	SYUNIT= 000000
DIRTYP= 015172   	F.RCTL= ****** GX	N.DRSZ= 000004   	R$$EIS= 000000   	WI.DLK= 000002
FCSEFN= 000040   	HA.CHU= 000003   	N.DVPT= 000002   	R$$LCL= 000000   	WI.LCK= 000001
FD.DIR= ****** GX	HA.FP = 000002   	N.DVSZ= 000000   	R$$MUL= 000000   	$$    = 000067
FD.DVR= 000020   	HA.NAM= 000005   	N.FNPT= 000012   	R$$OPF= 000000   	.CLOSE= ****** G
FD.EFB= 000004   	HA.TYP= 000006   	N.FNSZ= 000010   	R$$RSL= 000000   	.DLFNB  000000RG
FD.EF1= 000010   	HA.UAT= 000004   	PAR$$$= 000000   	R$$SEQ= 000000   	.SAVR1= ****** GX
FD.EOF= 000002   	HA.UI = 000001   	PP.SEP= 000002   	R$$SPL= 000000   	..ALUN= ****** GX
FD.WRT= 000001   	HA.VER= 000007   	PP.ZER= 000001   	R$$11M= 000001   	..DEL1= ****** GX
F.BDB = ****** GX	NB.DOT= 100000   	R$$ANI= 000000   	SYDEV = 054523   	...CTL= 000001
F.ERR = ****** GX	NB.SMI= 040000   	R$$BBF= 000000

. ABS.	000000	   000
      	000064	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2736 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]DLFNB,[41,20]DLFNB/-SP=[41,30]FCSPRE,DLFNB
EDDAT	MACRO M1108  05-DEC-77 23:41  PAGE 2


      1						.TITLE	EDDAT
      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					; G.W. BERRY/C. MONIA 06-APR-74                                                 ;**NEW**
     23					;                                                                               ;**-13
     24					; DATE AND TIME FORMAT CONVERSION ROUTINES
     25					;+
     26					; **-$DAT-CONVERT DATE STRING
     27					;
     28					; THIS ROUTINE IS CALLED TO CONVERT THE THREE WORD INTERNAL DATE
     29					; TO THE STANDARD 9-CHARACTER OUTPUT FORMAT, AS FOLLOWS:
     30					;
     31					;			Z9-AAA-99
     32					;
     33					; INPUTS:
     34					;
     35					;	R0 = OUTPUT STRING
     36					;	R1 = ADDRESS OF PARAMETER BLOCK
     37					;	WHERE THE FORMAT FOR THE PARAMETER BLOCK IS:
     38					;		.WORD 	YEAR	;YEAR-1900
     39					;		.WORD	MONTH	;MONTH OF YEAR
     40					;		.WORD	DAY	;DAY OF MONTH
     41					;
     42					; OUTPUTS:
     43					;
     44					;	R0 = OUTPUT STRING (ADVANCED)
     45					;	R1 = (INPUT R1) + 6
     46					;-
     47
     48					;MONTH TABLE
     49	000000	   112 	   101 	   116 	MONTH:	.ASCII /JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC/
	000003	   106 	   105 	   102
	000006	   115 	   101 	   122
	000011	   101 	   120 	   122
	000014	   115 	   101 	   131
	000017	   112 	   125 	   116
	000022	   112 	   125 	   114
	000025	   101 	   125 	   107
	000030	   123 	   105 	   120
EDDAT	MACRO M1108  05-DEC-77 23:41  PAGE 2-1


	000033	   117 	   103 	   124
	000036	   116 	   117 	   126
	000041	   104 	   105 	   103
     50
     51	000044				$DAT::				;                                               ;**NEW**
     52	000044					SAVRG			; SAVE NON-VOLATILE REGISTERS                   ;**NEW**
     53	000050	010104 				MOV	R1,R4		; FREE UP R1, R2                                ;**NEW**
     54	000052	010205 				MOV	R2,R5		;                                               ;**NEW**
     55	000054	012446 				MOV	(R4)+,-(SP)	; SAVE YEAR                                     ;**NEW**
     56	000056	012446 				MOV	(R4)+,-(SP)	; SAVE MONTH                                    ;**NEW**
     57	000060	012401 				MOV	(R4)+,R1	; GET DAY                                       ;**NEW**
     58	000062					CALL	DIGS		; OUTPUT TWO DIGITS ZERO SURPRESSED             ;**NEW**
     59	000066	112720 	000055 			MOVB	#'-,(R0)+	; OUTPUT SEPARATOR                              ;**NEW**
     60	000072	011601 				MOV	(SP),R1		; GET MONTH                                     ;**NEW**
     61	000074	006316 				ASL	(SP)		; MULTIPLY BY THREE                             ;**NEW**
     62	000076	062601 				ADD	(SP)+,R1	;                                               ;**NEW**
     63	000100	062701 	177775'			ADD	#MONTH-3,R1	; COMPUTE TABLE INDEX                           ;**NEW**
     64	000104	112120 				MOVB	(R1)+,(R0)+	; OUTPUT MONTH                                  ;**NEW**
     65	000106	112120 				MOVB	(R1)+,(R0)+	;                                               ;**NEW**
     66	000110	112120 				MOVB	(R1)+,(R0)+	;                                               ;**NEW**
     67	000112	112720 	000055 			MOVB	#'-,(R0)+	; OUTPUT SEPARATOR                              ;**NEW**
     68	000116	012601 				MOV	(SP)+,R1	; GET YEAR                                      ;**NEW**
     69	000120	000444 				BR	DIG		; OUTPUT TWO DIGITS, EXIT                       ;**NEW**
     70					                                                                                ;**-18
     71					;+
     72					; **-$TIM-CONVERT TIME
     73					;
     74					; THIS ROUTINE IS CALLED TO CONVERT THE TIME IN A STANDARD FORMAT
     75					; TO AN ASCII OUTPUT STRING OF THE FORM:
     76					;
     77					;		HH:MM:SS.S
     78					;
     79					; THE STANDARD FORMAT FOR THE INPUT VALUES IS IDENTICAL WITH THE
     80					; ARGUMENTS RETURNED BY THE "GET TIME" SYSTEM CALL.
     81					;
     82					; INPUTS:
     83					;
     84					;	R0 = OUTPUT STRING
     85					;	R1 = ADDRESS OF FIRST PARAMETER
     86					;	R2 = PARAMETER COUNT, WHERE:
     87					;		R2=0 OR 1	OUTPUT: HH
     88					;		R2=2		OUTPUT: HH:MM
     89					;		R2=3		OUTPUT: HH:MM:SS
     90					;		R2>3		OUTPUT: HH:MM:SS.S
     91					;
     92					;	WHERE THE FORMAT FOR THE PARAMETER BLOCK IS:
     93					;		.WORD	HOUR-OF-DAY
     94					;		.WORD	MINUTE-OF-HOUR
     95					;		.WORD	SECOND-OF-MINUTE
     96					;		.WORD	TICK-OF-SECOND
     97					;		.WORD	TICKS-PER-SECOND
     98					;
     99					; OUTPUTS:
    100					;
    101					;	R0 = OUTPUT STRING
    102					;	R1 = NEXT PARAMETER (ADVANCED PAST LAST PARAMETER USED)
    103					;	R2 IS DISTROYED
EDDAT	MACRO M1108  05-DEC-77 23:41  PAGE 2-2


    104					;-
    105
    106	000122				$TIM::				;                                               ;**NEW**
    107	000122					SAVRG			; SAVE NON-VOLATILE REGISTERS                   ;**NEW**
    108	000126	010104 				MOV	R1,R4		; FREE UP R1                                    ;**NEW**
    109	000130	012705 	000003 			MOV	#3,R5		; ASSUME TENTHS WANTED                          ;**NEW**
    110	000134	020205 				CMP	R2,R5		; WANT TENTHS OF SECOND?                        ;**NEW**
    111	000136	101421 				BLOS	10$		; IF LOS NO                                     ;**NEW**
    112	000140					CALL	30$		; OUTPUT HH:MM:SS                               ;**NEW**
    113	000144	112720 	000056 			MOVB	#'.,(R0)+	; OUTPUT SEPARATOR                              ;**NEW**
    114	000150	010003 				MOV	R0,R3		; SAVE STRING POINTER                           ;**NEW**
    115					                                                                                ;**NEW**
    116						.IF	DF	V1145                                                   ;**NEW**
    117					                                                                                ;**NEW**
    118						MOV	(R4)+,R0	; GET TICKS                                     ;**NEW**
    119						MUL	#10.,R0		; COMPUTE TICKS X 10.                           ;**NEW**
    120						DIV	(R4)+,R0	; COMPUTE TENTHS OF SECOND                      ;**NEW**
    121					                                                                                ;**NEW**
    122						.IFF                                                                    ;**NEW**
    123					                                                                                ;**NEW**
    124	000152	011400 				MOV	(R4),R0		; GET TICKS                                     ;**NEW**
    125	000154	006300 				ASL	R0		; MULTIPLY TICKS BY 10.                         ;**NEW**
    126	000156	006300 				ASL	R0		;                                               ;**NEW**
    127	000160	006300 				ASL	R0		; NOW HAVE TICKS*8                              ;**NEW**
    128	000162	061400 				ADD	(R4),R0		; ADD TICKS*2                                   ;**NEW**
    129	000164	062400 				ADD	(R4)+,R0	;                                               ;**NEW**
    130	000166	012401 				MOV	(R4)+,R1	; GET TICKS PER SECOND                          ;**NEW**
    131	000170					CALL	$DIV		; COMPUTE TENTHS                                ;**NEW**
    132					                                                                                ;**NEW**
    133						.ENDC                                                                   ;**NEW**
    134					                                                                                ;**NEW**
    135	000174	010001 				MOV	R0,R1		; SET VALUE TO BE CONVERTED                     ;**NEW**
    136	000176	010300 				MOV	R3,R0		; RESTORE STRING POINTER                        ;**NEW**
    137	000200	000412 				BR	DIGS		; RESTORE UPDATED R1, EXIT                      ;**NEW**
    138	000202				10$:				;                                               ;**NEW**
    139	000202	010205 				MOV	R2,R5		; SET LOOP COUNT                                ;**NEW**
    140	000204	000402 				BR	30$		;                                               ;**NEW**
    141	000206				20$:				;                                               ;**NEW**
    142	000206	112720 	000072 			MOVB	#':,(R0)+	; OUTPUT SEPARATOR                              ;**NEW**
    143	000212				30$:				;                                               ;**NEW**
    144	000212	012401 				MOV	(R4)+,R1	; GET VALUE                                     ;**NEW**
    145	000214					CALL	DIG		; OUTPUT TWO DIGITS                             ;**NEW**
    146	000220	005305 				DEC	R5		; DECREMENT COUNT                               ;**NEW**
    147	000222	003371 				BGT	20$		; IF GT GO AGAIN                                ;**NEW**
    148	000224	000405 				BR	DIGX		;                                               ;**NEW**
    149					                                                                                ;**-22
    150					;+
    151					; OUTPUT TWO DIGIT SUBROUTINE.
    152					;
    153					; INPUTS:
    154					;
    155					;	R0 = OUTPUT STRING
    156					;	R1=VALUE (MUST BE IN RANGE 0-99)                                        ;**NEW**
    157					;                                                                               ;**-1
    158					; OUTPUTS:
    159					;
    160					;	R0 = OUTPUT STRING
EDDAT	MACRO M1108  05-DEC-77 23:41  PAGE 2-3


    161					;                                                                               ;**NEW**
    162					;-                                                                              ;**-1
    163					;                                                                               ;**NEW**
    164					; ZERO SURPRESS FIRST DIGIT                                                     ;**NEW**
    165					;                                                                               ;**NEW**
    166					                                                                                ;**NEW**
    167	000226				DIGS:				;                                               ;**NEW**
    168	000226	005002 				CLR	R2		; SET SURPRESS INDICATOR                        ;**NEW**
    169	000230	000401 				BR	DIG1		;                                               ;**NEW**
    170					                                                                                ;**NEW**
    171					;                                                                               ;**NEW**
    172					; NO ZERO SURPRESS ON FIRST DIGIT                                               ;**NEW**
    173					;                                                                               ;**NEW**
    174					                                                                                ;**NEW**
    175	000232				DIG:				;                                               ;**NEW**
    176	000232	010702 				MOV	PC,R2		;                                               ;**NEW**
    177	000234				DIG1:				;                                               ;**NEW**
    178	000234					CALL	$CBDAT		; CONVERT DIGITS                                ;**NEW**
    179	000240				DIGX:				;                                               ;**NEW**
    180	000240	010401 				MOV	R4,R1		; SET UPDATED PARAMETER VECTOR                  ;**NEW**
    181	000242	010502 				MOV	R5,R2		; RESTORE R2 (POSSIBLY DESTROYED)               ;**NEW**
    182	000244					RETURN			;                                               ;**NEW**
    183					                                                                                ;**-16
    184		000001 				.END
EDDAT	MACRO M1108  05-DEC-77 23:41  PAGE 2-4
SYMBOL TABLE

CR    = 000015   	DIG1    000234R  	MONTH   000000R  	$CBDAT= ****** GX	$SAVRG= ****** GX
DIG     000232R  	FF    = 000014   	R$$11M= 000000   	$DAT    000044RG 	$TIM    000122RG
DIGS    000226R  	HT    = 000011   	SPA   = 000040   	$DIV  = ****** GX	$$    = 000001
DIGX    000240R  	LF    = 000012   	VT    = 000013

. ABS.	000000	   000
      	000246	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  717 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:10
[46,10]EDDAT,[46,20]EDDAT/-SP=[46,30]MACFLM.,EDDAT.002
EDTMG	MACRO M1108  05-DEC-77 23:41  PAGE 2


      1						.TITLE	EDTMG
      2						.IDENT	/08/                                                            ;**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 08                                                                    ;**NEW**
     20					;                                                                               ;**-1
     21					; D. N. CUTLER/C. MONIA 10-MAY-74
     22					;
     23					; MODIFICATIONS:                                                                ;**NEW**
     24					;                                                                               ;**NEW**
     25					; NO.		DATE		PROGRAMMER                                      ;**NEW**
     26					; ---		----		----------                                      ;**NEW**
     27					;                                                                               ;**NEW**
     28					; 030		02-JAN-75	C. MONIA                                        ;**NEW**
     29					;                                                                               ;**NEW**
     30					; GENERALIZED FORMATTING ROUTINE
     31					;
     32					;
     33					; EQUATED SYMBOLS
     34					;
     35
     36		000001 			NP=1				; NO-PARAMETER FLAG
     37
     38					;
     39					; LOCAL DATA
     40					;
     41
     42	000000	   101 			OPRAND:	.BYTE	'A		;%A-ASCII
     43	000001	   102 				.BYTE	'B		;++030 %B-BINARY BYTE TO OCTAL                  ;**NEW**
     44	000002	   104 				.BYTE	'D		;%D-SIGNED BINARY TO DECIMAL CONVERSION
     45	000003	   105 				.BYTE	'E		;++030 %E-EXTENDED ASCII CONVERSION             ;**NEW**
     46	000004	   106 				.BYTE	'F		;%F-FORM FEED
     47	000005	   116 				.BYTE	'N		;%N-NEW LINE (CR-LF)
     48	000006	   117 				.BYTE	'O		;%O-SIGNED BINARY TO OCTAL CONVERSION
     49	000007	   120 				.BYTE	'P		;%P-MAGNITUDE BINARY TO OCTAL CONVERSION
     50	000010	   122 				.BYTE	'R		;%R-BINARY TO RAD50 CONVERSION
     51	000011	   123 				.BYTE	'S		;++030 %S-SPACE GENERATOR                       ;**NEW**
     52	000012	   130 				.BYTE	'X		;%X-FILE NAME CONVERSION
     53	000013	   131 				.BYTE	'Y		;%Y-DATE CONVERSION
     54	000014	   132 				.BYTE	'Z		;%Z-TIME CONVERSION
     55		000015 			OPRNDX=.-OPRAND			;NUMBER OF DIRECTIVES
     56
     57						.EVEN
EDTMG	MACRO M1108  05-DEC-77 23:41  PAGE 2-1


     58
     59					;
     60					; DIRECTIVE DISPATCH TABLE:
     61					;
     62					; THE LOW ORDER BIT IS SET FOR THOSE DIRECTIVES NOT REQUIRING
     63					; AN ARGUMENT BLOCK ENTRY
     64					;
     65
     66
     67	000016	000000C			VECTOR:	.WORD	ILLDIR!NP	; ILLEGAL DIRECTIVE
     68	000020	000250'				.WORD	ASCII		;%A->ASCII STRING
     69	000022	000264'				.WORD	BYTE		;++030 %B->BINARY BYTE TO OCTAL                 ;**NEW**
     70	000024	000316'				.WORD	BINDEC		;%D->SIGNED DECIMAL
     71	000026	000332'				.WORD	EASCI		;++030 %E->EXTENDED ASCII                       ;**NEW**
     72	000030	000000C				.WORD	FORM!NP		; %F->FORM CONTROL
     73	000032	000000C				.WORD	NEWLIN!NP	; %N->NEWLINE
     74	000034	000426'				.WORD	OCTAL		;%0->SIGNED OCTAL
     75	000036	000450'				.WORD	POINT		;%P->ABSOLUTE OCTAL
     76	000040	000466'				.WORD	RAD50		;%R->RAD50 STRING
     77	000042	000000C				.WORD	SPACE!NP	;++030 %S->SPACE GENERATOR                      ;**NEW**
     78	000044	000520'				.WORD	XFNAM		;%X->FILE NAME STRING
     79	000046	000634'				.WORD	EDATE		;%Y->DATE CONVERSION
     80	000050	000650'				.WORD	ETIME		;%Z->TIME CONVERSION
     81
     82					;+
     83					; **-$EDMSG-EDIT MESSAGE
     84					;
     85					; THIS ROUTINE IS CALLED TO PROCESS AN ASCIZ FORMAT STRING TO PRODUCE
     86					; AN EDITED OUTPUT STRING. THE INPUTS TO THE ROUTINE ARE A FORMAT STRING
     87					; AND THE ADDRESS OF AN ARGUMENT BLOCK. THE FORMAT STRING IS SCANNED
     88					; LOOKING FOR FORMAT DIRECTIVES. AS EACH NON-FORMAT CHARACTER IS EN-
     89					; COUNTERED, IT IS SIMPLY COPIED INTO THE OUTPUT STRING. A"%" SIGN IS
     90					; USED TO DELIMIT A FORMAT DIRECTIVE. IF A "%" SIGN IS FOLLOWED BY A "V"
     91					; (VALUE), THEN THE REPEAT COUNT IS TAKEN FROM THE NEXT WORD IN THE ARG-
     92					; UMENT BLOCK. ELSE THE NEXT "N" CHARACTERS (BY CONTEXT) ARE CONVERTED
     93					; TO BINARY AND THIS VALUE IS TAKEN AS THE REPEAT COUNT. A REPEAT COUNT
     94					; OF ZERO IS DEFAULTED TO A REPEAT COUNT OF ONE IN EITHER CASE. THE NEXT
     95					; CHARACTER IN THE FORMAT STRING MUST BE A FORMAT DIRECTIVE. THE FOLLOW-
     96					; ING FORMAT DIRECTIVES ARE IMPLEMENTED.
     97					;
     98					;	%A-ASCII STRING
     99					;++030	%B-BINARY BYTE TO OCTAL                                                 ;**NEW**
    100					;	%D=SIGNED BINARY TO DECIMAL CONVERSION
    101					;++030	%E-EXTENDED ASCII                                                       ;**NEW**
    102					;	%F-FORM CONTROL
    103					;	%N-NEW LINE (CR-LF)
    104					;	%O-SIGNED BINARY TO OCTAL CONVERSION
    105					;	%P-MAGNITUDE BINARY TO OCTAL CONVERSION
    106					;	%R-BINARY TO RAD50 CONVERSION
    107					;++030	%S-SPACE GENERATOR                                                      ;**NEW**
    108					;	%X-FILE NAME CONVERSION
    109					;	%Y-DATE CONVERSION
    110					;	%Z-TIME CONVERSION
    111					;
    112					; INPUTS:
    113					;
    114					;	R0=ADDRESS OF OUTPUT STRING.
EDTMG	MACRO M1108  05-DEC-77 23:41  PAGE 2-2


    115					;	R1=ADDRESS OF INPUT STRING
    116					;	R2=ADDRESS OF ARGUMENT BLOCK.
    117					;
    118					; OUTPUTS:
    119					;
    120					;	R0=ADDRESS OF LAST BYTE IN OUTPUT STRING.
    121					;	R1=LENGTH OF OUTPUT STRING IN BYTES.
    122					;	R2=ADDRESS OF NEXT PARAMETER IN ARGUMENT BLOCK
    123					;-
    124
    125	000052				$EDMSG::SAVRG			;SAVE NONVOLITILE REGISTERS
    126	000056	010046 				MOV	R0,-(SP)	;SAVE STARTING ADDRESS OF OUTPUT BUFFER
    127	000060	010003 				MOV	R0,R3		;MOVE PARAMETERS TO NONVOLITILE REGISTER
    128	000062	010104 				MOV	R1,R4		;
    129	000064	010205 				MOV	R2,R5		;
    130	000066	112402 			10$:	MOVB	(R4)+,R2	;GET NEXT CHARACTER IN INPUT STRING
    131	000070	001405 				BEQ	20$		;IF EQ ALL DONE
    132	000072	122702 	000045 			CMPB	#'%,R2		;FORMATTING CHARACTER?
    133	000076	001410 				BEQ	30$		;IF EQ YES
    134	000100	110223 				MOVB	R2,(R3)+	;STORE CHARACTER IN OUTPUT STRING
    135	000102	000771 				BR	10$		;GO AGAIN
    136	000104	105013 			20$:	CLRB	(R3)		;CLEAR LAST BYTE FOR ASCIZ
    137	000106	010300 				MOV	R3,R0		;SET LAST BYTE ADDRESS
    138	000110	010001 				MOV	R0,R1		;COPY ADDRESS OF NEXT BYTE IN OUTPUT BUF
    139	000112	162601 				SUB	(SP)+,R1	;CALCULATE LENGTH OF LINE IN BYTES
    140	000114	010502 				MOV	R5,R2		; SET ADDRESS OF NEXT PARAMETER
    141	000116					RETURN			;
    142	000120	010446 			30$:	MOV	R4,-(SP)	;SAVE R4 IN CASE OF ILLEGAL DIRECTIVE
    143	000122	010400 				MOV	R4,R0		;SET ADDRESS OF NEXT BYTE
    144	000124	122720 	000126 			CMPB	#'V,(R0)+	;NEXT CHARACTER "V"?
    145	000130	001002 				BNE	35$		; IF NE NO
    146	000132	012501 				MOV	(R5)+,R1	; GET ARGUMENT
    147	000134	000404 				BR	40$		; PROCESS DIRECTIVE
    148	000136				35$:				;
    149	000136	010400 				MOV	R4,R0		;SET ADDRESS OF NEXT BYTE
    150	000140					CALL	$CDTB		;CONVERT LEADING NUMBER
    151	000144	005300 				DEC	R0		;BACKUP TO TERMINAL BYTE
    152	000146	010004 			40$:	MOV	R0,R4		;RESTORE ADDRESS OF NEXT CHARACTER
    153	000150	010300 				MOV	R3,R0		;SET ADDRESS OF NEXT IN OUTPUT STRING
    154	000152	010103 				MOV	R1,R3		;SET REPEAT COUNT
    155	000154	001001 				BNE	45$		;IF NE OKAY
    156	000156	005203 				INC	R3		;MAKE COUNT 1
    157	000160	012702 	000015 		45$:	MOV	#OPRNDX,R2	;GET NUMBER OF DIRECTIVES
    158	000164	121462 	177777'		50$:	CMPB	(R4),OPRAND-1(R2);MATCH?
    159	000170	001402 				BEQ	60$		;IF EQ YES
    160	000172					SOB	R2,50$		;REPEAT
    161	000176	005204 			60$:	INC	R4		;INCREMENT PAST DIRECTIVE
    162	000200	006302 				ASL	R2		;MAKE WORD INDEX
    163	000202	016246 	000016'			MOV	VECTOR(R2),-(SP) ; GET ADDRESS OF DIRECTIVE ROUTINE
    164	000206	006216 				ASR	(SP)		; ISOLATE NO-PARAMETERS FLAG
    165	000210	103401 				BCS	70$		; IF C/S NO PARAMETERS REQUIRED
    166	000212	012501 				MOV	(R5)+,R1	; ELSE FETCH FIRST PARAMETER
    167	000214				70$:				;
    168	000214	006316 				ASL	(SP)		; CONVERT TO ADDRESS
    169	000216					CALL	@(SP)+		; CALL PROCESSING ROUTINE
    170	000220	010003 				MOV	R0,R3		;RESTORE ADDRESS OF NEXT IN OUTPUT STRIN
    171	000222	005726 				TST	(SP)+		;CLEAN STACK
EDTMG	MACRO M1108  05-DEC-77 23:41  PAGE 2-3


    172	000224	000720 				BR	10$		;GO AGAIN
    173
    174					;
    175					; ILLEGAL DIRECTIVE (%"UNKNOWN)
    176					;
    177
    178	000226	112720 	000045 		ILLDIR:	MOVB	#'%,(R0)+	;STORE PERCENT SIGN IN OUTPUT STRING
    179	000232	016604 	000002 			MOV	2(SP),R4	;RESTORE INPUT STRING ADDRESS
    180	000236	122714 	000126 			CMPB	#'V,(R4)	;"V" DIRECTIVE?
    181	000242	001001 				BNE	10$		;IF NE NO
    182	000244	005745 				TST	-(R5)		;BACKUP ARGUMENT POINTER
    183	000246				10$:	RETURN			;
    184
    185					;
    186					; ASCII DIRECTIVE (%NA)
    187					;
    188					; MOVE "N" CHARACTERS FROM STRING POINTER TO BY R1 TO OUTPUT STRING.
    189					;
    190
    191	000250	112120 			ASCII:	MOVB	(R1)+,(R0)+	;MOVE A BYTE
    192	000252					SOB	R3,ASCII	;REPEAT
    193	000256					RETURN			;
    194					                                                                                ;**NEW**
    195					;++030                                                                          ;**NEW**
    196					;++030 BINARY BYTE TO OCTAL CONVERSION (%NB)                                    ;**NEW**
    197					;++030                                                                          ;**NEW**
    198					;++030 CONVERT N CONSECUTIVE BYTES POINTED TO BY R1                             ;**NEW**
    199					;++030                                                                          ;**NEW**
    200					                                                                                ;**NEW**
    201	000260				BYTE1:				;++030                                          ;**NEW**
    202	000260	112720 	000040 			MOVB	#SPA,(R0)+	;++030 INSERT A SPACE                           ;**NEW**
    203	000264				BYTE:				;++030                                          ;**NEW**
    204	000264	112102 				MOVB	(R1)+,R2	;++030 GET NEXT BYTE                            ;**NEW**
    205	000266	010146 				MOV	R1,-(SP)	;++030 SAVE R1                                  ;**NEW**
    206	000270	010201 				MOV	R2,R1		;++030 SET VALUE TO CONVERT                     ;**NEW**
    207	000272	010602 				MOV	SP,R2		;++030 DO NOT SUPPRESS ZEROS                    ;**NEW**
    208	000274					CALL	$CBTMG		;++030 CONVERT BYTE TO MAGNITUDE OCTAL          ;**NEW**
    209	000300	012601 				MOV	(SP)+,R1	;++030 RESTORE R1                               ;**NEW**
    210	000302					SOB	R3,BYTE1	;++030 GO AGAIN                                 ;**NEW**
    211	000306					RETURN			;++030                                          ;**NEW**
    212
    213					;
    214					; SIGNED BINARY TO DECIMAL CONVERSION (%ND)
    215					;
    216					; CONVERT "N" CONSECUTIVE ARGUMENT WORDS. IF MORE THAN ONE WORD IS
    217					; CONVERTED, THEN INSERT A TAB BETWEEN WORDS.
    218					;
    219
    220	000310	112720 	000011 		BINDC1:	MOVB	#HT,(R0)+	;INSERT A TAB
    221	000314	012501 				MOV	(R5)+,R1	;GET NEXT ARGUMENT WORD
    222	000316	005002 			BINDEC:	CLR	R2		;ENABLE ZERO SUPPRESSION
    223	000320					CALL	$CBDSG		;CONVERT TO DECIMAL
    224	000324					SOB	R3,BINDC1	;REPEAT
    225	000330					RETURN			;
    226					                                                                                ;**NEW**
    227					;++030                                                                          ;**NEW**
    228					;++030 EXTENDED ASCII CONVERSION (%NE)                                          ;**NEW**
EDTMG	MACRO M1108  05-DEC-77 23:41  PAGE 2-4


    229					;++030                                                                          ;**NEW**
    230					;++030 CONVERT N BYTES POINTED TO BY R1 TO EXTENDED ASCII REPRESENTATION        ;**NEW**
    231					;++030                                                                          ;**NEW**
    232					                                                                                ;**NEW**
    233	000332				EASCI:				;++030                                          ;**NEW**
    234	000332	112110 				MOVB	(R1)+,(R0)	;++030 MOVE NEXT BYTE                           ;**NEW**
    235	000334	142710 	000200 			BICB	#200,(R0)	;++030 CLEAR PARITY BIT                         ;**NEW**
    236	000340	121027 	000040 			CMPB	(R0),#SPA	;++030 PRINTING CHARACTER?                      ;**NEW**
    237	000344	002403 				BLT	10$		;++030 IF LT NO                                 ;**NEW**
    238	000346	121027 	000177 			CMPB	(R0),#177	;++030 RUBOUT?                                  ;**NEW**
    239	000352	001002 				BNE	20$		;++030 IF NE NO                                 ;**NEW**
    240	000354				10$:				;++030                                          ;**NEW**
    241	000354	112710 	000040 			MOVB	#SPA,(R0)	;++030 REPLACE NON-PRINTING CHAR. WITH SPACE    ;**NEW**
    242	000360				20$:				;++030                                          ;**NEW**
    243	000360	005200 				INC	R0		;++030 STEP TO NEXT OUTPUT BYTE                 ;**NEW**
    244	000362					SOB	R3,EASCI	;++030 GO AGAIN                                 ;**NEW**
    245	000366					RETURN			;++030                                          ;**NEW**
    246
    247					;
    248					; FORM CONTROL DIRECTIVE (%NF)
    249					;
    250					; INSERT "N" FORM FEEDS INTO OUTPUT STRING.
    251					;
    252
    253	000370	112720 	000014 		FORM:	MOVB	#FF,(R0)+	;INSERT A FORM FEED
    254	000374					SOB	R3,FORM		;REPEAT
    255	000400					RETURN			;
    256
    257					;
    258					; NEW LINE DIRECTIVE (%NN)
    259					;
    260					; INSERT "N" CR-LF PAIRS INTO OUTPUT STRING.
    261					;
    262
    263	000402	112720 	000015 		NEWLIN:	MOVB	#CR,(R0)+	;INSERT A CR
    264	000406	112720 	000012 			MOVB	#LF,(R0)+	;INSERT A LF
    265	000412					SOB	R3,NEWLIN	;REPEAT
    266	000416					RETURN			;
    267
    268					;
    269					; SIGNED BINARY TO OCTAL CONVERSION DIRECTIVE (%NO)
    270					;
    271					; CONVERT "N" CONSECUTIVE ARGUMENT WORDS. IF MORE THAN ONE WORD IS
    272					; CONVERTED, THEN INSERT A TAB BETWEEN WORDS.
    273					;
    274
    275	000420	112720 	000011 		OCTAL1:	MOVB	#HT,(R0)+	;INSERT A TAB
    276	000424	012501 				MOV	(R5)+,R1	;GET NEXT ARGUMENT WORD
    277	000426	005002 			OCTAL:	CLR	R2		;ENABLE ZERO SUPPRESSION
    278	000430					CALL	$CBOSG		;CONVERT TO OCTAL
    279	000434					SOB	R3,OCTAL1	;REPEAT
    280	000440					RETURN			;
    281
    282					;
    283					; MAGNITUDE BINARY TO OCTAL CONVERSION DIRECTIVE (%NP)
    284					;
    285					; CONVERT "N" CONSECUTIVE ARGUMENT WORDS. IF MORE THAN ONE WORD IS
EDTMG	MACRO M1108  05-DEC-77 23:41  PAGE 2-5


    286					; CONVERTED, THEN INSERT A TAB BETWEEN WORDS.
    287					;
    288
    289	000442	112720 	000011 		POINT1:	MOVB	#HT,(R0)+	;INSERT A TAB
    290	000446	012501 				MOV	(R5)+,R1	;GET NEXT ARGUMENT WORD
    291	000450	010602 			POINT:	MOV	SP,R2		;DISABLE ZERO SUPPRESSION
    292	000452					CALL	$CBOMG		;CONVERT TO OCTAL
    293	000456					SOB	R3,POINT1	;REPEAT
    294	000462					RETURN			;
    295
    296					;
    297					; BINARY TO RAD50 CONVERSION DIRECTIVE
    298					;
    299					; CONVERT "N" CONSECUTIVE RAD50 WORDS.
    300					;
    301
    302	000464	012501 			RAD501:	MOV	(R5)+,R1	;GET NEXT ARGUMENT WORD
    303	000466				RAD50:	CALL	$C5TA		;CONVERT TO RAD50
    304	000472					SOB	R3,RAD501	;REPEAT
    305	000476					RETURN			;
    306					                                                                                ;**NEW**
    307					;++030                                                                          ;**NEW**
    308					;++030 SPACE GENERATOR (%NS)                                                    ;**NEW**
    309					;++030                                                                          ;**NEW**
    310					;++030 GENERATE N SPACES IN BUFFER                                              ;**NEW**
    311					;++030                                                                          ;**NEW**
    312					                                                                                ;**NEW**
    313	000500				SPACE:				;++030                                          ;**NEW**
    314	000500	112720 	000040 			MOVB	#SPA,(R0)+	;++030 PUT IN A SPACE                           ;**NEW**
    315	000504					SOB	R3,SPACE	;++030 LOOP UNTIL DONE                          ;**NEW**
    316	000510					RETURN			;++030                                          ;**NEW**
    317
    318					;
    319					; FILE NAME STRING CONVERSION
    320					;
    321					; CONVERT "N" FILE NAME STRINGS. IF MORE THAN ONE FILE NAME STRING IS
    322					; CONVERTED, THEN INSERT A TAB BETWEEN STRINGS.
    323					;
    324
    325	000512	112720 	000011 		XFNAM1:	MOVB	#HT,(R0)+	;INSERT A TAB
    326	000516	012501 				MOV	(R5)+,R1	;GET NEXT INPUT PARAMETER
    327	000520	012746 	000003 		XFNAM:	MOV	#3,-(SP)	;SET LOOP COUNT
    328	000524				10$:	CALL	$C5TA		;CONVERT TO RAD50
    329	000530	012501 				MOV	(R5)+,R1	;GET NEXT INPUT PARAMETER
    330	000532	005316 				DEC	(SP)		;DECREMENT LOOP COUNT
    331	000534	003373 				BGT	10$		;IF GT GO AGAIN
    332	000536	005726 				TST	(SP)+		;CLEAN STACK
    333	000540	012702 	000011 			MOV	#9.,R2		;SET SUPRESS COUNT
    334	000544					CALL	30$		;SUPRESS TRAILING BLANKS
    335	000550	112720 	000056 			MOVB	#'.,(R0)+	;INSERT PERIOD SEPARATOR
    336	000554					CALL	$C5TA		;CONVERT FILE TYPE TO RAD50
    337	000560	012702 	000003 			MOV	#3,R2		;SET SUPRESS COUNT
    338	000564					CALL	30$		;SUPRESS TRAILING BLANKS
    339	000570	012501 				MOV	(R5)+,R1	;GET VERSION NUMBER
    340	000572	001405 				BEQ	15$		;IF EQ SKIP VERSION
    341	000574	112720 	000073 			MOVB	#';,(R0)+	;INSERT A SEMICOLON SEPARATOR
    342	000600	005002 				CLR	R2		;ENABLE ZERO SUPRESSION
EDTMG	MACRO M1108  05-DEC-77 23:41  PAGE 2-6


    343	000602					CALL	$CBOMG		; CONVERT VERSION TO OCTAL
    344	000606				15$:	SOB	R3,XFNAM1	;REPEAT
    345	000612				20$:	RETURN			;
    346	000614	005302 			30$:	DEC	R2		;SUPRESS ANY MORE?
    347	000616	002775 				BLT	20$		;IF LT NO
    348	000620	122760 	000040 	177777 		CMPB	#' ,-1(R0)	;TRAILING BLANK?
    349	000626	001371 				BNE	20$		;IF NE NO
    350	000630	005300 				DEC	R0		;BACK UP A BYTE
    351	000632	000770 				BR	30$		;
    352
    353					;
    354					; DATE CONVERSION
    355					;
    356					; NOTE: REPEAT COUNT IS IGNORED.
    357					;
    358
    359	000634	010501 			EDATE:	MOV	R5,R1		;COPY ADDRESS OF NEXT PARAMETER
    360	000636	005741 				TST	-(R1)		;BACK UP TO FIRST PARAMETER
    361	000640					CALL	$DAT		;CONVERT DATE
    362	000644	010105 				MOV	R1,R5		;SET ADDRESS OF NEXT ARGUMENT
    363	000646					RETURN			;
    364
    365					;
    366					; TIME CONVERSION
    367					;
    368					; REPEAT COUNT IS USED TO SPECIFY THE TIME FORMAT.
    369					;
    370
    371	000650	010501 			ETIME:	MOV	R5,R1		;COPY ADDRESS OF NEXT ARGUMENT
    372	000652	005741 				TST	-(R1)		;BACK UP TO FIRST ARGUMENT
    373	000654	010302 				MOV	R3,R2		;SET CONVERSION TYPE
    374	000656					CALL	$TIM		;CONVERT TIME
    375	000662	010105 				MOV	R1,R5		;SET ADDRESS OF NEXT ARGUMENT
    376	000664					RETURN			;
    377
    378		000001 				.END
EDTMG	MACRO M1108  05-DEC-77 23:41  PAGE 2-7
SYMBOL TABLE

ASCII   000250R  	FF    = 000014   	OPRAND  000000R  	SPACE   000500R  	$CBTMG= ****** GX
BINDC1  000310R  	FORM    000370R  	OPRNDX= 000015   	VECTOR  000016R  	$CDTB = ****** GX
BINDEC  000316R  	HT    = 000011   	POINT   000450R  	VT    = 000013   	$C5TA = ****** GX
BYTE    000264R  	ILLDIR  000226R  	POINT1  000442R  	XFNAM   000520R  	$DAT  = ****** GX
BYTE1   000260R  	LF    = 000012   	RAD50   000466R  	XFNAM1  000512R  	$EDMSG  000052RG
CR    = 000015   	NEWLIN  000402R  	RAD501  000464R  	$CBDSG= ****** GX	$SAVRG= ****** GX
EASCI   000332R  	NP    = 000001   	R$$11M= 000000   	$CBOMG= ****** GX	$TIM  = ****** GX
EDATE   000634R  	OCTAL   000426R  	SPA   = 000040   	$CBOSG= ****** GX	$$    = 000001
ETIME   000650R  	OCTAL1  000420R

. ABS.	000000	   000
      	000666	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  803 WORDS  ( 4 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[46,10]EDTMG,[46,20]EDTMG/-SP=[46,30]MACFLM.,EDTMG.008
EOFCHK 0100MS, EOF CHECKING ROU	MACRO M1108  05-DEC-77 22:09  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
EOFCHK 0100MS, EOF CHECKING ROU	MACRO M1108  05-DEC-77 22:09  PAGE 7


						.TITLE	EOFCHK 0100MS, EOF CHECKING ROUTINES
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 11-AUG-73
     21					;
EOFCHK 0100MS, EOF CHECKING ROU	MACRO M1108  05-DEC-77 22:09  PAGE 8


     23					;+
     24					; SEE IF AT OR BEYOND EOF
     25					; CALLING SEQUENCE:
     26					;	CALL	..EFCK
     27					; INPUTS:
     28					;	R0=FDB
     29					; OUTPUTS:
     30					;	C=0 IF NOT AT EOF, C=1 IF EOF, F.ERR SET
     31					;	FD.EFB IN F.BKP1=0 IF CURRENT VBN IS BEFORE
     32					;	END OF FILE. =1 IF AT OR BEYOND EOF
     33					;	R1 ALTERED. R0,R2-R5 PRESERVED
     34					; OPERATION:
     35					;	SETS UP FD.EFB ACCORDING TO WHETHER THE
     36					; CURRENT VBN (F.VBN) IS BEFORE OR AFTER F.EFBK.
     37					; THEN IF AT THE END OF FILE BLOCK, NREC AND FFBY
     38					; ARE COMPARED TO SEE IF REALLY BEYOND EOF.
     39					;
     40					; ALTERNATE ENTRY:
     41					;	CALL	..EFC1
     42					; OPERATION:
     43					; FD.EFB IS ASSUMED PROPERLY SET UP. IF
     44					; IT IS 1 THEN THE CHECK OF FFBY AND NREC
     45					; IS MADE TO SEE IF BEYOND EOF.
     46					;-
     47	000000				..EFCK::CALL	..SEFB		;SEE IF AT OR BEYOND EOF BLOCK
     48	000004	103423 				BCS	EOFCKX		;BRANCH IF BEYOND
     49	000006	132760 	000004 	000000G	..EFC1::BITB	#FD.EFB,F.BKP1(R0) ;IS THIS THE EOF BLOCK
     50	000014	001411 				BEQ	2$		;BRANCH IF NOT
     51					; AT EOF BLOCK-CHECK RECORD POINTER
     52	000016	016001 	000000G			MOV	F.NREC(R0),R1	;CALCULATE OFFSET OF RECORD PTR INTO BUFFER
     53	000022	066001 	000000G			ADD	F.VBSZ(R0),R1
     54	000026	166001 	000000G			SUB	F.EOBB(R0),R1
     55	000032	026001 	000000G			CMP	F.FFBY(R0),R1	;
     56	000036	003402 				BLE	4$		;BRANCH IF EOF
     57	000040	000241 			2$:	CLC
     58	000042					RETURN
     59									;CLEAR RETURN ADDRESS FROM STACK
     60	000044	112760 	000000G	000000G	4$:	MOVB	#IE.EOF,F.ERR(R0) ;INDICATE EOF
     61	000052	000261 				SEC
     62	000054				EOFCKX:	RETURN
EOFCHK 0100MS, EOF CHECKING ROU	MACRO M1108  05-DEC-77 22:09  PAGE 9


     64					;+
     65					; IS CURRENT VBN AT OR BEYOND THE END OF FILE BLOCK
     66					; CALLING SEQUENCE:
     67					;	CALL	..SEFB
     68					; INPUTS:
     69					;	R0=FDB
     70					; OUTPUTS:
     71					;	C=0 IF BEFORE OR AT EFBK
     72					;	C=1 IF BEYOND EFBK, F.ERR SET
     73					;	FD.EFB IN F.BKP1(R0)=1 IF AT OR BEYOND EFKB
     74					;		=0 IF BEFORE EFBK
     75					;	ALL REGISTERS PRESERVED
     76					;-
     77	000056	142760 	000004 	000000G	..SEFB::BICB	#FD.EFB,F.BKP1(R0)
     78	000064					CALL	CMPEFB
     79	000070	103407 				BLO	10$		;BRANCH IF BEFORE EFBK
     80	000072	101010 				BHI	20$		;BRANCH IF BEYOND EFBK
     81	000074	005760 	000000G			TST	F.FFBY(R0)	;IF AT EFBK AND FFBY = 0 THEN
     82	000100	001405 				BEQ	20$		;REALLY BEYOND EOF
     83	000102	152760 	000004 	000000G		BISB	#FD.EFB,F.BKP1(R0)
     84	000110	000241 			10$:	CLC
     85	000112					RETURN
     86	000114	112760 	000000G	000000G	20$:	MOVB	#IE.EOF,F.ERR(R0)
     87	000122	152760 	000004 	000000G		BISB	#FD.EFB,F.BKP1(R0)
     88	000130	000261 				SEC
     89	000132					RETURN
     90	000134	026060 	000000G	000000G	CMPEFB:	CMP	F.VBN(R0),F.EFBK(R0)
     91	000142	001003 				BNE	10$
     92	000144	026060 	000002G	000002G		CMP	F.VBN+2(R0),F.EFBK+2(R0)
     93	000152				10$:	RETURN
     94					;
     95					;
     96	000154					$END	EOFCHK
     97					;
     98					;
     99		000001 				.END
EOFCHK 0100MS, EOF CHECKING ROU	MACRO M1108  05-DEC-77 22:09  PAGE 9-1
SYMBOL TABLE

BD.FRE= 000001   	F.EOBB= ****** GX	HA.UI = 000001   	PP.SEP= 000002   	R$$SPL= 000000
CMPEFB  000134R  	F.ERR = ****** GX	HA.VER= 000007   	PP.ZER= 000001   	R$$11M= 000001
DIRTYP= 015172   	F.FFBY= ****** GX	IE.EOF= ****** GX	R$$ANI= 000000   	SYDEV = 054523
EOFCKX  000054R  	F.NREC= ****** GX	NB.DOT= 100000   	R$$BBF= 000000   	SYUNIT= 000000
FCSEFN= 000040   	F.VBN = ****** GX	NB.SMI= 040000   	R$$DPB= 000001   	WI.DLK= 000002
FD.DVR= 000020   	F.VBSZ= ****** GX	N.DRPT= 000006   	R$$EIS= 000000   	WI.LCK= 000001
FD.EFB= 000004   	HA.CHU= 000003   	N.DRSZ= 000004   	R$$LCL= 000000   	$$    = 000067
FD.EF1= 000010   	HA.FP = 000002   	N.DVPT= 000002   	R$$MUL= 000000   	..EFCK  000000RG
FD.EOF= 000002   	HA.NAM= 000005   	N.DVSZ= 000000   	R$$OPF= 000000   	..EFC1  000006RG
FD.WRT= 000001   	HA.TYP= 000006   	N.FNPT= 000012   	R$$RSL= 000000   	..SEFB  000056RG
F.BKP1= ****** GX	HA.UAT= 000004   	N.FNSZ= 000010   	R$$SEQ= 000000   	...CTL= 000001
F.EFBK= ****** GX

. ABS.	000000	   000
      	000154	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2570 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[41,10]EOFCHK,[41,20]EOFCHK/-SP=[41,30]FCSPRE,EOFCHK
EXTEND 0100MS, EXTEND THE FILE	MACRO M1108  05-DEC-77 22:09  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
EXTEND 0100MS, EXTEND THE FILE	MACRO M1108  05-DEC-77 22:09  PAGE 7


						.TITLE	EXTEND 0100MS, EXTEND THE FILE
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 11-AUG-73
     21					;
     22					;+
     23					; EXTEND THE FILE - OPEN OR CLOSED
     24					; CALLING SEQUENCE:
     25					;	CALL	.EXTND
     26					; INPUTS:
     27					;	R0=FDB
     28					;	R1=NUMBER OF BLOCKS TO EXTEND FILE BY
     29					;	R2=TYPE OF ALLOCATION,  1=CONTIGUOUS, 0=NON-CONTIG
     30					; OUTPUTS:
     31					;	C=0 IF SUCCESSFUL, F.HIBK ADJUSTED APPROPRIATELY
     32					;	C=1 IF FAILURE, F.ERR TELLS WHAT HAPPENED
     33					;	ALL REGISTERS PRESERVED
     34					;-
     35	000000				.EXTND::.SAVR1
     36	000004	012760 	000001 	000000G		MOV	#1,F.ERR(R0)
     37	000012	010146 				MOV	R1,-(SP)
     38	000014	010246 				MOV	R2,-(SP)
     39	000016					CALL	..STFN		;SET UP FILE NAME BLOCK IF NECESSARY
     40	000022	011146 				MOV	@R1,-(SP)	;SAVE THE FILE ID TO BE RESTORED LATER
     41	000024	103416 				BCS	EXTBX1		;BRANCH IF PARSE, ..ALUN FAILED
     42	000026	001003 				BNE	10$		;BRANCH IF FILE ID WAS SET UP
     43	000030					CALL	..FIND		;FILE ID WASN'T SET, FIND THE FILE ID
     44	000034	103412 				BCS	EXTBX1		;BRANCH IF CAN'T FIND IT
     45	000036	132760 	000000G	000000G	10$:	BITB	#FD.REC,F.RCTL(R0) ;NOP IF RECORD ORIENTED
     46	000044	001006 				BNE	EXTBX1
     47	000046	016601 	000002 			MOV	2(SP),R1	;R1=TYPE OF ALLOCATION
     48	000052	016602 	000004 			MOV	4(SP),R2	;R2=NO. OF BLOCKS TO ALLOCATE
     49	000056					CALL	..EXT1		;ISSUE THE EXTEND QI/O AND WAIT
     50	000062	012660 	000000G		EXTBX1:	MOV	(SP)+,F.FNB(R0)	;RESTORE THE FILE ID
     51	000066	012602 				MOV	(SP)+,R2
     52	000070	012601 				MOV	(SP)+,R1
     53	000072					RETURN
     54					;
     55					;
     56	000074					$END	EXTEND
EXTEND 0100MS, EXTEND THE FILE	MACRO M1108  05-DEC-77 22:09  PAGE 7-1


     57					;
     58					;
     59		000001 				.END
EXTEND 0100MS, EXTEND THE FILE	MACRO M1108  05-DEC-77 22:09  PAGE 7-2
SYMBOL TABLE

BD.FRE= 000001   	F.FNB = ****** GX	N.DRPT= 000006   	R$$DPB= 000001   	SYUNIT= 000000
DIRTYP= 015172   	F.RCTL= ****** GX	N.DRSZ= 000004   	R$$EIS= 000000   	WI.DLK= 000002
EXTBX1  000062R  	HA.CHU= 000003   	N.DVPT= 000002   	R$$LCL= 000000   	WI.LCK= 000001
FCSEFN= 000040   	HA.FP = 000002   	N.DVSZ= 000000   	R$$MUL= 000000   	$$    = 000067
FD.DVR= 000020   	HA.NAM= 000005   	N.FNPT= 000012   	R$$OPF= 000000   	.EXTND  000000RG
FD.EFB= 000004   	HA.TYP= 000006   	N.FNSZ= 000010   	R$$RSL= 000000   	.SAVR1= ****** GX
FD.EF1= 000010   	HA.UAT= 000004   	PP.SEP= 000002   	R$$SEQ= 000000   	..EXT1= ****** GX
FD.EOF= 000002   	HA.UI = 000001   	PP.ZER= 000001   	R$$SPL= 000000   	..FIND= ****** GX
FD.REC= ****** GX	HA.VER= 000007   	R$$ANI= 000000   	R$$11M= 000001   	..STFN= ****** GX
FD.WRT= 000001   	NB.DOT= 100000   	R$$BBF= 000000   	SYDEV = 054523   	...CTL= 000001
F.ERR = ****** GX	NB.SMI= 040000

. ABS.	000000	   000
      	000074	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2521 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]EXTEND,[41,20]EXTEND/-SP=[41,30]FCSPRE,EXTEND
FCSFSR 0302MS, FILE STORAGE REG	MACRO M1108  05-DEC-77 22:09  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
FCSFSR 0302MS, FILE STORAGE REG	MACRO M1108  05-DEC-77 22:09  PAGE 7


						.TITLE	FCSFSR 0302MS, FILE STORAGE REGION DEFINITION
						.IDENT	/0302MS/
      2					; ALTERED WEDNESDAY 20-MAR-74 15:35
      3					; ALTERED MONDAY 14-JUL-75 13:12
      4					;
      5					;                             COPYRIGHT (C) 1973, 1978 BY
      6					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      7					;
      8					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      9					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     10					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     11					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     12					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     13					;
     14					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     15					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     16					;       CORPORATION.
     17					;
     18					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     19					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     20					;
     21					; PETER H. LIPMAN 21-MAR-73
     22					;
     23						.MCALL	FSROF$
     24
     25	000000					FSROF$	DEF$L
FCSFSR 0302MS, FILE STORAGE REG	MACRO M1108  05-DEC-77 22:09  PAGE 8


     27					; DEFINE THE FOLLOWING GLOBAL, DEFINE THE
     28					; $$FSR1 AND $$FSR2 PSECTS, AND INITIALIZE CERTAIN LOCATIONS
     29						.GLOBL	.FSRPT
     30					;
     31					; STORE ADDRESS OF FILE STORAGE REGION ALLOCATION CONTROL BLOCK
     32					; IN ABSOLUTE (VIRTUAL) LOCATION .FSRPT
     33					;
     34						.IF	EQ,R$$11M	;IF NOT RSX11M
     35						.ASECT
     36						.=.FSRPT
     37						.WORD	.FSRCB
     38						.ENDC
     39
     40					; DUMMY CSECT TO ALLOW THE DEFINITION OF THE ADDRESS OF THE
     41					; FIRST WORD.  THE USER PROGRAM IS EXPECTED TO REFERENCE THIS CSECT
     42					; AND SET ITS SIZE APPROPRIATELY.
     43	000000					.PSECT $$FSR1,GBL,OVR,D
     44	000000				FSR:
     45
     46					; THE FOLLOWING CSECT IS NEXT IN ALPHABETIC ORDER TO THE
     47					; FILE STORAGE REGION.  THE TASK BUILDER GUARANTEES THAT CSECTS
     48					; ARE LOADED ALPHABETICALLY.  THUS THE SYMBOL .FSRCB
     49					; IMMEDIATELY FOLLOWS THE LAST BYTE OF THE FSR.
     50	000000					.PSECT $$FSR2,GBL,D
     51	000000				.FSRCB::
     52		000004'				.=.FSRCB+A.BFSR
     53	000004	000000'	177777'			.WORD	FSR,.FSRCB-1
     54		000050'				.=.FSRCB+A.DFDR
     55					; THE FIRST 2 WORDS ARE SIZE AND ADDRESS OF DEFAULT DIRECTORY STRING
     56					; STARTING AFTER THE 2ND WORD IS ROOM TO STORE THE INITIAL DEFAULT
     57					; DIRECTORY STRING AS INITIALIZED FROM THE TASK'S UIC.
     58					; A STRING SIZE OF 0 OR -1 MEANS A NULL STRING, 0 INDICATES THAT
     59					; THE MFD SHOULD BE USED, -1 INDICATES THAT THE STRING HAS NOT BEEN
     60					; INITIALIZED.  THIS INITIALIZATION TAKES PLACE IN PARSE AT THE
     61					; POINT THAT THE DEFAULT DIRECTORY STRING IS NEEDED.
     62	000050	177777 				.WORD	-1
     63		000012'				.=.FSRCB+A.FIPR
     64	000012	177777 				.WORD	-1		;INIT TO "NOT SPECIFIED"
     65		000100'				.=.FSRCB+A.DFBC
     66	000100	000001 			.MBFCT::.WORD	1		;DEFAULT TO 1 BUFFER IN PUT/GET MODE
     67					;
     68		000102'				.=.FSRCB+S.FSR2
     69	000000					.PSECT
     70
     71					;
     72					;
     73	000000					$END	FCSFSR
     74					;
     75					;
     76		000001 				.END
FCSFSR 0302MS, FILE STORAGE REG	MACRO M1108  05-DEC-77 22:09  PAGE 8-1
SYMBOL TABLE

A.BFSR= 000004   	D.DFUN= 000026   	HA.UAT= 000004   	PP.ZER= 000001   	R$$11M= 000001
A.DFBC= 000100   	FCSEFN= 000040   	HA.UI = 000001   	R$$ANI= 000000   	SYDEV = 054523
A.DFDR= 000050   	FD.DVR= 000020   	HA.VER= 000007   	R$$BBF= 000000   	SYUNIT= 000000
A.DPB = 000014   	FD.EFB= 000004   	NB.DOT= 100000   	R$$DPB= 000001   	S.FSR2= 000102
A.EFSR= 000006   	FD.EF1= 000010   	NB.SMI= 040000   	R$$EIS= 000000   	WI.DLK= 000002
A.FIPR= 000012   	FD.EOF= 000002   	N.DRPT= 000006   	R$$LCL= 000000   	WI.LCK= 000001
A.IOST= 000044   	FD.WRT= 000001   	N.DRSZ= 000004   	R$$MUL= 000000   	.FSRCB  000000RG    003
A.OWUI= 000010   	FSR     000000R     002	N.DVPT= 000002   	R$$OPF= 000000   	.FSRPT= ****** G
BD.FRE= 000001   	HA.CHU= 000003   	N.DVSZ= 000000   	R$$RSL= 000000   	.MBFCT  000100RG    003
DIRTYP= 015172   	HA.FP = 000002   	N.FNPT= 000012   	R$$SEQ= 000000   	...CTL= 000001
D.DFDV= 000024   	HA.NAM= 000005   	N.FNSZ= 000010   	R$$SPL= 000000   	...TPC= 000030
D.DFID= 000016   	HA.TYP= 000006   	PP.SEP= 000002

. ABS.	000000	   000
      	000000	   001
$$FSR1	000000	   002
$$FSR2	000102	   003
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2684 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[41,10]FCSFSR,[41,20]FCSFSR/-SP=[41,30]FCSPRE,FCSFSR
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 1


      1						.TITLE	FCSMAC-FILE CONTROL SERVICES MACRO DEFINITIONS
      2					; ALTERED TUESDAY 20-AUG-74 10:35
      3						.IDENT	/0722/
      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					; PETER H LIPMAN		5-DEC-72
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 2


     22
     23					; MCALL ALL THE FCS MACROS USED AT TOP LEVEL.
     24						.MACRO	FCSMC$
     25						.MCALL	OPEN$R,OPEN$W,OPEN$M,OPEN$U,OPEN$A,CLOSE$
     26						.MCALL	OPNS$R,OPNS$W,OPNS$M,OPNS$U,OPNS$A
     27						.MCALL	READ$,WRITE$,WAIT$,GET$,PUT$,DELET$,FINIT$
     28						.MCALL	FSRSZ$,FDBDF$,FDAT$A,FDRC$A,FDOP$A,FDBF$A,FDBK$A
     29						.MCALL	FDAT$R,FDRC$R,FDOP$R,FDBF$R,FDBK$R,NMBLK$
     30						.MACRO	FCSMC$
     31						.ENDM	FCSMC$
     32						.ENDM	FCSMC$
     33					;
     34
     35					;  OPEN FILE FOR READING
     36
     37						.MACRO	OPEN$R FDB,LUN,FNPT,RACC,URBA,URBS,ERR
     38						.MCALL	OPEN$
     39						OPEN$	FDB,#FO.RD,LUN,FNPT,,RACC,URBA,URBS,ERR
     40						.ENDM	OPEN$R
     41
     42					; OPEN FILE FOR WRITING
     43						.MACRO	OPEN$W FDB,LUN,FNPT,RACC,URBA,URBS,ERR
     44						.MCALL	OPEN$
     45						OPEN$	FDB,#FO.WRT,LUN,FNPT,,RACC,URBA,URBS,ERR
     46						.ENDM	OPEN$W
     47
     48					; OPEN FILE FOR MODIFY
     49						.MACRO	OPEN$M FDB,LUN,FNPT,RACC,URBA,URBS,ERR
     50						.MCALL	OPEN$
     51						OPEN$	FDB,#FO.MFY,LUN,FNPT,,RACC,URBA,URBS,ERR
     52						.ENDM	OPEN$M
     53
     54					; OPEN FILE FOR UPDATE
     55						.MACRO	OPEN$U FDB,LUN,FNPT,RACC,URBA,URBS,ERR
     56						.MCALL	OPEN$
     57						OPEN$	FDB,#FO.UPD,LUN,FNPT,,RACC,URBA,URBS,ERR
     58						.ENDM	OPEN$U
     59
     60					; OPEN FILE FOR APPEND
     61						.MACRO	OPEN$A FDB,LUN,FNPT,RACC,URBA,URBS,ERR
     62						.MCALL	OPEN$
     63						OPEN$	FDB,#FO.APD,LUN,FNPT,,RACC,URBA,URBS,ERR
     64						.ENDM	OPEN$A
     65
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 3


     67					;  OPEN FILE FOR READING - SHARED
     68
     69						.MACRO	OPNS$R FDB,LUN,FNPT,RACC,URBA,URBS,ERR
     70						.MCALL	OPEN$
     71						OPEN$	FDB,#FA.SHR!FO.RD,LUN,FNPT,,RACC,URBA,URBS,ERR
     72						.ENDM	OPNS$R
     73
     74					; OPEN FILE FOR WRITING - SHARED
     75						.MACRO	OPNS$W FDB,LUN,FNPT,RACC,URBA,URBS,ERR
     76						.MCALL	OPEN$
     77						OPEN$	FDB,#FA.SHR!FO.WRT,LUN,FNPT,,RACC,URBA,URBS,ERR
     78						.ENDM	OPNS$W
     79
     80					; OPEN FILE FOR MODIFY - SHARED
     81						.MACRO	OPNS$M FDB,LUN,FNPT,RACC,URBA,URBS,ERR
     82						.MCALL	OPEN$
     83						OPEN$	FDB,#FA.SHR!FO.MFY,LUN,FNPT,,RACC,URBA,URBS,ERR
     84						.ENDM	OPNS$M
     85
     86					; OPEN FILE FOR UPDATE - SHARED
     87						.MACRO	OPNS$U FDB,LUN,FNPT,RACC,URBA,URBS,ERR
     88						.MCALL	OPEN$
     89						OPEN$	FDB,#FA.SHR!FO.UPD,LUN,FNPT,,RACC,URBA,URBS,ERR
     90						.ENDM	OPNS$U
     91
     92					; OPEN FILE FOR APPEND - SHARED
     93						.MACRO	OPNS$A FDB,LUN,FNPT,RACC,URBA,URBS,ERR
     94						.MCALL	OPEN$
     95						OPEN$	FDB,#FA.SHR!FO.APD,LUN,FNPT,,RACC,URBA,URBS,ERR
     96						.ENDM	OPNS$A
     97
     98					; OPEN A TEMP FILE AND MARK IT FOR DELETE
     99					; CREATE, ACCESS, AND MARK FOR DELETE A NEW FILE
    100					; NOT ENTERED IN A DIRECTORY
    101					; WILL BE DELETED WHEN CLOSED (DEACCESSED)
    102					; WILL EVEN BE PROPERLY DELETED IF PROGRAM SHOULD TERMINATE ABNORMALLY
    103						.MACRO	OPNT$D	FDB,LUN,FNPT,RACC,URBA,URBS,ERR
    104						.MCALL	OPNT$W
    105						OPNT$W	FDB,LUN,FNPT,RACC,URBA,URBS
    106						BCS	.+6
    107						JSR	PC,.MRKDL
    108						ERR$	ERR
    109						.ENDM	OPNT$D
    110					;
    111					; OPEN A TEMP FILE
    112					; CREATE AND ACCESS A NEW FILE, DON'T ENTER IT IN A DIRECTORY
    113					; FILE MAY BE CLOSED AND REOPENED BY FILE ID
    114					; FILE SHOULD BE DELETED BEFORE THE PROGRAM EXITS OTHERWISE IT
    115					; WILL REMAIN IN THE INDEX FILE WITH NO DIRECTORY ENTRY
    116						.MACRO	OPNT$W FDB,LUN,FNPT,RACC,URBA,URBS,ERR
    117						.MCALL	OPEN$
    118						OPEN$	FDB,#FA.TMP!FO.WRT,LUN,FNPT,,RACC,URBA,URBS,ERR
    119						.ENDM	OPNT$W
    120
    121					; OPEN FILE
    122						.MACRO	OPEN$ FDB,FACC,LUN,FNPT,DFNB,RACC,URBA,URBS,ERR
    123						.MCALL	FDOP$R,FDRC$R,ERR$,CMOV$B
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 3-1


    124						FDOP$R	FDB,LUN,FNPT,DFNB,FACC
    125						FDRC$R	,RACC,URBA,URBS
    126						.GLOBL	.OPEN
    127						JSR	PC,.OPEN
    128						ERR$	ERR
    129						.ENDM	OPEN$
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 4


    131					; OPEN FILE FOR READING - BY FILE ID
    132						.MACRO	OFID$R FDB,LUN,FNPT,RACC,URBA,URBS,ERR
    133						.MCALL	OFID$
    134						OFID$	FDB,#FO.RD,LUN,FNPT,,RACC,URBA,URBS,ERR
    135						.ENDM	OFID$R
    136
    137					; OPEN FILE FOR WRITING - BY FILE ID
    138						.MACRO	OFID$W FDB,LUN,FNPT,RACC,URBA,URBS,ERR
    139						.MCALL	OFID$
    140						OFID$	FDB,#FO.WRT,LUN,FNPT,,RACC,URBA,URBS,ERR
    141						.ENDM	OFID$W
    142
    143					; OPEN FILE FOR MODIFY - BY FILE ID
    144						.MACRO	OFID$M FDB,LUN,FNPT,RACC,URBA,URBS,ERR
    145						.MCALL	OFID$
    146						OFID$	FDB,#FO.MFY,LUN,FNPT,,RACC,URBA,URBS,ERR
    147						.ENDM	OFID$M
    148
    149					; OPEN FILE FOR UPDATE - BY FILE ID
    150						.MACRO	OFID$U FDB,LUN,FNPT,RACC,URBA,URBS,ERR
    151						.MCALL	OFID$
    152						OFID$	FDB,#FO.UPD,LUN,FNPT,,RACC,URBA,URBS,ERR
    153						.ENDM	OFID$U
    154
    155					; OPEN FILE FOR APPEND - BY FILE ID
    156						.MACRO	OFID$A FDB,LUN,FNPT,RACC,URBA,URBS,ERR
    157						.MCALL	OFID$
    158						OFID$	FDB,#FO.APD,LUN,FNPT,,RACC,URBA,URBS,ERR
    159						.ENDM	OFID$A
    160
    161					; OPEN FILE - BY FILE ID
    162						.MACRO	OFID$ FDB,FACC,LUN,FNPT,DFNB,RACC,URBA,URBS,ERR
    163						.MCALL	FDOP$R,FDRC$R,ERR$,CMOV$B
    164						FDOP$R	FDB,LUN,FNPT,DFNB,FACC
    165						FDRC$R	,RACC,URBA,URBS
    166						.GLOBL	.OPFID
    167						JSR	PC,.OPFID
    168						ERR$	ERR
    169						.ENDM	OFID$
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 5


    171					; OPEN FILE FOR READING - BY FILE NAME BLOCK
    172						.MACRO	OFNB$R FDB,LUN,FNPT,RACC,URBA,URBS,ERR
    173						.MCALL	OFNB$
    174						OFNB$	FDB,#FO.RD,LUN,FNPT,,RACC,URBA,URBS,ERR
    175						.ENDM	OFNB$R
    176
    177					; OPEN FILE FOR WRITING - BY FILE NAME BLOCK
    178						.MACRO	OFNB$W FDB,LUN,FNPT,RACC,URBA,URBS,ERR
    179						.MCALL	OFNB$
    180						OFNB$	FDB,#FO.WRT,LUN,FNPT,,RACC,URBA,URBS,ERR
    181						.ENDM	OFNB$W
    182
    183					; OPEN FILE FOR MODIFY - BY FILE NAME BLOCK
    184						.MACRO	OFNB$M FDB,LUN,FNPT,RACC,URBA,URBS,ERR
    185						.MCALL	OFNB$
    186						OFNB$	FDB,#FO.MFY,LUN,FNPT,,RACC,URBA,URBS,ERR
    187						.ENDM	OFNB$M
    188
    189					; OPEN FILE FOR UPDATE - BY FILE NAME BLOCK
    190						.MACRO	OFNB$U FDB,LUN,FNPT,RACC,URBA,URBS,ERR
    191						.MCALL	OFNB$
    192						OFNB$	FDB,#FO.UPD,LUN,FNPT,,RACC,URBA,URBS,ERR
    193						.ENDM	OFNB$U
    194
    195					; OPEN FILE FOR APPEND - BY FILE NAME BLOCK
    196						.MACRO	OFNB$A FDB,LUN,FNPT,RACC,URBA,URBS,ERR
    197						.MCALL	OFNB$
    198						OFNB$	FDB,#FO.APD,LUN,FNPT,,RACC,URBA,URBS,ERR
    199						.ENDM	OFNB$A
    200
    201					; OPEN FILE - BY FILE NAME BLOCK
    202						.MACRO	OFNB$ FDB,FACC,LUN,FNPT,DFNB,RACC,URBA,URBS,ERR
    203						.MCALL	FDOP$R,FDRC$R,ERR$,CMOV$B
    204						FDOP$R	FDB,LUN,FNPT,DFNB,FACC
    205						FDRC$R	,RACC,URBA,URBS
    206						.GLOBL	.OPFNB
    207						JSR	PC,.OPFNB
    208						ERR$	ERR
    209						.ENDM	OFNB$
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 6


    211					; CLOSE THE FILE
    212
    213						.MACRO	CLOSE$ FDB,ERR
    214						.MCALL	LDFDB$,ERR$
    215						LDFDB$	FDB
    216						.GLOBL	.CLOSE
    217						JSR	PC,.CLOSE
    218						ERR$	ERR
    219						.ENDM	CLOSE$
    220
    221					; READ A VIRTUAL BLOCK
    222
    223						.MACRO	READ$ FDB,BKAD,BKSZ,BKVB,BKEF,BKST,BKDN,ERR
    224						.MCALL	FDBK$R,ERR$
    225						FDBK$R	FDB,BKAD,BKSZ,BKVB,BKEF,BKST,BKDN
    226						.GLOBL	.READ
    227						JSR	PC,.READ
    228						ERR$	ERR
    229						.ENDM	READ$
    230					; WRITE VIRTUAL BLOCK
    231
    232						.MACRO	WRITE$ FDB,BKAD,BKSZ,BKVB,BKEF,BKST,BKDN,ERR
    233						.MCALL	FDBK$R,ERR$
    234						FDBK$R	FDB,BKAD,BKSZ,BKVB,BKEF,BKST,BKDN
    235						.GLOBL	.WRITE
    236						JSR	PC,.WRITE
    237						ERR$	ERR
    238						.ENDM	WRITE$
    239					;
    240					; WAIT FOR I/O COMPLETION AFTER READ$ OR WRITE$
    241					;
    242						.MACRO	WAIT$	FDB,EFN,BKST,ERR
    243						.MCALL	LDFDB$,CMOV$W,CMOV$B,ERR$
    244						LDFDB$	FDB
    245						CMOV$B	EFN,F.EFN
    246						CMOV$W	BKST,F.BKST
    247						.GLOBL	.WAIT
    248						JSR	PC,.WAIT
    249						ERR$	ERR
    250						.ENDM	WAIT$
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 7


    252					; GET A RECORD
    253
    254						.MACRO	GET$ FDB,INADR,MAXCNT,ERR
    255						.MCALL	LDFDB$,CMOV$W,ERR$
    256						LDFDB$	FDB
    257						CMOV$W	INADR,F.URBD+2	;USER RECORD BUFFER ADDRESS
    258						CMOV$W	MAXCNT,F.URBD	;USER RECORD BUFFER SIZE
    259						.GLOBL	.GET
    260						JSR	PC,.GET
    261						ERR$	ERR
    262						.ENDM	GET$
    263					; GET A RECORD - IN RANDOM MODE
    264
    265						.MACRO	GET$R FDB,INADR,MAXCNT,LRCNM,HRCNM,ERR
    266						.MCALL	LDFDB$,CMOV$W,ERR$
    267						LDFDB$	FDB
    268						CMOV$W	INADR,F.URBD+2	;USER RECORD BUFFER ADDRESS
    269						CMOV$W	MAXCNT,F.URBD	;USER RECORD BUFFER SIZE
    270						CMOV$W	LRCNM,F.RCNM+2	;LOW ORDER RECORD NUMBER
    271						CMOV$W	HRCNM,F.RCNM	;HIGH ORDER RECORD NUMBER
    272						.GLOBL	.GET
    273						JSR	PC,.GET
    274						ERR$	ERR
    275						.ENDM	GET$R
    276					; GET A RECORD  - SEQUENTIAL MODE STRICTLY
    277
    278						.MACRO	GET$S FDB,INADR,MAXCNT,ERR
    279						.MCALL	LDFDB$,CMOV$W,ERR$
    280						LDFDB$	FDB
    281						CMOV$W	INADR,F.URBD+2	;USER RECORD BUFFER ADDRESS
    282						CMOV$W	MAXCNT,F.URBD	;USER RECORD BUFFER SIZE
    283						.GLOBL	.GETSQ
    284						JSR	PC,.GETSQ
    285						ERR$	ERR
    286						.ENDM	GET$S
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 8


    288					; PUT A RECORD - RANDOM OR SEQUENTIAL
    289
    290						.MACRO	PUT$ FDB,OUTADR,OUTCNT,ERR
    291						.MCALL	LDFDB$,CMOV$W,ERR$
    292						LDFDB$	FDB
    293						CMOV$W	OUTADR,F.NRBD+2	;NEXT RECORD BUFFER ADDRESS
    294						CMOV$W	OUTCNT,F.NRBD	;NEXT RECORD BUFFER SIZE
    295						.GLOBL	.PUT
    296						JSR	PC,.PUT
    297						ERR$	ERR
    298						.ENDM	PUT$
    299
    300					; PUT A RECORD - RANDOM MODE
    301
    302						.MACRO	PUT$R FDB,OUTADR,OUTCNT,LRCNM,HRCNM,ERR
    303						.MCALL	LDFDB$,CMOV$W,ERR$
    304						LDFDB$	FDB
    305						CMOV$W	OUTADR,F.NRBD+2	;NEXT RECORD BUFFER ADDRESS
    306						CMOV$W	OUTCNT,F.NRBD	;NEXT RECORD BUFFER SIZE
    307						CMOV$W	LRCNM,F.RCNM+2	;LOW ORDER RECORD NUMBER
    308						CMOV$W	HRCNM,F.RCNM	;HIGH ORDER RECORD NUMBER
    309						.GLOBL	.PUT
    310						JSR	PC,.PUT
    311						ERR$	ERR
    312						.ENDM	PUT$R
    313
    314					; PUT A RECORD - SEQUENTIAL MODE STRICTLY
    315
    316						.MACRO	PUT$S FDB,OUTADR,OUTCNT,ERR
    317						.MCALL	LDFDB$,CMOV$W,ERR$
    318						LDFDB$	FDB
    319						CMOV$W	OUTADR,F.NRBD+2	;NEXT RECORD BUFFER ADDRESS
    320						CMOV$W	OUTCNT,F.NRBD	;NEXT RECORD BUFFER SIZE
    321						.GLOBL	.PUTSQ
    322						JSR	PC,.PUTSQ
    323						ERR$	ERR
    324						.ENDM	PUT$S
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 9


    326					; DELETE A FILE
    327						.MACRO	DELET$	FDB,ERR
    328						.MCALL	LDFDB$,ERR$
    329						LDFDB$	FDB
    330						.GLOBL	.DELET
    331						JSR	PC,.DELET
    332						ERR$	ERR
    333						.ENDM	DELET$
    334
    335					; INITIALIZE THE FILE CONTROL SERVICES
    336						.MACRO	FINIT$
    337						.GLOBL	.FINIT
    338						JSR	PC,.FINIT
    339						.ENDM	FINIT$
    340
    341					;
    342					;
    343						.MACRO	FSRSZ$ NFILES,BFSPAC,PSECT
    344						.MCALL	BDOFF$,DEF$L
    345						.IF	NDF,S.BFHD
    346						BDOFF$	DEF$N
    347						DEF$L	S.BFHD
    348						.ENDC
    349						.GLOBL	.FSRCB
    350						.PSECT	$$FSR1,GBL,OVR,D
    351						.IF	NB,<BFSPAC>
    352						.BLKB	NFILES*S.BFHD+<BFSPAC>
    353						.IFF
    354						.BLKB	NFILES*<S.BFHD+512.>
    355						.ENDC
    356
    357						.PSECT	PSECT
    358						.ENDM	FSRSZ$
    359
    360					; FILE DESCRIPTOR BLOCK - ALLOCATION OF SPACE AT ASSEMBLY TIME
    361
    362						.MACRO	FDBDF$
    363						.MCALL	FDBSZ$
    364						FDBSZ$
    365						...PC1=.
    366						.BLKB	S.FDB
    367						.ENDM	FDBDF$
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 10


    369					; FILE ATTRIBUTE SECTION OF FDB-ASSEMBLY TIME INITIALIATION
    370
    371						.MACRO	FDAT$A RTYP,RATT,RSIZ,CNTG,ALOC
    372						.MCALL	FDOFF$,CBYTE$,CWORD$
    373						FDOFF$	DEF$L
    374						CBYTE$	<RTYP>,F.RTYP
    375						CBYTE$	<RATT>,F.RATT
    376						CWORD$	<RSIZ>,F.RSIZ
    377						CWORD$	<CNTG>,F.CNTG
    378						CWORD$	<ALOC>,F.ALOC
    379						.ENDM	FDAT$A
    380
    381					; RECORD ACCESS SECTION OF FDB-ASSEMBLY TIME INITIALIZATION
    382
    383						.MACRO	FDRC$A RACC,URBA,URBS
    384						.MCALL	FDOFF$,CBYTE$,CWORD$
    385						FDOFF$	DEF$L
    386						CBYTE$	<RACC>,F.RACC
    387						CWORD$	<URBA>,F.URBD+2
    388						CWORD$	<URBS>,F.URBD
    389						.ENDM	FDRC$A
    390
    391					; FILE OPEN SECTION OF FDB-ASSEMBLY TIME INITIALIZATION
    392						.MACRO	FDOP$A LUN,FNPT,DFNB,FACC
    393						.MCALL	FDOFF$,CBYTE$,CWORD$
    394						FDOFF$	DEF$L
    395						CBYTE$	<LUN>,F.LUN
    396						CWORD$	<FNPT>,F.DSPT
    397						CWORD$	<DFNB>,F.DFNB
    398						CBYTE$	<FACC>,F.FACC
    399						.ENDM	FDOP$A
    400
    401					; BUFFER DECRIPTOR SECTION OF FDB-ASSEMBLY TIME INITIALIZATION
    402
    403						.MACRO	FDBF$A EFN,OVBS,MBCT,MBFG
    404						.MCALL	FDOFF$,CBYTE$,CWORD$
    405						FDOFF$	DEF$L
    406						CBYTE$	<EFN>,F.EFN
    407						CWORD$	<OVBS>,F.OVBS
    408						CBYTE$	<MBCT>,F.MBCT
    409						CBYTE$	<MBFG>,F.MBFG
    410						.ENDM	FDBF$A
    411
    412					; BLOCK ACCESS SECTION OF FDB ASSEMBLY TIME INITIALIZATION
    413						.MACRO	FDBK$A BKAD,BKSZ,BKVB,BKEF,BKST,BKDN
    414						.MCALL	FDOFF$,CBYTE$,CWORD$
    415						FDOFF$	DEF$L
    416						CWORD$	<BKAD>,F.BKDS+2
    417						CWORD$	<BKSZ>,F.BKDS
    418						CWORD$	<BKVB>,F.BKVB+2	;STORE LOW ORDER ONLY
    419						CBYTE$	<BKEF>,F.BKEF
    420						CWORD$	<BKST>,F.BKST
    421						CWORD$	<BKDN>,F.BKDN
    422						.ENDM	FDBK$A
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 11


    424					; FILE ATTRIBUTE SECTION OF FDB-RUNTIME INITIALIZATION
    425
    426						.MACRO	FDAT$R FDB,RTYP,RATT,RSIZ,CNTG,ALOC
    427						.MCALL	LDFDB$,CMOV$W,CMOV$B
    428
    429						LDFDB$	FDB		;SAVE R0 AND LOAD FDB
    430						CMOV$B	RTYP,F.RTYP
    431						CMOV$B	RATT,F.RATT
    432						CMOV$W	RSIZ,F.RSIZ
    433						CMOV$W	CNTG,F.CNTG
    434						CMOV$W	ALOC,F.ALOC
    435						.ENDM	FDAT$R
    436
    437					; RECORD ACCESS SECTION OF FDB-RUNTIME INITIALIZATION
    438
    439						.MACRO	FDRC$R FDB,RACC,URBA,URBS
    440						.MCALL	LDFDB$,CMOV$W,CMOV$B
    441						LDFDB$	FDB
    442						CMOV$B	RACC,F.RACC
    443						CMOV$W	URBA,F.URBD+2
    444						CMOV$W	URBS,F.URBD
    445						.ENDM	FDRC$R
    446
    447					; FILE OPEN SECTION OF FDB-RUNTIME INITIALIZATION
    448
    449						.MACRO	FDOP$R FDB,LUN,FNPT,DFNB,FACC
    450						.MCALL	LDFDB$,CMOV$W,CMOV$B
    451						LDFDB$	FDB
    452						CMOV$B	LUN,F.LUN
    453						CMOV$W	FNPT,F.DSPT
    454						CMOV$W	DFNB,F.DFNB
    455						CMOV$B	FACC,F.FACC
    456						.ENDM	FDOP$R
    457
    458					; BLOCK BUFFER SECTION OF FDB-RUNTIME INITIALIZATION.
    459
    460						.MACRO	FDBF$R FDB,EFN,OVBS,MBCT,MBFG
    461						.MCALL	LDFDB$,CMOV$W,CMOV$B
    462						LDFDB$	FDB
    463						CMOV$B	EFN,F.EFN	;EVENT FLAG TO USE
    464						CMOV$W	OVBS,F.OVBS	;SIZE OF BLOCK BUFFER
    465						CMOV$B	MBCT,F.MBCT	;NO. OF BUFFERS
    466						CMOV$B	MBFG,F.MBFG	;READ AHEAD OR WRITE BEHIND
    467						.ENDM	FDBF$R
    468
    469					; BLOCK ACCESS SECTION OF FDB-RUNTIME INITIALIZATION
    470
    471						.MACRO	FDBK$R FDB,BKAD,BKSZ,BKVB,BKEF,BKST,BKDN
    472						.MCALL	LDFDB$,CMOV$B,CMOV$W,CMOV$2
    473						LDFDB$	FDB
    474						CMOV$W	BKAD,F.BKDS+2	;BLOCK ADDRESS-MEMORY BUFFER
    475						CMOV$W	BKSZ,F.BKDS	;SIZE OF TRANSFER IN BYTES
    476						CMOV$2	BKVB,F.BKVB	;ADDRESS OF 2 WORD VIRTUAL
    477									;BLOCK NUMBER, MOVE BOTH WORDS
    478						CMOV$B	BKEF,F.BKEF	;EVENT FLAG
    479						CMOV$W	BKST,F.BKST	;ADR OF I/O STATUS BLOCK
    480						CMOV$W	BKDN,F.BKDN	;ADR OF I/O DONE AST
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 11-1


    481						.ENDM	FDBK$R
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 12


    483					; DEFINE THE SIZE OF THE FDB AS A LOCAL SYMBOL (S.FDB)
    484						.MACRO	FDBSZ$		;DEFINE S.FDB AS SIZE OF FDB
    485						.IIF	DF,S.FDB,.MEXIT
    486						.MCALL	FDOFF$,DEF$L
    487						FDOFF$	DEF$N		;INVOKE OFFSET DEFINITIONS BUT DON'T
    488									;ACTUALLY DEFINE THE OFFSET NAMES
    489						DEF$L	S.FDB		;NOW DEFINE S.FDB
    490						.ENDM	FDBSZ$
    491
    492					; INVOKE FDOFF$ TO DEFINE OFFSETS AS LOCAL - DO IT ONCE ONLY
    493						.MACRO	FDOF$L
    494						.MCALL	FDOFF$
    495						FDOFF$	DEF$L
    496						.ENDM	FDOF$L
    497					;
    498					; DEFINE FILE NAME BLOCK AT ASEMBLY TIME
    499						.MACRO	NMBLK$	FNAME,FTYPE,VERS,DEVNAM,UNIT
    500						.MCALL	RAD50$,CWORD$,NBOFF$
    501						NBOFF$	DEF$L		;DEFINE NAME BLOCK OFFSETS LOCALLY
    502						.IIF	NDF,...PC1,...PC1=0
    503						...PC3=...PC1		;PRESERVE ...PC1
    504						...PC1=.
    505						.=...PC1+N.FNAM
    506						RAD50$	<FNAME>,S.FNAM/2
    507						.=...PC1+N.FTYP
    508						RAD50$	<FTYPE>,S.FTYP/2
    509						CWORD$	<VERS>,N.FVER
    510						.IF	NB,DEVNAM
    511						.=...PC1+N.DVNM
    512						.WORD	"DEVNAM
    513						.ENDC
    514						CWORD$	<UNIT>,N.UNIT
    515						.=...PC1+S.FNB
    516						...PC1=...PC3		;RESTORE ...PC1
    517						.ENDM	NMBLK$
    518					;
    519					; INVOKE NBOFF$ TO DEFINE OFFSETS AS LOCAL - DO IT ONCE ONLY
    520						.MACRO	NBOF$L
    521						.MCALL	NBOFF$
    522						NBOFF$	DEF$L
    523						.ENDM	NBOF$L
    524
    525
    526					; IF THE FDB PARAM IS NULL OR R0, THEN DON'T
    527					; GENERATE A MOVE OF FDB TO R0.  OTHERWISE
    528					; GENERATE THE MOVE
    529
    530						.MACRO	LDFDB$ FDB
    531						.IIF	B,FDB,.MEXIT	;IF NULL THEN EXIT
    532						.NTYPE	PAR$$$,FDB
    533						.IIF	EQ,PAR$$$,.MEXIT ;IF R0 THEN EXIT
    534						MOV	FDB,R0		;ELSE GENERATE THE MOVE
    535						.ENDM	LDFDB$
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 13


    537					; CONDITIONALLY MOVE A WORD TO THE SPECIFIED OFFSET OF R0
    538
    539						.MACRO	CMOV$W VAR,OFFSET
    540						.IF	IDN,<#0>,<VAR>
    541						CLR	OFFSET(R0)
    542						.MEXIT
    543						.ENDC
    544						.IIF	NB,VAR,	MOV	VAR,OFFSET(R0)
    545						.ENDM	CMOV$W
    546
    547					; CONDITIONALLY GENERATE A MOVE BYTE TO THE SPECIFIED OFFSET OF R0
    548
    549						.MACRO	CMOV$B VAR,OFFSET
    550						.IF	IDN,<#0>,<VAR>
    551						CLRB	OFFSET(R0)
    552						.MEXIT
    553						.ENDC
    554						.IIF	NB,VAR,	MOVB VAR,OFFSET(R0)
    555						.ENDM	CMOV$B
    556
    557					; CONDITIONALLY MOVE 2 WORDS FROM VAR TO THE SPECIFIED OFFSET OF R0
    558						.MACRO	CMOV$2 VAR,OFFSET
    559						.IIF	B,VAR,.MEXIT
    560						MOV	VAR,-(SP)	;ADDRESS OF 2 WORDS TO STATE
    561						MOV	@(SP),OFFSET(R0) ;FIRST WORD TO FDB
    562						ADD	#2,(SP)		;CALCULATE ADR OF 2ND WORD
    563						MOV	@(SP)+,OFFSET+2(R0) ;2ND WORD TO FDB
    564						.ENDM	CMOV$2
    565
    566					; CONDITIONALLY ASSEMBLE .BYTE DIRECTIVE FOR VAR
    567					; AT THE SPECIFIED OFFSET FROM THE BEGINNING OF THE FDB
    568
    569						.MACRO	CBYTE$ VAR,OFFSET
    570						.IF	NB,VAR		;IF NON NULL
    571						...PC2=.		;SAVE PC
    572						.=...PC1+OFFSET		;SET PC TO SPECIFIED OFFSET
    573						.BYTE	VAR		;ASSEMBLE THE BYTE
    574						.=...PC2		;RESTORE PC
    575						.ENDC
    576						.ENDM	CBYTE$
    577
    578
    579					; CONDITIONALLY ASSEMBLE WORD DIRECTIVE FOR VAR
    580					; AT THE SPECIFIED OFFSET FROM THE BEGINNING OF THE FDB
    581
    582						.MACRO	CWORD$ VAR,OFFSET
    583						.IF NB,VAR		;IF VAR IS NOT NULL
    584						...PC2=.		;SAVE THE PC
    585						.=...PC1+OFFSET		;SET THE PC TO THE SPECIFIED OFFSET
    586						.WORD	VAR		;ASSEMBLE THE WORD
    587						.=...PC2		;RESTORE THE PC
    588						.ENDC
    589						.ENDM	CWORD$
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 14


    591					; DEFINE FCS BITS AND VALUES LOCALLY OR GLOBALLY
    592					; CALL WITH DEF$G FOR GLOBAL DEFINITIONS, CONVENTIONALLY
    593					; CALLED WITH DEF$L FOR LOCAL, BUT ANYTHING NOT EQUAL TO DEF$G
    594					; WILL DO
    595						.MACRO	FCSBT$	GLOBL
    596						.MCALL	DEFIN$
    597						...GBL=0
    598						.IIF	IDN,<GLOBL>,<DEF$G>,...GBL=1
    599					;
    600					;
    601					; F.RATT BITS - RECORD ATTRIBUTE BYTE
    602						DEFIN$	FD.FTN,1	;FORTRAN CARRIAGE CONTROL BIT
    603						DEFIN$	FD.CR,2		;INSERT CARRIAGE RETURNS BETWEEN RECORDS
    604						DEFIN$	FD.BLK,10	;1 IF RECORDS CANNOT CROSS BLOCK BOUNDARIES
    605					; F.RACC BITS - RECORD ACCESS BYTE
    606						DEFIN$	FD.RWM,1	;ON IF READ/WRITE,OFF IF GET/PUT
    607						DEFIN$	FD.RAN,2	;ON IF RANDOM,OFF IF SEQUENTIAL
    608						DEFIN$	FD.PLC,4	;ON IF PARTIAL LOCATE,OFF IF SEQUENTIAL
    609						DEFIN$	FD.INS,10	;ON IF PUT SEQUENTIAL INSERT MODE
    610									;OFF IF TRUNCATE MODE
    611					; F.RCTL BITS - RECORD CONTROL BYTE - DEVICE CHARACTERISTICS
    612						DEFIN$	FD.REC,1	;ON IF RECORD ORIENTED DEV, OFF IF BLK ORIENTED
    613						DEFIN$	FD.CCL,2	;ON IF CARRIAGE CONTROL OUTPUT DEVICE
    614									;OFF IF NOT
    615						DEFIN$	FD.TTY,4	;ON IF THIS DEVICE IS A TTY
    616						DEFIN$	FD.DIR,10	;ON IF DIRECTORY DEVICE, OFF IF NOT
    617						DEFIN$	FD.SDI,20	;ON IF SINGLE DIRECTORY DEVICE
    618						DEFIN$	FD.SQD,40	;ON IF SEQUENTIAL DEVICE
    619					;
    620					; N.STAT BITS - FILE NAME BLOCK STATUS WORD - SET BY PARSE
    621						DEFIN$	NB.VER,1	;SET IF FILE VERSION WAS EXPLICIT
    622						DEFIN$	NB.TYP,2	;SET IF FILE TYPE WAS EXPLICIT
    623						DEFIN$	NB.NAM,4	;SET IF FILE NAME WAS EXPLICIT
    624						DEFIN$	NB.SVR,10	;SET IF * IN VERSION FIELD
    625						DEFIN$	NB.STP,20	;SET IF * IN TYPE FIELD
    626						DEFIN$	NB.SNM,40	;SET IF * IN NAME FILED
    627						DEFIN$	NB.DIR,100	;SET IF EXPLICIT DIRECTORY SPECIFIED
    628						DEFIN$	NB.DEV,200	;SET IF DEVICE NAME WAS EXPLICIT
    629						DEFIN$	NB.SD1,400	;SET IF * IN PROJECT NUMBER OF PPN
    630						DEFIN$	NB.SD2,1000	;SET IF * IN PROGRAMMER NUMBER OF PPN
    631					; ***** BEWARE MORE BITS IN N.STAT USED BY FCS LOCALLY
    632					; CHECK DEFINITION SECTION IN FCS
    633					;
    634					; F.RTYP VALUES - RECORD TYPE BYTE - ***** NOTE THESE ARE VALUES, NOT BITS
    635						DEFIN$	R.FIX,1		;FIXED LENGTH RECORDS
    636						DEFIN$	R.VAR,2		;VARIABLE LENGTH RECORDS
    637					;
    638					; F.FACC BITS - FILE ACCESS BYTE
    639						DEFIN$	FA.RD,1		;SET IF READ ONLY
    640						DEFIN$	FA.WRT,2	;SET IF ACCESSED FOR WRITE
    641						DEFIN$	FA.EXT,4	;SET IF ACCESS FOR EXTEND
    642						DEFIN$	FA.CRE,10	;SET IF CREATING NEW FILE
    643						DEFIN$	FA.TMP,20	;SET IF CREATING TEMP FILE
    644						DEFIN$	FA.SHR,40	;SET IF SHARED ACCESS
    645					;
    646					; THE FOLLOWING TWO NAMES APPLY TO THE SAME CONTROL BIT IN F.FACC
    647					; FA.APD IS ONLY USED IF THE FILE IS AN EXISTING FILE (FA.CRE=0)
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 14-1


    648					; FA.NSP IS ONLY USED IF THE FILE IS BEING CREATED (FA.CRE=1)
    649					;
    650						DEFIN$	FA.APD,100	;SET IF APPENDING (POSIT TO EOF)
    651						DEFIN$	FA.NSP,100	;SET IF INHIBITING SUPERSEDE ON FILE CREATION
    652					;
    653						DEFIN$	FO.RD,FA.RD	;OPEN FOR READ
    654						DEFIN$	FO.WRT,FA.WRT!FA.EXT!FA.CRE ;OPEN FOR WRITE (CREATE)
    655						DEFIN$	FO.APD,FA.WRT!FA.EXT!FA.APD ;OPEN FOR APPEND
    656						DEFIN$	FO.MFY,FA.WRT	;OPEN FOR MODIFY
    657						DEFIN$	FO.UPD,FA.WRT!FA.EXT ;OPEN FOR UPDATE
    658					;
    659					; F.MBFG BITS - MULTIPLE BUFFERING FLAG WORD - USER CONTROLLED AND SET BY OPEN
    660						DEFIN$	FD.RAH,1	;READ AHEAD IF SET - THIS OR WRITE BEHIND
    661						DEFIN$	FD.WBH,2	;WRITE BEHIND IF SET - NOT BOTH
    662					; ***** BEWARE MORE BITS IN F.MBFG USED IN FCS LOCALLY
    663					;
    664					;
    665						.MACRO	FCSBT$	ARG
    666						.ENDM	FCSBT$
    667						.ENDM	FCSBT$
    668					;
    669					; EQUATE THE SYMBOL WITH ITS SPECIFIED VALUE
    670					; DEFINE IT GLOBALLY IF ...GBL=1, OTHERWISE LOCALLY
    671						.MACRO	DEFIN$	SYM,VAL
    672						.IIF	EQ,...GBL-1,.GLOBL SYM
    673						SYM=VAL
    674						.ENDM	DEFIN$
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 15


    676					; FILE DESCRIPTOR BLOCK OFFSETS DEFINITION MACRO
    677					; CALL WITH ONE OF THE FOLLOWING MACRO NAMES DEF$L,DEF$G,DEF$N
    678					; TO DEFINE LOCAL OFFSETS, DEFINE TOTAL OFFSETS,
    679					; OR DEFINE NO OFFSETS.  THE LATTER SETS THINGS UP
    680					; SO THAT ONLY THE SIZE OF THE FDB CAN BE
    681					; DEFINED
    682
    683						.MACRO	FDOFF$ OFFSET
    684						.MCALL	OFFSET,DEF$I,NBOFF$
    685						NBOFF$	OFFSET
    686						DEF$I	0		;INIT THE DEFINITION MACRO
    687					; FILE ATTRIBUTE SECTION
    688						OFFSET	F.RTYP,1	;RECORD TYPE
    689						OFFSET	F.RATT,1	;RECORD ATTRIBUTES
    690						OFFSET	F.RSIZ,2	;RECORD SIZE
    691						OFFSET	F.HIBK,4	;HIGHEST VIRTUAL BLOCK NO. ALLOCATED
    692						OFFSET	F.EFBK,4	;END OF FILE BLOCK NUMBER
    693						OFFSET	F.FFBY,2	;FIRST FREE BYTE IN LAST BLOCK
    694						OFFSET	S.FATT		;SIZE OF FILE ATTRIBUTE SECTION
    695
    696					; RECORD ACCESS SECTION
    697
    698						OFFSET	F.RACC,1	;RECORD ACCESS
    699						OFFSET	F.RCTL,1	;RECORD CONTROL
    700						OFFSET	F.BKDS		;BLOCK I/O - BUFFER DESCRIPTOR
    701						OFFSET	F.URBD,4	;USER'S RECORD BUFFER DESCRIPTOR
    702						OFFSET	F.BKST		;BLOCK I/O - I/O STATUS BLOCK ADDRESS
    703						OFFSET	F.NRBD,2	;NEXT RECORD BUFFER DESCRIPTOR
    704						OFFSET	F.BKDN		;BLOCK I/O - I/O DONE AST ADDRESS
    705						OFFSET	,2		;2ND WORD OF NRBD
    706						OFFSET	F.OVBS		;OVERRIDE BLOCK BUFFER SIZE
    707						OFFSET	F.NREC,2	;NEXT RECORD ADDRESS IN BLOCK BUFFER
    708						OFFSET	F.EOBB,2	;END OF BLOCK BUFFER
    709						OFFSET	F.CNTG		;SIZE IN BLOCKS OF CONTIGUOUS FILE
    710						OFFSET	F.RCNM,2	;RECORD NUMBER FOR RANDOM RECORDS
    711						OFFSET	F.STBK		;ADDRESS TO READ IN STATISTICS BLOCK
    712						OFFSET	,2		;2ND WORD OF RCNM
    713						OFFSET	F.ALOC,2	;ALLOCATE THIS MUCH SPACE WHEN NEED
    714									;TO EXTEND, + = CONTIG, - = NOT
    715
    716					; FILE OPEN SECTION
    717						OFFSET	F.LUN,1		;LOGICAL UNIT NUMBER
    718						OFFSET	F.FACC,1	;FILE ACCESS
    719						OFFSET	F.DSPT,2	;FILE DESCRIPTOR POINTER
    720						OFFSET	F.DFNB,2	;DEFAULT FILE NAME BLOCK ADDRESS
    721
    722					; BLOCK BUFFER SECTION
    723						OFFSET	F.BKEF		;BLOCK I/O - EVENT FLAG NUMBER
    724						OFFSET	F.EFN,1		;EVENT FLAG USED IN QIO
    725						OFFSET	F.BKP1,1	;BOOKKEEPING BITS
    726						OFFSET	F.ERR,2		;1ST BYTE ERROR RETURN CODE
    727									;2ND BYTE FOR QI/O ERROR INDICATOR
    728						OFFSET	F.MBCT,1	;NUMBER OF BUFFERS TO USE (DESIRED)
    729						OFFSET	F.MBC1,1	;NO. OF BUFFERS IN USE
    730						OFFSET	F.MBFG,1	;MULTIPLE BUFFERING CONTROL FLAGS
    731						OFFSET	F.BGBC,1	;BIG BUFFER BLOCK COUNT (SIZE IN BLOCKS)
    732						OFFSET	F.VBSZ,2	;VIRTUAL BLOCK SIZE IN BYTES
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 15-1


    733						OFFSET	F.BBFS,2	;BLOCK BUFFER SIZE
    734						OFFSET	F.BKVB		;BLOCK I/O - VIRTUAL BLOCK NUMBER
    735						OFFSET	F.VBN,4		;VIRTUAL BLOCK NUMBER
    736						OFFSET	F.BDB,2		;BLOCK BUFFER DESCRIPTOR BLOCK
    737						OFFSET	,8.		;SPARE
    738
    739					; FILE NAME BLOCK SECTION
    740						OFFSET	F.FNB,S.FNB	;BEGINNING OF FILE NAME BLOCK
    741						.IIF	IDN,<OFFSET>,<DEF$N>,.MEXIT
    742						.IF	IDN,<OFFSET>,<DEF$G>
    743						.GLOBL	F.FNAM,F.FTYP,F.FVER,F.DVNM,F.UNIT
    744						.ENDC
    745						F.FNAM=N.FNAM+F.FNB
    746						F.FTYP=N.FTYP+F.FNB
    747						F.FVER=N.FVER+F.FNB
    748						F.DVNM=N.DVNM+F.FNB
    749						F.UNIT=N.UNIT+F.FNB
    750						OFFSET	S.FDB		;SIZE OF FDB
    751						.MACRO	FDOFF$	ARG
    752						.ENDM	FDOFF$
    753						.ENDM	FDOFF$
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 16


    755					; BUFFER DESCRIPTOR OFFSETS-SAME TYPE OF CALL AS FOR FILE DESCRIPTOR OFFSETS
    756						.MACRO	BDOFF$ OFFSET
    757						.MCALL	OFFSET,DEF$I
    758						DEF$I	0
    759						OFFSET	,4
    760						OFFSET	B.VBN,4		;VIRTUAL BLOCK NUMBER FOR THIS BUFFER
    761						OFFSET	B.BBFS,2	;NUMBER OF BYTES READ OR WRITTEN
    762						OFFSET	B.NXBD,2	;POINTER TO NEXT BUFFER DESCRIPTOR
    763						OFFSET	,1		;SPARE BYTE
    764						OFFSET	B.BFST,1	;BUFFER STATUS BYTE
    765						OFFSET	,2		;SPARE WORD
    766						OFFSET	S.BFHD
    767						.IIF	IDN,<DEF$N>,<OFFSET>,.MEXIT
    768						.MACRO	BDOFF$	ARG
    769						.ENDM	BDOFF$
    770						.ENDM	BDOFF$
    771
    772					; NAME BLOCK OFFSET - LIKE FDOFF
    773						.MACRO	NBOFF$	OFFSET
    774						.MCALL	OFFSET,DEF$I,DEF$L
    775						DEF$I	0
    776						OFFSET	S.FNAM		;DEFINE AS GLOBAL IF PARAMETER
    777						OFFSET	S.FTYP		;IS DEF$G
    778						OFFSET	S.FNTY
    779						OFFSET	S.FNBW
    780						S.FNAM=6		;SIZE OF FILENAME IN BYTES
    781						S.FTYP=2		;SIZE OF FILE TYPE IN BYTES
    782						S.FNTY=<S.FNAM+S.FTYP>/2  ;SIZE OF FILENAME + TYPE IN WORDS
    783						OFFSET	N.FID,6		;FILE ID
    784						OFFSET	N.FNAM,S.FNAM	;FILENAME
    785						OFFSET	N.FTYP,S.FTYP	;TYPE
    786						OFFSET	N.FVER,2	;VERSION
    787						OFFSET	S.NFEN		;SIZE OF NAME FILE ENTRY IN BYTES
    788						DEF$L	S.NFEN		;FORCE AT LEAST A LOCAL DEFINITION
    789						OFFSET	N.STAT,2	;STATUS
    790						OFFSET	N.NEXT,2	;TEMP CELL FOR FIND NEXT
    791						OFFSET	N.DID,6		;DIRECTORY ID
    792						OFFSET	N.DVNM,2	;DEVICE NAME IN ASCII
    793						OFFSET	N.UNIT,2	;UNIT NUMBER
    794						OFFSET	S.FNB		;SIZE OF FNB IN BYTES
    795						DEF$L	S.FNB		;FORCE LOCAL DEFINITION AT LEAST
    796						S.FNBW=S.FNB/2		;SIZE OF FNB IN WORDS
    797						.IIF	IDN,<DEF$N>,<OFFSET>,.MEXIT ;DON'T REDEFINE THE MACRO
    798						.MACRO	NBOFF$	ARG
    799						.ENDM	NBOFF$
    800						.ENDM	NBOFF$
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 17


    802					;
    803					; FILE STORAGE REGION OFFSETS - LIKE FDOFF
    804						.MACRO	FSROF$	OFFSET
    805						.MCALL	OFFSET,DEF$I,DEF$L
    806					;
    807					; DEFINE THE OFFSETS FOR $$FSR2
    808						DEF$I	0
    809
    810						OFFSET	,4		;LIST HEAD FOR ALLOCATION
    811						OFFSET	A.BFSR,2	;FIRST ADDRESS IN FSR1
    812						OFFSET	A.EFSR,2	;LAST ADDRESS IN FSR1
    813					;
    814					; ***** DO NOT SEPARATE THE FOLLOWING 2 DEFINITIONS
    815					;
    816						OFFSET	A.OWUI,2	;UIC OF OWNER (FROM TASK HEADER)
    817						OFFSET	A.FIPR,2	;DEFAULT FILE PROTECTION WORD
    818					;
    819					; DO NOT SEPARATE THE PRECEEDING 2 DEFINITIONS
    820					;
    821					; ***** DO NOT SEPARATE THE FOLLOWING 3 DEFINTIONS
    822					;
    823						OFFSET	A.DPB,24.	;QI/O DPB AND SCRATCH AREA
    824						OFFSET	A.IOST,4	;SCRATCH I/O STATUS BLOCK
    825						OFFSET	A.DFDR,24.	;DEFAULT DIRECTORY INFORMATION
    826					;
    827					; DO NOT SEPARATE THE PRECEEDING 3 DEFINITIONS
    828					;
    829						OFFSET	A.DFBC,2	;DEFAULT BUFFER CNT (MULTIPLE BUFFERING)
    830						OFFSET	S.FSR2		;SIZE OF FILE STORAGE REGION 2
    831						DEF$L	S.FSR2
    832					;
    833					; DEFINE OFFSETS RELATIVE TO BEGINNING OF THE DEFAULT DIRECTORY INFO
    834
    835						DEF$I	0
    836
    837						OFFSET	,14.
    838						OFFSET	D.DFID,6	;DEFAULT DIRECTORY ID
    839						OFFSET	D.DFDV,2	;DEV NAME FOR DFLT DIR ID
    840						OFFSET	D.DFUN,2	;UNIT NUMBER FOR DFLT DIR ID
    841					;
    842						.IIF	IDN,<DEF$N>,<OFFSET>,.MEXIT
    843						.MACRO	FSROF$	ARG
    844						.ENDM	FSROF$
    845						.ENDM	FSROF$
    846					;
    847					; DEFINE OFFSETS RELATIVE TO THE FILE DESCRIPTOR POINTER, F.DSPT
    848						.MACRO	FDSOF$	OFFSET
    849						.MCALL	OFFSET,DEF$I,DEF$L
    850						DEF$I	0
    851					;
    852						OFFSET	N.DEVD,4	;DEVICE STRING DESCRIPTOR
    853						OFFSET	N.DIRD,4	;DIRECTORY STRING DESCRIPTOR
    854						OFFSET	N.FNMD,4	;FILE NAME STRING DESCRIPTOR
    855						OFFSET	S.FIDS
    856						.IF	IDN,<DEF$N>,<OFFSET>
    857						DEF$L	S.FIDS
    858						.MEXIT
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 17-1


    859						.ENDC
    860						.MACRO	FDSOF$	ARG
    861						.ENDM	FDSOF$
    862						.ENDM	FDSOF$
FCSMAC-FILE CONTROL SERVICES MA	MACRO M1108  05-DEC-77 22:09  PAGE 18


    864						.MACRO	DEF$G VAR,SIZ	;DEFINE GLOBAL OFFSET
    865						.MCALL	DEF$L
    866						.IIF	NB,VAR,.GLOBL VAR
    867						DEF$L	VAR,SIZ
    868						.ENDM	DEF$G
    869
    870						.MACRO	DEF$N VAR,SIZ	;DEFINE NO OFFSET-CALCULATE THE SIZE
    871						.MCALL	DEF$L
    872						DEF$L	,SIZ
    873						.ENDM	DEF$N
    874
    875						.MACRO	DEF$I IVAL	;INITIALIZE DEFINITION
    876						...TPC=IVAL		;MACROS PROGRAM COUNTER
    877						.ENDM	DEF$I
    878
    879						.MACRO	DEF$L SYM,SIZ
    880						.IF NB,SYM
    881						SYM=...TPC
    882						.ENDC
    883						.IF NB,SIZ
    884						...TPC=...TPC+SIZ
    885						.ENDC
    886						.ENDM	DEF$L
    887					;
    888						.MACRO	RAD50$	STRING,MAXWRD
    889						...PC2=.
    890						.RAD50	/STRING/
    891						.IF	GT,<.-...PC2>-<2*MAXWRD>
    892						.ERROR	STRING		;RAD50 - STRING TOO LONG, TRUNCATED;
    893						.=...PC2+2*MAXWRD
    894						.MEXIT
    895						.ENDC
    896						.REPT	MAXWRD-<<.-...PC2>/2>
    897						.WORD	0
    898						.ENDR
    899						.ENDM	RAD50$
FCSGBL - FILE CONTROL SERVICES 	MACRO M1108  05-DEC-77 22:09  PAGE 20


      1						.TITLE FCSGBL - FILE CONTROL SERVICES GLOBAL DEFINTIONS
      2					; ALTERED THURSDAY 31-JAN-74 2:20
      3					;	.IDENT /0502/
      4
      5
      6					;                             COPYRIGHT (C) 1972, 1978 BY
      7					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      8					;
      9					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
     10					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     11					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     12					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     13					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     14					;
     15					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     16					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     17					;       CORPORATION.
     18					;
     19					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     20					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     21
     22
     23					;
     24					; PETER H. LIPMAN	14-DEC-72
     25
     26						.MCALL FDOFF$,BDOFF$,FCSBT$,FSROF$,FDSOF$
     27	000000					FDOFF$	DEF$G		;DEFINE GLOBAL FILE DESCRIPTOR BLOCK OFFSETS
     28	000000					BDOFF$	DEF$G		;DEFINE GLOBAL BUFFER DESCRIPTOR OFFSETS
     29	000000					FCSBT$	DEF$G		;DEFINE GLOBAL BITS AND VALUES
     30	000000					FSROF$	DEF$G		;DEFINE GLOBAL FILE STORAGE REGION OFFSETS
     31	000000					FDSOF$	DEF$G		;DEFINE GLOBAL FILE DESCRIPTOR POINTER OFFSETS
     32
     33		000001 				.END
FCSGBL - FILE CONTROL SERVICES 	MACRO M1108  05-DEC-77 22:09  PAGE 20-1
SYMBOL TABLE

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

. ABS.	000000	   000
      	000000	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  10626 WORDS  ( 42 PAGES)
DYNAMIC MEMORY:  11552 WORDS  ( 44 PAGES)
ELAPSED TIME:  00:01:16
[41,10]FCSGBL,[41,20]FCSGBL/-SP=[41,30]FCSMAC,FCSGBL
FINIT 0101MS, INITIALIZE THE FI	MACRO M1108  05-DEC-77 22:11  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
FINIT 0101MS, INITIALIZE THE FI	MACRO M1108  05-DEC-77 22:11  PAGE 7


						.TITLE	FINIT 0101MS, INITIALIZE THE FILE STORAGE REGION
						.IDENT	/0101MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 17-AUG-73
     21					;
     22						.MCALL	FSROF$
     23	000000					FSROF$	DEF$L		;DEFINE FSR OFFSETS LOCALLY
FINIT 0101MS, INITIALIZE THE FI	MACRO M1108  05-DEC-77 22:11  PAGE 8


     25					;+
     26					;
     27					; SUBROUTINE TO INITIALIZE SOME FILE SYSTEM TABLES, SPECIFICALLY
     28					; THE ALLOCATION CONTROL BLOCK FOR THE FILE STORAGE REGION.
     29					; AND THE DEFAULT DIRECTORY STRING IS CREATED FROM THE TASKS PPN.
     30					; CALLING SEQUENCE
     31					;	JSR PC,.FINIT
     32					; INPUTS:
     33					;	NONE
     34					; OUTPUTS:
     35					;	C=0 ALWAYS SUCCESSFUL
     36					;	ALL REGISTERS PRESERVED
     37					;
     38					;-
     39	000000				.FINIT::.SAVR1			;SAVE REGISTERS R1-R5
     40	000004	013701 	000000G			MOV	@#.FSRPT,R1	;ADDRESS OF ALLOCATION CONTROL BLOCK FOR FSR
     41	000010	016102 	000004 		..FINI::MOV	4(R1),R2	;R2=ADDRESS OF FSR
     42	000014	010211 				MOV	R2,(R1)		;SET 1ST WORD OF ACB
     43	000016	005012 				CLR	(R2)		;ZERO FIRST WORD OF FSR
     44	000020	016103 	000006 			MOV	6(R1),R3	;R3=LAST ADDR IN FSR
     45	000024	160203 				SUB	R2,R3		;R3=LAST-FIRST
     46	000026	005203 				INC	R3		;R3=LENGTH OF FSR
     47	000030	010362 	000002 			MOV	R3,2(R2)	;STORE AS 2ND WORD OF FSR
     48	000034	012761 	100200 	000010 		MOV	#200*400+200,A.OWUI(R1) ;FCS IS INITIALIZED
     49					; NOW INITIALIZE THE DEFAULT DIRECTORY STRING FROM THE TASK'S PPN
     50	000042					ASSUME	A.IOST,A.DPB+24. ;NEED 32. BYTES OF SCRATCH STORE
     51	000042					ASSUME	A.DFDR,A.IOST+4
     52					;
     53					; USE 16 WORDS TO READ TASK PARAMETERS. 12 WORDS IN THE DPB AREA
     54					; 2 WORDS FROM SCRATCH I/O STATUS BLOCK, AND 2 WORDS FROM THE
     55					; DEFAULT DIRECTORY DESCRIPTOR, INITIALIZED AFTER THE GTSK$S CALL
     56					;
     57	000042	010102 				MOV	R1,R2
     58	000044	062702 	000014 			ADD	#A.DPB,R2	;ADDRESS TO READ TASK PARAMETER (16W)
     59	000050					GTSK$S	R2
     60	000060	103403 				BCS	20$
     61	000062	016261 	000016 	000010 		MOV	G.TSPC(R2),A.OWUI(R1) ;SET OWNER'S UIC
     62
     63	000070	012761 	177777 	000050 	20$:	MOV	#-1,A.DFDR(R1)	;DIRECTORY STRING NOT INITIALIZED
     64	000076	005061 	000074 			CLR	A.DFDR+D.DFDV(R1) ;NO DEVICE INITIALIZED EITHER
     65	000102					RETURN
     66					;
     67					;
     68	000104					$END	FINIT
     69					;
     70					;
     71		000001 				.END
FINIT 0101MS, INITIALIZE THE FI	MACRO M1108  05-DEC-77 22:11  PAGE 8-1
SYMBOL TABLE

A.BFSR= 000004   	FD.EFB= 000004   	G.TSVA= 000026   	N.DVSZ= 000000   	R$$SPL= 000000
A.DFBC= 000100   	FD.EF1= 000010   	G.TSVL= 000030   	N.FNPT= 000012   	R$$11M= 000001
A.DFDR= 000050   	FD.EOF= 000002   	HA.CHU= 000003   	N.FNSZ= 000010   	SYDEV = 054523
A.DPB = 000014   	FD.WRT= 000001   	HA.FP = 000002   	PP.SEP= 000002   	SYUNIT= 000000
A.EFSR= 000006   	G.TSFW= 000024   	HA.NAM= 000005   	PP.ZER= 000001   	S.FSR2= 000102
A.FIPR= 000012   	G.TSGC= 000017   	HA.TYP= 000006   	R$$ANI= 000000   	WI.DLK= 000002
A.IOST= 000044   	G.TSMT= 000022   	HA.UAT= 000004   	R$$BBF= 000000   	WI.LCK= 000001
A.OWUI= 000010   	G.TSNL= 000020   	HA.UI = 000001   	R$$DPB= 000001   	$$$OST= 000034
BD.FRE= 000001   	G.TSPC= 000016   	HA.VER= 000007   	R$$EIS= 000000   	.FINIT  000000RG
DIRTYP= 015172   	G.TSPN= 000004   	NB.DOT= 100000   	R$$LCL= 000000   	.FSRPT= ****** GX
D.DFDV= 000024   	G.TSPR= 000014   	NB.SMI= 040000   	R$$MUL= 000000   	.SAVR1= ****** GX
D.DFID= 000016   	G.TSRN= 000010   	N.DRPT= 000006   	R$$OPF= 000000   	..FINI  000010RG
D.DFUN= 000026   	G.TSTN= 000000   	N.DRSZ= 000004   	R$$RSL= 000000   	...CTL= 000001
FCSEFN= 000040   	G.TSTS= 000032   	N.DVPT= 000002   	R$$SEQ= 000000   	...TPC= 000030
FD.DVR= 000020

. ABS.	000000	   000
      	000104	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  3036 WORDS  ( 12 PAGES)
DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:00:17
[41,10]FINIT,[41,20]FINIT/-SP=[41,30]FCSPRE,FINIT
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 1


      1		000001 			R$$11M=1
      2						.IF NDF	R$$11M
      3
      4
      5						.TITLE	.GCML  RSX-11D GET COMMAND LINE
      6						.IDENT	/13/
      7
      8						.IFF
      9
     10						.TITLE	.GCML  RSX-11M GET COMMAND LINE
     11						.IDENT	/M13/
     12
     13
     14						.ENDC
     15
     16
     17
     18					;
     19					; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
     20					; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
     21					; COPYRIGHT 1973, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
     22					;
     23					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
     24					; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
     25					;
     26					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
     27					; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     28					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     29					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     30					;
     31					; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     32					; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     33					; EQUIPMENT CORPORATION.
     34					;
     35					; VERSION 13
     36					;
     37					; WRITTEN BY:
     38					;	R. GROVE
     39					;	P. KNEUVEN
     40					;
     41					; MODIFIED BY:
     42					;	C.A. D'ELIA	26-NOV-73	001
     43					;	C.A. D'ELIA	12-JAN-74	002
     44					;	C.A. D'ELIA	12-MAR-74	003
     45					;	C.A. D'ELIA	19-MAR-74	004
     46					;	C.A. D'ELIA	31-MAR-74	005
     47					;	C.A. D'ELIA	05-APR-74	006
     48					;	C.A. D'ELIA	04-JUN-74	007
     49					;	C.A. D'ELIA	01-JUL-74	008
     50					;	C.A. D'ELIA	01-AUG-74	009
     51					;	C.A. D'ELIA	20-JAN-75	010
     52					;	C.A. D'ELIA	21-MAR-75	011
     53					;	C.A. D'ELIA	30-JUL-75	012
     54					;
     55					;
     56					; LOCAL OFFSET AND SYMBOL DEFINITIONS
     57
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 1-1


     58						.MCALL	CSI$		;++009
     59	000000					CSI$	DEF$L
     60						.MCALL	GCMLD$		;++009
     61	000000					GCMLD$	DEF$L
     62						.MCALL	NBOFF$		;++009
     63	000000					NBOFF$	DEF$L		;++009 DEFINE NAME BLOCK OFFSETS
     64
     65
     66						.MCALL	CALL,RETURN,DIR$,CSI$1,CSI$2,CLOSE$  ;++003
     67
     68
     69						.IF NDF	R$$11M		;++003
     70
     71						.MCALL	OPEN$R,GET$	;++003
     72
     73						.IFF			;++003
     74
U    75						.MCALL	OFNB$R,GET$S,FINIT$,ENCP$S,DSCP$S  ;++010
     76
     77						.ENDC			;++003
     78
     79
     80					; INTERNAL GCML$ BLOCK OFFSET DEFINITIONS
     81		000152 			G.CDEP	=G.ERR+10.	;CURRENT PUSH DOWN DEPTH
     82		000153 			G.MDEP	=G.CDEP+1	;MAXIMUM PUSH DOWN DEPTH
     83		000154 			G.PPTR	=G.MDEP+1	;PUSH DOWN STORAGE POINTER
     84		000156 			G.RBUF	=G.PPTR+2	;RECORD BUFFER POINTER
     85		000160 			G.DPRM	=G.RBUF+2	;DEFAULT PROMPT STRING TEXT
     86		000166 			G.DFNB	=G.DPRM+6	;DEFAULT FILE NAME BLOCK
     87		000020 			G.PDSL = <3*2>+<5*2>		;++001 PUSH DOWN FRAME SIZE (8 WORDS)
     88
     89					; G.MODE BIT DEFINITIONS
     90		000200 			GE.MCR	=200		;G.MODE BIT, SET IF TOP LEVEL IS MCR LINE
     91
     92					; ASCII CHARACTER DEFINITIONS
     93		000015 			CR	=15
     94		000011 			TAB	=11
     95		000040 			BLANK	=40
     96		000033 			ALTMOD	=33
     97
     98						.MACRO	.SAVR1
     99						JSR	R5,.SAVR1
    100						.ENDM	.SAVR1
    101
    102
    103						.IF DF	R$$11M
    104
    105						.MACRO	SOB	REG,ADDR
    106						DEC	REG
    107						BNE	ADDR
    108						.ENDM	SOB
    109
    110						.ENDC
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 2


    112					; GCML$ - ENTRY TO GET NEXT COMMAND LINE
    113
    114	000000				.GCML1::.SAVR1
    115	000004	010005 				MOV	R0,R5		;BLOCK POINTER ALWAYS IN R5
    116	000006	105765 	000152 		LVLTST:	TSTB	G.CDEP(R5)	;++012 TEST CURRENT DEPTH
    117	000012	001413 				BEQ	LVL0		;++001 SPECIAL TEST IF AT LEVEL ZERO
    118	000014	003016 				BGT	PROMPT		;++001 IF .GT. ZERO, THEN PROMPT FOR CMD
    119	000016					CALL	GETMCR		;TRY TO GET AN MCR LINE
    120	000022	103123 				BCC	CMLSCN		;GOT ONE - DON'T DO TOP-LEVEL OPEN
    121
    122
    123						.IF NDF	R$$11M		;++002
    124
    125
    126						OPEN$R	R5		;TOP-LEVEL OPEN
    127
    128						.IFF			;++002
    129
    130	000024	016502 	000000G			MOV	F.DSPT(R5),R2	;++002 GET DESCRIPTOR IN R2
    131	000030					CALL	GOPEN		;++002 OPEN THE FILE
    132
    133						.IFTF			;++010
    134
    135	000034	103002 				BCC	LVL0		;++008 SKIP ON SUCCESS
    136	000036	000167 	000440 			JMP	IOERR		;++008 ELSE, INITIAL OPEN FAILED
    137	000042	132765 	000200 	000141 	LVL0:	BITB	#GE.MCR,G.MODE(R5) ;++001 DID WE HAVE MCR INPUT?
    138	000050	001165 				BNE	TOPEOF		;++001 IF SO, LEVEL 0 IS THE END
    139
    140	000052	005765 	000000G		PROMPT:	TST	F.BDB(R5)	;++001 IS FILE ALREADY OPEN?
    141	000056	001002 				BNE	1$		;++001 YES, SKIP THE OPEN
    142	000060					CALL	POPOP1		;++001 NO, POP IT UP AND OPEN IT
    143	000064	122775 	000000G	000000G	1$:	CMPB	#IE.EOF,@F.BDB(R5)  ;++011 DELAYED FCS EOF PENDING?
    144	000072	001540 				BEQ	IOEOF		;++011 IF EQ YES
    145	000074	132765 	000000G	000000G		BITB	#FD.TTY,F.RCTL(R5) ;++011 NO, IS FILE A TTY?
    146	000102	001434 				BEQ	4$		;NO - DON'T PROMPT
    147	000104	012701 	000000G			MOV	#IO.ATT,R1	;++001 SPECIFY ATTACH
    148	000110	005002 				CLR	R2		;++001 NO EXTRA QIO PARMS NEEDED
    149	000112					CALL	.XQIO		;++001 USE FCS TO ATTACH THE TTY
    150	000116	016501 	000144 			MOV	G.PSDS+2(R5),R1	;USER PROMPT STRING ADDRESS
    151	000122	016502 	000142 			MOV	G.PSDS(R5),R2	;USER PROMPT STRING LENGTH
    152	000126	001005 				BNE	2$		;USE USER'S STRING
    153	000130	010501 				MOV	R5,R1		;USE DEFAULT PROMPT FROM BLOCK
    154	000132	062701 	000160 			ADD	#G.DPRM,R1	;
    155	000136	012702 	000006 			MOV	#6,R2		;EXACTLY 6 BYTE'S WORTH
    156	000142				2$:				;++001
    157	000142	016503 	000156 			MOV	G.RBUF(R5),R3	;++002 PUT ADDR OF BUFFER IN R3
    158	000146	010123 				MOV	R1,(R3)+	;++002 SPECIFY PROMPT STRING ADDR
    159	000150	010223 				MOV	R2,(R3)+	;++002 SPECIFY BYTE COUNT
    160	000152	005013 				CLR	(R3)		;++002 CLEAR CARRIAGE CONTROL
    161	000154	024343 				CMP	-(R3),-(R3)	;++002 POINT R3 TO PARM LIST
    162	000156	012702 	000003 			MOV	#3,R2		;++002 SET PARAMETER COUNT
    163	000162	012701 	000000G			MOV	#IO.WVB,R1	;++002 SPECIFY WRITE VIRTUAL BLOCK
    164	000166					CALL	.XQIO		;++002 SEND PROMPT STRING
    165	000172	103411 				BCS	6$		;DETACH AND I/O ERROR HANDLING
    166	000174				4$:				;++002
    167
    168						.IFT			;++010
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 2-1


    169
    170						GET$	R5,G.RBUF(R5),#80.  ;++002 READ A COMMAND LINE
    171
    172						.IFF			;++002
    173
    174	000174					GET$S	R5,G.RBUF(R5),#80.  ;++002 READ A COMMAND LINE
    175
    176						.ENDC			;++011 (R$$11M)
    177
    178
    179	000216	006046 			6$:	ROR	-(SP)		;++011 SAVE THE C-BIT
    180	000220	116503 	000000G			MOVB	F.ERR(R5),R3	;++001 SAVE FCS RETURN STATUS
    181	000224	017004 	000000G			MOV	@F.BDB(R0),R4	;++011 AND THE FCS I/O STATUS WORD
    182	000230	132765 	000000G	000000G		BITB	#FD.TTY,F.RCTL(R5)	;DETACH ONLY IF TTY
    183	000236	001405 				BEQ	8$		;
    184	000240	012701 	000000G			MOV	#IO.DET,R1	;++001 SPECIFY DETACH
    185	000244	005002 				CLR	R2		;++001 NO EXTRA QIO PARMS NEEDED
    186	000246					CALL	.XQIO		;++001 USE FCS TO DETACH THE TTY
    187	000252	010470 	000000G		8$:	MOV	R4,@F.BDB(R0)	;++011 RESTORE FCS I/O STATUS WORD
    188	000256	006126 				ROL	(SP)+		;++011 AND THE C-BIT (FROM GET$)
    189	000260	103442 				BCS	IOERR0		;
    190	000262	016501 	000002G			MOV	F.NRBD+2(R5),R1	;GET COMMAND LINE ADDRESS
    191	000266	016502 	000000G			MOV	F.NRBD(R5),R2	;GET COMMAND LINE LENGTH
    192
    193					; PROCESS COMMAND LINE OBTAINED
    194					;    R1 IS COMMAND LINE ADDRESS
    195					;    R2 IS COMMAND LINE LENGTH
    196	000272	010165 	000150 		CMLSCN:	MOV	R1,G.CMLD+2(R5)	;SET COMMAND LINE ADDRESS
    197	000276	010265 	000146 			MOV	R2,G.CMLD(R5)	;AND LENGTH
    198	000302	001463 				BEQ	OKOUT		;RETURN NULL LINE TO USER
    199	000304	132765 	000010 	000141 		BITB	#GE.LC,G.MODE(R5)  ;++010 DOES CALLER WANT LOWER CASE?
    200	000312	001015 				BNE	30$		;++010 IF NE YES
    201	000314	010246 				MOV	R2,-(SP)	;++010 SAVE CHARACTER COUNT
    202	000316	060201 				ADD	R2,R1		;++010 POINT TO END OF COMMAND LINE
    203	000320	124127 	000141 		10$:	CMPB	-(R1),#141	;++010 LESS THAN LOWER CASE "A"?
    204	000324	002405 				BLT	20$		;++010 SKIP IF TRUE
    205	000326	121127 	000172 			CMPB	(R1),#172	;++010 GREATER THAN LOWER CASE "Z"?
    206	000332	003002 				BGT	20$		;++010 SKIP IF TRUE
    207	000334	142711 	000040 			BICB	#40,(R1)	;++010 CONVERT TO UPPER CASE
    208	000340				20$:	SOB	R2,10$		;++010 REPEAT FOR ENTIRE COMMAND LINE
    209	000344	012602 				MOV	(SP)+,R2	;++010 RESTORE CHARACTER COUNT
    210	000346	122711 	000073 		30$:	CMPB	#';,(R1)	;++010 CHECK FOR ; IN COLUMN 1
    211	000352	001113 				BNE	INDIR		;NO - CHECK FOR INDIRECT FILE
    212	000354	132765 	000001 	000141 		BITB	#GE.COM,G.MODE(R5); COMMENTS PERMITTED ?
    213	000362	001211 				BNE	LVLTST		;++012 YES - GET ANOTHER LINE
    214	000364	000432 				BR	OKOUT		;NO  - RETURN IT TO USER
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 3


    216					; I/O ERROR AND END-OF-FILE PROCESSING
    217	000366	122703 	000000G		IOERR0:	CMPB	#IE.EOF,R3	;++001 END OF FILE ERROR?
    218	000372	001043 				BNE	IOERR		;NO - I/O ERROR
    219	000374	116500 	000152 		IOEOF:	MOVB	G.CDEP(R5),R0	;++011 ARE WE AT TOP LEVEL ALREADY ?
    220	000400	001411 				BEQ	TOPEOF		;YES - RETURN EOF TO CALLER
    221	000402	005300 				DEC	R0		;IF NOT AT LEVEL 1
    222	000404	001004 				BNE	2$		;POP UP AND CARRY ON
    223	000406	132765 	000200 	000141 		BITB	#GE.MCR,G.MODE(R5);IF RETURNING TO LEVEL 0
    224	000414	001003 				BNE	TOPEOF		;++001 AND TOP WAS MCR, RETURN EOF TO CALLER
    225	000416				2$:	CALL	POPOPN		;POP UP A LEVEL
    226	000422	000613 				BR	PROMPT		;TRY FOR ANOTHER COMMAND
    227
    228					; EXITS FROM .GCML1 AND .GCML2
    229
    230	000424				TOPEOF:	CLOSE$	R5		;CLOSE TOP LEVEL CMI
    231	000432	142765 	000200 	000141 		BICB	#GE.MCR,G.MODE(R5) ;++001 ALL DONE, CLEAR MCR BIT, ...
    232	000440	105365 	000152 			DECB	G.CDEP(R5)	;++001 ... AND SET DEPTH TO -1
    233	000444	012746 	177766 			MOV	#GE.EOF,-(SP)	;++005 INDICATE END-OF-FILE
    234	000450	000401 				BR	OUT		;++005
    235
    236	000452	005046 			OKOUT:	CLR	-(SP)		;++005 INDICATE GCML SUCCESS
    237
    238	000454	132765 	000004 	000141 	OUT:	BITB	#GE.CLO,G.MODE(R5) ;++005 CLOSE FILE AFTER THIS GET?
    239	000462	001402 				BEQ	1$		;++001 NO, SET RETURN INFORMATION
    240	000464					CALL	CLOCRT		;++001 YES, CLOSE CURRENT LEVEL
    241	000470	111665 	000140 		1$:	MOVB	(SP),G.ERR(R5)	;++005 PUT RETURN CODE IN G.ERR
    242	000474	006126 				ROL	(SP)+		;++005 SET C-BIT RETURN STATUS
    243	000476	010500 				MOV	R5,R0		;RESTORE R0
    244	000500					RETURN
    245
    246	000502	012746 	177777 		IOERR:	MOV	#GE.IOR,-(SP)	;++005 INDICATE I/O ERROR
    247	000506	000762 				BR	OUT		;++005
    248	000510	012746 	177776 		OPRERR:	MOV	#GE.OPR,-(SP)	;++005 INDICATE INDIRECT OPEN ERROR
    249	000514	000757 				BR	OUT		;++005
    250	000516	062706 	000054 		BIFERR:	ADD	#C.SIZE,SP	;POP LINGERING CSI BLOCK FROM STACK
    251	000522	012746 	177775 			MOV	#GE.BIF,-(SP)	;++005 INDICATE BAD INDIRECT FILE NAME
    252	000526	000752 				BR	OUT		;++005
    253	000530	012746 	177774 		MDEERR:	MOV	#GE.MDE,-(SP)	;++005 INDICATE MAX INDIRECT DEPTH EXCEEDED
    254	000534	000747 				BR	OUT
    255
    256					; RCML$ - ENTRY TO POP WORLD TO TOP LEVEL
    257
    258	000536				.GCML2::.SAVR1
    259	000542	010005 				MOV	R0,R5		;SET UP BLOCK POINTER
    260	000544	105765 	000152 			TSTB	G.CDEP(R5)	;AT TOP ALREADY ?
    261	000550	003740 				BLE	OKOUT		;++007 YES -- EXIT
    262	000552	105365 	000152 		10$:	DECB	G.CDEP(R5)	;++004 DECREMENT CURRENT DEPTH COUNT
    263	000556	001404 				BEQ	20$		;++004 SKIP BEFORE TOP LEVEL (0) PROCESSED
    264	000560	162765 	000020 	000154 		SUB	#G.PDSL,G.PPTR(R5)  ;++004 BACK UP THE PUSH-DOWN LIST PTR
    265	000566	000771 				BR	10$		;++004 ITERATE
    266	000570	105265 	000152 		20$:	INCB	G.CDEP(R5)	;++004 INDICATE LEVEL ONE
    267	000574					CALL	POPOPN		;POP THINGS UP TO LEVEL 0
    268	000600	000724 				BR	OKOUT		;RETURN BLISSFULLY
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 4


    270					; SET UP TO PROCESS AN INDIRECT FILE
    271					; LOOK FOR @ IN COLUMN 1
    272					;    R1 IS COMMAND LINE ADDRESS
    273					;    R2 IS COMMAND LINE LENGTH
    274					;
    275	000602	122711 	000100 		INDIR:	CMPB	#'@,(R1)	;CHECK FOR @
    276	000606	001321 				BNE	OKOUT		;NO  - RETURN LINE TO USER
    277	000610	132765 	000002 	000141 		BITB	#GE.IND,G.MODE(R5); INDIRECT PERMITTED ?
    278	000616	001715 				BEQ	OKOUT		;NO  - RETURN IT TO USER
    279					; PROCESS INDIRECT FILE
    280	000620	126565 	000152 	000153 		CMPB	G.CDEP(R5),G.MDEP(R5)	;CHECK DEPTH
    281	000626	002340 				BGE	MDEERR		;TOO DEEP
    282	000630	162706 	000054 			SUB	#C.SIZE,SP	;ALLOCATE A CSI BLOCK ON STACK
    283	000634	005201 				INC	R1		;SKIP OVER @
    284	000636	005302 				DEC	R2		;1 LESS CHARACTER IN LINE
    285					; CALL CSI1 AND CSI2
    286	000640					CSI$1	SP,R1,R2	;CHECK SYNTAX ON FILE SPEC
    287	000656	016065 	000002 	000146 		MOV	C.CMLD(R0),G.CMLD(R5)	;SET COMPRESSED LENGTH
    288	000664	005265 	000146 			INC	G.CMLD(R5)	;ADJUST LENGTH FOR @ IN COLUMN 1
    289	000670	103712 				BCS	BIFERR		;BAD SYNTAX
    290	000672	132760 	000040 	000001 		BITB	#CS.EQU,C.STAT(R0)  ;++009 WAS EQUAL SIGN (=) FOUND?
    291	000700	001306 				BNE	BIFERR		;++009 ANY INDICATION OF INPUT SPEC IS ERROR
    292	000702					CSI$2	R0,OUTPUT	;GET THE OUTPUT FILE
    293	000712	103701 				BCS	BIFERR		;
    294	000714	132760 	000030 	000001 		BITB	#CS.WLD!CS.MOR,C.STAT(R0); NO * WILD CARDS, AND ONLY ONE FILE
    295	000722	001275 				BNE	BIFERR;
    296	000724	132760 	000005 	000001 		BITB	#CS.DVF!CS.NMF,C.STAT(R0);
    297	000732	001671 				BEQ	BIFERR		;ERROR - NO DEVICE OR FILE NAME
    298					; SAVE FILE ID AND POINTERS
    299	000734					CALL	PSHCLS		;PUSH AND CLOSE FILE
    300	000740	010602 				MOV	SP,R2		;++002 POINT R2 TO THE CSI DATA ...
    301	000742	062702 	000006 			ADD	#C.DSDS,R2	;++002 ... SET DESCRIPTOR
    302	000746	012765 	054523 	000220 		MOV	#"SY,N.DVNM+G.DFNB(R5);DEFAULT DEVICE IS SY FOR LOWER OPEN'S
    303
    304
    305						.IF NDF	R$$11M		;++002
    306
    307
    308						OPEN$R	R5,,R2		;++002 OPEN THE FILE
    309
    310						.IFF			;++002
    311
    312	000754					CALL	GOPEN		;++002 OPEN THE FILE
    313
    314
    315						.ENDC			;++002
    316
    317
    318	000760	103404 				BCS	4$		;ERROR - CLEANUP AND REPORT ERROR
    319	000762	062706 	000054 			ADD	#C.SIZE,SP	;POP CSI BLOCK FROM STACK
    320	000766	000167 	177060 			JMP	PROMPT		;ALL OK - GET A COMMAND LINE
    321	000772	062706 	000054 		4$:	ADD	#C.SIZE,SP	;POP CSI BLOCK FROM STACK
    322	000776					CALL	POPOPN		;RE-OPEN THE LEVEL ABOVE
    323	001002	000642 			OPRBR:	BR	OPRERR		;REPORT ERROR ON @ FILE OPEN
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 5


    325					;
    326					; POPOPN - SUBROUTINE TO CLOSE, POP UP, AND RE-OPEN
    327					;
    328	001004				POPOPN:	CLOSE$	R5		;CLOSE CURRENT FILE
    329	001012				POPOP1:				;++001
    330	001012	016504 	000154 			MOV	G.PPTR(R5),R4	;UPDATE PUSHDOWN POINTER
    331	001016	162765 	000020 	000154 		SUB	#G.PDSL,G.PPTR(R5) ;++001 RESET PUSHDOWN PTR IN GCML BLK
    332	001024	105365 	000152 			DECB	G.CDEP(R5)	;DECREASE PUSHDOWN LEVEL
    333	001030	001004 				BNE	1$		;IF POPPING TO LEVEL 0
    334	001032	132765 	000200 	000141 		BITB	#GE.MCR,G.MODE(R5) ;++001 AND TOP WAS AN MCR LINE,
    335	001040	001036 				BNE	3$		;DON'T RE-OPEN LEVEL 0
    336	001042	010503 			1$:	MOV	R5,R3		;++001 POINT R3 JUST PAST THE FILE ID ...
    337	001044	062703 	000006G			ADD	#F.FNB+N.FID+6,R3  ;++001 ...IN THE FDB
    338	001050	014443 				MOV	-(R4),-(R3)	;++001 TRANSFER ...
    339	001052	014443 				MOV	-(R4),-(R3)	;++001 ... THE ...
    340	001054	014443 				MOV	-(R4),-(R3)	;++001 ... FILE ID, ...
    341	001056	014463 	000032 			MOV	-(R4),N.DVNM-N.FID(R3)  ;++001 ... THE DEVICE NAME, AND ...
    342	001062	114463 	000034 			MOVB	-(R4),N.UNIT-N.FID(R3)  ;++011 ... UNIT NUMBER INTO THE FDB
    343
    344
    345						.IF NDF	R$$11M		;++002
    346
    347
    348						OPEN$R	R5		;RE-OPEN THE LEVEL ABOVE
    349
    350						.IFF			;++002
    351
    352	001066					OFNB$R	R5		;++003 OPEN FILE BY FILENAME BLOCK
    353
    354
    355						.ENDC			;++002
    356
    357
    358	001102	103416 				BCS	4$		;ERROR ON RE-OPEN, VERY BAD
    359					; RESTORE POINTERS INTO THE FILE
    360	001104	114446 				MOVB	-(R4),-(SP)	;++011 SAVE THE OLD FCS I/O STATUS BYTE
    361	001106	014403 				MOV	-(R4),R3	;BYTE-IN-BLOCK
    362	001110	014402 				MOV	-(R4),R2	;
    363	001112	014401 				MOV	-(R4),R1	;VIRTUAL BLOCK NUMBER
    364	001114					CALL	.POINT		;FDB IS IN R0, NOW .POINT
    365	001120	112675 	000000G			MOVB	(SP)+,@F.BDB(R5)  ;++011 RESTORE OLD FCS I/O STATUS
    366	001124	103004 				BCC	3$		;NO ERRORS
    367	001126	122765 	000000G	000000G		CMPB	#IE.EOF,F.ERR(R5);
    368	001134	001001 				BNE	4$		;ANYTHING EXCEPT EOF IS AN I/O ERROR
    369	001136				3$:	RETURN			;ALL IS NOW READY FOR NEXT GET$
    370	001140	005726 			4$:	TST	(SP)+		;THROW AWAY CALLER'S RETURN ADDRESS
    371	001142	000717 				BR	OPRBR		;++010 DECLARE INDIRECT FILE OPEN ERROR
    372
    373					;++001
    374					;
    375					; CLOSE CURRENT COMMAND LEVEL
    376					;
    377					;--001
    378	001144				.GCML3::.SAVR1			;++001 SAVE REGISTERS
    379	001150	010005 				MOV	R0,R5		;++001 SET FDB POINTER
    380	001152	005765 	000000G		CLOCRT:	TST	F.BDB(R5)	;++001 IS FILE OPEN?
    381	001156	001432 				BEQ	PSHRTN		;++001 NO, JUST RETURN
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 5-1


    382
    383					;
    384					; PSHCLS - SUBROUTINE TO PUSH DOWN AND CLOSE
    385					;
    386	001160	105265 	000152 		PSHCLS:	INCB	G.CDEP(R5)	;++001 INCREASE PUSHDOWN LEVEL
    387	001164	016504 	000154 			MOV	G.PPTR(R5),R4	;NEXT PUSHDOWN FRAME
    388	001170	010500 				MOV	R5,R0		;GET FDB FOR .MARK
    389	001172					CALL	.MARK		;MARK CURRENT PLACE IN FILE FOR .POINT
    390	001176	010124 				MOV	R1,(R4)+	;VIRTUAL BLOCK NUMBER
    391	001200	010224 				MOV	R2,(R4)+	;
    392	001202	010324 				MOV	R3,(R4)+	;BYTE-IN-BLOCK
    393	001204	062700 	000000G			ADD	#F.FNB+N.FID,R0	;++001 POINT R0 TO FILE ID IN FDB
    394	001210	117524 	000000G			MOVB	@F.BDB(R5),(R4)+  ;++011 SAVE FCS I/O STATUS BYTE
    395	001214	116024 	000034 			MOVB	N.UNIT-N.FID(R0),(R4)+  ;++011 SAVE THE UNIT NUMBER, ...
    396	001220	016024 	000032 			MOV	N.DVNM-N.FID(R0),(R4)+  ;++001 ...THE DEVICE NAME, AND ...
    397	001224	012024 				MOV	(R0)+,(R4)+	;++001 ... THE ...
    398	001226	012024 				MOV	(R0)+,(R4)+	;++001 ... FILE ID ...
    399	001230	012024 				MOV	(R0)+,(R4)+	;++001 ... FROM FDB IN THE PUSH DOWN LIST
    400	001232	010465 	000154 			MOV	R4,G.PPTR(R5)	;RESET PUSHDOWN FRAME
    401	001236					CLOSE$	R5		;++001 CLOSE CURRENT LEVEL
    402	001244				PSHRTN:				;++001
    403	001244					RETURN
    404
    405
    406						.IF DF	R$$11M		;++002
    407
    408					;++002
    409					;
    410					; *-GOPEN-* OPEN FILE BY PERFORMING A PARSE, AND AN OPEN BY
    411					; 	    FILE NAME BLOCK.
    412					;
    413					; INPUTS:
    414					;	R2=DATA SET DESCRIPTOR ADDRESS
    415					;	R5=FDB/GCMLB ADDRESS
    416					;
    417					; OUTPUTS:
    418					;	R0,R1, AND R3 ARE LOST
    419					;	C-BIT CLEAR INDICATES SUCCESS OF ALL THREE STEPS
    420					;	C-BIT SET INDICATES FAILURE
    421					;
    422					;--002
    423	001246	010500 			GOPEN:	MOV	R5,R0		;++002 PUT FDB ADDR IN R0
    424	001250	013701 	000000G			MOV	@#.FSRPT,R1	;++002 MUST DETERMINE IF A '.FINIT' ...
    425	001254	005761 	000000G			TST	A.OWUI(R1)	;++002 ...HAS BEEN PERFORMED
    426	001260	001002 				BNE	1$		;++002 IF SO, THEN SKIP
    427	001262					FINIT$			;++002 INITIALIZE
    428	001266	010001 			1$:	MOV	R0,R1		;++002 POINT R1 TO THE ...
    429	001270	062701 	000000G			ADD	#F.FNB,R1	;++002 ... FILE NAME BLOCK
    430	001274	016003 	000000G			MOV	F.DFNB(R0),R3	;++002 PNT R3 TO DEFAULT FILE NAME BLOCK
    431	001300					CALL	.PARSE		;++002 PARSE THE FILE NAME
    432	001304	103405 				BCS	10$		;++002 SKIP ON ERROR
    433	001306					OFNB$R			;++003 OPEN FILE FOR READ (VIA FNB)
    434	001320				10$:	RETURN			;++002
    435
    436
    437						.ENDC			;++002
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 6


    439					; GETMCR - SUBROUTINE CONDITIONALLY GETS AN MCR LINE
    440					;    RETURNS
    441					;    C=1 IF NO MCR LINE, C=0 OTHERWISE
    442					;    R1=STRING ADDRESS
    443					;    R2=STRING LENGTH
    444					;    REGISTERS CHANGED R0-R4
    445	001322	016501 	000156 		GETMCR:	MOV	G.RBUF(R5),R1	;GET RECORD BUFFER ADDRESS
    446	001326	105065 	000152 			CLRB	G.CDEP(R5)	;++001 SET CMD LEVEL TO ZERO
    447	001332	012711 				MOV	(PC)+,(R1)	;SET UP "GET MCR LINE" DPB
    448	001334	   177 	   051 			.BYTE	127.,41.
    449	001336					DIR$	R1		;TRY TO GET AN MCR LINE
    450	001342	103432 				BCS	10$		;TASK NOT INVOKED AS MCR FUNCTION
    451	001344	005721 				TST	(R1)+		;POINT TO MCR LINE IN BUFFER
    452	001346	013702 	000000G			MOV	@#$DSW,R2	;++006 GET MCR LINE BYTE COUNT
    453
    454	001352				2$:	CALL	NXTBYT		;SCAN TO A TAB OR BLANK
    455	001356	103424 				BCS	10$		;NO COMMAND LINE FOLLOWING MCR FUNCTION
    456	001360	120027 	000011 			CMPB	R0,#TAB
    457	001364	001403 				BEQ	4$
    458	001366	120027 	000040 			CMPB	R0,#BLANK
    459	001372	001367 				BNE	2$
    460	001374				4$:	CALL	NXTBYT		;SKIP TABS AND BLANKS
    461	001400	103413 				BCS	10$
    462	001402	120027 	000011 			CMPB	R0,#TAB
    463	001406	001772 				BEQ	4$
    464	001410	120027 	000040 			CMPB	R0,#BLANK
    465	001414	001767 				BEQ	4$
    466
    467	001416	124122 				CMPB	-(R1),(R2)+	;++001 DECR POINTER AND INCR COUNT
    468	001420	152765 	000200 	000141 		BISB	#GE.MCR,G.MODE(R5);SET TOP-LEVEL MCR FLAG
    469	001426	000241 				CLC			;AND INDICATE MCR LINE GOTTEN
    470	001430				10$:	RETURN
    471
    472					; NXTBYT - GET NEXT BYTE FROM MCR LINE
    473					;    INPUT - R1 IS STRING POINTER, R2 IS REMAINING BYTE COUNT
    474					;    OUTPUT- R1,R2 UPDATED, R0 IS THE BYTE
    475					;    SETS C=1 ON END OF LINE
    476	001432	162702 	000001 		NXTBYT:	SUB	#1,R2		;++001 DECR R2 AND SET CC-C WHEN REACH -1
    477	001436	112100 				MOVB	(R1)+,R0	;GET NEXT BYTE
    478	001440					RETURN
    479
    480
    481
    482		000001 				.END
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 6-1
SYMBOL TABLE

ALTMOD= 000033   	C.SWAD= 000022   	GOPEN   001246R  	NXTBYT  001432R  	S.FNBW= 000017
A.OWUI= ****** GX	C.TYPR= 000000   	G.CDEP= 000152   	N.DID = 000024   	S.FNTY= 000004
BIFERR  000516R  	FD.TTY= ****** GX	G.CMLD= 000146   	N.DVNM= 000032   	S.FTYP= 000002
BLANK = 000040   	FO.RD = ****** GX	G.DFNB= 000166   	N.FID = 000000   	S.NFEN= 000020
CLOCRT  001152R  	F.BDB = ****** GX	G.DPRM= 000160   	N.FNAM= 000006   	TAB   = 000011
CMLSCN  000272R  	F.DFNB= ****** GX	G.ERR = 000140   	N.FTYP= 000014   	TOPEOF  000424R
CR    = 000015   	F.DSPT= ****** GX	G.ISIZ= 000020   	N.FVER= 000016   	$DSW  = ****** GX
CS.DIF= 000002   	F.ERR = ****** GX	G.MDEP= 000153   	N.NEXT= 000022   	$$    = 000067
CS.DVF= 000004   	F.FACC= ****** GX	G.MODE= 000141   	N.STAT= 000020   	.CLOSE= ****** G
CS.EQU= 000040   	F.FNB = ****** GX	G.PDSL= 000020   	N.UNIT= 000034   	.CSI1 = ****** G
CS.INP= 000001   	F.NRBD= ****** GX	G.PPTR= 000154   	OKOUT   000452R  	.CSI2 = ****** G
CS.MOR= 000020   	F.RCTL= ****** GX	G.PSDS= 000142   	OPRBR   001002R  	.FINIT= ****** G
CS.NMF= 000001   	F.URBD= ****** GX	G.RBUF= 000156   	OPRERR  000510R  	.FSRPT= ****** GX
CS.OUT= 000002   	GETMCR  001322R  	IE.EOF= ****** GX	OUT     000454R  	.GCML1  000000RG
CS.WLD= 000010   	GE.BIF= 177775   	INDIR   000602R  	PAR$$$= 000005   	.GCML2  000536RG
C.CMLD= 000002   	GE.CLO= 000004   	IOEOF   000374R  	POPOPN  001004R  	.GCML3  001144RG
C.DEVD= 000006   	GE.COM= 000001   	IOERR   000502R  	POPOP1  001012R  	.GETSQ= ****** G
C.DIRD= 000012   	GE.EOF= 177766   	IOERR0  000366R  	PROMPT  000052R  	.MARK = ****** GX
C.DSDS= 000006   	GE.IND= 000002   	IO.ATT= ****** GX	PSHCLS  001160R  	.OPFNB= ****** G
C.FILD= 000016   	GE.IOR= 177777   	IO.DET= ****** GX	PSHRTN  001244R  	.PARSE= ****** GX
C.MKW1= 000024   	GE.LC = 000010   	IO.WVB= ****** GX	R$$11M= 000001   	.POINT= ****** GX
C.MKW2= 000026   	GE.MCR= 000200   	LVLTST  000006R  	S.FDB = 000140   	.SAVR1= ****** GX
C.SIZE= 000054   	GE.MDE= 177774   	LVL0    000042R  	S.FNAM= 000006   	.XQIO = ****** GX
C.STAT= 000001   	GE.OPR= 177776   	MDEERR  000530R  	S.FNB = 000036   	...TPC= 000036

. ABS.	000000	   000
      	001442	   001
ERRORS DETECTED:  1

VIRTUAL MEMORY USED:  2916 WORDS  ( 12 PAGES)
DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:00:37
[46,10]GCML,[46,20]GCML/-SP=[46,30]GCML
GET 0105MS, FCS GET RECORD ROUT	MACRO M1108  05-DEC-77 22:11  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
GET 0105MS, FCS GET RECORD ROUT	MACRO M1108  05-DEC-77 22:11  PAGE 7


						.TITLE	GET 0105MS, FCS GET RECORD ROUTINE
						.IDENT	/0105MS/
      2					; ALTERED MONDAY 10-FEB-75 12:16 BY E. MARISON 16:20
      3					; ALTERED MONDAY 14-JUL-75 13:16 BY E. MARISON
      4					; ALTERED WED 16-JUL-75 13:30 BY E. MARISON
      5					;
      6					;                             COPYRIGHT (C) 1973, 1978 BY
      7					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      8					;
      9					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
     10					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     11					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     12					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     13					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     14					;
     15					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     16					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     17					;       CORPORATION.
     18					;
     19					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     20					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     21
     22					;
     23					; PETER H. LIPMAN 13-JULY-73
     24					;
     25					; SHAO-SUN CHIEN 24-NOV-74
     26					;
     27					;
GET 0105MS, FCS GET RECORD ROUT	MACRO M1108  05-DEC-77 22:11  PAGE 8


     29					;+
     30					; .GET IS A SUBROUTINE TO READ A LOGICAL RECORD FROM A FILE.
     31					;
     32					; CALLING SEQUENCE:
     33					;	JSR PC,.GET
     34					; INPUTS:
     35					;	R0=FILE DESCRIPTOR BLOCK ADDRESS
     36					; OUTPUTS:
     37					;	F.NRBD+2	= ADDRESS OF RECORD IF IN LOCATE MODE
     38					;	F.NRBD	= SIZE  IN BYTES OF RECORD READ
     39					;	F.ERR	= +1 IN NO ERRORS
     40					;		= -N IF ERROR, WHERE N DESCRIBES WHAT HAPPENED
     41					;	C BIT	= 0 IF NO ERROR
     42					;		= 1 IF ERROR
     43					; OPERATION:
     44					;	ALL PARAMETERS ARE ASSUMED TO BE IN THE FILE DESCRIPTOR BLOCK
     45					; THESE INCLUDE THE ADDRESS AND SIZE OF THE USER'S RECORD BUFFER.
     46					;
     47					;-
     48
     49						.IF	EQ,R$$11M	; RSX-11D ONLY
     50						.IF	GT,R$$RSL	;IF ASSEMBLING FOR RESIDENT LIBRARY
     51						.IF	EQ,R$$SEQ	;AND NOT SEQUENTIAL ONLY
     52					.GETSQ::
     53						.ENDC
     54						.ENDC
     55						.ENDC
     56						.IF	EQ,R$$SEQ
     57	000000				.GET::	.SAVR1			;SAVE REGISTERS R1-R5
     58	000004					CALL	..PGCR		;VERIFY THAT PUT/GET IS LEGAL
     59						.ENDC
     60					;
     61						.IF	GT,R$$SEQ
     62					.GETSQ::.SAVR1
     63						CALL	..PGCS		;VERIFY THAT PUT GET IS LEGAL
     64						.ENDC
     65					;
     66	000010	103463 				BCS	GETX1		;BRANCH IF ILLEGAL
     67	000012	012760 	000001 	000000G		MOV	#1,F.ERR(R0)	;INIT THE ERROR RETURN CODE
     68	000020	132760 	000000G	000000G		BITB	#FD.REC,F.RCTL(R0) ;RECORD ORIENTED?
     69	000026	001455 				BEQ	GTBLK		;BRANCH IF BLOCK ORIENTED
     70					; RECORD ORIENTED DEVICE
     71	000030	132760 	000010 	000000G		BITB	#FD.EF1,F.BKP1(R0) ;DELAYED EOF TO REPORT?
     72	000036	001404 				BEQ	2$		;BRANCH IF NO
     73	000040	112760 	000000G	000000G		MOVB	#IE.EOF,F.ERR(R0) ;REPORT EOF
     74	000046	000442 				BR	GETX		;AND EXIT
     75	000050				2$:	CALL	..RWAT		;READ THE NEXT RECORD
     76	000054	016001 	000000G			MOV	F.BDB(R0),R1
     77	000060	016160 	000002 	000000G		MOV	2(R1),F.NRBD(R0) ;RETURN RECORD SIZE TO USER FROM
     78									;SECOND I/O STATUS WORD
     79	000066	132760 	000000G	000000G		BITB	#FD.PLC,F.RACC(R0) ;MOVE MODE OR PARTIAL LOCATE?
     80	000074	001404 				BEQ	6$		;MOVE MODE, GO MOVE THE RECORD
     81	000076	016060 	000000G	000002G		MOV	F.NREC(R0),F.NRBD+2(R0) ;PARTIAL LOCATE MODE, RETURN
     82									;ADDRESS OF RECORD TO THE USER
     83	000104	000406 				BR	20$		;EXIT THROUGH COMMON EXIT
     84
     85					; MOVE THE RECORD TO THE USER'S RECORD BUFFER
GET 0105MS, FCS GET RECORD ROUT	MACRO M1108  05-DEC-77 22:11  PAGE 8-1


     86	000106	016001 	000000G		6$:	MOV	F.NREC(R0),R1	;R1=RECORD ADDRESS
     87	000112	016002 	000002G			MOV	F.URBD+2(R0),R2	;R2= DESTINATION ADDRESS
     88	000116					CALL	..MVRU		;MOVE THE RECORD
     89	000122	122760 	000000G	000000G	20$:	CMPB	#IE.EOF,F.ERR(R0) ;END OF FILE TO REPORT?
     90	000130	001011 				BNE	GETX
     91	000132	005760 	000000G			TST	F.NRBD(R0)	;YES, IF THERE IS DATA TOO
     92	000136	001406 				BEQ	GETX
     93	000140	012760 	000001 	000000G		MOV	#1,F.ERR(R0)	;INDICATE A SUCCESSFUL "GET"
     94	000146	152760 	000010 	000000G		BISB	#FD.EF1,F.BKP1(R0) ;AND SET THE DELAYED EOF BIT
     95					;
     96	000154				GETX:	CALL	..FCSX
     97	000160				GETX1:	RETURN
GET 0105MS, FCS GET RECORD ROUT	MACRO M1108  05-DEC-77 22:11  PAGE 9


     99					; GET THE NEXT RECORD FROM THE BLOCK BUFFER
    100	000162				GTBLK:
    101						.IF	EQ,R$$SEQ
    102	000162	132760 	000000G	000000G		BITB	#FD.RAN,F.RACC(R0) ;RANDOM OR SEQUENTIAL
    103	000170	001404 				BEQ	GTBKSQ		;BRANCH IF SEQUENTIAL
    104	000172					CALL	..PSRC		;POSITION FOR THE RECORD
    105	000176	103770 				BCS	GETX1		;BRANCH IF ERROR (F.ERR SET)
    106	000200	000403 				BR	GTBKS1
    107						.ENDC
    108					;
    109					; SEQUENTIAL GET FROM BLOCK BUFFER
    110	000202				GTBKSQ:	CALL	..EFC1		;CHECK FOR END OF FILE
    111	000206	103764 				BCS	GETX1		;BRANCH IF YES
    112	000210	062760 	000001 	000002G	GTBKS1:	ADD	#1,F.RCNM+2(R0)	;INCREMENT RECORD NUMBER SO THAT NEXT
    113	000216	005560 	000000G			ADC	F.RCNM(R0)	;RANDOM GET WILL GET THE NEXT ONE
    114	000222	016002 	000000G			MOV	F.NREC(R0),R2	;R2 POINTS AT RECORD ABOUT TO BE GOTTEN
    115	000226	020260 	000000G			CMP	R2,F.EOBB(R0)	;IF NEXT RECORD POINTER
    116									;POINTS AT THE END OF THE BLOCK
    117									;BUFFER, THEN THE NEXT RECORD
    118									;BEGINS AT THE START OF THE NEXT
    119									;BLOCK
    120	000232	001005 				BNE	4$		;BRANCH IF THIS IS NOT THE CASE
    121	000234				2$:
    122						.IF	EQ,R$$SEQ
    123	000234					CALL	..RDRN		;READ THE NEXT BLOCK, WRITING THIS ONE
    124									;IF IT HAPPENS TO BE "DIRTY"
    125						.ENDC
    126					;
    127						.IF	GT,R$$SEQ
    128						CALL	READSQ		;READ THE NEXT BLOCK
    129						.ENDC
    130					;
    131	000240	103747 				BCS	GETX1		;BRANCH IF ERROR
    132	000242	016002 	000000G			MOV	F.NREC(R0),R2	;R2=ADDRESS OF NEXT RECORD
    133	000246	016003 	000000G		4$:	MOV	F.RSIZ(R0),R3	;R3=SIZE OF RECORD IF FIXED LENGTH
    134	000252	122760 	000000G	000000G		CMPB	#R.VAR,F.RTYP(R0) ;VARIABLE OR FIXED LENGTH
    135	000260	001005 				BNE	6$		;BRANCH IF FIXED LENGTH
    136						.IF	GT,R$$ANI
    137						BIT	#CH.AND,F.CHR(R0)	;ANSI "D" ?
    138						BEQ	5$
    139						MOV	#4,R4		;4 BYTES TO CONVERT
    140						CLR	R3		;CLEAR ACCUMULATED VALUE
    141					10$:	MOVB	(R2)+,R5	;GET NEXT BYTE
    142						CMPB	#'9,R5	;TOO LARGE ?
    143						BLO	15$	;IF LO YES
    144						CMPB	#'0,R5	;TOO SMALL ?
    145						BHI	15$		;IF HI YES
    146						MUL	#10.,R3	;10.XR3-->R3
    147						SUB	#'0,R5		;SUB. CHARACTER BIAS
    148						ADD	R5,R3		;ACCUMULATE RESULT
    149						SOB	R4,10$
    150						MOV	R2,R1		;R1=ADDR. OF DATA
    151						SUB	#4.,R3		;ADJ. COUNT TO DATA BYTE COUNT
    152						ADD	R3,R2		;R2 NOW POINTS TO NEXT RECORD
    153						BR	17$
    154					;
    155					15$:
GET 0105MS, FCS GET RECORD ROUT	MACRO M1108  05-DEC-77 22:11  PAGE 9-1


    156						CMPB	#'^,R5		; IS THE CHAR THE PAD CHAR
    157						BEQ	2$		; YES GO READ NEXT BLOCK
    158						MOVB	#IE.NNC,F.ERR(R0) ; NO - NOTE ERROR
    159						BR	GETX		; AND EXIT
    160						.ENDC
    161	000262	012203 			5$:	MOV	(R2)+,R3	;R3=SIZE OF VARIABLE LENGTH RECORDS
    162	000264	002003 				BGE	6$		;BRANCH IF LEGAL BYTE COUNT
    163	000266	005203 				INC	R3		;IF -1, THEN LAST RECORD THIS BLOCK
    164	000270	001761 				BEQ	2$
    165	000272	000505 				BR	50$
    166					;
    167					; AT THIS POINT R2=ADDRESS OF DATA,R3=SIZE OF RECORD
    168					; SEE IF RECORD IS ENTIRELY WITHIN THIS BLOCK BUFFER.
    169	000274	010201 			6$:	MOV	R2,R1		;R1=ADDRESS OF DATA
    170	000276	060302 				ADD	R3,R2		;R2=BEGINNING OF NEXT RECORD
    171	000300	005202 				INC	R2		;ASSUME WORD ALIGNED, ROUND UP TO WRD BDRY
    172	000302	042702 	000001 			BIC	#1,R2
    173	000306	020260 	000000G		17$:	CMP	R2,F.EOBB(R0)	;BEYOND END OF BLOCK BUFFER?
    174	000312	101016 				BHI	20$		;BRANCH IF RECORD CROSSES BLOCK BOUNDARY
    175					; THE RECORD IS CONTAINED IN THIS BLOCK BUFFER.
    176	000314	010360 	000000G			MOV	R3,F.NRBD(R0)	;RETURN SIZE TO USER
    177	000320	002472 				BLT	50$		;BRANCH IF RECORD IS TOO BIG
    178									;(NEEDED FOR FIX LENGTH RECORD PATH)
    179	000322	010260 	000000G			MOV	R2,F.NREC(R0)	;UPDATE NEXT RECORD POINTER
    180	000326	010160 	000002G			MOV	R1,F.NRBD+2(R0)	;RETURN RECORD ADDRESS TO USER
    181									;ASSUMING PARTIAL LOCATE MODE
    182	000332	132760 	000000G	000000G		BITB	#FD.PLC,F.RACC(R0) ;IS IT PARTIAL LOCATE MODE?
    183	000340	001305 			18$:	BNE	GETX		;BRANCH IF YES
    184					;
    185					; IT'S MOVE MODE, MOVE RECORD, WILL SET F.NRBD+2 TO F.URBD+2
    186	000342					CALL	..MVRU		;MOVE RECORD TO USER BUFFER
    187	000346	000702 				BR	GETX
    188					; RECORD CROSSES BLOCK BOUNDARY-R3=SIZE,R1=FIRST BYTE OF RECORD DATA
    189	000350	132760 	000000G	000000G	20$:	BITB	#FD.BLK,F.RATT(R0)
    190	000356	001405 				BEQ	22$		;BRANCH IF RECORDS CAN CROSS BLK BDRY
    191					;
    192					; RECORDS NOT SUPPOSED TO CROSS, BUT IF FIXED LENGTH AND SMALLER
    193					; THAN VIRTUAL BLOCK SIZE, READ NEXT BLOCK
    194	000360	122760 	000000G	000000G		CMPB	#R.FIX,F.RTYP(R0)
    195	000366	001722 				BEQ	2$		;READ NEXT BLOCK
    196	000370	000446 				BR	50$		;INDICATE RECORD TOO BIG
    197	000372	026003 	000000G		22$:	CMP	F.URBD(R0),R3	;IS USER'S RECORD BUFFER BIG ENOUGH?
    198	000376	103443 				BLO	50$		;BRANCH IF RECORD TOO BIG
    199	000400	016002 	000002G			MOV	F.URBD+2(R0),R2	;R2=DESTINATION FOR RECORD
    200	000404	010260 	000002G			MOV	R2,F.NRBD+2(R0)	;TELL USER WHERE HIS RECORD IS
    201	000410	010360 	000000G			MOV	R3,F.NRBD(R0)	;AND HOW BIG IT IS
    202	000414	010346 				MOV	R3,-(SP)	;PUSH TOTAL BYTES TO BE MOVED
    203	000416	016003 	000000G		23$:	MOV	F.EOBB(R0),R3	;END OF BLOCK BUFFER
    204	000422	160103 				SUB	R1,R3		;R3=BYTES REMAINING IN THIS BUFFER
    205	000424	021603 			24$:	CMP	@SP,R3		;MORE BYTES TO MOVE THAN LEFT IN
    206									;BUFFER?
    207	000426	101413 				BLOS	30$		;BRANCH IF NO MOVE LAST PART OF
    208									;RECORD.
    209					; MOVE FIRST OR INTERMEDIATE PIECE OF THE RECORD
    210	000430	160316 				SUB	R3,@SP		;UPDATE BYTES STILL TO BE MOVED
    211	000432					CALL	..MVR1		;MOVE ALL BYTES LEFT IN THIS
    212									;BLOCK.
GET 0105MS, FCS GET RECORD ROUT	MACRO M1108  05-DEC-77 22:11  PAGE 9-2


    213					; NOW READ THE NEXT BLOCK
    214	000436	010246 				MOV	R2,-(SP)	;POINTS TO NEXT WORD IN USER REC BUFFER
    215					;
    216						.IF	EQ,R$$SEQ
    217	000440					CALL	..RDRN		;READ NEXT BLOCK, WRITE THIS IF DIRTY
    218						.ENDC
    219					;
    220						.IF	GT,R$$SEQ
    221						CALL	READSQ		;READ THE NEXT BLOCK
    222						.ENDC
    223					;
    224	000444	103415 				BCS	40$
    225	000446	012602 				MOV	(SP)+,R2
    226	000450	016001 	000000G			MOV	F.NREC(R0),R1
    227	000454	000760 				BR	23$
    228					; LAST PART OF RECORD
    229	000456	012603 			30$:	MOV	(SP)+,R3	;NO OF BYTES REMAINING IN THE RECORD
    230	000460					CALL	..MVR1		;MOVE THE RECORD
    231	000464	005201 				INC	R1		;R1=NEXT BYTE AFTER LAST BYTE
    232	000466	042701 	000001 			BIC	#1,R1		;MOVED.  ROUND UP TO WORD BDRY
    233	000472	010160 	000000G			MOV	R1,F.NREC(R0)	;AND STORE AS NEXT RECORD POINTER
    234	000476	000720 				BR	18$
    235	000500	062706 	000004 		40$:	ADD	#4,SP		;GET RID OF 2 WORDS ON STACK
    236	000504	000715 				BR	18$		;AND RETURN ERROR
    237
    238					; RECORD TOO BIG - SIGN BIT SET, OR TOO BIG FOR USER BUFFER
    239	000506	112760 	000000G	000000G	50$:	MOVB	#IE.RBG,F.ERR(R0)
    240	000514	000711 				BR	18$
    241					;
    242						.IF	GT,R$$SEQ
    243					READSQ:	BITB	#FD.WRT,F.BKP1(R0) ;IF THIS BLOCK IS DIRTY
    244						BNE	10$		;THEN ILLEGAL OPERATION
    245						CALL	..RWAT		;READ THE NEXT BLOCK
    246						CALLR	..FCSX
    247					10$:	CALLR	..SQER		;ILLEGAL SEQUENTIAL OPERATION
    248						.ENDC
    249					;
    250					;
    251	000516					$END	GET
    252					;
    253					;
    254		000001 				.END
GET 0105MS, FCS GET RECORD ROUT	MACRO M1108  05-DEC-77 22:11  PAGE 9-3
SYMBOL TABLE

BD.FRE= 000001   	F.NRBD= ****** GX	HA.NAM= 000005   	PP.ZER= 000001   	SYUNIT= 000000
DIRTYP= 015172   	F.NREC= ****** GX	HA.TYP= 000006   	R$$ANI= 000000   	WI.DLK= 000002
FCSEFN= 000040   	F.RACC= ****** GX	HA.UAT= 000004   	R$$BBF= 000000   	WI.LCK= 000001
FD.BLK= ****** GX	F.RATT= ****** GX	HA.UI = 000001   	R$$DPB= 000001   	$$    = 000067
FD.DVR= 000020   	F.RCNM= ****** GX	HA.VER= 000007   	R$$EIS= 000000   	.GET    000000RG
FD.EFB= 000004   	F.RCTL= ****** GX	IE.EOF= ****** GX	R$$LCL= 000000   	.SAVR1= ****** GX
FD.EF1= 000010   	F.RSIZ= ****** GX	IE.RBG= ****** GX	R$$MUL= 000000   	..EFC1= ****** GX
FD.EOF= 000002   	F.RTYP= ****** GX	NB.DOT= 100000   	R$$OPF= 000000   	..FCSX= ****** GX
FD.PLC= ****** GX	F.URBD= ****** GX	NB.SMI= 040000   	R$$RSL= 000000   	..MVRU= ****** GX
FD.RAN= ****** GX	GETX    000154R  	N.DRPT= 000006   	R$$SEQ= 000000   	..MVR1= ****** GX
FD.REC= ****** GX	GETX1   000160R  	N.DRSZ= 000004   	R$$SPL= 000000   	..PGCR= ****** GX
FD.WRT= 000001   	GTBKSQ  000202R  	N.DVPT= 000002   	R$$11M= 000001   	..PSRC= ****** GX
F.BDB = ****** GX	GTBKS1  000210R  	N.DVSZ= 000000   	R.FIX = ****** GX	..RDRN= ****** GX
F.BKP1= ****** GX	GTBLK   000162R  	N.FNPT= 000012   	R.VAR = ****** GX	..RWAT= ****** GX
F.EOBB= ****** GX	HA.CHU= 000003   	N.FNSZ= 000010   	SYDEV = 054523   	...CTL= 000002
F.ERR = ****** GX	HA.FP = 000002   	PP.SEP= 000002

. ABS.	000000	   000
      	000516	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2770 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:18
[41,10]GET,[41,20]GET/-SP=[41,30]FCSPRE,GET
GETDI 0102MS, GET DIRECTORY ID 	MACRO M1108  05-DEC-77 22:12  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
GETDI 0102MS, GET DIRECTORY ID 	MACRO M1108  05-DEC-77 22:12  PAGE 7


						.TITLE	GETDI 0102MS, GET DIRECTORY ID - USER INTERFACE
						.IDENT	/0102MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					; ALTERED FRIDAY 28-JUN-74 3:00		SHAO-SUN CHIEN
      4					; ALTERED MONDAY 14-JUL-75 13:24
      5					;
      6					;                             COPYRIGHT (C) 1973, 1978 BY
      7					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      8					;
      9					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
     10					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     11					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     12					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     13					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     14					;
     15					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     16					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     17					;       CORPORATION.
     18					;
     19					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     20					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     21					;
     22					; PETER H. LIPMAN 1-OCT-73
     23					;
     24					;+
     25					; GET THE DIRECTORY ID - SECOND HALF.
     26					;
     27					; THIS HALF OF THE GET DIRECTORY ROUTINE IS CALLED
     28					; EITHER BY GETDIR, OR BY GETDID.
     29					;
     30					;
     31					; INPUTS:
     32					;	R0=FDB ADDRESS
     33					;	R1=FILE NAME BLOCK ADDRESS
     34					;	R2=DIRECTORY STRING DESCRIPTOR - ADDRESS OF 2 WORD BLOCK
     35					;		CONTAINING THE SIZE AND ADDRESS OF THE STRING
     36					;	(SP)=ENTRY TO DIRFND OR PARDID
     37					;	2(SP)=RETURN LOCATION
     38					; OUTPUTS:
     39					;	C=0 IF OK, C=1 IF ERROR, F.ERR(R0) SET TO REASON
     40					;	ALL REGISTERS PRESERVED
     41					;	N.DID(R1) 6 BYTES SET TO DIRECTORY ID FOUND
     42					;	PRESERVES N.FNAM, N.FTYP, N.FVER, N.DVNM, N.UNIT IN FNB
     43					;	REST OF FNB ZEROED
     44					;-
     45	000000	012760 	000001 	000000G	..GTDI::MOV	#1,F.ERR(R0)
     46	000006	010246 				MOV	R2,-(SP)
     47	000010					CALL	..ALUN
     48	000014	012602 				MOV	(SP)+,R2
     49	000016	103447 				BCS	55$
     50	000020	132760 	000000G	000000G		BITB	#FD.DIR,F.RCTL(R0) ;IF NON DIRECTORY DEVICE
     51	000026	001433 				BEQ	50$
     52	000030	132760 	000000G	000000G		BITB	#FD.SDI,F.RCTL(R0) ;OR SINGLE DIRECTORY DEVICE
     53	000036	001027 				BNE	50$		;THEN SET DID TO MFD
GETDI 0102MS, GET DIRECTORY ID 	MACRO M1108  05-DEC-77 22:12  PAGE 8


     55					;
     56					; PRESERVE FILE NAME, TYPE, AND VERSION IN THE FILE NAME BLOCK
     57					; DIRFND USES THAT AREA IN THE PROCESS OF LOOKING UP THE UFD
     58	000040	016146 	000000G			MOV	N.FNAM(R1),-(SP)
     59	000044	016146 	000002G			MOV	N.FNAM+2(R1),-(SP)
     60	000050	016146 	000004G			MOV	N.FNAM+4(R1),-(SP)
     61	000054	016146 	000000G			MOV	N.FTYP(R1),-(SP)
     62	000060	016146 	000000G			MOV	N.FVER(R1),-(SP)
     63	000064					CALL	@10.(SP)	;EITHER ..DIRF OR ..PDID
     64	000070	012661 	000000G			MOV	(SP)+,N.FVER(R1)
     65	000074	012661 	000000G			MOV	(SP)+,N.FTYP(R1)
     66	000100	012661 	000004G			MOV	(SP)+,N.FNAM+4(R1)
     67	000104	012661 	000002G			MOV	(SP)+,N.FNAM+2(R1)
     68	000110	012661 	000000G			MOV	(SP)+,N.FNAM(R1)
     69	000114	000410 				BR	55$
     70					;
     71					; SET DIRECTORY ID TO MASTER FILE DIRECTORY (MFD)
     72	000116	012761 	177777 	000000G	50$:	MOV	#-1,N.DID(R1)
     73	000124	012761 	177777 	000002G		MOV	#-1,N.DID+2(R1)
     74	000132	005061 	000004G			CLR	N.DID+4(R1)	;ALSO CLC
     75	000136	005226 			55$:	INC	(SP)+		;RESTORE STACK
     76	000140					RETURN
     77					;
     78					;
     79	000142					$END	GETDI
     80					;
     81					;
     82		000001 				.END
GETDI 0102MS, GET DIRECTORY ID 	MACRO M1108  05-DEC-77 22:12  PAGE 8-1
SYMBOL TABLE

BD.FRE= 000001   	F.RCTL= ****** GX	N.DRPT= 000006   	PP.ZER= 000001   	R$$SPL= 000000
DIRTYP= 015172   	HA.CHU= 000003   	N.DRSZ= 000004   	R$$ANI= 000000   	R$$11M= 000001
FCSEFN= 000040   	HA.FP = 000002   	N.DVPT= 000002   	R$$BBF= 000000   	SYDEV = 054523
FD.DIR= ****** GX	HA.NAM= 000005   	N.DVSZ= 000000   	R$$DPB= 000001   	SYUNIT= 000000
FD.DVR= 000020   	HA.TYP= 000006   	N.FNAM= ****** GX	R$$EIS= 000000   	WI.DLK= 000002
FD.EFB= 000004   	HA.UAT= 000004   	N.FNPT= 000012   	R$$LCL= 000000   	WI.LCK= 000001
FD.EF1= 000010   	HA.UI = 000001   	N.FNSZ= 000010   	R$$MUL= 000000   	$$    = 000076
FD.EOF= 000002   	HA.VER= 000007   	N.FTYP= ****** GX	R$$OPF= 000000   	..ALUN= ****** GX
FD.SDI= ****** GX	NB.DOT= 100000   	N.FVER= ****** GX	R$$RSL= 000000   	..GTDI  000000RG
FD.WRT= 000001   	NB.SMI= 040000   	PP.SEP= 000002   	R$$SEQ= 000000   	...CTL= 000001
F.ERR = ****** GX	N.DID = ****** GX

. ABS.	000000	   000
      	000142	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2575 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[41,10]GETDI,[41,20]GETDI/-SP=[41,30]FCSPRE,GETDI
GETDID 0101MS, GET TASK DEFAULT	MACRO M1108  05-DEC-77 22:12  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
GETDID 0101MS, GET TASK DEFAULT	MACRO M1108  05-DEC-77 22:12  PAGE 7


						.TITLE	GETDID 0101MS, GET TASK DEFAULT DIRECTORY ID
						.IDENT	/0101MS/
      2					;
      3					;                             COPYRIGHT (C) 1975, 1978 BY
      4					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      5					;
      6					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      7					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      8					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      9					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     10					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     11					;
     12					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     13					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     14					;       CORPORATION.
     15					;
     16					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     17					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     18					;
     19					; SHAO-SUN CHIEN	28-JUNE-74
     20					;
     21					;+
     22					; THIS ROUTINE IS USED TO REPLACE THE NORMAL PARSE ROUTINES
     23					; FOR THE SPECIAL CASE OF DEFAULT UIC, PROVIDED THE USER
     24					; TAKES CARE OF THE FILE NAME PORTION OF THE FNB.
     25					; FROM THIS MODULE CONTROL IS TRANSFERRED TO PARDID AND THEN TO
     26					; DIDFND, THUS PROVIDING A SHORT CUT TO THE FULL PARSE AND FIND
     27					; DIRECTORY ID ROUTINES.
     28					;-
     29	000000				.GTDID::.SAVR1
     30	000004	010746 				MOV	PC,-(SP)	;PUSH
     31	000006	062716 	000000C			ADD	#..PDID-.,(SP)	;ENTRY TO PARDID ON THE STACK
     32	000012					CALLR	..GTDI		;JUMP TO GETDI AND RETURN TO CALLER THERE
     33					;
     34					;
     35	000016					$END	GETDID
     36					;
     37		000001 				.END
GETDID 0101MS, GET TASK DEFAULT	MACRO M1108  05-DEC-77 22:12  PAGE 7-1
SYMBOL TABLE

BD.FRE= 000001   	HA.FP = 000002   	N.DRSZ= 000004   	R$$DPB= 000001   	SYDEV = 054523
DIRTYP= 015172   	HA.NAM= 000005   	N.DVPT= 000002   	R$$EIS= 000000   	SYUNIT= 000000
FCSEFN= 000040   	HA.TYP= 000006   	N.DVSZ= 000000   	R$$LCL= 000000   	WI.DLK= 000002
FD.DVR= 000020   	HA.UAT= 000004   	N.FNPT= 000012   	R$$MUL= 000000   	WI.LCK= 000001
FD.EFB= 000004   	HA.UI = 000001   	N.FNSZ= 000010   	R$$OPF= 000000   	.GTDID  000000RG
FD.EF1= 000010   	HA.VER= 000007   	PP.SEP= 000002   	R$$RSL= 000000   	.SAVR1= ****** GX
FD.EOF= 000002   	NB.DOT= 100000   	PP.ZER= 000001   	R$$SEQ= 000000   	..GTDI= ****** GX
FD.WRT= 000001   	NB.SMI= 040000   	R$$ANI= 000000   	R$$SPL= 000000   	..PDID= ****** GX
HA.CHU= 000003   	N.DRPT= 000006   	R$$BBF= 000000   	R$$11M= 000001   	...CTL= 000001

. ABS.	000000	   000
      	000016	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2521 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[41,10]GETDID,[41,20]GETDID/-SP=[41,30]FCSPRE,GETDID
GETDIR 0101MS, GET DIRECTORY ID	MACRO M1108  05-DEC-77 22:12  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
GETDIR 0101MS, GET DIRECTORY ID	MACRO M1108  05-DEC-77 22:12  PAGE 7


						.TITLE	GETDIR 0101MS, GET DIRECTORY ID - USER INTERFACE
						.IDENT	/0101MS/
      2					;
      3					; COPYRIGHT 1973, DIGITAL EQUIPMENT CORP., MAYNARD MASS.
      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					; SHAO-SUN CHIEN	28-JUN-74
     19					;
     20					;+
     21					; GET THE DIRECTORY ID - USER CALLABLE ROUTINE
     22					;
     23					; THE ENTRY POINT TO FIND DIRECTORY ID ROUTINE(DIRFND) IS PUSHED
     24					; ON THE STACK, CONTROL IS THEN TRANSFERRED TO THE
     25					; SECOND HALF OF THIS ROUTINE - GETDI, AND RETURNS TO CALLER THERE.
     26					;
     27					;-
     28	000000				.GTDIR::.SAVR1
     29	000004	010746 				MOV	PC,-(SP)	;PUSH
     30	000006	062716 	000000C			ADD	#..DIRF-.,(SP)	;ENTRY TO DIRFND ON STACK
     31	000012					CALLR	..GTDI		;JUMP TO GETDI
     32					;
     33	000016					$END	GETDIR
     34					;
     35					;
     36		000001 				.END
GETDIR 0101MS, GET DIRECTORY ID	MACRO M1108  05-DEC-77 22:12  PAGE 7-1
SYMBOL TABLE

BD.FRE= 000001   	HA.FP = 000002   	N.DRSZ= 000004   	R$$DPB= 000001   	SYDEV = 054523
DIRTYP= 015172   	HA.NAM= 000005   	N.DVPT= 000002   	R$$EIS= 000000   	SYUNIT= 000000
FCSEFN= 000040   	HA.TYP= 000006   	N.DVSZ= 000000   	R$$LCL= 000000   	WI.DLK= 000002
FD.DVR= 000020   	HA.UAT= 000004   	N.FNPT= 000012   	R$$MUL= 000000   	WI.LCK= 000001
FD.EFB= 000004   	HA.UI = 000001   	N.FNSZ= 000010   	R$$OPF= 000000   	.GTDIR  000000RG
FD.EF1= 000010   	HA.VER= 000007   	PP.SEP= 000002   	R$$RSL= 000000   	.SAVR1= ****** GX
FD.EOF= 000002   	NB.DOT= 100000   	PP.ZER= 000001   	R$$SEQ= 000000   	..DIRF= ****** GX
FD.WRT= 000001   	NB.SMI= 040000   	R$$ANI= 000000   	R$$SPL= 000000   	..GTDI= ****** GX
HA.CHU= 000003   	N.DRPT= 000006   	R$$BBF= 000000   	R$$11M= 000001   	...CTL= 000001

. ABS.	000000	   000
      	000016	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2529 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[41,10]GETDIR,[41,20]GETDIR/-SP=[41,30]FCSPRE,GETDIR
GETSQ 0105MS, FCS GET RECORD RO	MACRO M1108  05-DEC-77 22:11  PAGE 1


      1					;                             COPYRIGHT (C) 1975, 1978 BY
      2					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      3					;
      4					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      5					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      6					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      7					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
      8					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
      9					;
     10					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     11					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     12					;       CORPORATION.
     13					;
     14					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     15					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     16		000001 				R$$SEQ=1		;ASSEMBLE SEQUENTIAL PUT, GET, PGVFY
     17									;PRODUCING .PUTSQ, GETSQ, PGSEQ
GETSQ 0105MS, FCS GET RECORD RO	MACRO M1108  05-DEC-77 22:11  PAGE 2


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
GETSQ 0105MS, FCS GET RECORD RO	MACRO M1108  05-DEC-77 22:11  PAGE 8


						.TITLE	GETSQ 0105MS, FCS GET RECORD ROUTINE
						.IDENT	/0105MS/
      2					; ALTERED MONDAY 10-FEB-75 12:16 BY E. MARISON 16:20
      3					; ALTERED MONDAY 14-JUL-75 13:16 BY E. MARISON
      4					; ALTERED WED 16-JUL-75 13:30 BY E. MARISON
      5					;
      6					;                             COPYRIGHT (C) 1973, 1978 BY
      7					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      8					;
      9					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
     10					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     11					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     12					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     13					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     14					;
     15					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     16					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     17					;       CORPORATION.
     18					;
     19					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     20					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     21
     22					;
     23					; PETER H. LIPMAN 13-JULY-73
     24					;
     25					; SHAO-SUN CHIEN 24-NOV-74
     26					;
     27					;
GETSQ 0105MS, FCS GET RECORD RO	MACRO M1108  05-DEC-77 22:11  PAGE 9


     29					;+
     30					; .GET IS A SUBROUTINE TO READ A LOGICAL RECORD FROM A FILE.
     31					;
     32					; CALLING SEQUENCE:
     33					;	JSR PC,.GET
     34					; INPUTS:
     35					;	R0=FILE DESCRIPTOR BLOCK ADDRESS
     36					; OUTPUTS:
     37					;	F.NRBD+2	= ADDRESS OF RECORD IF IN LOCATE MODE
     38					;	F.NRBD	= SIZE  IN BYTES OF RECORD READ
     39					;	F.ERR	= +1 IN NO ERRORS
     40					;		= -N IF ERROR, WHERE N DESCRIBES WHAT HAPPENED
     41					;	C BIT	= 0 IF NO ERROR
     42					;		= 1 IF ERROR
     43					; OPERATION:
     44					;	ALL PARAMETERS ARE ASSUMED TO BE IN THE FILE DESCRIPTOR BLOCK
     45					; THESE INCLUDE THE ADDRESS AND SIZE OF THE USER'S RECORD BUFFER.
     46					;
     47					;-
     48
     49						.IF	EQ,R$$11M	; RSX-11D ONLY
     50						.IF	GT,R$$RSL	;IF ASSEMBLING FOR RESIDENT LIBRARY
     51						.IF	EQ,R$$SEQ	;AND NOT SEQUENTIAL ONLY
     52					.GETSQ::
     53						.ENDC
     54						.ENDC
     55						.ENDC
     56						.IF	EQ,R$$SEQ
     57					.GET::	.SAVR1			;SAVE REGISTERS R1-R5
     58						CALL	..PGCR		;VERIFY THAT PUT/GET IS LEGAL
     59						.ENDC
     60					;
     61						.IF	GT,R$$SEQ
     62	000000				.GETSQ::.SAVR1
     63	000004					CALL	..PGCS		;VERIFY THAT PUT GET IS LEGAL
     64						.ENDC
     65					;
     66	000010	103463 				BCS	GETX1		;BRANCH IF ILLEGAL
     67	000012	012760 	000001 	000000G		MOV	#1,F.ERR(R0)	;INIT THE ERROR RETURN CODE
     68	000020	132760 	000000G	000000G		BITB	#FD.REC,F.RCTL(R0) ;RECORD ORIENTED?
     69	000026	001455 				BEQ	GTBLK		;BRANCH IF BLOCK ORIENTED
     70					; RECORD ORIENTED DEVICE
     71	000030	132760 	000010 	000000G		BITB	#FD.EF1,F.BKP1(R0) ;DELAYED EOF TO REPORT?
     72	000036	001404 				BEQ	2$		;BRANCH IF NO
     73	000040	112760 	000000G	000000G		MOVB	#IE.EOF,F.ERR(R0) ;REPORT EOF
     74	000046	000442 				BR	GETX		;AND EXIT
     75	000050				2$:	CALL	..RWAT		;READ THE NEXT RECORD
     76	000054	016001 	000000G			MOV	F.BDB(R0),R1
     77	000060	016160 	000002 	000000G		MOV	2(R1),F.NRBD(R0) ;RETURN RECORD SIZE TO USER FROM
     78									;SECOND I/O STATUS WORD
     79	000066	132760 	000000G	000000G		BITB	#FD.PLC,F.RACC(R0) ;MOVE MODE OR PARTIAL LOCATE?
     80	000074	001404 				BEQ	6$		;MOVE MODE, GO MOVE THE RECORD
     81	000076	016060 	000000G	000002G		MOV	F.NREC(R0),F.NRBD+2(R0) ;PARTIAL LOCATE MODE, RETURN
     82									;ADDRESS OF RECORD TO THE USER
     83	000104	000406 				BR	20$		;EXIT THROUGH COMMON EXIT
     84
     85					; MOVE THE RECORD TO THE USER'S RECORD BUFFER
GETSQ 0105MS, FCS GET RECORD RO	MACRO M1108  05-DEC-77 22:11  PAGE 9-1


     86	000106	016001 	000000G		6$:	MOV	F.NREC(R0),R1	;R1=RECORD ADDRESS
     87	000112	016002 	000002G			MOV	F.URBD+2(R0),R2	;R2= DESTINATION ADDRESS
     88	000116					CALL	..MVRU		;MOVE THE RECORD
     89	000122	122760 	000000G	000000G	20$:	CMPB	#IE.EOF,F.ERR(R0) ;END OF FILE TO REPORT?
     90	000130	001011 				BNE	GETX
     91	000132	005760 	000000G			TST	F.NRBD(R0)	;YES, IF THERE IS DATA TOO
     92	000136	001406 				BEQ	GETX
     93	000140	012760 	000001 	000000G		MOV	#1,F.ERR(R0)	;INDICATE A SUCCESSFUL "GET"
     94	000146	152760 	000010 	000000G		BISB	#FD.EF1,F.BKP1(R0) ;AND SET THE DELAYED EOF BIT
     95					;
     96	000154				GETX:	CALL	..FCSX
     97	000160				GETX1:	RETURN
GETSQ 0105MS, FCS GET RECORD RO	MACRO M1108  05-DEC-77 22:11  PAGE 10


     99					; GET THE NEXT RECORD FROM THE BLOCK BUFFER
    100	000162				GTBLK:
    101						.IF	EQ,R$$SEQ
    102						BITB	#FD.RAN,F.RACC(R0) ;RANDOM OR SEQUENTIAL
    103						BEQ	GTBKSQ		;BRANCH IF SEQUENTIAL
    104						CALL	..PSRC		;POSITION FOR THE RECORD
    105						BCS	GETX1		;BRANCH IF ERROR (F.ERR SET)
    106						BR	GTBKS1
    107						.ENDC
    108					;
    109					; SEQUENTIAL GET FROM BLOCK BUFFER
    110	000162				GTBKSQ:	CALL	..EFC1		;CHECK FOR END OF FILE
    111	000166	103774 				BCS	GETX1		;BRANCH IF YES
    112	000170	062760 	000001 	000002G	GTBKS1:	ADD	#1,F.RCNM+2(R0)	;INCREMENT RECORD NUMBER SO THAT NEXT
    113	000176	005560 	000000G			ADC	F.RCNM(R0)	;RANDOM GET WILL GET THE NEXT ONE
    114	000202	016002 	000000G			MOV	F.NREC(R0),R2	;R2 POINTS AT RECORD ABOUT TO BE GOTTEN
    115	000206	020260 	000000G			CMP	R2,F.EOBB(R0)	;IF NEXT RECORD POINTER
    116									;POINTS AT THE END OF THE BLOCK
    117									;BUFFER, THEN THE NEXT RECORD
    118									;BEGINS AT THE START OF THE NEXT
    119									;BLOCK
    120	000212	001005 				BNE	4$		;BRANCH IF THIS IS NOT THE CASE
    121	000214				2$:
    122						.IF	EQ,R$$SEQ
    123						CALL	..RDRN		;READ THE NEXT BLOCK, WRITING THIS ONE
    124									;IF IT HAPPENS TO BE "DIRTY"
    125						.ENDC
    126					;
    127						.IF	GT,R$$SEQ
    128	000214					CALL	READSQ		;READ THE NEXT BLOCK
    129						.ENDC
    130					;
    131	000220	103757 				BCS	GETX1		;BRANCH IF ERROR
    132	000222	016002 	000000G			MOV	F.NREC(R0),R2	;R2=ADDRESS OF NEXT RECORD
    133	000226	016003 	000000G		4$:	MOV	F.RSIZ(R0),R3	;R3=SIZE OF RECORD IF FIXED LENGTH
    134	000232	122760 	000000G	000000G		CMPB	#R.VAR,F.RTYP(R0) ;VARIABLE OR FIXED LENGTH
    135	000240	001005 				BNE	6$		;BRANCH IF FIXED LENGTH
    136						.IF	GT,R$$ANI
    137						BIT	#CH.AND,F.CHR(R0)	;ANSI "D" ?
    138						BEQ	5$
    139						MOV	#4,R4		;4 BYTES TO CONVERT
    140						CLR	R3		;CLEAR ACCUMULATED VALUE
    141					10$:	MOVB	(R2)+,R5	;GET NEXT BYTE
    142						CMPB	#'9,R5	;TOO LARGE ?
    143						BLO	15$	;IF LO YES
    144						CMPB	#'0,R5	;TOO SMALL ?
    145						BHI	15$		;IF HI YES
    146						MUL	#10.,R3	;10.XR3-->R3
    147						SUB	#'0,R5		;SUB. CHARACTER BIAS
    148						ADD	R5,R3		;ACCUMULATE RESULT
    149						SOB	R4,10$
    150						MOV	R2,R1		;R1=ADDR. OF DATA
    151						SUB	#4.,R3		;ADJ. COUNT TO DATA BYTE COUNT
    152						ADD	R3,R2		;R2 NOW POINTS TO NEXT RECORD
    153						BR	17$
    154					;
    155					15$:
GETSQ 0105MS, FCS GET RECORD RO	MACRO M1108  05-DEC-77 22:11  PAGE 10-1


    156						CMPB	#'^,R5		; IS THE CHAR THE PAD CHAR
    157						BEQ	2$		; YES GO READ NEXT BLOCK
    158						MOVB	#IE.NNC,F.ERR(R0) ; NO - NOTE ERROR
    159						BR	GETX		; AND EXIT
    160						.ENDC
    161	000242	012203 			5$:	MOV	(R2)+,R3	;R3=SIZE OF VARIABLE LENGTH RECORDS
    162	000244	002003 				BGE	6$		;BRANCH IF LEGAL BYTE COUNT
    163	000246	005203 				INC	R3		;IF -1, THEN LAST RECORD THIS BLOCK
    164	000250	001761 				BEQ	2$
    165	000252	000505 				BR	50$
    166					;
    167					; AT THIS POINT R2=ADDRESS OF DATA,R3=SIZE OF RECORD
    168					; SEE IF RECORD IS ENTIRELY WITHIN THIS BLOCK BUFFER.
    169	000254	010201 			6$:	MOV	R2,R1		;R1=ADDRESS OF DATA
    170	000256	060302 				ADD	R3,R2		;R2=BEGINNING OF NEXT RECORD
    171	000260	005202 				INC	R2		;ASSUME WORD ALIGNED, ROUND UP TO WRD BDRY
    172	000262	042702 	000001 			BIC	#1,R2
    173	000266	020260 	000000G		17$:	CMP	R2,F.EOBB(R0)	;BEYOND END OF BLOCK BUFFER?
    174	000272	101016 				BHI	20$		;BRANCH IF RECORD CROSSES BLOCK BOUNDARY
    175					; THE RECORD IS CONTAINED IN THIS BLOCK BUFFER.
    176	000274	010360 	000000G			MOV	R3,F.NRBD(R0)	;RETURN SIZE TO USER
    177	000300	002472 				BLT	50$		;BRANCH IF RECORD IS TOO BIG
    178									;(NEEDED FOR FIX LENGTH RECORD PATH)
    179	000302	010260 	000000G			MOV	R2,F.NREC(R0)	;UPDATE NEXT RECORD POINTER
    180	000306	010160 	000002G			MOV	R1,F.NRBD+2(R0)	;RETURN RECORD ADDRESS TO USER
    181									;ASSUMING PARTIAL LOCATE MODE
    182	000312	132760 	000000G	000000G		BITB	#FD.PLC,F.RACC(R0) ;IS IT PARTIAL LOCATE MODE?
    183	000320	001315 			18$:	BNE	GETX		;BRANCH IF YES
    184					;
    185					; IT'S MOVE MODE, MOVE RECORD, WILL SET F.NRBD+2 TO F.URBD+2
    186	000322					CALL	..MVRU		;MOVE RECORD TO USER BUFFER
    187	000326	000712 				BR	GETX
    188					; RECORD CROSSES BLOCK BOUNDARY-R3=SIZE,R1=FIRST BYTE OF RECORD DATA
    189	000330	132760 	000000G	000000G	20$:	BITB	#FD.BLK,F.RATT(R0)
    190	000336	001405 				BEQ	22$		;BRANCH IF RECORDS CAN CROSS BLK BDRY
    191					;
    192					; RECORDS NOT SUPPOSED TO CROSS, BUT IF FIXED LENGTH AND SMALLER
    193					; THAN VIRTUAL BLOCK SIZE, READ NEXT BLOCK
    194	000340	122760 	000000G	000000G		CMPB	#R.FIX,F.RTYP(R0)
    195	000346	001722 				BEQ	2$		;READ NEXT BLOCK
    196	000350	000446 				BR	50$		;INDICATE RECORD TOO BIG
    197	000352	026003 	000000G		22$:	CMP	F.URBD(R0),R3	;IS USER'S RECORD BUFFER BIG ENOUGH?
    198	000356	103443 				BLO	50$		;BRANCH IF RECORD TOO BIG
    199	000360	016002 	000002G			MOV	F.URBD+2(R0),R2	;R2=DESTINATION FOR RECORD
    200	000364	010260 	000002G			MOV	R2,F.NRBD+2(R0)	;TELL USER WHERE HIS RECORD IS
    201	000370	010360 	000000G			MOV	R3,F.NRBD(R0)	;AND HOW BIG IT IS
    202	000374	010346 				MOV	R3,-(SP)	;PUSH TOTAL BYTES TO BE MOVED
    203	000376	016003 	000000G		23$:	MOV	F.EOBB(R0),R3	;END OF BLOCK BUFFER
    204	000402	160103 				SUB	R1,R3		;R3=BYTES REMAINING IN THIS BUFFER
    205	000404	021603 			24$:	CMP	@SP,R3		;MORE BYTES TO MOVE THAN LEFT IN
    206									;BUFFER?
    207	000406	101413 				BLOS	30$		;BRANCH IF NO MOVE LAST PART OF
    208									;RECORD.
    209					; MOVE FIRST OR INTERMEDIATE PIECE OF THE RECORD
    210	000410	160316 				SUB	R3,@SP		;UPDATE BYTES STILL TO BE MOVED
    211	000412					CALL	..MVR1		;MOVE ALL BYTES LEFT IN THIS
    212									;BLOCK.
GETSQ 0105MS, FCS GET RECORD RO	MACRO M1108  05-DEC-77 22:11  PAGE 10-2


    213					; NOW READ THE NEXT BLOCK
    214	000416	010246 				MOV	R2,-(SP)	;POINTS TO NEXT WORD IN USER REC BUFFER
    215					;
    216						.IF	EQ,R$$SEQ
    217						CALL	..RDRN		;READ NEXT BLOCK, WRITE THIS IF DIRTY
    218						.ENDC
    219					;
    220						.IF	GT,R$$SEQ
    221	000420					CALL	READSQ		;READ THE NEXT BLOCK
    222						.ENDC
    223					;
    224	000424	103415 				BCS	40$
    225	000426	012602 				MOV	(SP)+,R2
    226	000430	016001 	000000G			MOV	F.NREC(R0),R1
    227	000434	000760 				BR	23$
    228					; LAST PART OF RECORD
    229	000436	012603 			30$:	MOV	(SP)+,R3	;NO OF BYTES REMAINING IN THE RECORD
    230	000440					CALL	..MVR1		;MOVE THE RECORD
    231	000444	005201 				INC	R1		;R1=NEXT BYTE AFTER LAST BYTE
    232	000446	042701 	000001 			BIC	#1,R1		;MOVED.  ROUND UP TO WORD BDRY
    233	000452	010160 	000000G			MOV	R1,F.NREC(R0)	;AND STORE AS NEXT RECORD POINTER
    234	000456	000720 				BR	18$
    235	000460	062706 	000004 		40$:	ADD	#4,SP		;GET RID OF 2 WORDS ON STACK
    236	000464	000715 				BR	18$		;AND RETURN ERROR
    237
    238					; RECORD TOO BIG - SIGN BIT SET, OR TOO BIG FOR USER BUFFER
    239	000466	112760 	000000G	000000G	50$:	MOVB	#IE.RBG,F.ERR(R0)
    240	000474	000711 				BR	18$
    241					;
    242						.IF	GT,R$$SEQ
    243	000476	132760 	000001 	000000G	READSQ:	BITB	#FD.WRT,F.BKP1(R0) ;IF THIS BLOCK IS DIRTY
    244	000504	001004 				BNE	10$		;THEN ILLEGAL OPERATION
    245	000506					CALL	..RWAT		;READ THE NEXT BLOCK
    246	000512					CALLR	..FCSX
    247	000516				10$:	CALLR	..SQER		;ILLEGAL SEQUENTIAL OPERATION
    248						.ENDC
    249					;
    250					;
    251	000522					$END	GET
    252					;
    253					;
    254		000001 				.END
GETSQ 0105MS, FCS GET RECORD RO	MACRO M1108  05-DEC-77 22:11  PAGE 10-3
SYMBOL TABLE

BD.FRE= 000001   	F.NREC= ****** GX	HA.TYP= 000006   	PP.ZER= 000001   	SYDEV = 054523
DIRTYP= 015172   	F.RACC= ****** GX	HA.UAT= 000004   	READSQ  000476R  	SYUNIT= 000000
FCSEFN= 000040   	F.RATT= ****** GX	HA.UI = 000001   	R$$ANI= 000000   	WI.DLK= 000002
FD.BLK= ****** GX	F.RCNM= ****** GX	HA.VER= 000007   	R$$BBF= 000000   	WI.LCK= 000001
FD.DVR= 000020   	F.RCTL= ****** GX	IE.EOF= ****** GX	R$$DPB= 000001   	$$    = 000067
FD.EFB= 000004   	F.RSIZ= ****** GX	IE.RBG= ****** GX	R$$EIS= 000000   	.GETSQ  000000RG
FD.EF1= 000010   	F.RTYP= ****** GX	NB.DOT= 100000   	R$$LCL= 000000   	.SAVR1= ****** GX
FD.EOF= 000002   	F.URBD= ****** GX	NB.SMI= 040000   	R$$MUL= 000000   	..EFC1= ****** GX
FD.PLC= ****** GX	GETX    000154R  	N.DRPT= 000006   	R$$OPF= 000000   	..FCSX= ****** GX
FD.REC= ****** GX	GETX1   000160R  	N.DRSZ= 000004   	R$$RSL= 000000   	..MVRU= ****** GX
FD.WRT= 000001   	GTBKSQ  000162R  	N.DVPT= 000002   	R$$SEQ= 000001   	..MVR1= ****** GX
F.BDB = ****** GX	GTBKS1  000170R  	N.DVSZ= 000000   	R$$SPL= 000000   	..PGCS= ****** GX
F.BKP1= ****** GX	GTBLK   000162R  	N.FNPT= 000012   	R$$11M= 000001   	..RWAT= ****** GX
F.EOBB= ****** GX	HA.CHU= 000003   	N.FNSZ= 000010   	R.FIX = ****** GX	..SQER= ****** GX
F.ERR = ****** GX	HA.FP = 000002   	PP.SEP= 000002   	R.VAR = ****** GX	...CTL= 000002
F.NRBD= ****** GX	HA.NAM= 000005

. ABS.	000000	   000
      	000522	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2760 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:19
[41,10]GETSQ,[41,20]GETSQ/-SP=[41,30]GPSEQ,FCSPRE,GET
LOAD	MACRO M1108  05-DEC-77 23:42  PAGE 3


      1						.TITLE	LOAD
      2						.IDENT	/05/
      3					                                                                                ;**-1
      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					;                                                                               ;**-7
     20					; VERSION 05
     21					;                                                                               ;**-1
     22					; D.N. CUTLER/C. MONIA 09-JUN-74                                                ;**NEW**
     23					;                                                                               ;**-1
     24					; MANUAL SEGMENT LOADING
     25					;
     26					;+                                                                              ;**-5
     27					; **-$LOAD-LOAD SEGMENT
     28					;
     29					; THIS ROUTINE IS CALLED TO MANUALLY LOAD A NAMED SEGMENT INTO MEMORY.
     30					; IT IS ONE OF THE RUN TIME OVERLAY ROUTINES AND IS CALLED DIRECTLY BY
     31					; THE USER. THE SEGMENT TABLES ARE SEARCHED FOR THE SPECIFIED SEGMENT
     32					; NAME. IF THE NAME IS NOT FOUND A CARRY SET CONDITION IS RETURNED TO
     33					; THE CALLER. ELSE $MARKS IS CALLED TO MARK THE APPROPRIATE SEGMENTS
     34					; OUT OF MEMORY AND $RDSEG IS CALLED TO LOAD THE SEGMENT. BOTH SYN-
     35					; CHRONOUS AND ASYNCHRONOUS REQUESTS ARE SUPPORTED.
     36					;
     37					; INPUTS:
     38					;
     39					;	R0=ADDRESS OF ARGUMENT PARAMETER BLOCK.
     40					;
     41					;	PARAMETER BLOCK FORMAT:
     42					;
     43					;	.BYTE	LENGTH,EVENT FLAG
     44					;	.RAD50	/SEGNAME/
     45					;	.WORD	I/O STATUS
     46					;	.WORD	AST TRAP ADDRESS
     47					;
     48					;	WHERE:
     49					;
     50					;	LENGTH=LENGTH OF THE PARAMETER BLOCK IN WORDS. THE LENGTH MAY BE
     51					;		ANY NUMBER GREATER THAN 3 BUT ONLY THE FIRST FIVE WORDS
     52					;		OF THE PARAMTER BLOCK ARE CONSIDERED.
     53					;	EVENT FLAG=EVENT FLAG NUMBER TO BE USED FOR AN ASYNCHRONOUS LOAD
     54					;		REQUEST. IF NO EVENT FLAG IS SPECIFIED (I.E. ZERO), THEN
     55					;		THE LOAD REQUEST IS CONSIDIERED TO BE SYNCHRONOUS.
     56					;	SEGNAME=RAD50 NAME OF THE SEGMENT TO BE LOADED.
     57					;	I/O STATUS=ADDRESS OF I/O STATUS DOUBLEWORD. STANDARD Q I/O
LOAD	MACRO M1108  05-DEC-77 23:42  PAGE 3-1


     58					;		STATUS CODES APPLY.
     59					;	AST TRAP ADDRESS=ADDRESS OF AST TRAP ROUTINE TO TRAP TO AT THE
     60					;		COMPLETION OF THE LOAD REQUEST. NOTE THAT AN AST TRAP
     61					;		CAN OCCUR ON SYNCHRONOUS LOAD REQUESTS.
     62					;
     63					;	I/O STATUS AND AST TRAP ADDRESS ARE OPTIONAL PARAMETERS AND NEED
     64					;	BE SPECIFIED.
     65					;
     66					; OUTPUTS:
     67					;
     68					;	C=1 IF ILLEGAL PARAMETERS ARE SUPPLIED OR THE LOAD REQUEST IS
     69					;		UNSUCESSFUL.
     70					;	C=0 IF THE REQUEST IS SUCESSFULLY EXECUTED. FOR SYNCHRONOUS RE-
     71					;		QUESTS THIS MEANS THAT THE DESIRED SEGMENT HAS BEEN
     72					;		LOADED AND IS IN MEMORY. FOR ASYNCHRONOUS REQUESTS THIS
     73					;		MEANS THAT THE LOAD REQUEST HAS BEEN SUCESSFULLY EXECU-
     74					;		TED BUT THE SEGMENT IS NOT NECESSARILY IN MEMORY. THE
     75					;		CALLER MUST INSURE THAT LOADING IS COMPLETE BEFORE CALL-
     76					;		ING ANY ROUTINES OR ACCESSING ANY DATA IN THE LOADED
     77					;		SEGMENT.
     78					;	ALL REGISTERS ARE PRESERVED.
     79					;-
     80
     81	000000					.PSECT	$$LOAD
     82	000000	122710 	000003 		$LOAD::	CMPB	#3,(R0)		;ENOUGH PARAMETERS?
     83	000004	000261 				SEC			; ASSUME NO                                     ;**NEW**
     84	000006	003051 				BGT	60$		; IF EQ NO                                      ;**NEW**
     85	000010					SAVRG			; SAVE R3,R4,R5                                 ;**NEW**
     86	000014	010246 				MOV	R2,-(SP)	; SAVE R2                                       ;**NEW**
     87	000016	013702 	000000G			MOV	@#N.OVPT,R2	; GET POINTER TO IMPURE AREA                    ;**NEW**
     88	000022	016202 	000000G			MOV	N.STBL(R2),R2	; GET SEGMENT DESCRIPTOR TABLE ADDRESS          ;**NEW**
     89	000026				10$:				;                                               ;**NEW**
     90	000026	005712 				TST	(R2)		; END OF SEGMENT DESCRIPTOR LIST?               ;**NEW**
     91	000030	000261 				SEC			; ASSUME SEGMENT NOT FOUND                      ;**NEW**
     92	000032	001436 				BEQ	50$		; IF EQ NOT FOUND                               ;**NEW**
     93	000034	026260 	000014 	000002 		CMP	T$RNME(R2),2(R0) ; CHECK SEGMENT NAME                           ;**NEW**
     94	000042	001004 				BNE	20$		; IF NE NOT DESIRED SEGMENT                     ;**NEW**
     95	000044	026260 	000016 	000004 		CMP	T$RNME+2(R2),4(R0) ; CHECK SECOND HALF OF NAME                  ;**NEW**
     96	000052	001403 				BEQ	30$		; IF EQ HAVE REQUESTED SEGMENT                  ;**NEW**
     97	000054				20$:				;                                               ;**NEW**
     98	000054	062702 	000020 			ADD	#S$ZSEG,R2	; POINT TO NEXT DESCRIPTOR                      ;**NEW**
     99	000060	000762 				BR	10$		; GO AGAIN                                      ;**NEW**
    100	000062				30$:				;                                               ;**NEW**
    101	000062	005005 				CLR	R5		; ASSUME NO AST                                 ;**NEW**
    102	000064	005004 				CLR	R4		; ASSUME NO I/O STATUS                          ;**NEW**
    103	000066	121027 	000004 			CMPB	(R0),#4		; TEST FOR I/O STATUS OR AST                    ;**NEW**
    104	000072	103407 				BLO	40$		; IF LO NONE REQUESTED                          ;**NEW**
    105	000074	016004 	000006 			MOV	6(R0),R4	; SET ADDRESS OF I/O STATUS                     ;**NEW**
    106	000100	121027 	000005 			CMPB	(R0),#5		; CHECK FOR AST                                 ;**NEW**
    107	000104	103402 				BLO	40$		; IF LO NO AST SPECIFIED                        ;**NEW**
    108	000106	016005 	000010 			MOV	10(R0),R5	; SET AST ADDRESS                               ;**NEW**
    109	000112				40$:				;                                               ;**NEW**
    110	000112	005003 				CLR	R3		; SET FOR MOVB WITH NO EXTEND                   ;**NEW**
    111	000114	156003 	000001 			BISB	1(R0),R3	; GET EFN                                       ;**NEW**
    112	000120					CALL	$MARKS		; MARK APPROPRIATE SEGMENTS OUT OF MEMORY       ;**NEW**
    113	000124					CALL	$RDSEG		; READ SEGMENT INTO MEMORY                      ;**NEW**
    114	000130				50$:				;                                               ;**NEW**
LOAD	MACRO M1108  05-DEC-77 23:42  PAGE 3-2


    115	000130	012602 				MOV	(SP)+,R2	; RESTORE R2                                    ;**NEW**
    116	000132				60$:				;                                               ;**NEW**
    117	000132					RETURN			;                                               ;**NEW**
    118					                                                                                ;**-63
    119		000001 				.END
LOAD	MACRO M1108  05-DEC-77 23:42  PAGE 3-3
SYMBOL TABLE

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

. ABS.	000172	   000
      	000000	   001
$$LOAD	000134	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1143 WORDS  ( 5 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:10
[46,10]LOAD,[46,20]LOAD/-SP=[46,30]MACFLM.,SEGDF.005,LOAD.005
MKDL 0100MS, MARK FILE FOR DELE	MACRO M1108  05-DEC-77 22:12  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
MKDL 0100MS, MARK FILE FOR DELE	MACRO M1108  05-DEC-77 22:12  PAGE 7


						.TITLE	MKDL 0100MS, MARK FILE FOR DELETE - INTERNAL INTERFACE
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 17-AUG-73
     21					;
     22					;+
     23					; ISSUE THE MARK FILE FOR DELETE QI/O
     24					; CALLING SEQUENCE:
     25					;	CALL	..MKDL
     26					; INPUTS:
     27					;	R0 = FDB
     28					;	R1 = FILE NAME BLOCK
     29					; OUTPUTS:
     30					;	C=0 IF SUCCESSFUL, C=1 IF ERROR, F.ERR(R0) SET
     31					;	R0 PRESERVED, R1-R5 ALTERED
     32					;-
     33	000000				..MKDL::
     34	000000					CALL	..IDPB		;INIT DPB AND SET R5 TO PARAM BLOCK
     35	000004	010115 				MOV	R1,(R5)		;STORE FILE ID ADDRESS
     36	000006	012704 	000000G			MOV	#IO.DEL,R4	;MARK FOR DELETE I/O FUNCTION CODE
     37	000012					CALLR	..QIOW		;ISSUE THE QI/O, WAIT, AND RETURN
     38					;
     39					;
     40	000016					$END	MKDL
     41					;
     42					;
     43		000001 				.END
MKDL 0100MS, MARK FILE FOR DELE	MACRO M1108  05-DEC-77 22:12  PAGE 7-1
SYMBOL TABLE

BD.FRE= 000001   	HA.NAM= 000005   	N.DRSZ= 000004   	R$$DPB= 000001   	SYDEV = 054523
DIRTYP= 015172   	HA.TYP= 000006   	N.DVPT= 000002   	R$$EIS= 000000   	SYUNIT= 000000
FCSEFN= 000040   	HA.UAT= 000004   	N.DVSZ= 000000   	R$$LCL= 000000   	WI.DLK= 000002
FD.DVR= 000020   	HA.UI = 000001   	N.FNPT= 000012   	R$$MUL= 000000   	WI.LCK= 000001
FD.EFB= 000004   	HA.VER= 000007   	N.FNSZ= 000010   	R$$OPF= 000000   	$$    = 000067
FD.EF1= 000010   	IO.DEL= ****** GX	PP.SEP= 000002   	R$$RSL= 000000   	..IDPB= ****** GX
FD.EOF= 000002   	NB.DOT= 100000   	PP.ZER= 000001   	R$$SEQ= 000000   	..MKDL  000000RG
FD.WRT= 000001   	NB.SMI= 040000   	R$$ANI= 000000   	R$$SPL= 000000   	..QIOW= ****** GX
HA.CHU= 000003   	N.DRPT= 000006   	R$$BBF= 000000   	R$$11M= 000001   	...CTL= 000001
HA.FP = 000002

. ABS.	000000	   000
      	000016	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2558 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[41,10]MKDL,[41,20]MKDL/-SP=[41,30]FCSPRE,MKDL
MOVREC 0100MS, MOVE RECORD TO/F	MACRO M1108  05-DEC-77 22:12  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
MOVREC 0100MS, MOVE RECORD TO/F	MACRO M1108  05-DEC-77 22:12  PAGE 7


						.TITLE	MOVREC 0100MS, MOVE RECORD TO/FROM USER BUFFER
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 11-AUG-73
     21					;
MOVREC 0100MS, MOVE RECORD TO/F	MACRO M1108  05-DEC-77 22:12  PAGE 8


     23					;+
     24					; SUBROUTINE TO MOVE A RECORD
     25					; CALLING SEQUENCE
     26					;	CALL	..MVRC
     27					; INPUTS:
     28					;	R0=FDB
     29					;	R1=BYTE ADDR OF SOURCE RECORD
     30					;	R2=BYTE ADDR OF DESTINATION
     31					; OUTPUTS:
     32					;	R1=ADDRESS OF NEXT BYTE NOT MOVED FROM
     33					;	R2=ADDRESS OF NEXT BYTE NOT MOVED TO
     34					;	R0,R5 PRESERVED
     35					;	R3,R4 DESTROYED
     36					;
     37					; OPERATION:
     38					;	THIS ROUTINE MOVES THE DATA A WORD AT A TIME IF NEITHER
     39					; MEMORY ADDRESS IS ODD.  IT WILL HANDLE AN ODD BYTE COUNT IN THIS
     40					; CASE BY MOVING ONE EXTRA BYTE AFTER THE WORD MOVE LOOP.
     41					; IF EITHER ADDRESS IS ODD, THE DATA IS MOVED A BYTE AT A TIME.
     42					; IT WORKS OUT THAT THE CASE OF BOTH ADDRESSES BEING ODD WILL NOT
     43					; OCCUR BECAUSE THE ADDRESS IN THE FCS BUFFER IS ALWAYS EVEN.
     44					;
     45					; ALTERNATE ENTRY POINT 1
     46					;	CALL	..MVR1
     47					; IDENTICAL TO ..MVRC EXCEPT THAT R3=SIZE OF RECORD IN BYTES WHEN CALLED.
     48					;
     49					; ALTERNATE ENTRY POINT 2 - MOVE RECORD TO USER'S RECORD BUFFER
     50					; CALLING SEQUENCE:
     51					;	CALL	..MVRU
     52					; INPUTS:
     53					;	R0=FDB
     54					;	R1=BYTE ADDRESS OF SOURCE RECORD
     55					;	F.URBD+2(R0)=BYTE ADDRESS OF DESTINATIN
     56					;	F.NRBD(R0)=SIZE OF RECORD IN BYTES
     57					; OUTPUTS:
     58					;	SAME AS ..MVRC WITH THE ADDITION THAT
     59					;	F.NRBD+2(R0)=USER RECORD BUFFER ADDRESS
     60					;	ALSO NORMAL RETURN WITH C=0, C=1 MEANS USER BUFFER TOO SMALL
     61					;	F.ERR SET TO INDICATE THAT ERROR
     62					; OPERATION:
     63					;	CHECKS TO SEE IF RECORD WILL FIT IN USER'S RECORD BUFFER.
     64					; FATAL ERROR IF IT WON'T.  THEN IT DOES THE MOVE AS ABOVE.
     65					;-
MOVREC 0100MS, MOVE RECORD TO/F	MACRO M1108  05-DEC-77 22:12  PAGE 9


     67	000000	026060 	000000G	000000G	..MVRU::CMP	F.URBD(R0),F.NRBD(R0) ;ENOUGH ROOM IN USER'S BUFFER?
     68	000006	103410 				BLO	10$		;BRANCH IF NOT ENOUGH ROOM
     69	000010	016002 	000002G			MOV	F.URBD+2(R0),R2	;R2=DESTINATION ADDRESS
     70	000014	010260 	000002G			MOV	R2,F.NRBD+2(R0)	;RETURN ADDRESS OF RECORD TO USER
     71	000020					CALL	..MVRC
     72	000024	000241 				CLC
     73	000026					RETURN
     74	000030	112760 	000000G	000000G	10$:	MOVB	#IE.RBG,F.ERR(R0)
     75	000036	000261 				SEC
     76	000040					RETURN
     77					;
     78					;
     79	000042	016003 	000000G		..MVRC::MOV	F.NRBD(R0),R3	;R3=SIZE OF RECORD IN BYTES
     80					; THIS NEXT INSTRUCTION SETS THE C BIT TO THE LOW ORDER BIT OF THE
     81					; BYTE COUNT.  C MUST BE PRESERVED THROUGHOUT THE REMAINING
     82					; ALGORITHM SO IT CAN BE CHECKED FOR THE FINAL MOVE BYTE INSTRUCTION.
     83					;
     84	000046	006203 			..MVR1::ASR	R3		;R3=WORD COUNT, C=0 OF EVEN, 1 IF ODD
     85	000050	001411 				BEQ	20$		;TAKE CARE OF 0 OR 1  BYTE
     86	000052	100412 				BMI	30$		;NO MOVES IF NEGATIVE
     87	000054	010104 				MOV	R1,R4
     88	000056	050204 				BIS	R2,R4
     89	000060	032704 	000001 			BIT	#1,R4
     90	000064	001006 				BNE	40$		;BRANCH IF EITHER ADDRESS IS ODD
     91	000066	012122 			10$:	MOV	(R1)+,(R2)+	;MOVE A WORD AT A TIME
     92	000070					SOB	R3,10$
     93	000074	103001 			20$:	BCC	30$		;BRANCH IF BYTE COUNT WAS EVEN
     94	000076	112122 				MOVB	(R1)+,(R2)+	;MOVE THE LAST BYTE
     95	000100				30$:	RETURN
     96					;
     97					; HAVE TO MOVE BYTE AT A TIME
     98	000102	112122 			40$:	MOVB	(R1)+,(R2)+
     99	000104	112122 				MOVB	(R1)+,(R2)+
    100	000106					SOB	R3,40$		;REMEMBER R3=WORD COUNT
    101	000112	000770 				BR	20$		;MOVE LAST BYTE IF ODD COUNT
    102					;
    103					;
    104	000114					$END	MOVREC
    105					;
    106					;
    107		000001 				.END
MOVREC 0100MS, MOVE RECORD TO/F	MACRO M1108  05-DEC-77 22:12  PAGE 9-1
SYMBOL TABLE

BD.FRE= 000001   	F.URBD= ****** GX	NB.SMI= 040000   	R$$BBF= 000000   	SYDEV = 054523
DIRTYP= 015172   	HA.CHU= 000003   	N.DRPT= 000006   	R$$DPB= 000001   	SYUNIT= 000000
FCSEFN= 000040   	HA.FP = 000002   	N.DRSZ= 000004   	R$$EIS= 000000   	WI.DLK= 000002
FD.DVR= 000020   	HA.NAM= 000005   	N.DVPT= 000002   	R$$LCL= 000000   	WI.LCK= 000001
FD.EFB= 000004   	HA.TYP= 000006   	N.DVSZ= 000000   	R$$MUL= 000000   	$$    = 000067
FD.EF1= 000010   	HA.UAT= 000004   	N.FNPT= 000012   	R$$OPF= 000000   	..MVRC  000042RG
FD.EOF= 000002   	HA.UI = 000001   	N.FNSZ= 000010   	R$$RSL= 000000   	..MVRU  000000RG
FD.WRT= 000001   	HA.VER= 000007   	PP.SEP= 000002   	R$$SEQ= 000000   	..MVR1  000046RG
F.ERR = ****** GX	IE.RBG= ****** GX	PP.ZER= 000001   	R$$SPL= 000000   	...CTL= 000001
F.NRBD= ****** GX	NB.DOT= 100000   	R$$ANI= 000000   	R$$11M= 000001

. ABS.	000000	   000
      	000114	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2570 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[41,10]MOVREC,[41,20]MOVREC/-SP=[41,30]FCSPRE,MOVREC
MRKDL 0100MS, MARK FOR DELETE -	MACRO M1108  05-DEC-77 22:13  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
MRKDL 0100MS, MARK FOR DELETE -	MACRO M1108  05-DEC-77 22:13  PAGE 7


						.TITLE	MRKDL 0100MS, MARK FOR DELETE - USER INTERFACE
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 1-OCT-73
     21					;
     22					;+
     23					; ISSUE THE MARK FILE FOR DELETE QI/O - USER INTERFACE
     24					;
     25					; CALLING SEQUENCE:
     26					;	CALL	.MRKDL
     27					; INPUTS:
     28					;	R0=FDB ADDRESS
     29					; OUTPUTS:
     30					;	C=0 IF OK, C=1 IF ERROR, F.ERR(R0) SET TO REASON
     31					;	ALL REGISTERS PRESERVED
     32					; OPERATION:
     33					;	FILE MAY BE OPEN OR CLOSED, WILL NOT CLOSE IT IF OPEN
     34					; JUST ISSUES THE MARK FOR DELETE, THE NEXT DEACCESS WILL CAUSE
     35					; THE FILE TO REALLY BE DELETED IF IT WAS OPEN.
     36					;-
     37	000000				.MRKDL::.SAVR1
     38	000004	012760 	000001 	000000G		MOV	#1,F.ERR(R0)
     39	000012	010001 				MOV	R0,R1
     40	000014	062701 	000000G			ADD	#F.FNB,R1
     41	000020	005760 	000000G			TST	F.BDB(R0)	;DON'T TRY ASSLUN IF OPEN
     42	000024	001003 				BNE	20$
     43	000026					CALL	..ALUN
     44	000032	103402 				BCS	60$
     45	000034				20$:	CALL	..MKDL
     46	000040				60$:	RETURN
     47					;
     48					;
     49	000042					$END	MRKDL
     50					;
     51					;
     52		000001 				.END
MRKDL 0100MS, MARK FOR DELETE -	MACRO M1108  05-DEC-77 22:13  PAGE 7-1
SYMBOL TABLE

BD.FRE= 000001   	F.FNB = ****** GX	N.DRPT= 000006   	R$$DPB= 000001   	SYUNIT= 000000
DIRTYP= 015172   	HA.CHU= 000003   	N.DRSZ= 000004   	R$$EIS= 000000   	WI.DLK= 000002
FCSEFN= 000040   	HA.FP = 000002   	N.DVPT= 000002   	R$$LCL= 000000   	WI.LCK= 000001
FD.DVR= 000020   	HA.NAM= 000005   	N.DVSZ= 000000   	R$$MUL= 000000   	$$    = 000067
FD.EFB= 000004   	HA.TYP= 000006   	N.FNPT= 000012   	R$$OPF= 000000   	.MRKDL  000000RG
FD.EF1= 000010   	HA.UAT= 000004   	N.FNSZ= 000010   	R$$RSL= 000000   	.SAVR1= ****** GX
FD.EOF= 000002   	HA.UI = 000001   	PP.SEP= 000002   	R$$SEQ= 000000   	..ALUN= ****** GX
FD.WRT= 000001   	HA.VER= 000007   	PP.ZER= 000001   	R$$SPL= 000000   	..MKDL= ****** GX
F.BDB = ****** GX	NB.DOT= 100000   	R$$ANI= 000000   	R$$11M= 000001   	...CTL= 000001
F.ERR = ****** GX	NB.SMI= 040000   	R$$BBF= 000000   	SYDEV = 054523

. ABS.	000000	   000
      	000042	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2559 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[41,10]MRKDL,[41,20]MRKDL/-SP=[41,30]FCSPRE,MRKDL
.ODCVT	MACRO M1108  05-DEC-77 23:44  PAGE 1


      1						.TITLE	.ODCVT
      2						.IDENT	/X03.01/
      3
      4					;
      5					; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
      6					; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
      7					; COPYRIGHT 1973, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
      8					;
      9					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
     10					; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
     11					;
     12					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
     13					; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     14					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     15					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     16					;
     17					; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     18					; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     19					; EQUIPMENT CORPORATION.
     20					;
     21					;
     22					; VERSION X03-01
     23					;
     24					; WRITTEN BY:
     25					;	A. MAROTTO (CCA)
     26					;
     27					; MODIFIED BY:
     28					;	C.A. D'ELIA	11-FEB-74	001
     29					;	C.A. D'ELIA	02-JUL-75	002
     30					;
     31					;
     32					;	ASCII TO OCTAL/DECIMAL CONVERSION ROUTINE
     33					;
     34	000000					.PSECT	$$RESL
     35
     36					;+
     37					;
     38					; *-* .ODCVT -- CONVERT WITH OCTAL DEFAULT
     39					; *-* .DCCVT -- CONVERT WITH DECIMAL DEFAULT
     40					;
     41					;
     42					;	STRING FORMAT-
     43					;
     44					;	OPTIONAL LEADING + OR -
     45					;	OPTIONAL # (FORCE OCTAL CONVERSION)
     46					;	ASCII DIGITS EITHER OCTAL OR DECIMAL
     47					;	OPTIONAL TRAILING . (FOR DECIMAL CONVERSION)
     48					;
     49					;	CALLING SEQUENCE -
     50					;	R3=ADDR OF RESULT WORD
     51					;	R4=LENGTH OF ASCII STRING
     52					;	R5=ADDR OF ASCII STRING
     53					;
     54					;	ERRORS - C-BIT SET IF ILLEGAL CHARS,NO DIGITS
     55					;		OR RESULT OVERFLOW
     56					;
     57					;-
.ODCVT	MACRO M1108  05-DEC-77 23:44  PAGE 1-1


     58
     59	000000	005013 			.ODCVT::CLR	(R3)		;++001 OCTAL DEFAULT (USE RESULT LOCN)
     60	000002	000402 				BR	CVT0		;++001 SKIP TO COMMON CODE
     61	000004	012713 	000001 		.DCCVT::MOV	#1,(R3)		;++001 DECIMAL DEFAULT
     62	000010	004567 	000000G		CVT0:	JSR	R5,.SAVR1	;++001 SAVE REGISTERS
     63	000014	010046 				MOV	R0,-(SP)	;SAVE R0
     64	000016	010502 				MOV	R5,R2		;SET STRING PTR
     65	000020	060405 				ADD	R4,R5		;ADDR END OF STRING
     66	000022	005001 			CVT2:	CLR	R1		;SET POS NUM SWITCH
     67	000024	121227 	000053 			CMPB	(R2),#'+	;BRANCH IF LEADING +
     68	000030	001404 				BEQ	CVT3
     69	000032	121227 	000055 			CMPB	(R2),#'-	;BRANCH IF NOT LEADING -
     70	000036	001003 				BNE	CVT4
     71	000040	005201 				INC	R1		;SET NEG RESULT SWITCH
     72	000042	005202 			CVT3:	INC	R2		;STEP OVER SIGN
     73	000044	005304 				DEC	R4		;AND DECREASE SCAN COUNT
     74	000046	122712 	000043 		CVT4:	CMPB	#'#,(R2)	;++001 LEADING HASH MARK?
     75	000052	001003 				BNE	10$		;++001 NO, MAKE DECIMAL TEST
     76	000054	005202 				INC	R2		;++001 YES, BYPASS THAT CHARACTER
     77	000056	005313 				DEC	(R3)		;++001 FORCE OCTAL CONVERSION
     78	000060	000404 				BR	15$		;++001 DECR STR LENGTH VIA COMMON CODE
     79	000062	122745 	000056 		10$:	CMPB	#'.,-(R5)	;++001 TRAILING PERIOD?
     80	000066	001002 				BNE	20$		;++001 NO, USE ENTRY POINT DEFAULTS
     81	000070	005213 				INC	(R3)		;++001 YES, FORCE DECIMAL CONVERSION
     82	000072	005304 			15$:	DEC	R4		;++001 DECREMENT STRING LENGTH
     83	000074	012705 	000007 		20$:	MOV	#7,R5		;++001 ASSUME OCTAL CONVERSION
     84	000100	011346 				MOV	(R3),-(SP)	;++001 PUT CONVERSION FLAG ON STACK
     85	000102	003401 				BLE	30$		;++001 SKIP IF OCTAL DESIRED
     86	000104	122525 				CMPB	(R5)+,(R5)+	;++001 UPGRADE CONVERSION TO DECIMAL
     87	000106	005013 			30$:	CLR	(R3)		;++001 CLEAR RESULT LOCATION
     88	000110	005704 				TST	R4		;++001 ERROR IF NULL STRING
     89	000112	003436 				BLE	CVTERR		;++001
     90	000114	112200 			CVT5:	MOVB	(R2)+,R0	;GET DIGIT
     91	000116	162700 	000060 			SUB	#60,R0
     92	000122	100432 				BMI	CVTERR		;ERROR IF LOWER THAN 0
     93	000124	020005 				CMP	R0,R5		;OR HIGHER THAN 7(OR 9)
     94	000126	101030 				BHI	CVTERR
     95	000130	006313 				ASL	(R3)		;MULTIPLY PREVIOUS RESULT
     96	000132	103426 				BCS	CVTERR		;++002 BY 8(OR 10)
     97	000134	005716 				TST	(SP)		;AND ADD IN NEW DIGIT
     98	000136	003402 				BLE	CVT6		;++001 SKIP IF OCTAL CONVERSION
     99	000140	061300 				ADD	(R3),R0
    100	000142	103422 				BCS	CVTERR		;++002
    101	000144	006313 			CVT6:	ASL	(R3)
    102	000146	103420 				BCS	CVTERR		;++002
    103	000150	006313 				ASL	(R3)
    104	000152	103416 				BCS	CVTERR		;++002
    105	000154	060013 				ADD	R0,(R3)
    106	000156	103414 				BCS	CVTERR		;++002
    107	000160	100002 				BPL	10$		;++002 BRANCH IF NO SIGN CHANGE
    108	000162	005716 				TST	(SP)		;++002 ELSE, CHECK CONVERSION MODE
    109	000164	003011 				BGT	CVTERR		;++002 ERROR IF DECIMAL OVERFLOW
    110	000166	005304 			10$:	DEC	R4		;++002 BRANCH IF MORE DIGITS
    111	000170	001351 				BNE	CVT5
    112	000172	005701 				TST	R1		;BRANCH IF POS NUM
    113	000174	001401 				BEQ	CVTXIT
    114	000176	005413 				NEG	(R3)		;NEGATE NUM
.ODCVT	MACRO M1108  05-DEC-77 23:44  PAGE 1-2


    115	000200	000241 			CVTXIT:	CLC			;SET NO ERROR
    116	000202	012600 			CXT:	MOV	(SP)+,R0	;++001 POP CONVERSION FLAG (C-BIT SAFE)
    117	000204	012600 				MOV	(SP)+,R0	;++001 RESTORE R0
    118	000206	000207 				RTS	PC		;EXIT
    119					;
    120	000210				CVTERR:				;++001
    121	000210	000261 				SEC			;SET ERROR
    122	000212	000773 				BR	CXT
    123					;
    124		000001 				.END
.ODCVT	MACRO M1108  05-DEC-77 23:44  PAGE 1-3
SYMBOL TABLE

CVTERR  000210R     002	CVT2    000022R     002	CVT5    000114R     002	CXT     000202R     002	.ODCVT  000000RG    002
CVTXIT  000200R     002	CVT3    000042R     002	CVT6    000144R     002	.DCCVT  000004RG    002	.SAVR1= ****** GX
CVT0    000010R     002	CVT4    000046R     002

. ABS.	000000	   000
      	000000	   001
$$RESL	000214	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  125 WORDS  ( 1 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:04
[46,10]ODCVT,[46,20]ODCVT/-SP=[46,30]ODCVT
OD2CT - CONVERT FROM ASCII TO T	MACRO M1108  05-DEC-77 23:46  PAGE 1


      1						.TITLE	OD2CT - CONVERT FROM ASCII TO TWO BINARY WORDS
      2
      3						.IDENT	"V0002"
      4					;
      5					;
      6					; COPYRIGHT (C)   1975,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					; COPYRIGHT (C)   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
     22					;
     23					; ANDREW C. GOLDSTEIN  10 JUL 1974
     24					;
     25						.MCALL	RETURN
     26
     27					.MACRO	SAVR1
     28						JSR	R5,.SAVR1
     29					.ENDM	SAVR1
OD2CT - CONVERT FROM ASCII TO T	MACRO M1108  05-DEC-77 23:46  PAGE 2


     31					;+
     32					;
     33					; *** - .DD2CT	CONVERT A DECIMAL NUMBER TO TWO BINARY WORDS.
     34					;		THIS SUBROUTINE CONVERTS AN ASCII DECIMAL NUMBER STRING
     35					;		TO A DOUBLE LENGTH BINARY NUMBER. A TRAILING DECIMAL
     36					;		POINT IS PERMITTED.
     37					;
     38					; *** - .OD2CT	CONVERT AN OCTAL OR DECIMAL NUMBER TO TWO BINARY WORDS.
     39					;		THIS SUBROUTINE CONVERTS AN ASCII OCTAL OR DECIMAL
     40					;		NUMBER STRING TO A DOUBLE LENGTH BINARY NUMBER. RADIX
     41					;		IS CONTROLLED BY THE PRESENCE OR ABSENCE OF A TRAILING
     42					;		DECIMAL POINT.
     43					;
     44					;	BOTH ENTRIES ACCEPT A LEADING "+" OR "-" AND PRODUCE A TWO'S
     45					;	COMPLEMENT NEGATIVE FOR THE LATTER.
     46					;
     47					; INPUT:
     48					;	R3 - ADDRESS OF TWO WORD FIELD TO HOLD CONVERTED NUMBER
     49					;		WORD 1 - HIGH ORDER 16 BITS
     50					;		WORD 2 - LOW ORDER 16 BITS
     51					;	R4 - CHARACTER COUNT OF STRING
     52					;	R5 - ADDRESS OF STRING
     53					;
     54					; OUTPUT:
     55					;
     56					;	CC-C
     57					;	     CLEAR - SUCCESSFUL CONVERSION
     58					;	     SET   - ILLEGAL CHARACTERS IN STRING
     59					;
     60					; ALL REGISTERS ARE PRESERVED
     61					;
     62					;-
     63
     64						.ENABL	LSB
     65
     66	000000				.DD2CT::SAVR1			; SAVE REGISTERS
     67	000004	012701 	000012 			MOV	#10.,R1		; SET UP FOR DECIMAL RADIX ONLY
     68	000010	000404 				BR	10$
     69
     70	000012				.OD2CT::SAVR1			; SAVE REGISTERS
     71	000016	012701 	000010 			MOV	#8.,R1		; SET UP FOR OCTAL RADIX
     72
     73	000022	010502 			10$:	MOV	R5,R2		; COPY THE STRING POINTER
     74	000024	060402 				ADD	R4,R2		; POINT TO END OF STRING
     75	000026	124227 	000056 			CMPB	-(R2),#'.	; LOOK FOR TRAILING DECIMAL POINT
     76	000032	001003 				BNE	20$		; NO
     77	000034	012701 	000012 			MOV	#10.,R1		; YES - SET DECIMAL
     78	000040	005304 				DEC	R4		; REMOVE "." FROM STRING
     79
     80	000042	005046 			20$:	CLR	-(SP)		; CLEAR NEGATIVE FLAG
     81	000044	121527 	000053 			CMPB	(R5),#'+	; LOOK FOR LEADING "+"
     82	000050	001404 				BEQ	30$		; YES
     83	000052	121527 	000055 			CMPB	(R5),#'-	; LOOK FOR LEADING "-"
     84	000056	001003 				BNE	40$		; NO
     85	000060	005216 				INC	(SP)		; YES - SET NEGATIVE
     86	000062	005205 			30$:	INC	R5		; EITHER - DISPOSE OF CHARACTER
     87	000064	005304 				DEC	R4
OD2CT - CONVERT FROM ASCII TO T	MACRO M1108  05-DEC-77 23:46  PAGE 2-1


     88
     89	000066	005023 			40$:	CLR	(R3)+		; ZERO HIGH ORDER 16 BITS
     90	000070	005013 				CLR	(R3)		; ZERO LOW ORDER 16 BITS
     91
     92	000072	112502 			50$:	MOVB	(R5)+,R2	; GET NEXT CHARACTER
     93	000074	162702 	000060 			SUB	#'0,R2		; CONVERT DIGIT TO VALUE
     94	000100	103440 				BLO	90$		; NOT A LEGAL DIGIT CHARACTER
     95
     96	000102	020201 				CMP	R2,R1		; LAST CHANCE TO BE IN RANGE
     97	000104	103036 				BHIS	90$		; DEFINITELY NOT LEGAL
     98	000106	006313 				ASL	(R3)		; MULTIPLY CURRENT BINARY NUMBER BY 2
     99	000110	006143 				ROL	-(R3)		; USE FULL 32 BIT ACCURACY
    100	000112	012346 				MOV	(R3)+,-(SP)	; SAVE HIGH ORDER BITS
    101	000114	011346 				MOV	(R3),-(SP)	; SAVE LOW ORDER BITS
    102	000116	006313 				ASL	(R3)		; MULTIPLY AGAIN BY 2
    103	000120	006143 				ROL	-(R3)		; KEEP THOSE BITS MOVING
    104	000122	006363 	000002 			ASL	2(R3)		; MAKE TOTAL MULTIPLICATION BY 8
    105	000126	006123 				ROL	(R3)+		; NOW HAVE (NEW NUMBER) = (OLD NUMBER)*8
    106
    107	000130	020127 	000012 			CMP	R1,#10.		; CHECK WHAT RADIX WE'RE IN
    108	000134	001402 				BEQ	60$		; EQUAL IF DECIMAL
    109	000136	022626 				CMP	(SP)+,(SP)+	; OCTAL - THROW AWAY (OLD NUMBER)*2
    110	000140	000403 				BR	70$
    111
    112	000142	062613 			60$:	ADD	(SP)+,(R3)	; ADD BACK (OLD NUMBER)*2
    113	000144	005543 				ADC	-(R3)		; ADD ANY OVERFLOW TO HIGH ORDER
    114	000146	062623 				ADD	(SP)+,(R3)+	; NOW HAVE (NEW NUMBER) = (OLD NUMBER)*10
    115
    116	000150	060213 			70$:	ADD	R2,(R3)		; ADD THIS DIGIT TO MAKE NEW TOTAL
    117	000152	005563 	177776 			ADC	-2(R3)		; MAKE SURE OVERFLOW IS CONSIDERED
    118	000156	005304 				DEC	R4		; COUNT CHARACTERS
    119	000160	001344 				BNE	50$		; GO GET NEXT DIGIT
    120
    121	000162	005726 				TST	(SP)+		; CHECK NEGATIVE FLAG
    122	000164	001405 				BEQ	80$		; POSITIVE
    123	000166	005443 				NEG	-(R3)		; COMPLEMENT HIGH ORDER
    124	000170	005463 	000002 			NEG	2(R3)		; COMPLEMENT LOW ORDER
    125	000174	005613 				SBC	(R3)		; AND PROPAGATE THE CARRY
    126	000176	000257 				CCC			; SET SUCCESS
    127	000200				80$:	RETURN
    128
    129					; TO HERE ON AN ILLEGAL CHARACTER
    130
    131	000202	005726 			90$:	TST	(SP)+		; CLEAN THE STACK
    132	000204	000261 				SEC			; SET THE CARRY
    133	000206					RETURN
    134
    135						.DSABL	LSB
    136
    137		000001 				.END
OD2CT - CONVERT FROM ASCII TO T	MACRO M1108  05-DEC-77 23:46  PAGE 2-2
SYMBOL TABLE

.DD2CT  000000RG 	.OD2CT  000012RG 	.SAVR1= ****** GX

. ABS.	000000	   000
      	000210	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  171 WORDS  ( 1 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:05
[46,10]OD2CT,[46,20]OD2CT/-SP=[46,30]OD2CT
OPEN 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
OPEN 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 7


						.TITLE	OPEN 0106S, OPEN FILE ROUTINE
						.IDENT	/0106S/
      2					; ALTERED THURSDAY 3-OCT-74 13:10
      3					;
      4					;                             COPYRIGHT (C) 1975, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 13-JULY-73
     21					;
     22					;+
     23					; OPEN A FILE
     24					; CALLING SEQUENCE:
     25					;	CALL	.OPEN
     26					; INPUTS:
     27					;	R0=FDB
     28					; OUTPUTS:
     29					;	ALL REGISTERS PRESERVED
     30					;	C=0 IF SUCCESSFULL, C=1 IF FAILED TO OPEN, F.ERR SET TO WHY
     31					;	FDB SET UP
     32					; OPERATION:
     33					;	USES THE GET INFORMATION PER LUN DIRECTIVE TO GET THE
     34					; DEVICE NAME AND UNIT NUMBER AND SET UP THE BLOCK SIZE AND
     35					; DEVICE DEPENDENT BITS IN F.RCTL.  INITIALIZES SOME OF THE FDB, AND
     36					; THEN DOES EITHER A PARSE, FIND SEQUENCE ON AN EXISTING FILE OR
     37					; A PARSE, ENTER SEQUENCE ON A NEW FILE.  FOR AN EXISTING
     38					; FILE IF THE FILE NAME STRING HAS LENGTH -1 THEN THE PARSE, FIND
     39					; SEQUENCE IS SKIPPED AND THE FILE NAME BLOCK PORTION OF THE FDB
     40					; IS ASSUMED TO BE SET UP.  FINALLY THE BLOCK BUFFER IS ALLOCATED,
     41					; THE REST OF THE FDB INITIALIZED, AND THE FILE ACCESSED.
     42					;-
OPEN 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 8


     44						.IF	EQ,R$$OPF	;NORMAL OPEN
     45	000000				.OPEN::
     46						.ENDC
     47					;
     48						.IF	EQ,R$$OPF-1	;OPEN BY FILE NAME BLOCK
     49					.OPFNB::
     50						.ENDC
     51					;
     52						.IF	EQ,R$$OPF-2	;OPEN BY FILE ID
     53					.OPFID::
     54						.ENDC
     55					;
     56	000000					.SAVR1			;SAVE REGISTERS R1-R5
     57	000004	013701 	000000G			MOV	@#.FSRPT,R1	;SEE IF ALLOC CONTROL BLOCK HAS BEEN INITED
     58	000010	005761 	000000G			TST	A.OWUI(R1)	;UIC WORD SHOULD BE NON ZERO
     59	000014	001002 				BNE	10$		;BRANCH IF IT IS
     60	000016					CALL	..FINI		;INIT THE FILE SYSTEM
     61	000022	005760 	000000G		10$:	TST	F.BDB(R0)	;IS THE FILE ALREADY OPEN?
     62	000026	001402 				BEQ	20$		;BRANCH IF NO
     63	000030	000167 	000660 			JMP	BADOPN		;ALREADY OPEN - ERROR
     64	000034	132760 	000000C	000000G	20$:	BITB	#^C<FD.RWM!FD.RAN!FD.PLC!FD.INS>,F.RACC(R0)
     65	000042	001402 				BEQ	24$		;BRANCH IF LEGAL
     66	000044	000167 	000742 			JMP	BADRAC		;ILLEGAL RECORD ACCESS BITS
     67	000050	132760 	000000G	000000G	24$:	BITB	#FA.CRE,F.FACC(R0) ;IF CREATING NEW FILE
     68	000056	001426 				BEQ	40$
     69	000060	132760 	000000C	000000G		BITB	#^C<FD.FTN!FD.CR!FD.BLK>,F.RATT(R0)
     70	000066	001402 				BEQ	26$		;BRANCH IF OK
     71	000070	000167 	000726 			JMP	BADRAT		;ILLEGAL RECORD ATTRIBUTES
     72	000074	132760 	000000G	000000G	26$:	BITB	#FD.RWM,F.RACC(R0) ;IF READ/WRITE MODE
     73	000102	001014 				BNE	40$		;IGNORE RECORD TYPE
     74	000104	122760 	000000G	000000G		CMPB	#R.FIX,F.RTYP(R0) ;CHECK RECORD TYPE
     75	000112	001410 				BEQ	40$		;BRANCH IF LEGAL
     76	000114	122760 	000000G	000000G		CMPB	#R.VAR,F.RTYP(R0) ;VARIABLE LENGTH RECORDS?
     77	000122	001402 				BEQ	30$		;BRANCH IF YES
     78	000124	000167 	000652 			JMP	BADTYP		;ILLEGAL RECORD TYPE
     79	000130	005060 	000000G		30$:	CLR	F.RSIZ(R0)	;VARIABLE LENGTH SIZE INIT TO ZERO
     80	000134	012760 	000001 	000000G	40$:	MOV	#1,F.ERR(R0)	;INIT ERROR INDICATION TO SUCCESSFUL
     81	000142	005060 	000000G			CLR	F.HIBK(R0)	;INIT LAST BLOCK ALLOCATED
     82	000146	005060 	000002G			CLR	F.HIBK+2(R0)
     83	000152	005060 	000000G			CLR	F.EFBK(R0)	;INIT THE END OF FILE BLOCK NO.
     84	000156	012760 	000001 	000002G		MOV	#1,F.EFBK+2(R0)
     85	000164	005060 	000000G			CLR	F.FFBY(R0)	;ZERO THE FIRST FREE BYTE POINTER
     86	000170	005060 	000000G			CLR	F.VBN(R0)	;ZERO THE INITIAL VBN
     87	000174	005060 	000002G			CLR	F.VBN+2(R0)
     88	000200	105060 	000000G			CLRB	F.BKP1(R0)
     89	000204				OPDIR:
     90						.IF	EQ,R$$OPF	;REGULAR OPEN (BY FILE NAME)
     91	000204					CALL	..STFN		;PARSE INTO FNB UNLESS ALREADY SET UP
     92						.ENDC
     93					;
     94						.IF	EQ,R$$OPF-1	;OPEN BY FILE NAME BLOCK
     95						MOV	R0,R1
     96						ADD	#F.FNB,R1	;R1=ADDR OF FNB
     97						CALL	..ALUN
     98						.ENDC
     99					;
    100						.IF	LE,R$$OPF-1 ;OPEN BY NAME OR FNB
OPEN 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 8-1


    101	000210	103435 				BCS	26$
    102	000212					CALL	OVBFSZ		;USE OVERIDE BUFFER SIZE IF SPECIFIED
    103	000216	005761 	000000G			TST	N.FID(R1)	;IS FILE ID ALREADY SET?
    104	000222	001133 				BNE	80$		;BRANCH IF YES
    105	000224	132760 	000000G	000000G		BITB	#FA.CRE,F.FACC(R0) ;CREATING A NEW FILE?
    106	000232	001004 				BNE	20$		;BRANCH IF YES
    107					; OPENING AN EXISTING FILE
    108	000234					CALL	..FIND
    109	000240	103421 				BCS	26$
    110	000242	000523 				BR	80$
    111
    112					; OPENING A NEW FILE
    113	000244	132760 	000000G	000000G	20$:	BITB	#FD.SQD,F.RCTL(R0) ;IF SEQUENTIAL DEVICE
    114	000252	001435 				BEQ	40$
    115	000254	122760 	000000G	000000G		CMPB	#R.FIX,F.RTYP(R0) ;AND FIXED LENGTH RECORDS
    116	000262	001026 				BNE	38$
    117	000264	016003 	000000G			MOV	F.RSIZ(R0),R3	;CHECK RECORD SIZE
    118					;
    119					; REMOVE THE LOWER BOUNDS CHECK WHEN FCP ENFORCES IT
    120	000270	020327 	000022 			CMP	R3,#18.
    121	000274	103005 				BHIS	30$		;BRANCH IF SIZE IS OK
    122	000276	112760 	000000G	000000G	25$:	MOVB	#IE.RBG,F.ERR(R0)
    123	000304	000167 	000376 		26$:	JMP	BADOP2
    124					;
    125					; CALCULATE NEW BLOCK SIZE. INTEGER MULTIPLE OF RECORD SIZE
    126						.IF	GT,R$$EIS
    127					30$:	CLR	R4
    128						MOV	F.BBFS(R0),R5
    129						DIV	R3,R4		;R4=RECORDS / BLOCK
    130						BNE	35$
    131						INC	R4		;AT LEAST 1
    132					35$:	MUL	R3,R4
    133						.IFF
    134	000310	005005 			30$:	CLR	R5		;START AT 0
    135	000312	060305 			35$:	ADD	R3,R5		;NOW ADD IN RECORD SIZE
    136	000314	020560 	000000G			CMP	R5,F.BBFS(R0)	;OVER LIMIT?
    137	000320	103774 				BLO	35$		;NOPE
    138	000322	160305 				SUB	R3,R5		;YES, SO CORRECT DOWN
    139	000324	001001 				BNE	36$		;NON-ZERO
    140	000326	010305 				MOV	R3,R5		;MAKE AT LEAST 1
    141	000330				36$:
    142						.ENDC
    143	000330	010560 	000000G			MOV	R5,F.VBSZ(R0)
    144	000334	010560 	000000G			MOV	R5,F.BBFS(R0)	;STORE NEW BLOCK SIZE
    145	000340	016060 	000000G	000000G	38$:	MOV	F.BBFS(R0),F.FFBY(R0) ;MAKE BLOCK SIZE AVAILABLE TO FCP
    146					;
    147					; ISSUE THE QI/O TO CREATE THE NEW FILE
    148	000346				40$:	CALL	..CREA		;CREATE THE NEW FILE
    149	000352	103754 				BCS	26$
    150	000354	132760 	000000G	000000G		BITB	#FA.TMP,F.FACC(R0) ;IF CREATING TEMP FILE
    151	000362	001053 				BNE	80$		;SKIP THE ENTER
    152	000364	005760 	000000G			TST	F.FVER(R0)
    153	000370	001003 				BNE	45$
    154	000372	152760 	000020 	000000G		BISB	#FD.DVR,F.BKP1(R0) ;CREATING DEFAULT VERSION NUMBER
    155	000400				45$:	CALL	..ENTR		;MAKE THE DIRECTORY ENTRY
    156	000404	103042 				BCC	80$		;BRANCH IF NO ERROR FROM ..ENTR
    157					; IF THE ENTER ERROR WAS THAT FILE ALREADY EXISTS BY THAT NAME, THEN DELETE IT
OPEN 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 8-2


    158	000406	132760 	000000G	000000G		BITB	#FA.NSP,F.FACC(R0) ;SUPERSEDE INHIBITED?
    159	000414	001033 				BNE	60$		;BRANCH IF YES,INDICATE OPEN FAILURE
    160	000416	122760 	000000G	000000G		CMPB	#IE.DUP,F.ERR(R0)
    161	000424	001027 				BNE	60$		;OTHER KIND OF ERROR, REAL ERROR
    162	000426	012760 	000001 	000000G		MOV	#1,F.ERR(R0)	;RESET THE ERROR CONDITION
    163	000434	016146 	000000G			MOV	N.FID(R1),-(SP)	;SAVE THE FILE ID FROM THE DELETE
    164	000440	016146 	000002G			MOV	N.FID+2(R1),-(SP)
    165	000444	016146 	000004G			MOV	N.FID+4(R1),-(SP)
    166	000450	010146 				MOV	R1,-(SP)	;PRESERVE FNB ADDRESS FROM DELETE
    167	000452					CALL	..DEL1
    168	000456	012601 				MOV	(SP)+,R1
    169	000460	012661 	000004G			MOV	(SP)+,N.FID+4(R1)
    170	000464	012661 	000002G			MOV	(SP)+,N.FID+2(R1)
    171	000470	012661 	000000G			MOV	(SP)+,N.FID(R1)
    172	000474	103403 				BCS	60$		;BRANCH IF DELETE FAILED
    173	000476					CALL	..ENTR		;REISSUE THE ..ENTR, NOW IT SHOULD WORK
    174	000502	103003 				BCC	80$		;BRANCH IF OK
    175	000504	005002 			60$:	CLR	R2		;DON'T DO A REMOVE WHEN CLEANING UP
    176	000506	000167 	000234 			JMP	BADOP4		;SOME OTHER ERROR THIS TIME
    177						.ENDC
    178					;
    179						.IF	EQ,R$$OPF-2	;OPEN BY FILE ID
    180						MOV	R0,R1
    181						ADD	#F.FNB,R1
    182						CALL	..ALUN
    183						BCS	BADOP2
    184						CALL	OVBFSZ		;USE OVERRIDE BUF SIZE IF SPECIFIED
    185						TST	N.FID(R1)	;FILE ID MUST BE NON ZERO
    186						BNE	75$
    187						BITB	#FD.REC,F.RCTL(R0) ;UNLESS RECORD DEVICE
    188						BEQ	NOFID
    189						INC	N.FID(R1)	;IN WHICH CASE MAKE IT 1
    190					75$:
    191						.ENDC
    192					;
    193	000512				80$:
OPEN 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 9


    195	000512	132760 	000000G	000000G	OPALOC:	BITB	#FD.RWM,F.RACC(R0) ;READ/WRITE MODE?
    196	000520	001407 				BEQ	10$		;BRANCH IF PUT/GET MODE
    197					; PUT ADDRESS OF SCRATCH I/O STATUS BLOCK IN F.BDB
    198	000522	013760 	000000G	000000G		MOV	@#.FSRPT,F.BDB(R0)
    199	000530	062760 	000000G	000000G		ADD	#A.IOST,F.BDB(R0)
    200	000536	000420 				BR	60$
    201					;
    202					; ALLOCATE BLOCK BUFFER
    203	000540				10$:
    204						.IF	EQ,R$$MBF	;IF NO MULTIPLE BUFFERING
    205	000540	016001 	000000G			MOV	F.BBFS(R0),R1	;R1=BLOCK SIZE FOR THIS DEVICE
    206	000544	010046 				MOV	R0,-(SP)	;SAVE THE FDB ADDRESS
    207	000546	013700 	000000G			MOV	@#.FSRPT,R0	;ALLOCATION CONTROL BLOCK FOR FSR
    208	000552	062701 	000000G			ADD	#S.BFHD,R1	;ADD IN BUFFER HEADER
    209	000556					CALL	$RQCB		;REQUEST A CORE BLOCK
    210	000562	010001 				MOV	R0,R1		;ADDRESS ALLOCATED TO R1
    211	000564	012600 				MOV	(SP)+,R0	;RESTORE FDB FROM STACK
    212	000566	103457 				BCS	NOBUF		;BRANCH IF NO BUFFER SPACE
    213	000570	010160 	000000G			MOV	R1,F.BDB(R0)	;SET UP BUFFER DESCRIPTOR BLOCK POINTER
    214	000574	010161 	000000G			MOV	R1,B.NXBD(R1)	;CHAIN BUFFER TO ITSELF
    215						.ENDC
    216					;
    217						.IF	GT,R$$MBF	;IF MULTIPLE BUFFERING
    218					; ALLOCATE NUMBER OF BUFFERS SPECIFIED IN F.MBCT, AND
    219					; SET UP THE BUFFER RING
    220						MOV	R0,R4		;PRESERVE THE FDB ADDRESS
    221						CLR	R3		;NO BUFFERS ALLOCATED YET
    222						CLR	R5
    223						BISB	F.MBCT(R0),R5	;R5=NO. OF BUFFERS DESIRED
    224						BNE	20$
    225						MOV	@#.FSRPT,R5
    226						MOVB	A.DFBC(R5),R5	;USE DEFAULT NO. OF BUFFERS FROM FSR2
    227					20$:	CLRB	F.MBC1(R0)
    228						CMP	#1,R5		;IF SINGLE BUFFERING
    229						BGE	23$		;DON'T SET READ AHEAD, WRITE BEHIND
    230						BITB	#FD.RAH!FD.WBH,F.MBFG(R0) ;IF USER SET THESE
    231						BNE	23$		;DON'T CHANGE THEM
    232						MOV	#FD.RAH,R1	;DEFAULT TO READ AHEAD IF READ ONLY
    233						BITB	#FA.RD,F.FACC(R0)
    234						BNE	22$
    235						MOV	#FD.WBH,R1	;OTHERWISE USE WRITE BEHIND
    236					22$:	BISB	R1,F.MBFG(R0)
    237					23$:	MOV	@#.FSRPT,R0	;POINTER TO ALOOCATION CONTROL BLOCK
    238						MOV	F.BBFS(R4),R1
    239						ADD	#S.BFHD,R1	;R1=NO. OF BYTES TO ALLOCATES
    240						CALL	$RQCB		;REQUEST A CORE BLOCK
    241						BCS	58$		;BRANCH IF NO MORE MEMORY AVAILABLE
    242						TST	R3		;FIRST BUFFER?
    243						BNE	35$		;BRANCH IF NO
    244						MOV	R0,F.BDB(R4)	;YES, SET UP  F.BDB
    245						BR	47$
    246					35$:	MOV	R0,B.NXBD(R3)	;LINK THE BUFFERS
    247					47$:	MOV	R0,R3
    248						MOV	#1,@R3		;INIT THE BUFFER DESCRIPTOR
    249						MOVB	#BD.FRE,B.BFST(R3) ;NOTE BUFFER AVAILABLE
    250						INCB	F.MBC1(R4)	;COUNT THE BUFFERS ALLOCATED
    251						SOB	R5,23$		;ALLOCATE THE NEXT ONE
OPEN 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 9-1


    252					58$:	MOV	R4,R0		;RESTORE FDB ADDRESS
    253						TST	R3		;ANY BUFFERS ALLOCATED?
    254						BEQ	NOBUF		;BRANCH IF NO
    255						MOV	F.BDB(R0),B.NXBD(R3) ;CLOSE THE BUF RING
    256						.ENDC
    257					;
    258	000600				60$:	CALL	ACCESS
    259	000604	103453 				BCS	BADOP3
    260	000606	005060 	000000G			CLR	F.RCNM(R0)	;DON'T INIT BEFORE ACCESS
    261	000612	012760 	000001 	000002G		MOV	#1,F.RCNM+2(R0)	;INIT RECORD NUMBER TO 1
    262					;
    263					; SET UP NRBA AND NRBS BASED ON PARTIAL LOCATE MODE OR MOVE MODE
    264	000620	132760 	000000G	000000G		BITB	#FD.RWM,F.RACC(R0) ;READ/WRITE MODE?
    265	000626	001025 				BNE	80$		;BRANCH IF YES
    266	000630	016060 	000000G	000000G		MOV	F.URBD(R0),F.NRBD(R0) ;ASSUME MOVE MODE
    267	000636	016060 	000002G	000002G		MOV	F.URBD+2(R0),F.NRBD+2(R0)
    268	000644	122760 	000000G	000000G		CMPB	#R.FIX,F.RTYP(R0) ;IF FIXED LENGTH RECORDS
    269	000652	001011 				BNE	75$
    270	000654	005760 	000000G			TST	F.RSIZ(R0)	;IF FIXED RECORD SIZE =0
    271	000660	001003 				BNE	70$
    272	000662	016060 	000000G	000000G		MOV	F.VBSZ(R0),F.RSIZ(R0) ;USE THE VIRTUAL BLOCK SIZE
    273	000670	016060 	000000G	000000G	70$:	MOV	F.RSIZ(R0),F.NRBD(R0) ;SET NXT REC BUF SIZ TO FIXED SIZE
    274	000676				75$:	CALL	..RTAD		;RETURN ADDRESS FOR NEXT RECORD TO USER
    275	000702	000241 			80$:	CLC			;EXIT SUCCESSFULLY
    276	000704					RETURN
OPEN 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 10


    278					;
    279						.IF	EQ,R$$OPF-2	;OPEN BY FILE ID
    280					BADOP3:
    281						.ENDC
    282					;
    283					; ERROR EXITS FROM OPEN
    284	000706				BADOP2:	CALL	..RFDB		;RESET THE FDB, RELEASING BUFFER IF NECESSARY
    285	000712	000403 				BR	BADOP1		;AND EXIT REPORTING AN ERROR CONDITION
    286					; ATTEMPTED TO OPEN ALREADY OPEN FILE
    287	000714	112760 	000000G	000000G	BADOPN:	MOVB	#IE.FOP,F.ERR(R0)
    288	000722	000261 			BADOP1:	SEC
    289	000724					RETURN
    290					; NO FILE ID SPECIFIED TO OPEN BY FILE ID ROUTINE
    291						.IF	EQ,R$$OPF-2	;OPEN BY FILE ID
    292					NOFID:	MOVB	#IE.NFI,F.ERR(R0)
    293						BR	BADOP2
    294						.ENDC
    295					;
    296					; NO BUFFER SPACE AVAILABLE FOR THE FILE
    297	000726	112760 	000000G	000000G	NOBUF:	MOVB	#IE.NBF,F.ERR(R0)
    298					;
    299						.IF	NE,R$$OPF-2	;OPEN OR OPFNB
    300					; MARK FOR DELETE IF CREATING NEW FILE
    301	000734	132760 	000000G	000000G	BADOP3:	BITB	#FA.CRE,F.FACC(R0)
    302	000742	001761 				BEQ	BADOP2		;BRANCH IF EXISTING FILE
    303	000744	010702 				MOV	PC,R2		;REMOVE FROM DIR. IF R2 IS NOT ZERO
    304	000746	116046 	000000G		BADOP4:	MOVB	F.ERR(R0),-(SP)	;SAVE ERROR CODE
    305	000752	010001 				MOV	R0,R1
    306	000754	062701 	000000G			ADD	#F.FNB,R1
    307	000760	005702 				TST	R2
    308	000762	001402 				BEQ	10$
    309	000764					CALL	..RMOV		;REMOVE FROM DIRECTORY
    310	000770				10$:	CALL	..MKDL		;DELETE THE EMBRYONIC FILE
    311	000774	112660 	000000G			MOVB	(SP)+,F.ERR(R0)	;RESTORE ERROR CODE
    312	001000	000742 				BR	BADOP2
    313						.ENDC
    314					;
    315					; ILLEGAL RECORD TYPE
    316	001002	112760 	000000G	000000G	BADTYP:	MOVB	#IE.BTP,F.ERR(R0)
    317	001010	000744 				BR	BADOP1
    318					; ILLEGAL RECORD ACCESS CODE - UNUSED BITS MUST BE ZERO
    319	001012	112760 	000000G	000000G	BADRAC:	MOVB	#IE.RAC,F.ERR(R0)
    320	001020	000740 				BR	BADOP1
    321					; ILLEGAL RECORD ATTRIBUTES BITS SET - UNDEFINED BITS MUST BE ZERO
    322	001022	112760 	000000G	000000G	BADRAT:	MOVB	#IE.RAT,F.ERR(R0)
    323	001030	000734 				BR	BADOP1
OPEN 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 11


    325					;+
    326					; ACCESS THE FILE
    327					; CALLING SEQUENCE:
    328					;	CALL	ACCESS
    329					; INPUTS:
    330					;	R0=FDB
    331					;	F.VBN,F.VBN+2=0
    332					;	F.SHAR,F.STBK SET UP AS APPROPRIATE
    333					;
    334					;
    335					;
    336					;
    337					; OUTPUTS:
    338					;	C=0 IF SUCCESSFUL, C=1 IF ERROR F.ERR SET
    339					;	R0 PRESERVED, R1-R5 ALTERED
    340					;	F.VBN SET
    341					;	F.NREC,F.EOBB SET
    342					;
    343					;
    344					;
    345					; OPERATION:
    346					; ISSUES QIO ACCESS WITH READ OF RECORD ATTRIBUTES
    347					; FOR EXISTING BLOCK ORIENTED FILE, SETS UP RECORD
    348					; ATTRIBUTES FOR EXISTING RECORD ORIENTED FILE. IF CREATING
    349					; NEW FILE, RECORD ATTRIBUTES WERE ALL SET. IF ACCESSING
    350					; AN EXISTING BLOCK ORIENTED FILE READS THE 1ST
    351					; OR LAST (FOR APPEND) VIRTUAL BLOCK. NO READ INITIATED
    352					; FOR RECORD ORIENTED DEVICE.
    353					;-
    354	001032				ACCESS:
    355	001032	132760 	000000G	000000G		BITB	#FD.REC,F.RCTL(R0) ;IF RECORD ORIENTED
    356	001040	001171 				BNE	70$		;SKIP THE ACCESS QI/O
    357					;
    358					; ISSUE THE ACCESS QI/O
    359					;
    360	001042					CALL	..IDPB		;INIT THE DPB AND SET R5 TO PARAM BLOCK
    361	001046	010015 				MOV	R0,(R5)
    362	001050	062725 	000000G			ADD	#F.FNB,(R5)+	;STORE THE ADDRESS OF THE FILE ID
    363						.IF	GT,R$$DPB
    364	001054	162706 	000012 			SUB	#12,SP		;MAKE ROOM ON STACK FOR READ ATT LIST
    365	001060	010625 				MOV	SP,(R5)+	;STORE ADDRESS OF ATT LIST
    366	001062	062705 	000005 			ADD	#5,R5		;INDEX TO ACCESS CONTROL BITS
    367	001066	152715 	000200 			BISB	#200,(R5)	;AND SIGNAL ACCESS DESIRED
    368						.IFTF
    369	001072	132760 	000000G	000000G		BITB	#FA.SHR,F.FACC(R0) ;SHARED ACCESS DESIRED?
    370	001100	001002 				BNE	10$		;BRANCH IF YES
    371	001102	152715 	000001 			BISB	#WI.LCK,(R5)	;NO, REQUEST LOCKED ACCESS
    372	001106	012704 	000000G		10$:	MOV	#IO.ACR,R4	;ASSUME ACCESS FOR READ
    373	001112	132760 	000000G	000000G		BITB	#FA.RD,F.FACC(R0) ;READ ONLY ACCESS DESIRED?
    374	001120	001012 				BNE	20$		;YES, R4 ALL SET
    375					;
    376					; WRITE ACCESS DESIRED
    377					;
    378	001122	152715 	000002 			BISB	#WI.DLK,(R5)	;ENABLE DEACCESS LOCK
    379	001126	012704 	000000G			MOV	#IO.ACE,R4	;ASSUME ACCESS FOR EXTEND DESIRED
    380	001132	132760 	000000G	000000G		BITB	#FA.EXT,F.FACC(R0) ;EXTEND ACCESS REQUESTED?
    381	001140	001002 				BNE	20$		;BRANCH IF YES, R4 ALL SET
OPEN 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 11-1


    382	001142	012704 	000000G			MOV	#IO.ACW,R4	;ACCESS IS FOR READ, WRITE
    383	001146				20$:
    384						.IFF
    385						TST	(R5)+		;POINT TO PLACE TO PUT RECORD ATT ADDRESS
    386						BITB	#FA.CRE,F.FACC(R0) ;UNLESS CREATING A NEW FILE
    387						BNE	30$
    388						MOV	R0,(R5)		;READ RECORD ATTRIBUTE TO FDB
    389					30$:	TST	(R5)+		;POINT TO STATISTICS BLOCK ADDRESS
    390						MOV	F.STBK(R0),(R5)	;READ STATISTICS BLOCK IF DESIRED
    391						.IFT
    392	001146	010605 				MOV	SP,R5		;GET POINTER TO ATT LIST
    393	001150	132760 	000000G	000000G		BITB	#FA.CRE,F.FACC(R0) ;READ ATT UNLESS CREATING
    394	001156	001003 				BNE	30$
    395	001160	012725 				MOV	(PC)+,(R5)+	;SET READ REC I/O CODE
    396	001162	   374 	   000G			.BYTE	-HA.UAT,S.FATT
    397	001164	010025 				MOV	R0,(R5)+	;TO THIS ADDRESS
    398	001166	016015 	000000G		30$:	MOV	F.STBK(R0),(R5)	;ADDRESS OF STATISTICS BLOCK IF DESIRED
    399	001172	001405 				BEQ	33$		;NOT DESIRED...
    400	001174	012725 				MOV	(PC)+,(R5)+	;DESIRED, SET THE CODE
    401	001176	   367 	   012 			.BYTE	-11,12
    402	001200	016025 	000000G			MOV	F.STBK(R0),(R5)+
    403	001204	005015 				CLR	(R5)
    404	001206				33$:
    405						.IFTF
    406	001206					CALL	..QIOW		;ISSUE THE ACCESS QI/O AND WAIT
    407	001212	103500 				BCS	97$		;BRANCH IF FAILED TO ACCESS
    408						.IFT
    409	001214	062706 	000012 			ADD	#12,SP		;POP STACK ITEMS
    410						.IFTF
    411	001220	005260 	000002G			INC	F.VBN+2(R0)	;VBN=1
    412	001224	132760 	000000G	000000G		BITB	#FD.SQD,F.RCTL(R0) ;SEQUENTIAL DEVICE?
    413	001232	001412 				BEQ	35$		;BRANCH IF NOT
    414	001234	012760 	077777 	000000G		MOV	#77777,F.HIBK(R0) ;FAKE LARGE ALLOCATION
    415	001242	132760 	000000G	000000G		BITB	#FA.CRE,F.FACC(R0) ;AND IF OPENING EXISTING FILE
    416	001250	001003 				BNE	35$
    417	001252	012760 	037777 	000000G		MOV	#37777,F.EFBK(R0) ;FAKE EOF SHORT OF ALLOCATED SPACE
    418	001260	132760 	000000G	000000G	35$:	BITB	#FA.APD,F.FACC(R0) ;IF APPENDING
    419	001266	001406 				BEQ	38$
    420	001270	016060 	000000G	000000G		MOV	F.EFBK(R0),F.VBN(R0) ;SET NEXT VBN
    421	001276	016060 	000002G	000002G		MOV	F.EFBK+2(R0),F.VBN+2(R0)
    422	001304	132760 	000000G	000000G	38$:	BITB	#FD.RWM,F.RACC(R0) ;IF READ/WRITE ALL DONE
    423	001312	001071 				BNE	90$
    424	001314	132760 	000000G	000000G		BITB	#FA.CRE,F.FACC(R0) ;SKIP READ OF VBN
    425	001322	001061 				BNE	80$		;IF NEW FILE
    426					;
    427					; EXISTING BLOCK ORIENTED FILE, READ VBN 1 OR LAST VBN IF
    428					; OPEN FOR APPEND. THIS WILL INIT BUFFER AND RECORD POINTERS
    429					;
    430	001324					CALL	..RWAC		;READ THE 1ST OR LAST BLOCK
    431	001330	103021 				BCC	60$		;BRANCH IF SUCCESSFUL
    432	001332	012746 	000001 			MOV	#1,-(SP)	;ASSUME EOF ERROR
    433	001336	122760 	000000G	000000G		CMPB	#IE.EOF,F.ERR(R0) ;IF EOF ERROR, DELAY THE REPORT
    434	001344	001410 				BEQ	50$
    435	001346	016016 	000000G			MOV	F.ERR(R0),(SP)	;OTHERWISE SAVE THE ERROR CODE
    436					;
    437					; NOW DEACCESS THE FILE
    438					;
OPEN 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 11-2


    439	001352					CALL	..IDPB		;INIT AND ZERO THE DPB
    440	001356	012704 	000000G			MOV	#IO.DAC,R4	;I/O FUNCTION CODE FOR DEACCESS
    441	001362					CALL	..QIOW		;ISSUE THE QI/O AND WAIT
    442	001366	012660 	000000G		50$:	MOV	(SP)+,F.ERR(R0)	;RESTORE SAVED ERROR CODE
    443	001372	000441 				BR	90$
    444	001374	132760 	000000G	000000G	60$:	BITB	#FA.APD,F.FACC(R0) ;IF APPENDING
    445	001402	001435 				BEQ	90$
    446	001404	066060 	000000G	000000G		ADD	F.FFBY(R0),F.NREC(R0) ;SET NEXT RECORD POINTER TO EOF
    447	001412	000431 				BR	90$
    448	001414				97$:
    449						.IFT
    450	001414	062706 	000012 			ADD	#12,SP		;POP STACK ITEMS
    451	001420	000261 				SEC			;INDICATE ERROR
    452						.IFTF
    453	001422	000427 				BR	95$		;AND EXIT
    454						.ENDC
    455					; RECORD ORIENTED DEVICE MUST SET UP RECORD ATTRIBUTES IF
    456					; READING AN EXISTING FILE.
    457	001424	132760 	000000G	000000G	70$:	BITB	#FA.CRE,F.FACC(R0) ;IF NEW FILE
    458	001432	001011 				BNE	75$		;DON'T SET ATTRIBUTES
    459	001434	112760 	000000G	000000G		MOVB	#R.VAR,F.RTYP(R0) ;ASSUME VARIABLE LENGTH
    460	001442	112760 	000000G	000000G		MOVB	#FD.CR,F.RATT(R0) ;CARRIAGE RETURNS BETWEEN RECS
    461	001450	016060 	000000G	000000G		MOV	F.BBFS(R0),F.RSIZ(R0) ;MAX RECORD SIZE
    462	001456	132760 	000000G	000000G	75$:	BITB	#FD.RWM,F.RACC(R0)	;IF READ/WRITE MODE THEN EXIT
    463	001464	001004 				BNE	90$
    464					; INIT BUFFER DESCRIPTOR AND RECORD POINTERS FOR 1ST GET, PUT
    465	001466	016001 	000000G		80$:	MOV	F.BDB(R0),R1
    466	001472					CALL	..BDRC
    467	001476				90$:	CALL	..FCSX
    468	001502				95$:	RETURN
OPEN 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 12


    470					; USE OVERRIDE BUFFER SIZE IF SPECIFIED
    471					; DESTROYS R4,R5, R0-R3 PRESERVED
    472	001504	016005 	000000G		OVBFSZ:	MOV	F.OVBS(R0),R5
    473	001510	001414 				BEQ	50$		;BRANCH IF NO OVERRIDE SPECIFIED
    474					;
    475						.IF	EQ,R$$BBF	;NO BIG BUFFERS ALLOWED
    476	001512	132760 	000000C	000000G		BITB	#FD.REC!FD.SQD,F.RCTL(R0)
    477	001520	001410 				BEQ	50$		;NO OVERRIDE FOR BLOCK DEVICE
    478						.ENDC
    479					;
    480						.IF	GT,R$$BBF	;BIG BUFFERS ALLOWED
    481						BITB	#FD.REC!FD.SQD,F.RCTL(R0) ;IF RECORD DEVICE
    482						BNE	40$		;ALLOW THE OVERRIDE
    483						.IF	GT,R$$EIS
    484						CLR	R4
    485						DIV	F.BBFS(R0),R4	;NO. OF VIRT BLOCKS IN BUFFER
    486						TST	R4
    487						BNE	20$
    488						INC	R4		;AT LEAST ONE
    489					20$:	MOVB	R4,F.BGBC(R0)	;SAVE VB/BUFFER
    490						MUL	F.BBFS(R0),R4	;R5=SIZE OF BUFFER
    491						.IFF
    492						CLRB	F.BGBC(R0)	;START AT 0
    493						CLR	R4		;START AT 0
    494					20$:	ADD	F.BBFS(R0),R4	;ADD
    495						INCB	F.BGBC(R0)	;AND INC
    496						CMP	R4,R5		;AGAIN?
    497						BLO	20$		;YES
    498						DECB	F.BGBC(R0)	;CORRECT
    499						SUB	F.BBFS(R0),R4	;CORRECT OTHER
    500						BNE	25$		;O.K.
    501						INCB	F.BGBC(R0)	;CORRECT
    502						ADD	F.BBFS(R0),R4	;CORRECT ALSO
    503					25$:	MOV	R4,R5		;MATCH CONVENTIONS
    504						.ENDC
    505						BISB	#FD.BGB,F.MBFG(R0) ;NOTE USING BIG BUFFERS
    506						BR	45$
    507					40$:
    508					.ENDC
    509					;
    510	001522	132760 	000000G	000000G		BITB	#FD.SQD,F.RCTL(R0)
    511	001530	001402 				BEQ	45$
    512	001532	010560 	000000G			MOV	R5,F.VBSZ(R0)	;SET VIRTUAL BLOCK SIZE TOO IF SEQ DEV
    513	001536	010560 	000000G		45$:	MOV	R5,F.BBFS(R0)
    514	001542				50$:	RETURN
    515					;
    516					;
    517	001544					$END	OPEN
    518					;
    519					;
    520		000001 				.END
OPEN 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 12-1
SYMBOL TABLE

ACCESS  001032R  	FD.EOF= 000002   	F.RTYP= ****** GX	N.DRPT= 000006   	SYUNIT= 000000
A.IOST= ****** GX	FD.FTN= ****** GX	F.STBK= ****** GX	N.DRSZ= 000004   	S.BFHD= ****** GX
A.OWUI= ****** GX	FD.INS= ****** GX	F.URBD= ****** GX	N.DVPT= 000002   	S.FATT= ****** GX
BADOPN  000714R  	FD.PLC= ****** GX	F.VBN = ****** GX	N.DVSZ= 000000   	WI.DLK= 000002
BADOP1  000722R  	FD.RAN= ****** GX	F.VBSZ= ****** GX	N.FID = ****** GX	WI.LCK= 000001
BADOP2  000706R  	FD.REC= ****** GX	HA.CHU= 000003   	N.FNPT= 000012   	$RQCB = ****** GX
BADOP3  000734R  	FD.RWM= ****** GX	HA.FP = 000002   	N.FNSZ= 000010   	$$    = 000067
BADOP4  000746R  	FD.SQD= ****** GX	HA.NAM= 000005   	OPALOC  000512R  	.FSRPT= ****** GX
BADRAC  001012R  	FD.WRT= 000001   	HA.TYP= 000006   	OPDIR   000204R  	.OPEN   000000RG
BADRAT  001022R  	F.BBFS= ****** GX	HA.UAT= 000004   	OVBFSZ  001504R  	.SAVR1= ****** GX
BADTYP  001002R  	F.BDB = ****** GX	HA.UI = 000001   	PP.SEP= 000002   	..BDRC= ****** GX
BD.FRE= 000001   	F.BKP1= ****** GX	HA.VER= 000007   	PP.ZER= 000001   	..CREA= ****** GX
B.NXBD= ****** GX	F.EFBK= ****** GX	IE.BTP= ****** GX	R$$ANI= 000000   	..DEL1= ****** GX
DIRTYP= 015172   	F.ERR = ****** GX	IE.DUP= ****** GX	R$$BBF= 000000   	..ENTR= ****** GX
FA.APD= ****** GX	F.FACC= ****** GX	IE.EOF= ****** GX	R$$DPB= 000001   	..FCSX= ****** GX
FA.CRE= ****** GX	F.FFBY= ****** GX	IE.FOP= ****** GX	R$$EIS= 000000   	..FIND= ****** GX
FA.EXT= ****** GX	F.FNB = ****** GX	IE.NBF= ****** GX	R$$LCL= 000000   	..FINI= ****** GX
FA.NSP= ****** GX	F.FVER= ****** GX	IE.RAC= ****** GX	R$$MBF= 000000   	..IDPB= ****** GX
FA.RD = ****** GX	F.HIBK= ****** GX	IE.RAT= ****** GX	R$$MUL= 000000   	..MKDL= ****** GX
FA.SHR= ****** GX	F.NRBD= ****** GX	IE.RBG= ****** GX	R$$OPF= 000000   	..QIOW= ****** GX
FA.TMP= ****** GX	F.NREC= ****** GX	IO.ACE= ****** GX	R$$RSL= 000000   	..RFDB= ****** GX
FCSEFN= 000040   	F.OVBS= ****** GX	IO.ACR= ****** GX	R$$SEQ= 000000   	..RMOV= ****** GX
FD.BLK= ****** GX	F.RACC= ****** GX	IO.ACW= ****** GX	R$$SPL= 000000   	..RTAD= ****** GX
FD.CR = ****** GX	F.RATT= ****** GX	IO.DAC= ****** GX	R$$11M= 000001   	..RWAC= ****** GX
FD.DVR= 000020   	F.RCNM= ****** GX	NB.DOT= 100000   	R.FIX = ****** GX	..STFN= ****** GX
FD.EFB= 000004   	F.RCTL= ****** GX	NB.SMI= 040000   	R.VAR = ****** GX	...CTL= 000003
FD.EF1= 000010   	F.RSIZ= ****** GX	NOBUF   000726R  	SYDEV = 054523

. ABS.	000000	   000
      	001544	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  3182 WORDS  ( 13 PAGES)
DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:00:28
[41,10]OPEN,[41,20]OPEN/-SP=[41,30]FCSPRE,OPEN
OPFID 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 1


      1					;                             COPYRIGHT (C) 1975, 1978 BY
      2					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      3					;
      4					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      5					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      6					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      7					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
      8					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
      9					;
     10					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     11					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     12					;       CORPORATION.
     13					;
     14					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     15					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     16		000002 				R$$OPF=2		;ASSEMBLE OPEN TO PRODUCE OPFID
OPFID 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 2


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
OPFID 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 8


						.TITLE	OPFID 0106S, OPEN FILE ROUTINE
						.IDENT	/0106S/
      2					; ALTERED THURSDAY 3-OCT-74 13:10
      3					;
      4					;                             COPYRIGHT (C) 1975, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 13-JULY-73
     21					;
     22					;+
     23					; OPEN A FILE
     24					; CALLING SEQUENCE:
     25					;	CALL	.OPEN
     26					; INPUTS:
     27					;	R0=FDB
     28					; OUTPUTS:
     29					;	ALL REGISTERS PRESERVED
     30					;	C=0 IF SUCCESSFULL, C=1 IF FAILED TO OPEN, F.ERR SET TO WHY
     31					;	FDB SET UP
     32					; OPERATION:
     33					;	USES THE GET INFORMATION PER LUN DIRECTIVE TO GET THE
     34					; DEVICE NAME AND UNIT NUMBER AND SET UP THE BLOCK SIZE AND
     35					; DEVICE DEPENDENT BITS IN F.RCTL.  INITIALIZES SOME OF THE FDB, AND
     36					; THEN DOES EITHER A PARSE, FIND SEQUENCE ON AN EXISTING FILE OR
     37					; A PARSE, ENTER SEQUENCE ON A NEW FILE.  FOR AN EXISTING
     38					; FILE IF THE FILE NAME STRING HAS LENGTH -1 THEN THE PARSE, FIND
     39					; SEQUENCE IS SKIPPED AND THE FILE NAME BLOCK PORTION OF THE FDB
     40					; IS ASSUMED TO BE SET UP.  FINALLY THE BLOCK BUFFER IS ALLOCATED,
     41					; THE REST OF THE FDB INITIALIZED, AND THE FILE ACCESSED.
     42					;-
OPFID 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 9


     44						.IF	EQ,R$$OPF	;NORMAL OPEN
     45					.OPEN::
     46						.ENDC
     47					;
     48						.IF	EQ,R$$OPF-1	;OPEN BY FILE NAME BLOCK
     49					.OPFNB::
     50						.ENDC
     51					;
     52						.IF	EQ,R$$OPF-2	;OPEN BY FILE ID
     53	000000				.OPFID::
     54						.ENDC
     55					;
     56	000000					.SAVR1			;SAVE REGISTERS R1-R5
     57	000004	013701 	000000G			MOV	@#.FSRPT,R1	;SEE IF ALLOC CONTROL BLOCK HAS BEEN INITED
     58	000010	005761 	000000G			TST	A.OWUI(R1)	;UIC WORD SHOULD BE NON ZERO
     59	000014	001002 				BNE	10$		;BRANCH IF IT IS
     60	000016					CALL	..FINI		;INIT THE FILE SYSTEM
     61	000022	005760 	000000G		10$:	TST	F.BDB(R0)	;IS THE FILE ALREADY OPEN?
     62	000026	001402 				BEQ	20$		;BRANCH IF NO
     63	000030	000167 	000414 			JMP	BADOPN		;ALREADY OPEN - ERROR
     64	000034	132760 	000000C	000000G	20$:	BITB	#^C<FD.RWM!FD.RAN!FD.PLC!FD.INS>,F.RACC(R0)
     65	000042	001402 				BEQ	24$		;BRANCH IF LEGAL
     66	000044	000167 	000440 			JMP	BADRAC		;ILLEGAL RECORD ACCESS BITS
     67	000050	132760 	000000G	000000G	24$:	BITB	#FA.CRE,F.FACC(R0) ;IF CREATING NEW FILE
     68	000056	001426 				BEQ	40$
     69	000060	132760 	000000C	000000G		BITB	#^C<FD.FTN!FD.CR!FD.BLK>,F.RATT(R0)
     70	000066	001402 				BEQ	26$		;BRANCH IF OK
     71	000070	000167 	000424 			JMP	BADRAT		;ILLEGAL RECORD ATTRIBUTES
     72	000074	132760 	000000G	000000G	26$:	BITB	#FD.RWM,F.RACC(R0) ;IF READ/WRITE MODE
     73	000102	001014 				BNE	40$		;IGNORE RECORD TYPE
     74	000104	122760 	000000G	000000G		CMPB	#R.FIX,F.RTYP(R0) ;CHECK RECORD TYPE
     75	000112	001410 				BEQ	40$		;BRANCH IF LEGAL
     76	000114	122760 	000000G	000000G		CMPB	#R.VAR,F.RTYP(R0) ;VARIABLE LENGTH RECORDS?
     77	000122	001402 				BEQ	30$		;BRANCH IF YES
     78	000124	000167 	000350 			JMP	BADTYP		;ILLEGAL RECORD TYPE
     79	000130	005060 	000000G		30$:	CLR	F.RSIZ(R0)	;VARIABLE LENGTH SIZE INIT TO ZERO
     80	000134	012760 	000001 	000000G	40$:	MOV	#1,F.ERR(R0)	;INIT ERROR INDICATION TO SUCCESSFUL
     81	000142	005060 	000000G			CLR	F.HIBK(R0)	;INIT LAST BLOCK ALLOCATED
     82	000146	005060 	000002G			CLR	F.HIBK+2(R0)
     83	000152	005060 	000000G			CLR	F.EFBK(R0)	;INIT THE END OF FILE BLOCK NO.
     84	000156	012760 	000001 	000002G		MOV	#1,F.EFBK+2(R0)
     85	000164	005060 	000000G			CLR	F.FFBY(R0)	;ZERO THE FIRST FREE BYTE POINTER
     86	000170	005060 	000000G			CLR	F.VBN(R0)	;ZERO THE INITIAL VBN
     87	000174	005060 	000002G			CLR	F.VBN+2(R0)
     88	000200	105060 	000000G			CLRB	F.BKP1(R0)
     89	000204				OPDIR:
     90						.IF	EQ,R$$OPF	;REGULAR OPEN (BY FILE NAME)
     91						CALL	..STFN		;PARSE INTO FNB UNLESS ALREADY SET UP
     92						.ENDC
     93					;
     94						.IF	EQ,R$$OPF-1	;OPEN BY FILE NAME BLOCK
     95						MOV	R0,R1
     96						ADD	#F.FNB,R1	;R1=ADDR OF FNB
     97						CALL	..ALUN
     98						.ENDC
     99					;
    100						.IF	LE,R$$OPF-1 ;OPEN BY NAME OR FNB
OPFID 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 9-1


    101						BCS	26$
    102						CALL	OVBFSZ		;USE OVERIDE BUFFER SIZE IF SPECIFIED
    103						TST	N.FID(R1)	;IS FILE ID ALREADY SET?
    104						BNE	80$		;BRANCH IF YES
    105						BITB	#FA.CRE,F.FACC(R0) ;CREATING A NEW FILE?
    106						BNE	20$		;BRANCH IF YES
    107					; OPENING AN EXISTING FILE
    108						CALL	..FIND
    109						BCS	26$
    110						BR	80$
    111
    112					; OPENING A NEW FILE
    113					20$:	BITB	#FD.SQD,F.RCTL(R0) ;IF SEQUENTIAL DEVICE
    114						BEQ	40$
    115						CMPB	#R.FIX,F.RTYP(R0) ;AND FIXED LENGTH RECORDS
    116						BNE	38$
    117						MOV	F.RSIZ(R0),R3	;CHECK RECORD SIZE
    118					;
    119					; REMOVE THE LOWER BOUNDS CHECK WHEN FCP ENFORCES IT
    120						CMP	R3,#18.
    121						BHIS	30$		;BRANCH IF SIZE IS OK
    122					25$:	MOVB	#IE.RBG,F.ERR(R0)
    123					26$:	JMP	BADOP2
    124					;
    125					; CALCULATE NEW BLOCK SIZE. INTEGER MULTIPLE OF RECORD SIZE
    126						.IF	GT,R$$EIS
    127					30$:	CLR	R4
    128						MOV	F.BBFS(R0),R5
    129						DIV	R3,R4		;R4=RECORDS / BLOCK
    130						BNE	35$
    131						INC	R4		;AT LEAST 1
    132					35$:	MUL	R3,R4
    133						.IFF
    134					30$:	CLR	R5		;START AT 0
    135					35$:	ADD	R3,R5		;NOW ADD IN RECORD SIZE
    136						CMP	R5,F.BBFS(R0)	;OVER LIMIT?
    137						BLO	35$		;NOPE
    138						SUB	R3,R5		;YES, SO CORRECT DOWN
    139						BNE	36$		;NON-ZERO
    140						MOV	R3,R5		;MAKE AT LEAST 1
    141					36$:
    142						.ENDC
    143						MOV	R5,F.VBSZ(R0)
    144						MOV	R5,F.BBFS(R0)	;STORE NEW BLOCK SIZE
    145					38$:	MOV	F.BBFS(R0),F.FFBY(R0) ;MAKE BLOCK SIZE AVAILABLE TO FCP
    146					;
    147					; ISSUE THE QI/O TO CREATE THE NEW FILE
    148					40$:	CALL	..CREA		;CREATE THE NEW FILE
    149						BCS	26$
    150						BITB	#FA.TMP,F.FACC(R0) ;IF CREATING TEMP FILE
    151						BNE	80$		;SKIP THE ENTER
    152						TST	F.FVER(R0)
    153						BNE	45$
    154						BISB	#FD.DVR,F.BKP1(R0) ;CREATING DEFAULT VERSION NUMBER
    155					45$:	CALL	..ENTR		;MAKE THE DIRECTORY ENTRY
    156						BCC	80$		;BRANCH IF NO ERROR FROM ..ENTR
    157					; IF THE ENTER ERROR WAS THAT FILE ALREADY EXISTS BY THAT NAME, THEN DELETE IT
OPFID 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 9-2


    158						BITB	#FA.NSP,F.FACC(R0) ;SUPERSEDE INHIBITED?
    159						BNE	60$		;BRANCH IF YES,INDICATE OPEN FAILURE
    160						CMPB	#IE.DUP,F.ERR(R0)
    161						BNE	60$		;OTHER KIND OF ERROR, REAL ERROR
    162						MOV	#1,F.ERR(R0)	;RESET THE ERROR CONDITION
    163						MOV	N.FID(R1),-(SP)	;SAVE THE FILE ID FROM THE DELETE
    164						MOV	N.FID+2(R1),-(SP)
    165						MOV	N.FID+4(R1),-(SP)
    166						MOV	R1,-(SP)	;PRESERVE FNB ADDRESS FROM DELETE
    167						CALL	..DEL1
    168						MOV	(SP)+,R1
    169						MOV	(SP)+,N.FID+4(R1)
    170						MOV	(SP)+,N.FID+2(R1)
    171						MOV	(SP)+,N.FID(R1)
    172						BCS	60$		;BRANCH IF DELETE FAILED
    173						CALL	..ENTR		;REISSUE THE ..ENTR, NOW IT SHOULD WORK
    174						BCC	80$		;BRANCH IF OK
    175					60$:	CLR	R2		;DON'T DO A REMOVE WHEN CLEANING UP
    176						JMP	BADOP4		;SOME OTHER ERROR THIS TIME
    177						.ENDC
    178					;
    179						.IF	EQ,R$$OPF-2	;OPEN BY FILE ID
    180	000204	010001 				MOV	R0,R1
    181	000206	062701 	000000G			ADD	#F.FNB,R1
    182	000212					CALL	..ALUN
    183	000216	103511 				BCS	BADOP2
    184	000220					CALL	OVBFSZ		;USE OVERRIDE BUF SIZE IF SPECIFIED
    185	000224	005761 	000000G			TST	N.FID(R1)	;FILE ID MUST BE NON ZERO
    186	000230	001006 				BNE	75$
    187	000232	132760 	000000G	000000G		BITB	#FD.REC,F.RCTL(R0) ;UNLESS RECORD DEVICE
    188	000240	001510 				BEQ	NOFID
    189	000242	005261 	000000G			INC	N.FID(R1)	;IN WHICH CASE MAKE IT 1
    190	000246				75$:
    191						.ENDC
    192					;
    193	000246				80$:
OPFID 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 10


    195	000246	132760 	000000G	000000G	OPALOC:	BITB	#FD.RWM,F.RACC(R0) ;READ/WRITE MODE?
    196	000254	001407 				BEQ	10$		;BRANCH IF PUT/GET MODE
    197					; PUT ADDRESS OF SCRATCH I/O STATUS BLOCK IN F.BDB
    198	000256	013760 	000000G	000000G		MOV	@#.FSRPT,F.BDB(R0)
    199	000264	062760 	000000G	000000G		ADD	#A.IOST,F.BDB(R0)
    200	000272	000420 				BR	60$
    201					;
    202					; ALLOCATE BLOCK BUFFER
    203	000274				10$:
    204						.IF	EQ,R$$MBF	;IF NO MULTIPLE BUFFERING
    205	000274	016001 	000000G			MOV	F.BBFS(R0),R1	;R1=BLOCK SIZE FOR THIS DEVICE
    206	000300	010046 				MOV	R0,-(SP)	;SAVE THE FDB ADDRESS
    207	000302	013700 	000000G			MOV	@#.FSRPT,R0	;ALLOCATION CONTROL BLOCK FOR FSR
    208	000306	062701 	000000G			ADD	#S.BFHD,R1	;ADD IN BUFFER HEADER
    209	000312					CALL	$RQCB		;REQUEST A CORE BLOCK
    210	000316	010001 				MOV	R0,R1		;ADDRESS ALLOCATED TO R1
    211	000320	012600 				MOV	(SP)+,R0	;RESTORE FDB FROM STACK
    212	000322	103463 				BCS	NOBUF		;BRANCH IF NO BUFFER SPACE
    213	000324	010160 	000000G			MOV	R1,F.BDB(R0)	;SET UP BUFFER DESCRIPTOR BLOCK POINTER
    214	000330	010161 	000000G			MOV	R1,B.NXBD(R1)	;CHAIN BUFFER TO ITSELF
    215						.ENDC
    216					;
    217						.IF	GT,R$$MBF	;IF MULTIPLE BUFFERING
    218					; ALLOCATE NUMBER OF BUFFERS SPECIFIED IN F.MBCT, AND
    219					; SET UP THE BUFFER RING
    220						MOV	R0,R4		;PRESERVE THE FDB ADDRESS
    221						CLR	R3		;NO BUFFERS ALLOCATED YET
    222						CLR	R5
    223						BISB	F.MBCT(R0),R5	;R5=NO. OF BUFFERS DESIRED
    224						BNE	20$
    225						MOV	@#.FSRPT,R5
    226						MOVB	A.DFBC(R5),R5	;USE DEFAULT NO. OF BUFFERS FROM FSR2
    227					20$:	CLRB	F.MBC1(R0)
    228						CMP	#1,R5		;IF SINGLE BUFFERING
    229						BGE	23$		;DON'T SET READ AHEAD, WRITE BEHIND
    230						BITB	#FD.RAH!FD.WBH,F.MBFG(R0) ;IF USER SET THESE
    231						BNE	23$		;DON'T CHANGE THEM
    232						MOV	#FD.RAH,R1	;DEFAULT TO READ AHEAD IF READ ONLY
    233						BITB	#FA.RD,F.FACC(R0)
    234						BNE	22$
    235						MOV	#FD.WBH,R1	;OTHERWISE USE WRITE BEHIND
    236					22$:	BISB	R1,F.MBFG(R0)
    237					23$:	MOV	@#.FSRPT,R0	;POINTER TO ALOOCATION CONTROL BLOCK
    238						MOV	F.BBFS(R4),R1
    239						ADD	#S.BFHD,R1	;R1=NO. OF BYTES TO ALLOCATES
    240						CALL	$RQCB		;REQUEST A CORE BLOCK
    241						BCS	58$		;BRANCH IF NO MORE MEMORY AVAILABLE
    242						TST	R3		;FIRST BUFFER?
    243						BNE	35$		;BRANCH IF NO
    244						MOV	R0,F.BDB(R4)	;YES, SET UP  F.BDB
    245						BR	47$
    246					35$:	MOV	R0,B.NXBD(R3)	;LINK THE BUFFERS
    247					47$:	MOV	R0,R3
    248						MOV	#1,@R3		;INIT THE BUFFER DESCRIPTOR
    249						MOVB	#BD.FRE,B.BFST(R3) ;NOTE BUFFER AVAILABLE
    250						INCB	F.MBC1(R4)	;COUNT THE BUFFERS ALLOCATED
    251						SOB	R5,23$		;ALLOCATE THE NEXT ONE
OPFID 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 10-1


    252					58$:	MOV	R4,R0		;RESTORE FDB ADDRESS
    253						TST	R3		;ANY BUFFERS ALLOCATED?
    254						BEQ	NOBUF		;BRANCH IF NO
    255						MOV	F.BDB(R0),B.NXBD(R3) ;CLOSE THE BUF RING
    256						.ENDC
    257					;
    258	000334				60$:	CALL	ACCESS
    259	000340	103440 				BCS	BADOP3
    260	000342	005060 	000000G			CLR	F.RCNM(R0)	;DON'T INIT BEFORE ACCESS
    261	000346	012760 	000001 	000002G		MOV	#1,F.RCNM+2(R0)	;INIT RECORD NUMBER TO 1
    262					;
    263					; SET UP NRBA AND NRBS BASED ON PARTIAL LOCATE MODE OR MOVE MODE
    264	000354	132760 	000000G	000000G		BITB	#FD.RWM,F.RACC(R0) ;READ/WRITE MODE?
    265	000362	001025 				BNE	80$		;BRANCH IF YES
    266	000364	016060 	000000G	000000G		MOV	F.URBD(R0),F.NRBD(R0) ;ASSUME MOVE MODE
    267	000372	016060 	000002G	000002G		MOV	F.URBD+2(R0),F.NRBD+2(R0)
    268	000400	122760 	000000G	000000G		CMPB	#R.FIX,F.RTYP(R0) ;IF FIXED LENGTH RECORDS
    269	000406	001011 				BNE	75$
    270	000410	005760 	000000G			TST	F.RSIZ(R0)	;IF FIXED RECORD SIZE =0
    271	000414	001003 				BNE	70$
    272	000416	016060 	000000G	000000G		MOV	F.VBSZ(R0),F.RSIZ(R0) ;USE THE VIRTUAL BLOCK SIZE
    273	000424	016060 	000000G	000000G	70$:	MOV	F.RSIZ(R0),F.NRBD(R0) ;SET NXT REC BUF SIZ TO FIXED SIZE
    274	000432				75$:	CALL	..RTAD		;RETURN ADDRESS FOR NEXT RECORD TO USER
    275	000436	000241 			80$:	CLC			;EXIT SUCCESSFULLY
    276	000440					RETURN
OPFID 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 11


    278					;
    279						.IF	EQ,R$$OPF-2	;OPEN BY FILE ID
    280	000442				BADOP3:
    281						.ENDC
    282					;
    283					; ERROR EXITS FROM OPEN
    284	000442				BADOP2:	CALL	..RFDB		;RESET THE FDB, RELEASING BUFFER IF NECESSARY
    285	000446	000403 				BR	BADOP1		;AND EXIT REPORTING AN ERROR CONDITION
    286					; ATTEMPTED TO OPEN ALREADY OPEN FILE
    287	000450	112760 	000000G	000000G	BADOPN:	MOVB	#IE.FOP,F.ERR(R0)
    288	000456	000261 			BADOP1:	SEC
    289	000460					RETURN
    290					; NO FILE ID SPECIFIED TO OPEN BY FILE ID ROUTINE
    291						.IF	EQ,R$$OPF-2	;OPEN BY FILE ID
    292	000462	112760 	000000G	000000G	NOFID:	MOVB	#IE.NFI,F.ERR(R0)
    293	000470	000764 				BR	BADOP2
    294						.ENDC
    295					;
    296					; NO BUFFER SPACE AVAILABLE FOR THE FILE
    297	000472	112760 	000000G	000000G	NOBUF:	MOVB	#IE.NBF,F.ERR(R0)
    298					;
    299						.IF	NE,R$$OPF-2	;OPEN OR OPFNB
    300					; MARK FOR DELETE IF CREATING NEW FILE
    301					BADOP3:	BITB	#FA.CRE,F.FACC(R0)
    302						BEQ	BADOP2		;BRANCH IF EXISTING FILE
    303						MOV	PC,R2		;REMOVE FROM DIR. IF R2 IS NOT ZERO
    304					BADOP4:	MOVB	F.ERR(R0),-(SP)	;SAVE ERROR CODE
    305						MOV	R0,R1
    306						ADD	#F.FNB,R1
    307						TST	R2
    308						BEQ	10$
    309						CALL	..RMOV		;REMOVE FROM DIRECTORY
    310					10$:	CALL	..MKDL		;DELETE THE EMBRYONIC FILE
    311						MOVB	(SP)+,F.ERR(R0)	;RESTORE ERROR CODE
    312						BR	BADOP2
    313						.ENDC
    314					;
    315					; ILLEGAL RECORD TYPE
    316	000500	112760 	000000G	000000G	BADTYP:	MOVB	#IE.BTP,F.ERR(R0)
    317	000506	000763 				BR	BADOP1
    318					; ILLEGAL RECORD ACCESS CODE - UNUSED BITS MUST BE ZERO
    319	000510	112760 	000000G	000000G	BADRAC:	MOVB	#IE.RAC,F.ERR(R0)
    320	000516	000757 				BR	BADOP1
    321					; ILLEGAL RECORD ATTRIBUTES BITS SET - UNDEFINED BITS MUST BE ZERO
    322	000520	112760 	000000G	000000G	BADRAT:	MOVB	#IE.RAT,F.ERR(R0)
    323	000526	000753 				BR	BADOP1
OPFID 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 12


    325					;+
    326					; ACCESS THE FILE
    327					; CALLING SEQUENCE:
    328					;	CALL	ACCESS
    329					; INPUTS:
    330					;	R0=FDB
    331					;	F.VBN,F.VBN+2=0
    332					;	F.SHAR,F.STBK SET UP AS APPROPRIATE
    333					;
    334					;
    335					;
    336					;
    337					; OUTPUTS:
    338					;	C=0 IF SUCCESSFUL, C=1 IF ERROR F.ERR SET
    339					;	R0 PRESERVED, R1-R5 ALTERED
    340					;	F.VBN SET
    341					;	F.NREC,F.EOBB SET
    342					;
    343					;
    344					;
    345					; OPERATION:
    346					; ISSUES QIO ACCESS WITH READ OF RECORD ATTRIBUTES
    347					; FOR EXISTING BLOCK ORIENTED FILE, SETS UP RECORD
    348					; ATTRIBUTES FOR EXISTING RECORD ORIENTED FILE. IF CREATING
    349					; NEW FILE, RECORD ATTRIBUTES WERE ALL SET. IF ACCESSING
    350					; AN EXISTING BLOCK ORIENTED FILE READS THE 1ST
    351					; OR LAST (FOR APPEND) VIRTUAL BLOCK. NO READ INITIATED
    352					; FOR RECORD ORIENTED DEVICE.
    353					;-
    354	000530				ACCESS:
    355	000530	132760 	000000G	000000G		BITB	#FD.REC,F.RCTL(R0) ;IF RECORD ORIENTED
    356	000536	001171 				BNE	70$		;SKIP THE ACCESS QI/O
    357					;
    358					; ISSUE THE ACCESS QI/O
    359					;
    360	000540					CALL	..IDPB		;INIT THE DPB AND SET R5 TO PARAM BLOCK
    361	000544	010015 				MOV	R0,(R5)
    362	000546	062725 	000000G			ADD	#F.FNB,(R5)+	;STORE THE ADDRESS OF THE FILE ID
    363						.IF	GT,R$$DPB
    364	000552	162706 	000012 			SUB	#12,SP		;MAKE ROOM ON STACK FOR READ ATT LIST
    365	000556	010625 				MOV	SP,(R5)+	;STORE ADDRESS OF ATT LIST
    366	000560	062705 	000005 			ADD	#5,R5		;INDEX TO ACCESS CONTROL BITS
    367	000564	152715 	000200 			BISB	#200,(R5)	;AND SIGNAL ACCESS DESIRED
    368						.IFTF
    369	000570	132760 	000000G	000000G		BITB	#FA.SHR,F.FACC(R0) ;SHARED ACCESS DESIRED?
    370	000576	001002 				BNE	10$		;BRANCH IF YES
    371	000600	152715 	000001 			BISB	#WI.LCK,(R5)	;NO, REQUEST LOCKED ACCESS
    372	000604	012704 	000000G		10$:	MOV	#IO.ACR,R4	;ASSUME ACCESS FOR READ
    373	000610	132760 	000000G	000000G		BITB	#FA.RD,F.FACC(R0) ;READ ONLY ACCESS DESIRED?
    374	000616	001012 				BNE	20$		;YES, R4 ALL SET
    375					;
    376					; WRITE ACCESS DESIRED
    377					;
    378	000620	152715 	000002 			BISB	#WI.DLK,(R5)	;ENABLE DEACCESS LOCK
    379	000624	012704 	000000G			MOV	#IO.ACE,R4	;ASSUME ACCESS FOR EXTEND DESIRED
    380	000630	132760 	000000G	000000G		BITB	#FA.EXT,F.FACC(R0) ;EXTEND ACCESS REQUESTED?
    381	000636	001002 				BNE	20$		;BRANCH IF YES, R4 ALL SET
OPFID 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 12-1


    382	000640	012704 	000000G			MOV	#IO.ACW,R4	;ACCESS IS FOR READ, WRITE
    383	000644				20$:
    384						.IFF
    385						TST	(R5)+		;POINT TO PLACE TO PUT RECORD ATT ADDRESS
    386						BITB	#FA.CRE,F.FACC(R0) ;UNLESS CREATING A NEW FILE
    387						BNE	30$
    388						MOV	R0,(R5)		;READ RECORD ATTRIBUTE TO FDB
    389					30$:	TST	(R5)+		;POINT TO STATISTICS BLOCK ADDRESS
    390						MOV	F.STBK(R0),(R5)	;READ STATISTICS BLOCK IF DESIRED
    391						.IFT
    392	000644	010605 				MOV	SP,R5		;GET POINTER TO ATT LIST
    393	000646	132760 	000000G	000000G		BITB	#FA.CRE,F.FACC(R0) ;READ ATT UNLESS CREATING
    394	000654	001003 				BNE	30$
    395	000656	012725 				MOV	(PC)+,(R5)+	;SET READ REC I/O CODE
    396	000660	   374 	   000G			.BYTE	-HA.UAT,S.FATT
    397	000662	010025 				MOV	R0,(R5)+	;TO THIS ADDRESS
    398	000664	016015 	000000G		30$:	MOV	F.STBK(R0),(R5)	;ADDRESS OF STATISTICS BLOCK IF DESIRED
    399	000670	001405 				BEQ	33$		;NOT DESIRED...
    400	000672	012725 				MOV	(PC)+,(R5)+	;DESIRED, SET THE CODE
    401	000674	   367 	   012 			.BYTE	-11,12
    402	000676	016025 	000000G			MOV	F.STBK(R0),(R5)+
    403	000702	005015 				CLR	(R5)
    404	000704				33$:
    405						.IFTF
    406	000704					CALL	..QIOW		;ISSUE THE ACCESS QI/O AND WAIT
    407	000710	103500 				BCS	97$		;BRANCH IF FAILED TO ACCESS
    408						.IFT
    409	000712	062706 	000012 			ADD	#12,SP		;POP STACK ITEMS
    410						.IFTF
    411	000716	005260 	000002G			INC	F.VBN+2(R0)	;VBN=1
    412	000722	132760 	000000G	000000G		BITB	#FD.SQD,F.RCTL(R0) ;SEQUENTIAL DEVICE?
    413	000730	001412 				BEQ	35$		;BRANCH IF NOT
    414	000732	012760 	077777 	000000G		MOV	#77777,F.HIBK(R0) ;FAKE LARGE ALLOCATION
    415	000740	132760 	000000G	000000G		BITB	#FA.CRE,F.FACC(R0) ;AND IF OPENING EXISTING FILE
    416	000746	001003 				BNE	35$
    417	000750	012760 	037777 	000000G		MOV	#37777,F.EFBK(R0) ;FAKE EOF SHORT OF ALLOCATED SPACE
    418	000756	132760 	000000G	000000G	35$:	BITB	#FA.APD,F.FACC(R0) ;IF APPENDING
    419	000764	001406 				BEQ	38$
    420	000766	016060 	000000G	000000G		MOV	F.EFBK(R0),F.VBN(R0) ;SET NEXT VBN
    421	000774	016060 	000002G	000002G		MOV	F.EFBK+2(R0),F.VBN+2(R0)
    422	001002	132760 	000000G	000000G	38$:	BITB	#FD.RWM,F.RACC(R0) ;IF READ/WRITE ALL DONE
    423	001010	001071 				BNE	90$
    424	001012	132760 	000000G	000000G		BITB	#FA.CRE,F.FACC(R0) ;SKIP READ OF VBN
    425	001020	001061 				BNE	80$		;IF NEW FILE
    426					;
    427					; EXISTING BLOCK ORIENTED FILE, READ VBN 1 OR LAST VBN IF
    428					; OPEN FOR APPEND. THIS WILL INIT BUFFER AND RECORD POINTERS
    429					;
    430	001022					CALL	..RWAC		;READ THE 1ST OR LAST BLOCK
    431	001026	103021 				BCC	60$		;BRANCH IF SUCCESSFUL
    432	001030	012746 	000001 			MOV	#1,-(SP)	;ASSUME EOF ERROR
    433	001034	122760 	000000G	000000G		CMPB	#IE.EOF,F.ERR(R0) ;IF EOF ERROR, DELAY THE REPORT
    434	001042	001410 				BEQ	50$
    435	001044	016016 	000000G			MOV	F.ERR(R0),(SP)	;OTHERWISE SAVE THE ERROR CODE
    436					;
    437					; NOW DEACCESS THE FILE
    438					;
OPFID 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 12-2


    439	001050					CALL	..IDPB		;INIT AND ZERO THE DPB
    440	001054	012704 	000000G			MOV	#IO.DAC,R4	;I/O FUNCTION CODE FOR DEACCESS
    441	001060					CALL	..QIOW		;ISSUE THE QI/O AND WAIT
    442	001064	012660 	000000G		50$:	MOV	(SP)+,F.ERR(R0)	;RESTORE SAVED ERROR CODE
    443	001070	000441 				BR	90$
    444	001072	132760 	000000G	000000G	60$:	BITB	#FA.APD,F.FACC(R0) ;IF APPENDING
    445	001100	001435 				BEQ	90$
    446	001102	066060 	000000G	000000G		ADD	F.FFBY(R0),F.NREC(R0) ;SET NEXT RECORD POINTER TO EOF
    447	001110	000431 				BR	90$
    448	001112				97$:
    449						.IFT
    450	001112	062706 	000012 			ADD	#12,SP		;POP STACK ITEMS
    451	001116	000261 				SEC			;INDICATE ERROR
    452						.IFTF
    453	001120	000427 				BR	95$		;AND EXIT
    454						.ENDC
    455					; RECORD ORIENTED DEVICE MUST SET UP RECORD ATTRIBUTES IF
    456					; READING AN EXISTING FILE.
    457	001122	132760 	000000G	000000G	70$:	BITB	#FA.CRE,F.FACC(R0) ;IF NEW FILE
    458	001130	001011 				BNE	75$		;DON'T SET ATTRIBUTES
    459	001132	112760 	000000G	000000G		MOVB	#R.VAR,F.RTYP(R0) ;ASSUME VARIABLE LENGTH
    460	001140	112760 	000000G	000000G		MOVB	#FD.CR,F.RATT(R0) ;CARRIAGE RETURNS BETWEEN RECS
    461	001146	016060 	000000G	000000G		MOV	F.BBFS(R0),F.RSIZ(R0) ;MAX RECORD SIZE
    462	001154	132760 	000000G	000000G	75$:	BITB	#FD.RWM,F.RACC(R0)	;IF READ/WRITE MODE THEN EXIT
    463	001162	001004 				BNE	90$
    464					; INIT BUFFER DESCRIPTOR AND RECORD POINTERS FOR 1ST GET, PUT
    465	001164	016001 	000000G		80$:	MOV	F.BDB(R0),R1
    466	001170					CALL	..BDRC
    467	001174				90$:	CALL	..FCSX
    468	001200				95$:	RETURN
OPFID 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 13


    470					; USE OVERRIDE BUFFER SIZE IF SPECIFIED
    471					; DESTROYS R4,R5, R0-R3 PRESERVED
    472	001202	016005 	000000G		OVBFSZ:	MOV	F.OVBS(R0),R5
    473	001206	001414 				BEQ	50$		;BRANCH IF NO OVERRIDE SPECIFIED
    474					;
    475						.IF	EQ,R$$BBF	;NO BIG BUFFERS ALLOWED
    476	001210	132760 	000000C	000000G		BITB	#FD.REC!FD.SQD,F.RCTL(R0)
    477	001216	001410 				BEQ	50$		;NO OVERRIDE FOR BLOCK DEVICE
    478						.ENDC
    479					;
    480						.IF	GT,R$$BBF	;BIG BUFFERS ALLOWED
    481						BITB	#FD.REC!FD.SQD,F.RCTL(R0) ;IF RECORD DEVICE
    482						BNE	40$		;ALLOW THE OVERRIDE
    483						.IF	GT,R$$EIS
    484						CLR	R4
    485						DIV	F.BBFS(R0),R4	;NO. OF VIRT BLOCKS IN BUFFER
    486						TST	R4
    487						BNE	20$
    488						INC	R4		;AT LEAST ONE
    489					20$:	MOVB	R4,F.BGBC(R0)	;SAVE VB/BUFFER
    490						MUL	F.BBFS(R0),R4	;R5=SIZE OF BUFFER
    491						.IFF
    492						CLRB	F.BGBC(R0)	;START AT 0
    493						CLR	R4		;START AT 0
    494					20$:	ADD	F.BBFS(R0),R4	;ADD
    495						INCB	F.BGBC(R0)	;AND INC
    496						CMP	R4,R5		;AGAIN?
    497						BLO	20$		;YES
    498						DECB	F.BGBC(R0)	;CORRECT
    499						SUB	F.BBFS(R0),R4	;CORRECT OTHER
    500						BNE	25$		;O.K.
    501						INCB	F.BGBC(R0)	;CORRECT
    502						ADD	F.BBFS(R0),R4	;CORRECT ALSO
    503					25$:	MOV	R4,R5		;MATCH CONVENTIONS
    504						.ENDC
    505						BISB	#FD.BGB,F.MBFG(R0) ;NOTE USING BIG BUFFERS
    506						BR	45$
    507					40$:
    508					.ENDC
    509					;
    510	001220	132760 	000000G	000000G		BITB	#FD.SQD,F.RCTL(R0)
    511	001226	001402 				BEQ	45$
    512	001230	010560 	000000G			MOV	R5,F.VBSZ(R0)	;SET VIRTUAL BLOCK SIZE TOO IF SEQ DEV
    513	001234	010560 	000000G		45$:	MOV	R5,F.BBFS(R0)
    514	001240				50$:	RETURN
    515					;
    516					;
    517	001242					$END	OPEN
    518					;
    519					;
    520		000001 				.END
OPFID 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:13  PAGE 13-1
SYMBOL TABLE

ACCESS  000530R  	FD.FTN= ****** GX	F.RTYP= ****** GX	NOBUF   000472R  	R$$11M= 000001
A.IOST= ****** GX	FD.INS= ****** GX	F.STBK= ****** GX	NOFID   000462R  	R.FIX = ****** GX
A.OWUI= ****** GX	FD.PLC= ****** GX	F.URBD= ****** GX	N.DRPT= 000006   	R.VAR = ****** GX
BADOPN  000450R  	FD.RAN= ****** GX	F.VBN = ****** GX	N.DRSZ= 000004   	SYDEV = 054523
BADOP1  000456R  	FD.REC= ****** GX	F.VBSZ= ****** GX	N.DVPT= 000002   	SYUNIT= 000000
BADOP2  000442R  	FD.RWM= ****** GX	HA.CHU= 000003   	N.DVSZ= 000000   	S.BFHD= ****** GX
BADOP3  000442R  	FD.SQD= ****** GX	HA.FP = 000002   	N.FID = ****** GX	S.FATT= ****** GX
BADRAC  000510R  	FD.WRT= 000001   	HA.NAM= 000005   	N.FNPT= 000012   	WI.DLK= 000002
BADRAT  000520R  	F.BBFS= ****** GX	HA.TYP= 000006   	N.FNSZ= 000010   	WI.LCK= 000001
BADTYP  000500R  	F.BDB = ****** GX	HA.UAT= 000004   	OPALOC  000246R  	$RQCB = ****** GX
BD.FRE= 000001   	F.BKP1= ****** GX	HA.UI = 000001   	OPDIR   000204R  	$$    = 000067
B.NXBD= ****** GX	F.EFBK= ****** GX	HA.VER= 000007   	OVBFSZ  001202R  	.FSRPT= ****** GX
DIRTYP= 015172   	F.ERR = ****** GX	IE.BTP= ****** GX	PP.SEP= 000002   	.OPFID  000000RG
FA.APD= ****** GX	F.FACC= ****** GX	IE.EOF= ****** GX	PP.ZER= 000001   	.SAVR1= ****** GX
FA.CRE= ****** GX	F.FFBY= ****** GX	IE.FOP= ****** GX	R$$ANI= 000000   	..ALUN= ****** GX
FA.EXT= ****** GX	F.FNB = ****** GX	IE.NBF= ****** GX	R$$BBF= 000000   	..BDRC= ****** GX
FA.RD = ****** GX	F.HIBK= ****** GX	IE.NFI= ****** GX	R$$DPB= 000001   	..FCSX= ****** GX
FA.SHR= ****** GX	F.NRBD= ****** GX	IE.RAC= ****** GX	R$$EIS= 000000   	..FINI= ****** GX
FCSEFN= 000040   	F.NREC= ****** GX	IE.RAT= ****** GX	R$$LCL= 000000   	..IDPB= ****** GX
FD.BLK= ****** GX	F.OVBS= ****** GX	IO.ACE= ****** GX	R$$MBF= 000000   	..QIOW= ****** GX
FD.CR = ****** GX	F.RACC= ****** GX	IO.ACR= ****** GX	R$$MUL= 000000   	..RFDB= ****** GX
FD.DVR= 000020   	F.RATT= ****** GX	IO.ACW= ****** GX	R$$OPF= 000002   	..RTAD= ****** GX
FD.EFB= 000004   	F.RCNM= ****** GX	IO.DAC= ****** GX	R$$RSL= 000000   	..RWAC= ****** GX
FD.EF1= 000010   	F.RCTL= ****** GX	NB.DOT= 100000   	R$$SEQ= 000000   	...CTL= 000003
FD.EOF= 000002   	F.RSIZ= ****** GX	NB.SMI= 040000   	R$$SPL= 000000

. ABS.	000000	   000
      	001242	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  3071 WORDS  ( 12 PAGES)
DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:00:26
[41,10]OPFID,[41,20]OPFID/-SP=[41,30]OPFID,FCSPRE,OPEN
OPFNB 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:14  PAGE 1


      1					;                             COPYRIGHT (C) 1975, 1978 BY
      2					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      3					;
      4					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      5					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      6					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      7					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
      8					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
      9					;
     10					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     11					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     12					;       CORPORATION.
     13					;
     14					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     15					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     16		000001 				R$$OPF=1		;ASSEMBLE OPEN TO PRODUCE OPFNB
OPFNB 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:14  PAGE 2


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
OPFNB 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:14  PAGE 8


						.TITLE	OPFNB 0106S, OPEN FILE ROUTINE
						.IDENT	/0106S/
      2					; ALTERED THURSDAY 3-OCT-74 13:10
      3					;
      4					;                             COPYRIGHT (C) 1975, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 13-JULY-73
     21					;
     22					;+
     23					; OPEN A FILE
     24					; CALLING SEQUENCE:
     25					;	CALL	.OPEN
     26					; INPUTS:
     27					;	R0=FDB
     28					; OUTPUTS:
     29					;	ALL REGISTERS PRESERVED
     30					;	C=0 IF SUCCESSFULL, C=1 IF FAILED TO OPEN, F.ERR SET TO WHY
     31					;	FDB SET UP
     32					; OPERATION:
     33					;	USES THE GET INFORMATION PER LUN DIRECTIVE TO GET THE
     34					; DEVICE NAME AND UNIT NUMBER AND SET UP THE BLOCK SIZE AND
     35					; DEVICE DEPENDENT BITS IN F.RCTL.  INITIALIZES SOME OF THE FDB, AND
     36					; THEN DOES EITHER A PARSE, FIND SEQUENCE ON AN EXISTING FILE OR
     37					; A PARSE, ENTER SEQUENCE ON A NEW FILE.  FOR AN EXISTING
     38					; FILE IF THE FILE NAME STRING HAS LENGTH -1 THEN THE PARSE, FIND
     39					; SEQUENCE IS SKIPPED AND THE FILE NAME BLOCK PORTION OF THE FDB
     40					; IS ASSUMED TO BE SET UP.  FINALLY THE BLOCK BUFFER IS ALLOCATED,
     41					; THE REST OF THE FDB INITIALIZED, AND THE FILE ACCESSED.
     42					;-
OPFNB 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:14  PAGE 9


     44						.IF	EQ,R$$OPF	;NORMAL OPEN
     45					.OPEN::
     46						.ENDC
     47					;
     48						.IF	EQ,R$$OPF-1	;OPEN BY FILE NAME BLOCK
     49	000000				.OPFNB::
     50						.ENDC
     51					;
     52						.IF	EQ,R$$OPF-2	;OPEN BY FILE ID
     53					.OPFID::
     54						.ENDC
     55					;
     56	000000					.SAVR1			;SAVE REGISTERS R1-R5
     57	000004	013701 	000000G			MOV	@#.FSRPT,R1	;SEE IF ALLOC CONTROL BLOCK HAS BEEN INITED
     58	000010	005761 	000000G			TST	A.OWUI(R1)	;UIC WORD SHOULD BE NON ZERO
     59	000014	001002 				BNE	10$		;BRANCH IF IT IS
     60	000016					CALL	..FINI		;INIT THE FILE SYSTEM
     61	000022	005760 	000000G		10$:	TST	F.BDB(R0)	;IS THE FILE ALREADY OPEN?
     62	000026	001402 				BEQ	20$		;BRANCH IF NO
     63	000030	000167 	000666 			JMP	BADOPN		;ALREADY OPEN - ERROR
     64	000034	132760 	000000C	000000G	20$:	BITB	#^C<FD.RWM!FD.RAN!FD.PLC!FD.INS>,F.RACC(R0)
     65	000042	001402 				BEQ	24$		;BRANCH IF LEGAL
     66	000044	000167 	000750 			JMP	BADRAC		;ILLEGAL RECORD ACCESS BITS
     67	000050	132760 	000000G	000000G	24$:	BITB	#FA.CRE,F.FACC(R0) ;IF CREATING NEW FILE
     68	000056	001426 				BEQ	40$
     69	000060	132760 	000000C	000000G		BITB	#^C<FD.FTN!FD.CR!FD.BLK>,F.RATT(R0)
     70	000066	001402 				BEQ	26$		;BRANCH IF OK
     71	000070	000167 	000734 			JMP	BADRAT		;ILLEGAL RECORD ATTRIBUTES
     72	000074	132760 	000000G	000000G	26$:	BITB	#FD.RWM,F.RACC(R0) ;IF READ/WRITE MODE
     73	000102	001014 				BNE	40$		;IGNORE RECORD TYPE
     74	000104	122760 	000000G	000000G		CMPB	#R.FIX,F.RTYP(R0) ;CHECK RECORD TYPE
     75	000112	001410 				BEQ	40$		;BRANCH IF LEGAL
     76	000114	122760 	000000G	000000G		CMPB	#R.VAR,F.RTYP(R0) ;VARIABLE LENGTH RECORDS?
     77	000122	001402 				BEQ	30$		;BRANCH IF YES
     78	000124	000167 	000660 			JMP	BADTYP		;ILLEGAL RECORD TYPE
     79	000130	005060 	000000G		30$:	CLR	F.RSIZ(R0)	;VARIABLE LENGTH SIZE INIT TO ZERO
     80	000134	012760 	000001 	000000G	40$:	MOV	#1,F.ERR(R0)	;INIT ERROR INDICATION TO SUCCESSFUL
     81	000142	005060 	000000G			CLR	F.HIBK(R0)	;INIT LAST BLOCK ALLOCATED
     82	000146	005060 	000002G			CLR	F.HIBK+2(R0)
     83	000152	005060 	000000G			CLR	F.EFBK(R0)	;INIT THE END OF FILE BLOCK NO.
     84	000156	012760 	000001 	000002G		MOV	#1,F.EFBK+2(R0)
     85	000164	005060 	000000G			CLR	F.FFBY(R0)	;ZERO THE FIRST FREE BYTE POINTER
     86	000170	005060 	000000G			CLR	F.VBN(R0)	;ZERO THE INITIAL VBN
     87	000174	005060 	000002G			CLR	F.VBN+2(R0)
     88	000200	105060 	000000G			CLRB	F.BKP1(R0)
     89	000204				OPDIR:
     90						.IF	EQ,R$$OPF	;REGULAR OPEN (BY FILE NAME)
     91						CALL	..STFN		;PARSE INTO FNB UNLESS ALREADY SET UP
     92						.ENDC
     93					;
     94						.IF	EQ,R$$OPF-1	;OPEN BY FILE NAME BLOCK
     95	000204	010001 				MOV	R0,R1
     96	000206	062701 	000000G			ADD	#F.FNB,R1	;R1=ADDR OF FNB
     97	000212					CALL	..ALUN
     98						.ENDC
     99					;
    100						.IF	LE,R$$OPF-1 ;OPEN BY NAME OR FNB
OPFNB 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:14  PAGE 9-1


    101	000216	103435 				BCS	26$
    102	000220					CALL	OVBFSZ		;USE OVERIDE BUFFER SIZE IF SPECIFIED
    103	000224	005761 	000000G			TST	N.FID(R1)	;IS FILE ID ALREADY SET?
    104	000230	001133 				BNE	80$		;BRANCH IF YES
    105	000232	132760 	000000G	000000G		BITB	#FA.CRE,F.FACC(R0) ;CREATING A NEW FILE?
    106	000240	001004 				BNE	20$		;BRANCH IF YES
    107					; OPENING AN EXISTING FILE
    108	000242					CALL	..FIND
    109	000246	103421 				BCS	26$
    110	000250	000523 				BR	80$
    111
    112					; OPENING A NEW FILE
    113	000252	132760 	000000G	000000G	20$:	BITB	#FD.SQD,F.RCTL(R0) ;IF SEQUENTIAL DEVICE
    114	000260	001435 				BEQ	40$
    115	000262	122760 	000000G	000000G		CMPB	#R.FIX,F.RTYP(R0) ;AND FIXED LENGTH RECORDS
    116	000270	001026 				BNE	38$
    117	000272	016003 	000000G			MOV	F.RSIZ(R0),R3	;CHECK RECORD SIZE
    118					;
    119					; REMOVE THE LOWER BOUNDS CHECK WHEN FCP ENFORCES IT
    120	000276	020327 	000022 			CMP	R3,#18.
    121	000302	103005 				BHIS	30$		;BRANCH IF SIZE IS OK
    122	000304	112760 	000000G	000000G	25$:	MOVB	#IE.RBG,F.ERR(R0)
    123	000312	000167 	000376 		26$:	JMP	BADOP2
    124					;
    125					; CALCULATE NEW BLOCK SIZE. INTEGER MULTIPLE OF RECORD SIZE
    126						.IF	GT,R$$EIS
    127					30$:	CLR	R4
    128						MOV	F.BBFS(R0),R5
    129						DIV	R3,R4		;R4=RECORDS / BLOCK
    130						BNE	35$
    131						INC	R4		;AT LEAST 1
    132					35$:	MUL	R3,R4
    133						.IFF
    134	000316	005005 			30$:	CLR	R5		;START AT 0
    135	000320	060305 			35$:	ADD	R3,R5		;NOW ADD IN RECORD SIZE
    136	000322	020560 	000000G			CMP	R5,F.BBFS(R0)	;OVER LIMIT?
    137	000326	103774 				BLO	35$		;NOPE
    138	000330	160305 				SUB	R3,R5		;YES, SO CORRECT DOWN
    139	000332	001001 				BNE	36$		;NON-ZERO
    140	000334	010305 				MOV	R3,R5		;MAKE AT LEAST 1
    141	000336				36$:
    142						.ENDC
    143	000336	010560 	000000G			MOV	R5,F.VBSZ(R0)
    144	000342	010560 	000000G			MOV	R5,F.BBFS(R0)	;STORE NEW BLOCK SIZE
    145	000346	016060 	000000G	000000G	38$:	MOV	F.BBFS(R0),F.FFBY(R0) ;MAKE BLOCK SIZE AVAILABLE TO FCP
    146					;
    147					; ISSUE THE QI/O TO CREATE THE NEW FILE
    148	000354				40$:	CALL	..CREA		;CREATE THE NEW FILE
    149	000360	103754 				BCS	26$
    150	000362	132760 	000000G	000000G		BITB	#FA.TMP,F.FACC(R0) ;IF CREATING TEMP FILE
    151	000370	001053 				BNE	80$		;SKIP THE ENTER
    152	000372	005760 	000000G			TST	F.FVER(R0)
    153	000376	001003 				BNE	45$
    154	000400	152760 	000020 	000000G		BISB	#FD.DVR,F.BKP1(R0) ;CREATING DEFAULT VERSION NUMBER
    155	000406				45$:	CALL	..ENTR		;MAKE THE DIRECTORY ENTRY
    156	000412	103042 				BCC	80$		;BRANCH IF NO ERROR FROM ..ENTR
    157					; IF THE ENTER ERROR WAS THAT FILE ALREADY EXISTS BY THAT NAME, THEN DELETE IT
OPFNB 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:14  PAGE 9-2


    158	000414	132760 	000000G	000000G		BITB	#FA.NSP,F.FACC(R0) ;SUPERSEDE INHIBITED?
    159	000422	001033 				BNE	60$		;BRANCH IF YES,INDICATE OPEN FAILURE
    160	000424	122760 	000000G	000000G		CMPB	#IE.DUP,F.ERR(R0)
    161	000432	001027 				BNE	60$		;OTHER KIND OF ERROR, REAL ERROR
    162	000434	012760 	000001 	000000G		MOV	#1,F.ERR(R0)	;RESET THE ERROR CONDITION
    163	000442	016146 	000000G			MOV	N.FID(R1),-(SP)	;SAVE THE FILE ID FROM THE DELETE
    164	000446	016146 	000002G			MOV	N.FID+2(R1),-(SP)
    165	000452	016146 	000004G			MOV	N.FID+4(R1),-(SP)
    166	000456	010146 				MOV	R1,-(SP)	;PRESERVE FNB ADDRESS FROM DELETE
    167	000460					CALL	..DEL1
    168	000464	012601 				MOV	(SP)+,R1
    169	000466	012661 	000004G			MOV	(SP)+,N.FID+4(R1)
    170	000472	012661 	000002G			MOV	(SP)+,N.FID+2(R1)
    171	000476	012661 	000000G			MOV	(SP)+,N.FID(R1)
    172	000502	103403 				BCS	60$		;BRANCH IF DELETE FAILED
    173	000504					CALL	..ENTR		;REISSUE THE ..ENTR, NOW IT SHOULD WORK
    174	000510	103003 				BCC	80$		;BRANCH IF OK
    175	000512	005002 			60$:	CLR	R2		;DON'T DO A REMOVE WHEN CLEANING UP
    176	000514	000167 	000234 			JMP	BADOP4		;SOME OTHER ERROR THIS TIME
    177						.ENDC
    178					;
    179						.IF	EQ,R$$OPF-2	;OPEN BY FILE ID
    180						MOV	R0,R1
    181						ADD	#F.FNB,R1
    182						CALL	..ALUN
    183						BCS	BADOP2
    184						CALL	OVBFSZ		;USE OVERRIDE BUF SIZE IF SPECIFIED
    185						TST	N.FID(R1)	;FILE ID MUST BE NON ZERO
    186						BNE	75$
    187						BITB	#FD.REC,F.RCTL(R0) ;UNLESS RECORD DEVICE
    188						BEQ	NOFID
    189						INC	N.FID(R1)	;IN WHICH CASE MAKE IT 1
    190					75$:
    191						.ENDC
    192					;
    193	000520				80$:
OPFNB 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:14  PAGE 10


    195	000520	132760 	000000G	000000G	OPALOC:	BITB	#FD.RWM,F.RACC(R0) ;READ/WRITE MODE?
    196	000526	001407 				BEQ	10$		;BRANCH IF PUT/GET MODE
    197					; PUT ADDRESS OF SCRATCH I/O STATUS BLOCK IN F.BDB
    198	000530	013760 	000000G	000000G		MOV	@#.FSRPT,F.BDB(R0)
    199	000536	062760 	000000G	000000G		ADD	#A.IOST,F.BDB(R0)
    200	000544	000420 				BR	60$
    201					;
    202					; ALLOCATE BLOCK BUFFER
    203	000546				10$:
    204						.IF	EQ,R$$MBF	;IF NO MULTIPLE BUFFERING
    205	000546	016001 	000000G			MOV	F.BBFS(R0),R1	;R1=BLOCK SIZE FOR THIS DEVICE
    206	000552	010046 				MOV	R0,-(SP)	;SAVE THE FDB ADDRESS
    207	000554	013700 	000000G			MOV	@#.FSRPT,R0	;ALLOCATION CONTROL BLOCK FOR FSR
    208	000560	062701 	000000G			ADD	#S.BFHD,R1	;ADD IN BUFFER HEADER
    209	000564					CALL	$RQCB		;REQUEST A CORE BLOCK
    210	000570	010001 				MOV	R0,R1		;ADDRESS ALLOCATED TO R1
    211	000572	012600 				MOV	(SP)+,R0	;RESTORE FDB FROM STACK
    212	000574	103457 				BCS	NOBUF		;BRANCH IF NO BUFFER SPACE
    213	000576	010160 	000000G			MOV	R1,F.BDB(R0)	;SET UP BUFFER DESCRIPTOR BLOCK POINTER
    214	000602	010161 	000000G			MOV	R1,B.NXBD(R1)	;CHAIN BUFFER TO ITSELF
    215						.ENDC
    216					;
    217						.IF	GT,R$$MBF	;IF MULTIPLE BUFFERING
    218					; ALLOCATE NUMBER OF BUFFERS SPECIFIED IN F.MBCT, AND
    219					; SET UP THE BUFFER RING
    220						MOV	R0,R4		;PRESERVE THE FDB ADDRESS
    221						CLR	R3		;NO BUFFERS ALLOCATED YET
    222						CLR	R5
    223						BISB	F.MBCT(R0),R5	;R5=NO. OF BUFFERS DESIRED
    224						BNE	20$
    225						MOV	@#.FSRPT,R5
    226						MOVB	A.DFBC(R5),R5	;USE DEFAULT NO. OF BUFFERS FROM FSR2
    227					20$:	CLRB	F.MBC1(R0)
    228						CMP	#1,R5		;IF SINGLE BUFFERING
    229						BGE	23$		;DON'T SET READ AHEAD, WRITE BEHIND
    230						BITB	#FD.RAH!FD.WBH,F.MBFG(R0) ;IF USER SET THESE
    231						BNE	23$		;DON'T CHANGE THEM
    232						MOV	#FD.RAH,R1	;DEFAULT TO READ AHEAD IF READ ONLY
    233						BITB	#FA.RD,F.FACC(R0)
    234						BNE	22$
    235						MOV	#FD.WBH,R1	;OTHERWISE USE WRITE BEHIND
    236					22$:	BISB	R1,F.MBFG(R0)
    237					23$:	MOV	@#.FSRPT,R0	;POINTER TO ALOOCATION CONTROL BLOCK
    238						MOV	F.BBFS(R4),R1
    239						ADD	#S.BFHD,R1	;R1=NO. OF BYTES TO ALLOCATES
    240						CALL	$RQCB		;REQUEST A CORE BLOCK
    241						BCS	58$		;BRANCH IF NO MORE MEMORY AVAILABLE
    242						TST	R3		;FIRST BUFFER?
    243						BNE	35$		;BRANCH IF NO
    244						MOV	R0,F.BDB(R4)	;YES, SET UP  F.BDB
    245						BR	47$
    246					35$:	MOV	R0,B.NXBD(R3)	;LINK THE BUFFERS
    247					47$:	MOV	R0,R3
    248						MOV	#1,@R3		;INIT THE BUFFER DESCRIPTOR
    249						MOVB	#BD.FRE,B.BFST(R3) ;NOTE BUFFER AVAILABLE
    250						INCB	F.MBC1(R4)	;COUNT THE BUFFERS ALLOCATED
    251						SOB	R5,23$		;ALLOCATE THE NEXT ONE
OPFNB 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:14  PAGE 10-1


    252					58$:	MOV	R4,R0		;RESTORE FDB ADDRESS
    253						TST	R3		;ANY BUFFERS ALLOCATED?
    254						BEQ	NOBUF		;BRANCH IF NO
    255						MOV	F.BDB(R0),B.NXBD(R3) ;CLOSE THE BUF RING
    256						.ENDC
    257					;
    258	000606				60$:	CALL	ACCESS
    259	000612	103453 				BCS	BADOP3
    260	000614	005060 	000000G			CLR	F.RCNM(R0)	;DON'T INIT BEFORE ACCESS
    261	000620	012760 	000001 	000002G		MOV	#1,F.RCNM+2(R0)	;INIT RECORD NUMBER TO 1
    262					;
    263					; SET UP NRBA AND NRBS BASED ON PARTIAL LOCATE MODE OR MOVE MODE
    264	000626	132760 	000000G	000000G		BITB	#FD.RWM,F.RACC(R0) ;READ/WRITE MODE?
    265	000634	001025 				BNE	80$		;BRANCH IF YES
    266	000636	016060 	000000G	000000G		MOV	F.URBD(R0),F.NRBD(R0) ;ASSUME MOVE MODE
    267	000644	016060 	000002G	000002G		MOV	F.URBD+2(R0),F.NRBD+2(R0)
    268	000652	122760 	000000G	000000G		CMPB	#R.FIX,F.RTYP(R0) ;IF FIXED LENGTH RECORDS
    269	000660	001011 				BNE	75$
    270	000662	005760 	000000G			TST	F.RSIZ(R0)	;IF FIXED RECORD SIZE =0
    271	000666	001003 				BNE	70$
    272	000670	016060 	000000G	000000G		MOV	F.VBSZ(R0),F.RSIZ(R0) ;USE THE VIRTUAL BLOCK SIZE
    273	000676	016060 	000000G	000000G	70$:	MOV	F.RSIZ(R0),F.NRBD(R0) ;SET NXT REC BUF SIZ TO FIXED SIZE
    274	000704				75$:	CALL	..RTAD		;RETURN ADDRESS FOR NEXT RECORD TO USER
    275	000710	000241 			80$:	CLC			;EXIT SUCCESSFULLY
    276	000712					RETURN
OPFNB 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:14  PAGE 11


    278					;
    279						.IF	EQ,R$$OPF-2	;OPEN BY FILE ID
    280					BADOP3:
    281						.ENDC
    282					;
    283					; ERROR EXITS FROM OPEN
    284	000714				BADOP2:	CALL	..RFDB		;RESET THE FDB, RELEASING BUFFER IF NECESSARY
    285	000720	000403 				BR	BADOP1		;AND EXIT REPORTING AN ERROR CONDITION
    286					; ATTEMPTED TO OPEN ALREADY OPEN FILE
    287	000722	112760 	000000G	000000G	BADOPN:	MOVB	#IE.FOP,F.ERR(R0)
    288	000730	000261 			BADOP1:	SEC
    289	000732					RETURN
    290					; NO FILE ID SPECIFIED TO OPEN BY FILE ID ROUTINE
    291						.IF	EQ,R$$OPF-2	;OPEN BY FILE ID
    292					NOFID:	MOVB	#IE.NFI,F.ERR(R0)
    293						BR	BADOP2
    294						.ENDC
    295					;
    296					; NO BUFFER SPACE AVAILABLE FOR THE FILE
    297	000734	112760 	000000G	000000G	NOBUF:	MOVB	#IE.NBF,F.ERR(R0)
    298					;
    299						.IF	NE,R$$OPF-2	;OPEN OR OPFNB
    300					; MARK FOR DELETE IF CREATING NEW FILE
    301	000742	132760 	000000G	000000G	BADOP3:	BITB	#FA.CRE,F.FACC(R0)
    302	000750	001761 				BEQ	BADOP2		;BRANCH IF EXISTING FILE
    303	000752	010702 				MOV	PC,R2		;REMOVE FROM DIR. IF R2 IS NOT ZERO
    304	000754	116046 	000000G		BADOP4:	MOVB	F.ERR(R0),-(SP)	;SAVE ERROR CODE
    305	000760	010001 				MOV	R0,R1
    306	000762	062701 	000000G			ADD	#F.FNB,R1
    307	000766	005702 				TST	R2
    308	000770	001402 				BEQ	10$
    309	000772					CALL	..RMOV		;REMOVE FROM DIRECTORY
    310	000776				10$:	CALL	..MKDL		;DELETE THE EMBRYONIC FILE
    311	001002	112660 	000000G			MOVB	(SP)+,F.ERR(R0)	;RESTORE ERROR CODE
    312	001006	000742 				BR	BADOP2
    313						.ENDC
    314					;
    315					; ILLEGAL RECORD TYPE
    316	001010	112760 	000000G	000000G	BADTYP:	MOVB	#IE.BTP,F.ERR(R0)
    317	001016	000744 				BR	BADOP1
    318					; ILLEGAL RECORD ACCESS CODE - UNUSED BITS MUST BE ZERO
    319	001020	112760 	000000G	000000G	BADRAC:	MOVB	#IE.RAC,F.ERR(R0)
    320	001026	000740 				BR	BADOP1
    321					; ILLEGAL RECORD ATTRIBUTES BITS SET - UNDEFINED BITS MUST BE ZERO
    322	001030	112760 	000000G	000000G	BADRAT:	MOVB	#IE.RAT,F.ERR(R0)
    323	001036	000734 				BR	BADOP1
OPFNB 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:14  PAGE 12


    325					;+
    326					; ACCESS THE FILE
    327					; CALLING SEQUENCE:
    328					;	CALL	ACCESS
    329					; INPUTS:
    330					;	R0=FDB
    331					;	F.VBN,F.VBN+2=0
    332					;	F.SHAR,F.STBK SET UP AS APPROPRIATE
    333					;
    334					;
    335					;
    336					;
    337					; OUTPUTS:
    338					;	C=0 IF SUCCESSFUL, C=1 IF ERROR F.ERR SET
    339					;	R0 PRESERVED, R1-R5 ALTERED
    340					;	F.VBN SET
    341					;	F.NREC,F.EOBB SET
    342					;
    343					;
    344					;
    345					; OPERATION:
    346					; ISSUES QIO ACCESS WITH READ OF RECORD ATTRIBUTES
    347					; FOR EXISTING BLOCK ORIENTED FILE, SETS UP RECORD
    348					; ATTRIBUTES FOR EXISTING RECORD ORIENTED FILE. IF CREATING
    349					; NEW FILE, RECORD ATTRIBUTES WERE ALL SET. IF ACCESSING
    350					; AN EXISTING BLOCK ORIENTED FILE READS THE 1ST
    351					; OR LAST (FOR APPEND) VIRTUAL BLOCK. NO READ INITIATED
    352					; FOR RECORD ORIENTED DEVICE.
    353					;-
    354	001040				ACCESS:
    355	001040	132760 	000000G	000000G		BITB	#FD.REC,F.RCTL(R0) ;IF RECORD ORIENTED
    356	001046	001171 				BNE	70$		;SKIP THE ACCESS QI/O
    357					;
    358					; ISSUE THE ACCESS QI/O
    359					;
    360	001050					CALL	..IDPB		;INIT THE DPB AND SET R5 TO PARAM BLOCK
    361	001054	010015 				MOV	R0,(R5)
    362	001056	062725 	000000G			ADD	#F.FNB,(R5)+	;STORE THE ADDRESS OF THE FILE ID
    363						.IF	GT,R$$DPB
    364	001062	162706 	000012 			SUB	#12,SP		;MAKE ROOM ON STACK FOR READ ATT LIST
    365	001066	010625 				MOV	SP,(R5)+	;STORE ADDRESS OF ATT LIST
    366	001070	062705 	000005 			ADD	#5,R5		;INDEX TO ACCESS CONTROL BITS
    367	001074	152715 	000200 			BISB	#200,(R5)	;AND SIGNAL ACCESS DESIRED
    368						.IFTF
    369	001100	132760 	000000G	000000G		BITB	#FA.SHR,F.FACC(R0) ;SHARED ACCESS DESIRED?
    370	001106	001002 				BNE	10$		;BRANCH IF YES
    371	001110	152715 	000001 			BISB	#WI.LCK,(R5)	;NO, REQUEST LOCKED ACCESS
    372	001114	012704 	000000G		10$:	MOV	#IO.ACR,R4	;ASSUME ACCESS FOR READ
    373	001120	132760 	000000G	000000G		BITB	#FA.RD,F.FACC(R0) ;READ ONLY ACCESS DESIRED?
    374	001126	001012 				BNE	20$		;YES, R4 ALL SET
    375					;
    376					; WRITE ACCESS DESIRED
    377					;
    378	001130	152715 	000002 			BISB	#WI.DLK,(R5)	;ENABLE DEACCESS LOCK
    379	001134	012704 	000000G			MOV	#IO.ACE,R4	;ASSUME ACCESS FOR EXTEND DESIRED
    380	001140	132760 	000000G	000000G		BITB	#FA.EXT,F.FACC(R0) ;EXTEND ACCESS REQUESTED?
    381	001146	001002 				BNE	20$		;BRANCH IF YES, R4 ALL SET
OPFNB 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:14  PAGE 12-1


    382	001150	012704 	000000G			MOV	#IO.ACW,R4	;ACCESS IS FOR READ, WRITE
    383	001154				20$:
    384						.IFF
    385						TST	(R5)+		;POINT TO PLACE TO PUT RECORD ATT ADDRESS
    386						BITB	#FA.CRE,F.FACC(R0) ;UNLESS CREATING A NEW FILE
    387						BNE	30$
    388						MOV	R0,(R5)		;READ RECORD ATTRIBUTE TO FDB
    389					30$:	TST	(R5)+		;POINT TO STATISTICS BLOCK ADDRESS
    390						MOV	F.STBK(R0),(R5)	;READ STATISTICS BLOCK IF DESIRED
    391						.IFT
    392	001154	010605 				MOV	SP,R5		;GET POINTER TO ATT LIST
    393	001156	132760 	000000G	000000G		BITB	#FA.CRE,F.FACC(R0) ;READ ATT UNLESS CREATING
    394	001164	001003 				BNE	30$
    395	001166	012725 				MOV	(PC)+,(R5)+	;SET READ REC I/O CODE
    396	001170	   374 	   000G			.BYTE	-HA.UAT,S.FATT
    397	001172	010025 				MOV	R0,(R5)+	;TO THIS ADDRESS
    398	001174	016015 	000000G		30$:	MOV	F.STBK(R0),(R5)	;ADDRESS OF STATISTICS BLOCK IF DESIRED
    399	001200	001405 				BEQ	33$		;NOT DESIRED...
    400	001202	012725 				MOV	(PC)+,(R5)+	;DESIRED, SET THE CODE
    401	001204	   367 	   012 			.BYTE	-11,12
    402	001206	016025 	000000G			MOV	F.STBK(R0),(R5)+
    403	001212	005015 				CLR	(R5)
    404	001214				33$:
    405						.IFTF
    406	001214					CALL	..QIOW		;ISSUE THE ACCESS QI/O AND WAIT
    407	001220	103500 				BCS	97$		;BRANCH IF FAILED TO ACCESS
    408						.IFT
    409	001222	062706 	000012 			ADD	#12,SP		;POP STACK ITEMS
    410						.IFTF
    411	001226	005260 	000002G			INC	F.VBN+2(R0)	;VBN=1
    412	001232	132760 	000000G	000000G		BITB	#FD.SQD,F.RCTL(R0) ;SEQUENTIAL DEVICE?
    413	001240	001412 				BEQ	35$		;BRANCH IF NOT
    414	001242	012760 	077777 	000000G		MOV	#77777,F.HIBK(R0) ;FAKE LARGE ALLOCATION
    415	001250	132760 	000000G	000000G		BITB	#FA.CRE,F.FACC(R0) ;AND IF OPENING EXISTING FILE
    416	001256	001003 				BNE	35$
    417	001260	012760 	037777 	000000G		MOV	#37777,F.EFBK(R0) ;FAKE EOF SHORT OF ALLOCATED SPACE
    418	001266	132760 	000000G	000000G	35$:	BITB	#FA.APD,F.FACC(R0) ;IF APPENDING
    419	001274	001406 				BEQ	38$
    420	001276	016060 	000000G	000000G		MOV	F.EFBK(R0),F.VBN(R0) ;SET NEXT VBN
    421	001304	016060 	000002G	000002G		MOV	F.EFBK+2(R0),F.VBN+2(R0)
    422	001312	132760 	000000G	000000G	38$:	BITB	#FD.RWM,F.RACC(R0) ;IF READ/WRITE ALL DONE
    423	001320	001071 				BNE	90$
    424	001322	132760 	000000G	000000G		BITB	#FA.CRE,F.FACC(R0) ;SKIP READ OF VBN
    425	001330	001061 				BNE	80$		;IF NEW FILE
    426					;
    427					; EXISTING BLOCK ORIENTED FILE, READ VBN 1 OR LAST VBN IF
    428					; OPEN FOR APPEND. THIS WILL INIT BUFFER AND RECORD POINTERS
    429					;
    430	001332					CALL	..RWAC		;READ THE 1ST OR LAST BLOCK
    431	001336	103021 				BCC	60$		;BRANCH IF SUCCESSFUL
    432	001340	012746 	000001 			MOV	#1,-(SP)	;ASSUME EOF ERROR
    433	001344	122760 	000000G	000000G		CMPB	#IE.EOF,F.ERR(R0) ;IF EOF ERROR, DELAY THE REPORT
    434	001352	001410 				BEQ	50$
    435	001354	016016 	000000G			MOV	F.ERR(R0),(SP)	;OTHERWISE SAVE THE ERROR CODE
    436					;
    437					; NOW DEACCESS THE FILE
    438					;
OPFNB 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:14  PAGE 12-2


    439	001360					CALL	..IDPB		;INIT AND ZERO THE DPB
    440	001364	012704 	000000G			MOV	#IO.DAC,R4	;I/O FUNCTION CODE FOR DEACCESS
    441	001370					CALL	..QIOW		;ISSUE THE QI/O AND WAIT
    442	001374	012660 	000000G		50$:	MOV	(SP)+,F.ERR(R0)	;RESTORE SAVED ERROR CODE
    443	001400	000441 				BR	90$
    444	001402	132760 	000000G	000000G	60$:	BITB	#FA.APD,F.FACC(R0) ;IF APPENDING
    445	001410	001435 				BEQ	90$
    446	001412	066060 	000000G	000000G		ADD	F.FFBY(R0),F.NREC(R0) ;SET NEXT RECORD POINTER TO EOF
    447	001420	000431 				BR	90$
    448	001422				97$:
    449						.IFT
    450	001422	062706 	000012 			ADD	#12,SP		;POP STACK ITEMS
    451	001426	000261 				SEC			;INDICATE ERROR
    452						.IFTF
    453	001430	000427 				BR	95$		;AND EXIT
    454						.ENDC
    455					; RECORD ORIENTED DEVICE MUST SET UP RECORD ATTRIBUTES IF
    456					; READING AN EXISTING FILE.
    457	001432	132760 	000000G	000000G	70$:	BITB	#FA.CRE,F.FACC(R0) ;IF NEW FILE
    458	001440	001011 				BNE	75$		;DON'T SET ATTRIBUTES
    459	001442	112760 	000000G	000000G		MOVB	#R.VAR,F.RTYP(R0) ;ASSUME VARIABLE LENGTH
    460	001450	112760 	000000G	000000G		MOVB	#FD.CR,F.RATT(R0) ;CARRIAGE RETURNS BETWEEN RECS
    461	001456	016060 	000000G	000000G		MOV	F.BBFS(R0),F.RSIZ(R0) ;MAX RECORD SIZE
    462	001464	132760 	000000G	000000G	75$:	BITB	#FD.RWM,F.RACC(R0)	;IF READ/WRITE MODE THEN EXIT
    463	001472	001004 				BNE	90$
    464					; INIT BUFFER DESCRIPTOR AND RECORD POINTERS FOR 1ST GET, PUT
    465	001474	016001 	000000G		80$:	MOV	F.BDB(R0),R1
    466	001500					CALL	..BDRC
    467	001504				90$:	CALL	..FCSX
    468	001510				95$:	RETURN
OPFNB 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:14  PAGE 13


    470					; USE OVERRIDE BUFFER SIZE IF SPECIFIED
    471					; DESTROYS R4,R5, R0-R3 PRESERVED
    472	001512	016005 	000000G		OVBFSZ:	MOV	F.OVBS(R0),R5
    473	001516	001414 				BEQ	50$		;BRANCH IF NO OVERRIDE SPECIFIED
    474					;
    475						.IF	EQ,R$$BBF	;NO BIG BUFFERS ALLOWED
    476	001520	132760 	000000C	000000G		BITB	#FD.REC!FD.SQD,F.RCTL(R0)
    477	001526	001410 				BEQ	50$		;NO OVERRIDE FOR BLOCK DEVICE
    478						.ENDC
    479					;
    480						.IF	GT,R$$BBF	;BIG BUFFERS ALLOWED
    481						BITB	#FD.REC!FD.SQD,F.RCTL(R0) ;IF RECORD DEVICE
    482						BNE	40$		;ALLOW THE OVERRIDE
    483						.IF	GT,R$$EIS
    484						CLR	R4
    485						DIV	F.BBFS(R0),R4	;NO. OF VIRT BLOCKS IN BUFFER
    486						TST	R4
    487						BNE	20$
    488						INC	R4		;AT LEAST ONE
    489					20$:	MOVB	R4,F.BGBC(R0)	;SAVE VB/BUFFER
    490						MUL	F.BBFS(R0),R4	;R5=SIZE OF BUFFER
    491						.IFF
    492						CLRB	F.BGBC(R0)	;START AT 0
    493						CLR	R4		;START AT 0
    494					20$:	ADD	F.BBFS(R0),R4	;ADD
    495						INCB	F.BGBC(R0)	;AND INC
    496						CMP	R4,R5		;AGAIN?
    497						BLO	20$		;YES
    498						DECB	F.BGBC(R0)	;CORRECT
    499						SUB	F.BBFS(R0),R4	;CORRECT OTHER
    500						BNE	25$		;O.K.
    501						INCB	F.BGBC(R0)	;CORRECT
    502						ADD	F.BBFS(R0),R4	;CORRECT ALSO
    503					25$:	MOV	R4,R5		;MATCH CONVENTIONS
    504						.ENDC
    505						BISB	#FD.BGB,F.MBFG(R0) ;NOTE USING BIG BUFFERS
    506						BR	45$
    507					40$:
    508					.ENDC
    509					;
    510	001530	132760 	000000G	000000G		BITB	#FD.SQD,F.RCTL(R0)
    511	001536	001402 				BEQ	45$
    512	001540	010560 	000000G			MOV	R5,F.VBSZ(R0)	;SET VIRTUAL BLOCK SIZE TOO IF SEQ DEV
    513	001544	010560 	000000G		45$:	MOV	R5,F.BBFS(R0)
    514	001550				50$:	RETURN
    515					;
    516					;
    517	001552					$END	OPEN
    518					;
    519					;
    520		000001 				.END
OPFNB 0106S, OPEN FILE ROUTINE	MACRO M1108  05-DEC-77 22:14  PAGE 13-1
SYMBOL TABLE

ACCESS  001040R  	FD.EOF= 000002   	F.RTYP= ****** GX	N.DRPT= 000006   	SYUNIT= 000000
A.IOST= ****** GX	FD.FTN= ****** GX	F.STBK= ****** GX	N.DRSZ= 000004   	S.BFHD= ****** GX
A.OWUI= ****** GX	FD.INS= ****** GX	F.URBD= ****** GX	N.DVPT= 000002   	S.FATT= ****** GX
BADOPN  000722R  	FD.PLC= ****** GX	F.VBN = ****** GX	N.DVSZ= 000000   	WI.DLK= 000002
BADOP1  000730R  	FD.RAN= ****** GX	F.VBSZ= ****** GX	N.FID = ****** GX	WI.LCK= 000001
BADOP2  000714R  	FD.REC= ****** GX	HA.CHU= 000003   	N.FNPT= 000012   	$RQCB = ****** GX
BADOP3  000742R  	FD.RWM= ****** GX	HA.FP = 000002   	N.FNSZ= 000010   	$$    = 000067
BADOP4  000754R  	FD.SQD= ****** GX	HA.NAM= 000005   	OPALOC  000520R  	.FSRPT= ****** GX
BADRAC  001020R  	FD.WRT= 000001   	HA.TYP= 000006   	OPDIR   000204R  	.OPFNB  000000RG
BADRAT  001030R  	F.BBFS= ****** GX	HA.UAT= 000004   	OVBFSZ  001512R  	.SAVR1= ****** GX
BADTYP  001010R  	F.BDB = ****** GX	HA.UI = 000001   	PP.SEP= 000002   	..ALUN= ****** GX
BD.FRE= 000001   	F.BKP1= ****** GX	HA.VER= 000007   	PP.ZER= 000001   	..BDRC= ****** GX
B.NXBD= ****** GX	F.EFBK= ****** GX	IE.BTP= ****** GX	R$$ANI= 000000   	..CREA= ****** GX
DIRTYP= 015172   	F.ERR = ****** GX	IE.DUP= ****** GX	R$$BBF= 000000   	..DEL1= ****** GX
FA.APD= ****** GX	F.FACC= ****** GX	IE.EOF= ****** GX	R$$DPB= 000001   	..ENTR= ****** GX
FA.CRE= ****** GX	F.FFBY= ****** GX	IE.FOP= ****** GX	R$$EIS= 000000   	..FCSX= ****** GX
FA.EXT= ****** GX	F.FNB = ****** GX	IE.NBF= ****** GX	R$$LCL= 000000   	..FIND= ****** GX
FA.NSP= ****** GX	F.FVER= ****** GX	IE.RAC= ****** GX	R$$MBF= 000000   	..FINI= ****** GX
FA.RD = ****** GX	F.HIBK= ****** GX	IE.RAT= ****** GX	R$$MUL= 000000   	..IDPB= ****** GX
FA.SHR= ****** GX	F.NRBD= ****** GX	IE.RBG= ****** GX	R$$OPF= 000001   	..MKDL= ****** GX
FA.TMP= ****** GX	F.NREC= ****** GX	IO.ACE= ****** GX	R$$RSL= 000000   	..QIOW= ****** GX
FCSEFN= 000040   	F.OVBS= ****** GX	IO.ACR= ****** GX	R$$SEQ= 000000   	..RFDB= ****** GX
FD.BLK= ****** GX	F.RACC= ****** GX	IO.ACW= ****** GX	R$$SPL= 000000   	..RMOV= ****** GX
FD.CR = ****** GX	F.RATT= ****** GX	IO.DAC= ****** GX	R$$11M= 000001   	..RTAD= ****** GX
FD.DVR= 000020   	F.RCNM= ****** GX	NB.DOT= 100000   	R.FIX = ****** GX	..RWAC= ****** GX
FD.EFB= 000004   	F.RCTL= ****** GX	NB.SMI= 040000   	R.VAR = ****** GX	...CTL= 000003
FD.EF1= 000010   	F.RSIZ= ****** GX	NOBUF   000734R  	SYDEV = 054523

. ABS.	000000	   000
      	001552	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  3172 WORDS  ( 13 PAGES)
DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:00:29
[41,10]OPFNB,[41,20]OPFNB/-SP=[41,30]OPFNB,FCSPRE,OPEN
OVCTL	MACRO M1108  05-DEC-77 23:42  PAGE 3


      1						.TITLE	OVCTL
      2						.IDENT	/08/                                                            ;**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 08
     21					;                                                                               ;**-1
     22					; D. N. CUTLER/C. MONIA 11-JAN-74
     23					;
     24					; MODIFICATIONS:
     25					;
     26					; NO.		DATE		PROGRAMMER
     27					; ---		----		----------
     28					;
     29					; 021		11-JAN-74	C. MONIA
     30					;
     31					; OVERLAY RUN TIME ROUTINES
     32					;
     33					; EQUATED SYMBOLS
     34					;
     35
     36		000037 			O$VEF==31.			;SYSTEM OVERLAY EVENT FLAG
     37		000001 			Q$IO=1				;QUEUE I/O DIRECTIVE CODE
     38		000051 			W$FR=41.			;WAIT FOR EVENT FLAG DIRECTIVE CODE
     39
     40					;
     41					; MACRO LIBRARY CALLS
     42					;
     43
     44						.MCALL	DIR$,QIOSY$,WTSE$S                                              ;**NEW**
     45	000000					QIOSY$                                                                  ;**-1
     46
     47					;+
     48					; **-$MARKS-MARK SEGMENT
     49					;
     50					; THIS ROUTINE IS CALLED TO MARK ALL SEGMENTS OUT OF MEMORY THAT ARE
     51					; NOT ON THE SAME PATH AS THE ARGUMENT SEGMENT. IT IS ONE OF THE OVER-
     52					; LAY RUN TIME ROUTINES AND IS CALLED BY BOTH THE $LOAD (MANUAL LOAD-
     53					; ING) AND $AUTO (AUTOMATIC LOADING) ROUTINES.
     54					;
     55					; INPUTS:
     56					;
     57					;	R2=ADDRESS OF ARGUMENT SEGMENT DESCRIPTOR.                              ;**NEW**
OVCTL	MACRO M1108  05-DEC-77 23:42  PAGE 3-1


     58					;                                                                               ;**-1
     59					; OUTPUTS:
     60					;
     61					;	THE APPROPRIATE SEGMENTS ARE MARKED OUT OF MEMORY AND ALL REG-
     62					;	ISTERS ARE PRESERVED.
     63					;-
     64
     65	000000					.PSECT	$$OVCT
     66	000000				$MARKS::			;
     67	000000	010246 				MOV	R2,-(SP)	; SAVE ARGUMENT SEGMENT ADDRESS                 ;**NEW**
     68	000002	032762 	010000 	000000 	10$:	BIT	#10000,T$RBLK(R2) ; SEGMENT IN MEMORY?
     69	000010	001005 				BNE	20$		;IF NE NO                                       ;**-2
     70	000012	016202 	000010 		15$:	MOV	T$RDWN(R2),R2	;GET DOWN LINK OF SEGMENT                       ;**NEW**
     71	000016	001371 				BNE	10$		;IF NE GO AGAIN                                 ;**-1
     72	000020				17$:				;++021
     73	000020	012602 				MOV	(SP)+,R2	;RESTORE ARGUMENT SEGMENT                       ;**NEW**
     74	000022					RETURN			;                                               ;**-1
     75	000024				20$:				;++021
     76	000024	005762 	000010 			TST	T$RDWN(R2)	;++021 IS THIS A ROOT SEGMENT                   ;**NEW**
     77	000030	001773 				BEQ	17$		;++021 IF EQ YES                                ;**-1
     78	000032	010246 				MOV	R2,-(SP)	;++021 SAVE SEGMENT DESCRIPTOR ADDRESS          ;**NEW**
     79	000034	010246 			30$:	MOV	R2,-(SP)	;STACK SEGMENT DESCRIPTOR ADDRESS               ;**NEW**
     80	000036	016202 	000012 		40$:	MOV	T$RNXT(R2),R2	;GET NEXT LINK OF SEGMENT                       ;**NEW**
     81	000042	020216 				CMP	R2,(SP)		;SAME AS TOS SEGMENT?                           ;**NEW**
     82	000044	001414 				BEQ	60$		;IF EQ YES                                      ;**-4
     83	000046	032762 	010000 	000000 	50$:	BIT	#10000,T$RBLK(R2) ; SEGMENT IN MEMORY?
     84	000054	001370 				BNE	40$		; IF NE NO                                      ;**NEW**
     85	000056	052762 	010000 	000000 		BIS	#10000,T$RBLK(R2) ; SET SEGMENT OUT OF MEMORY
     86	000064	016216 	000006 			MOV	T$RUP(R2),(SP)	;REPLACE TOS WITH UP LINK OF SEGMENT            ;**NEW**
     87	000070	001402 				BEQ	60$		;IF EQ NO LINK UP                               ;**-4
     88	000072	011602 				MOV	(SP),R2		;GET ADDRESS OF UP LINK                         ;**NEW**
     89	000074	000764 				BR	50$		;                                               ;**-1
     90	000076	005726 			60$:	TST	(SP)+		;CLEAN STACK
     91	000100	012602 				MOV	(SP)+,R2	;RETRIEVE SEGMENT ADDRESS                       ;**NEW**
     92	000102	000743 				BR	15$		;                                               ;**-1
     93
     94					;+
     95					; **-$RDSEG-READ OVERLAY SEGMENT
     96					;
     97					; THIS ROUTINE IS CALLED TO LOAD AN OVERLAY SEGMENT INTO MEMORY. IT
     98					; IS ONE OF THE OVERLAY RUN TIME ROUTINES AND IS CALLED FROM BOTH THE
     99					; $LOAD (MANUAL LOADING) AND $AUTO (AUTOMATIC LOADING) ROUTINES.
    100					;
    101					; INPUTS:
    102					;
    103					;	R2=ADDRESS OF SEGMENT DESCRIPTOR OF SEGMENT TO BE LOADED.               ;**NEW**
    104					;	R3=EVENT FLAG NUMBER.                                                   ;**NEW**
    105					;		IF R3 EQ 0, THEN A SYNCHRONOUS LOAD IS SPECIFIED. THE           ;**NEW**
    106					;			EVENT FLAG THAT IS USED TO SYNCHRONIZE THE              ;**-3
    107					;			LOADING IS THE STANDARD OVERLAY EVENT FLAG.
    108					;		IF R3 NE 0, THEN AN ASYNCHRONOUS LOAD REQUEST IS SPEC-          ;**NEW**
    109					;			IFIED. THE SPECIFIED EVENT FLAG IS USED IN THE          ;**-1
    110					;			LOAD REQUEST THUS PROVIDING SYNCHRONIZATION
    111					;			FOR THE CALLER.
    112					;	R4=ADDRESS OF I/O STATUS DOUBLEWORD. IF NO STATUS DOUBLEWORD IS         ;**NEW**
    113					;		SPECIFIED NO I/O STATUS IS RETURNED TO THE CALLER.              ;**-1
    114					;	R5=AST TRAP ADDRESS. IF NO TRAP ADDRESS IS SPECIFIED NO TRAP OC-        ;**NEW**
OVCTL	MACRO M1108  05-DEC-77 23:42  PAGE 3-2


    115					;		CURS.                                                           ;**-1
    116					;
    117					; OUTPUTS:
    118					;
    119					;	C=1 IF I/O ERROR ON EITHER THE INITIAL REQUEST DIRECTIVE OR AT
    120					;		THE COMPLETION OF A SYNCHRONOUS LOAD REQUEST.
    121					;	C=0 IF REQUEST IS SUCESSFULLY COMPLETED. SEGMENT IS MARKED IN
    122					;		MEMORY.
    123					; 	R3,R4,R5 ARE  DESTROYED                                                 ;**NEW**
    124					;-                                                                              ;**-1
    125
    126	000104				$RDSEG::			;                                               ;**NEW**
    127	000104	005046 				CLR	-(SP)		; CLEAR PARAM. WORD 6                           ;**-2
    128	000106	016246 	000000 			MOV	T$RBLK(R2),-(SP);SET RELATIVE BLOCK NUMBER                      ;**NEW**
    129	000112	042716 	170000 			BIC	#170000,(SP)	; CLEAR STATUS FIELD
    130	000116	005046 				CLR	-(SP)		;SECOND HALF OF RELATIVE BLOCK IS ZERO          ;**-1
    131	000120	005046 				CLR	-(SP)		;ZERO STACK WORD
    132	000122	016246 	000004 			MOV	T$RLNG(R2),-(SP);SET LENGTH OF OVERLAY SEGMENT                  ;**NEW**
    133	000126	016246 	000002 			MOV	T$RLDA(R2),-(SP);SET VIRTUAL LOAD ADDRESS                       ;**NEW**
    134	000132	010546 				MOV	R5,-(SP)	;SET AST TRAP ADDRESS                           ;**NEW**
    135	000134	013705 	000000G			MOV	@#N.OVPT,R5	; POINT TO IMPURE AREA                          ;**NEW**
    136	000140	010446 				MOV	R4,-(SP)	;SET I/O STATUS DOUBLE WORD ADDRESS             ;**NEW**
    137	000142	001006 				BNE	10$		;IF NE ONE SPECIFIED                            ;**-4
    138	000144	105703 				TSTB	R3		;SYNCHRONOUS REQUEST?                           ;**NEW**
    139	000146	001004 				BNE	10$		;IF NE NO                                       ;**-1
    140	000150	010504 				MOV	R5,R4		; CALCULATE ADDRESS OF COMMON I/O STATUS        ;**NEW**
    141	000152	062704 	000000G			ADD	#N.IOST,R4	;                                               ;**NEW**
    142	000156	010416 				MOV	R4,(SP)		;                                               ;**NEW**
    143	000160	005046 			10$:	CLR	-(SP)		;CLEAR STACK WORD                               ;**-2
    144	000162	150316 				BISB	R3,(SP)		;SET EVENT FLAG NUMBER                          ;**NEW**
    145	000164	001002 				BNE	15$		;IF NE ASYNCHRONOUS REQUEST                     ;**-1
    146	000166	012716 	000037 			MOV	#O$VEF,(SP)	;SET SYSTEM EVENT FLAG
    147	000172				15$:				;                                               ;**NEW**
    148	000172	016546 	000000G			MOV	N.OVLY(R5),-(SP);SET LOGICAL UNIT NUMBER                        ;**NEW**
    149	000176	012746 	001010 			MOV	#IO.LOV,-(SP)	;SET FUNCTION CODE                              ;**-1
    150	000202	012746 				MOV	(PC)+,-(SP)	;SET DIRECTIVE CODE AND LENGTH
    151	000204	   001 	   014 			.BYTE	Q$IO,12.	;
    152	000206					DIR$			; MAKE REQUEST TO LOAD OVERLAY SEGMENT          ;**NEW**
    153	000210	103420 				BCS	50$		;IF CS LEAVE NOW                                ;**-1
    154	000212	042762 	010000 	000000 		BIC	#10000,T$RBLK(R2) ; MARK SEGMENT IN MEMORY
    155	000220	105703 				TSTB	R3		;SYNCHRONOUS REQUEST?                           ;**NEW**
    156	000222	001013 				BNE	50$		;IF NE NO                                       ;**-2
    157	000224					WTSE$S	#O$VEF		; WAIT FOR LOAD TO COMPLETE                     ;**NEW**
    158	000236				30$:				;                                               ;**NEW**
    159	000236	105714 				TSTB	(R4)		;TEST FINAL STATUS                              ;**NEW**
    160	000240	100004 				BPL	50$		;IF PL OKAY                                     ;**-10
    161	000242				40$:				;                                               ;**NEW**
    162	000242	052762 	010000 	000000 		BIS	#10000,T$RBLK(R2) ; MARK SEGMENT OUT OF MEMORY
    163	000250	000261 				SEC			;SET CARRY                                      ;**-1
    164	000252				50$:				;                                               ;**NEW**
    165	000252					RETURN			;                                               ;**-1
    166
    167		000001 				.END                                                                    ;**-20
OVCTL	MACRO M1108  05-DEC-77 23:42  PAGE 3-3
SYMBOL TABLE

CR    = 000015   	IE.INS= 177776   	IO.ATT= 001400   	IO.RLB= 001000   	IS.SET= 000002
FF    = 000014   	IE.IPR= 177641   	IO.CCI= 014000   	IO.RLV= 001100   	IS.SUC= 000001
HT    = 000011   	IE.ISQ= 177703   	IO.CCT= 002460   	IO.RNA= 005400   	LF    = 000012
IE.ABO= 177761   	IE.ITI= 177643   	IO.CLN= 003400   	IO.RNC= 001004   	N.IOST= ****** GX
IE.ACT= 177771   	IE.ITS= 177770   	IO.CON= 015400   	IO.RNE= 001020   	N.OVLY= ****** GX
IE.ADP= 177636   	IE.LCK= 177745   	IO.CRC= 001020   	IO.RTC= 003400   	N.OVPT= ****** GX
IE.ALN= 177736   	IE.LNL= 177646   	IO.CRE= 012000   	IO.RTI= 016400   	O$VEF = 000037 G
IE.AST= 177660   	IE.MBK= 177721   	IO.CTI= 015400   	IO.RTK= 000060   	Q$IO  = 000001
IE.BAD= 177777   	IE.MOD= 177753   	IO.CTL= 016400   	IO.RVB= 010400   	R$$11M= 000000
IE.BBE= 177710   	IE.NBF= 177731   	IO.DAC= 010000   	IO.RWD= 002400   	SPA   = 000040
IE.BDI= 177714   	IE.NBK= 177727   	IO.DCI= 014400   	IO.RWU= 002540   	S$GATL  000152
IE.BDR= 177716   	IE.NFI= 177704   	IO.DCT= 002470   	IO.R1C= 002400   	S$GBLK  000002
IE.BDV= 177711   	IE.NLN= 177733   	IO.DEL= 012400   	IO.SAO= 004000   	S$GCST  000024
IE.BHD= 177700   	IE.NNC= 177674   	IO.DET= 002000   	IO.SCS= 013000   	S$GDWN  000012
IE.BLK= 177754   	IE.NOD= 177751   	IO.DIS= 016000   	IO.SDI= 013000   	S$GELT  000146
IE.BNM= 177712   	IE.NSF= 177746   	IO.DTI= 016000   	IO.SDO= 012400   	S$GLDA  000004
IE.BTF= 177675   	IE.OFL= 177677   	IO.ENA= 006000   	IO.SEC= 002520   	S$GLGH  000172
IE.BTP= 177725   	IE.ONP= 177773   	IO.EOF= 003000   	IO.SEM= 002440   	S$GLNG  000006
IE.BVR= 177701   	IE.OVR= 177756   	IO.ESA= 002500   	IO.SHT= 002410   	S$GMEM  000160
IE.BYT= 177755   	IE.PRI= 177760   	IO.EXT= 011400   	IO.SLO= 005400   	S$GNME  000020
IE.CKP= 177766   	IE.RAC= 177724   	IO.FDX= 003020   	IO.SMO= 002560   	S$GNXT  000014
IE.CKS= 177742   	IE.RAT= 177723   	IO.FNA= 004400   	IO.SNM= 002450   	S$GPRV  000016
IE.CLO= 177732   	IE.RBG= 177730   	IO.HDX= 003010   	IO.SPB= 002420   	S$GRO   000030
IE.CON= 177752   	IE.RCN= 177722   	IO.HIS= 015000   	IO.SPF= 002440   	S$GRW   000032
IE.DAA= 177770   	IE.RER= 177740   	IO.INL= 002400   	IO.SSO= 004400   	S$GRWB  000162
IE.DAO= 177763   	IE.RNM= 177715   	IO.ITI= 017000   	IO.SST= 002430   	S$GSEG  000164
IE.DFU= 177750   	IE.RSU= 177757   	IO.KIL= 000012   	IO.STC= 002500   	S$GSEQ  000166
IE.DNA= 177771   	IE.SDP= 177635   	IO.LED= 012000   	IO.STP= 016400   	S$GSTB  000036
IE.DNR= 177775   	IE.SNC= 177735   	IO.LOV= 001010   	IO.SYN= 003040   	S$GSTS  000000
IE.DUN= 177767   	IE.SPC= 177772   	IO.LTK= 000050   	IO.TRM= 002410   	S$GUND  000140
IE.DUP= 177707   	IE.SQC= 177734   	IO.MCS= 013400   	IO.UNL= 000042   	S$GUP   000010
IE.EBX= 177776   	IE.SRE= 177762   	IO.MDA= 016000   	IO.WAT= 013400   	S$GVAD  000142
IE.EOF= 177766   	IE.STK= 177706   	IO.MDI= 014400   	IO.WLB= 000400   	S$ZSEG  000020
IE.EOT= 177702   	IE.ULN= 177773   	IO.MDO= 015400   	IO.WLS= 000410   	T$RBLK  000000
IE.EOV= 177765   	IE.UPN= 177777   	IO.MLO= 006000   	IO.WLV= 000500   	T$RDWN  000010
IE.EXP= 177676   	IE.VER= 177774   	IO.MOD= 003000   	IO.WVB= 011000   	T$RLDA  000002
IE.FEX= 177717   	IE.WAC= 177743   	IO.MSO= 005000   	IO.XMT= 014400   	T$RLNG  000004
IE.FHE= 177705   	IE.WAT= 177741   	IO.RAL= 001010   	IO.XNA= 014410   	T$RNME  000014
IE.FOP= 177713   	IE.WER= 177737   	IO.RAT= 013000   	IQ.Q  = 000002   	T$RNXT  000012
IE.HFU= 177744   	IE.WLK= 177764   	IO.RBC= 003000   	IQ.X  = 000001   	T$RUP   000006
IE.HWR= 177772   	IE.2DV= 177720   	IO.RCI= 015000   	IS.BV = 000005   	VT    = 000013
IE.IDU= 177644   	IO.ACE= 007400   	IO.RCV= 015000   	IS.CLR= 000000   	W$FR  = 000051
IE.IEF= 177637   	IO.ACR= 006400   	IO.RDB= 001200   	IS.CR = 006401   	$MARKS  000000RG    002
IE.IFC= 177776   	IO.ACW= 007000   	IO.RDN= 000022   	IS.ESC= 015401   	$RDSEG  000104RG    002
IE.IFU= 177747   	IO.ADS= 014000   	IO.REL= 013400   	IS.PND= 000000   	$$MSG = 000000
IE.ILL= 177726   	IO.APC= 014000   	IO.RHD= 001010   	IS.RDD= 000002   	...GBL= 000000
IE.ILU= 177640   	IO.APV= 014010

. ABS.	000172	   000
      	000000	   001
$$OVCT	000254	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  4205 WORDS  ( 17 PAGES)
DYNAMIC MEMORY:  5216 WORDS  ( 20 PAGES)
ELAPSED TIME:  00:00:39
[46,10]OVCTL,[46,20]OVCTL/-SP=[46,30]MACFLM.,SEGDF.005,OVCTL.008
OVDAT	MACRO M1108  05-DEC-77 23:43  PAGE 3


      1						.IIF NDF RES , .TITLE OVDAT
      2						.IIF DF  RES , .TITLE OVRES
      3						.IDENT	/05/                                                            ;**NEW**
      4					                                                                                ;**-1
      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 05                                                                    ;**NEW**
     22					;                                                                               ;**-1
     23					; D.N. CUTLER/C. MONIA 05-JAN-74
     24					;
     25					;
     26					; OVERLAY RUN TIME DATA AREA
     27					;
     28					; LOW CORE POINTER TO DATA VECTOR
     29					;
     30
     31	000020					.ASECT
     32
     33						.IF	NDF	R$$11M
     34
     35					.=6
     36
     37						.IFF
     38
     39		000042 			.=42
     40
     41						.ENDC
     42
     43
     44
     45						.IF NDF	RES
     46
     47						.IFT
     48	000042				.NOVPT::			; POINTER TO VECTOR
     49
     50						.IF	NDF	R$$11M
     51
     52						.WORD	OVRDAT                                                          ;**NEW**
     53					                                                                                ;**-1
     54						.IFF
     55
     56						.BLKW	1		;
     57
OVDAT	MACRO M1108  05-DEC-77 23:43  PAGE 3-1


     58						.ENDC
     59
     60
     61					;
     62					; OVERLAY DATA VECTOR
     63					;
     64
     65						.IFT
     66	000000					.PSECT
     67						.IFF
     68						.PSECT	$$OVDT,ABS
     69
     70						.IFT
     71	000000				OVRDAT:				;BASE ADDRESS OF VECTOR
     72
     73						.IFT
     74	000000				.NOVLY::			;OVERLAY LOGICAL UNIT (PLUGGED BY TKB)
     75						.IFF
     76					N.OVLY::			;OFFSET-OVERLAY LOGICAL UNIT
     77
     78						.IFTF
     79						.BLKW	1		;RESERVE SPACE FOR OVERLAY LOGICAL UNIT
     80
     81						.IFT
     82	000002				.NSTBL::			;ADDRESS OF SEGMENT TABLES (PLUGGED BY TKB)
     83						.IFF
     84					N.STBL::			;OFFSET-ADDRESS OF SEGMENT TABLES
     85
     86						.IFTF
     87						.BLKW	1		;RESERVE SPACE FOR SEGMENT TABLES ADDRESS
     88
     89						.IFT
     90	000004				.NIOST::			;COMMON I/O STATUS DOUBLEWORD
     91						.IFF
     92					N.IOST::			;OFFSET-COMMON I/O STATUS DOUBLEWOORD
     93
     94						.IFTF
     95						.BLKW	2		;RESERVE SPACE FOR I/O STATUS DOUBLEWORD
     96						.IFT                                                                    ;**NEW**
     97	000010	000000G			.NALER::.WORD	$ALERR		; ADDRESS OF AUTOLOAD ERROR HANDLER             ;**NEW**
     98						.IFF                                                                    ;**NEW**
     99					N.ALER::.BLKW	1		;                                               ;**NEW**
    100
    101						.ENDC
    102
    103
    104		000001 				.END
OVDAT	MACRO M1108  05-DEC-77 23:43  PAGE 3-2
SYMBOL TABLE

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

. ABS.	000172	   000
      	000012	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1097 WORDS  ( 5 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:08
[46,10]OVDAT,[46,20]OVDAT/-SP=[46,30]MACFLM.,SEGDF.005,OVDAT.005
OVGCL	MACRO M1108  05-DEC-77 23:46  PAGE 1


      1						.TITLE	OVGCL
      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					; WRITTEN BY:
     22					;
     23					;	C.A. D'ELIA	23-MAR-74
     24					;
     25					;+
     26					;
     27					; *-$OVGCL-*-GET COMMAND LINE
     28					; *-$RVGCL-*-RESTORE COMMAND LINE TO TOP LEVEL
     29					;
     30					; INPUTS:
     31					;	R0=ADDRESS OF THE ROOT GCML BLOCK
     32					;
     33					; OUTPUTS:
     34					;	R0=UNCHANGED
     35					;	C-BIT=AS SET BY GET COMMAND LINE
     36					;
     37					; NOTES:  THIS ROUTINE ASSUMES THE EXISTENCE OF A GCML BLOCK
     38					; (IN P-SECTION $GCMLB) AND A PARTIAL GCML BLOCK, CONTAINING ONLY
     39					; THE IMPURE GCML INFORMATION (IN THE ROOT). THE USER MUST GENERATE
     40					; THE WHOLE (CALLED LOCAL) GCML BLOCK IN A PROGRAM SECTION WITH THE
     41					; FOLLOWING ATTRIBUTES:
     42					;
     43					;	.PSECT	$GCMLB,D,GBL,OVR
     44					;
     45					; THIS BLOCK IS THE ONE USED BY GET COMMAND LINE. WHEN CALLED, THIS
     46					; ROUTINE COPIES INTO IT THE IMPURE INFORMATION IN THE ROOT GCML BLOCK.
     47					; THEN IT ISSUES A CALL TO GET COMMAND LINE (.GCML1). BEFORE RETURNING
     48					; TO THE CALLER, THE IMPURE INFORMATION IS COPIED BACK INTO THE ROOT
     49					; BLOCK. THIS ALLOWS THE USER TO STILL USE GET COMMAND LINE, BUT IT
     50					; SAVES SPACE BY REQUIRING THE USER TO ONLY SUPPLY PART OF THE GCML
     51					; BLOCK IN THE ROOT.
     52					;
     53					; RESTRICTIONS: THE PURE GCML DATA IN THE ROOT MUST MATCH THAT
     54					; SPECIFIED IN THE LOCAL GCML BLOCK. SINCE THIS SCHEME WILL WORK
     55					; ONLY IF THE GCML FILE IS CLOSED AFTER EACH REQUEST, THIS ROUTINE
     56					; FORCES THAT TO OCCUR. FURTHERMORE, THE GCML BLOCKS MUST BE
     57					; CONSTRUCTED WITH PUSH-DOWN STORAGE ALLOCATED ELSEWHERE.
OVGCL	MACRO M1108  05-DEC-77 23:46  PAGE 1-1


     58					;
     59					;-
     60
     61
     62						.MCALL	CALL,RETURN,GCMLD$
     63
     64	000000					GCMLD$			;DEFINE GCML SYMBOLS
     65
     66		000140'			GCLIMP=GCLBLK+S.FDB		;ADDR OF OVERLAY GCMLB IMPURE AREA
     67
     68
     69						.ENABL	LSB
     70
     71	000000	004567 	000000G		$OVGCL::JSR	R5,.SAVR1	;SAVE REGISTERS
     72	000004	012703 	000000G			MOV	#.GCML1,R3	;SETUP TO 'GET COMMAND LINE'
     73	000010	000404 				BR	10$		;BRANCH INTO THE COMMON CODE
     74
     75	000012	004567 	000000G		$RVGCL::JSR	R5,.SAVR1	;SAVE REGISTERS
     76	000016	012703 	000000G			MOV	#.GCML2,R3	;SETUP TO 'RETURN GCML TO TOP LEVEL'
     77
     78	000022	010046 			10$:	MOV	R0,-(SP)	;SAVE R0 (ADDR OF ROOT GCML BLOCK)
     79	000024	062700 	000140 			ADD	#S.FDB,R0	;POINT R0 TO ROOT GCMLB IMPURE AREA
     80	000030	012701 	000140'			MOV	#GCLIMP,R1	;POINT R1 TO OVERLAY GCMLB IMPURE AREA
     81	000034	012702 	000010 			MOV	#G.ISIZ/2,R2	;PUT SIZE OF GCMLB IMPURE AREA IN R2
     82	000040	012021 			20$:	MOV	(R0)+,(R1)+	;COPY THE ROOT GCMLB IMPURE AREA ...
     83	000042	005302 				DEC	R2		;... INTO THE OVERLAY GCMLB ...
     84	000044	003375 				BGT	20$		;... IMPURE AREA
     85	000046	012700 	000000'			MOV	#GCLBLK,R0	;POINT R0 TO THE OVERLAY GCML BLOCK
     86	000052	152760 	000004 	000141 		BISB	#GE.CLO,G.MODE(R0)  ;FORCE GCML FILE CLOSED AFTER OPERATION
     87	000060					CALL	(R3)		;CALL THE APPROPRIATE GCML ROUTINE
     88	000062	006004 				ROR	R4		;SAVE C-BIT (GCML RETURN STATUS)
     89	000064	012701 	000140'			MOV	#GCLIMP,R1	;POINT R1 TO OVERLAY GCMLB IMPURE AREA
     90	000070	011600 				MOV	(SP),R0		;POINT R0 TO ROOT GCML BLOCK
     91	000072	062700 	000140 			ADD	#S.FDB,R0	;AND TO ROOT GCMLB IMPURE AREA
     92	000076	012702 	000010 			MOV	#G.ISIZ/2,R2	;PUT SIZE OF GCMLB IMPURE AREA IN R2
     93	000102	012120 			30$:	MOV	(R1)+,(R0)+	;COPY THE OVERLAY GCMLB IMPURE ...
     94	000104	005302 				DEC	R2		;... AREA BACK INTO THE ROOT ...
     95	000106	003375 				BGT	30$		;... GCMLB IMPURE AREA
     96	000110	012600 				MOV	(SP)+,R0	;RESTORE R0
     97	000112	006104 				ROL	R4		;RESTORE C-BIT (GCML RETURN STATUS)
     98	000114					RETURN			;RETURN TO CALLER
     99
    100						.DSABL	LSB
    101
    102
    103
    104	000000					.PSECT	$GCMLB,D,GBL,OVR
    105	000000				GCLBLK:				;REF LABEL TO OVERLAY GCML BLOCK
    106
    107
    108		000001 				.END
OVGCL	MACRO M1108  05-DEC-77 23:46  PAGE 1-2
SYMBOL TABLE

GCLBLK  000000R     002	GE.IOR= 177777   	G.ERR = 000140   	S.FNB = 000036   	$RVGCL  000012RG
GCLIMP= 000140R     002	GE.LC = 000010   	G.ISIZ= 000020   	S.FNBW= 000017   	$$    = 000013
GE.BIF= 177775   	GE.MDE= 177774   	G.MODE= 000141   	S.FNTY= 000004   	.GCML1= ****** GX
GE.CLO= 000004   	GE.OPR= 177776   	G.PSDS= 000142   	S.FTYP= 000002   	.GCML2= ****** GX
GE.COM= 000001   	G.CMLD= 000146   	S.FDB = 000140   	S.NFEN= 000020   	.SAVR1= ****** GX
GE.EOF= 177766   	G.DPRM= 000160   	S.FNAM= 000006   	$OVGCL  000000RG 	...TPC= 000140
GE.IND= 000002

. ABS.	000000	   000
      	000116	   001
$GCMLB	000000	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1480 WORDS  ( 6 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[46,10]OVGCL,[46,20]OVGCL/-SP=[46,30]OVGCL
SEGDF	MACRO M1108  05-DEC-77 23:43  PAGE 3


      1		000000 			RES=0										;**NEW**
SEGDF	MACRO M1108  05-DEC-77 23:43  PAGE 4


						.IIF NDF RES , .TITLE OVDAT
      2						.IIF DF  RES , .TITLE OVRES
      3						.IDENT	/05/                                                            ;**NEW**
      4					                                                                                ;**-1
      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 05                                                                    ;**NEW**
     22					;                                                                               ;**-1
     23					; D.N. CUTLER/C. MONIA 05-JAN-74
     24					;
     25					;
     26					; OVERLAY RUN TIME DATA AREA
     27					;
     28					; LOW CORE POINTER TO DATA VECTOR
     29					;
     30
     31	000020					.ASECT
     32
     33						.IF	NDF	R$$11M
     34
     35					.=6
     36
     37						.IFF
     38
     39		000042 			.=42
     40
     41						.ENDC
     42
     43
     44
     45						.IF NDF	RES
     46
     47						.IFT
     48					.NOVPT::			; POINTER TO VECTOR
     49
     50						.IF	NDF	R$$11M
     51
     52						.WORD	OVRDAT                                                          ;**NEW**
     53					                                                                                ;**-1
     54						.IFF
     55
     56						.BLKW	1		;
     57
OVRES	MACRO M1108  05-DEC-77 23:43  PAGE 4-1


     58						.ENDC
     59
     60
     61					;
     62					; OVERLAY DATA VECTOR
     63					;
     64
     65						.IFT
     66						.PSECT
     67						.IFF
     68	000000					.PSECT	$$OVDT,ABS
     69
     70						.IFT
     71					OVRDAT:				;BASE ADDRESS OF VECTOR
     72
     73						.IFT
     74					.NOVLY::			;OVERLAY LOGICAL UNIT (PLUGGED BY TKB)
     75						.IFF
     76	000000				N.OVLY::			;OFFSET-OVERLAY LOGICAL UNIT
     77
     78						.IFTF
     79						.BLKW	1		;RESERVE SPACE FOR OVERLAY LOGICAL UNIT
     80
     81						.IFT
     82					.NSTBL::			;ADDRESS OF SEGMENT TABLES (PLUGGED BY TKB)
     83						.IFF
     84	000002				N.STBL::			;OFFSET-ADDRESS OF SEGMENT TABLES
     85
     86						.IFTF
     87						.BLKW	1		;RESERVE SPACE FOR SEGMENT TABLES ADDRESS
     88
     89						.IFT
     90					.NIOST::			;COMMON I/O STATUS DOUBLEWORD
     91						.IFF
     92	000004				N.IOST::			;OFFSET-COMMON I/O STATUS DOUBLEWOORD
     93
     94						.IFTF
     95						.BLKW	2		;RESERVE SPACE FOR I/O STATUS DOUBLEWORD
     96						.IFT                                                                    ;**NEW**
     97					.NALER::.WORD	$ALERR		; ADDRESS OF AUTOLOAD ERROR HANDLER             ;**NEW**
     98						.IFF                                                                    ;**NEW**
     99	000010				N.ALER::.BLKW	1		;                                               ;**NEW**
    100
    101						.ENDC
    102
    103
    104		000001 				.END
OVRES	MACRO M1108  05-DEC-77 23:43  PAGE 4-2
SYMBOL TABLE

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

. ABS.	000172	   000
      	000000	   001
$$OVDT	000012	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1093 WORDS  ( 5 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:09
[46,10]OVRES,[46,20]OVRES/-SP=[46,30]MACFLM.,SEGDF.005,OVRES.,OVDAT.005
PARDI 0102MS, PARSE  DIRECTORY 	MACRO M1108  05-DEC-77 22:14  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
PARDI 0102MS, PARSE  DIRECTORY 	MACRO M1108  05-DEC-77 22:14  PAGE 7


						.TITLE	PARDI 0102MS, PARSE  DIRECTORY NAME - 2ND HALF
						.IDENT	/0102MS/
      2					;
      3					;                             COPYRIGHT (C) 1974, 1978 BY
      4					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      5					;
      6					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      7					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      8					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      9					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     10					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     11					;
     12					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     13					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     14					;       CORPORATION.
     15					;
     16					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     17					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     18					;
     19					; PETER H. LIPMAN
     20					; MODIFIED BY SHAO-SUN CHIEN	28-JUN-74
     21					;
     22					;
     23					;+
     24					; CONTROL TRANSFERRED HERE EITHER FROM PARSDI (FIRST HALF OF PARSE
     25					; DIRECTORY NAME ROUTINE) OR PARDID.
     26					;
     27					; INPUT:
     28					;	R0 = FDB
     29					;	R1 = FNB
     30					;	(SP) = ENTRY TO DIRFND OR DIDFND
     31					;	2(SP) = RETURN LOCATION
     32					;
     33					; OUTPUT:
     34					;	ALL REGISTERS PRESERVED
     35					;	POPS STACK THEN RETURNS.
     36					;-
     37					;
     38	000000	013704 	000000G		..PDI:: MOV	@#.FSRPT,R4
     39	000004	062704 	000000G			ADD	#A.DFDR,R4	;R4=DESCRIPTOR OF DEFAULT DIR STRING
     40	000010	005714 				TST	@R4
     41	000012	003035 				BGT	45$		;BRANCH IF DEFAULT UIC STRING EXISTS
     42	000014	001011 				BNE	40$		;BRANCH IF NOT MFD
     43					;
     44					; NULL TASK DEFAULT DIRECTORY DESCRIPTOR - DEFAULT TO MFD
     45	000016	012761 	177777 	000000G		MOV	#-1,N.DID(R1)
     46	000024	012761 	177777 	000002G		MOV	#-1,N.DID+2(R1)
     47	000032	005061 	000004G			CLR	N.DID+4(R1)
     48	000036	000472 				BR	85$
PARDI 0102MS, PARSE  DIRECTORY 	MACRO M1108  05-DEC-77 22:14  PAGE 8


     50					;
     51					; SAVE UIC IN ASCII FORM IN FSR2
     52	000040	010246 			40$:	MOV	R2,-(SP)
     53	000042	010346 				MOV	R3,-(SP)
     54	000044	010446 				MOV	R4,-(SP)
     55	000046	010402 				MOV	R4,R2
     56	000050	062702 	000004 			ADD	#4,R2		;R2=BEGINNING ADDRESS OF STRING
     57	000054	010264 	000002 			MOV	R2,2(R4)	;SAVE ADR OF STRING IN FSR2
     58	000060	016403 	000000C			MOV	A.OWUI-A.DFDR(R4),R3 ;TASK UIC TO R3
     59	000064	005004 				CLR	R4
     60	000066					CALL	.PPASC
     61	000072	012604 				MOV	(SP)+,R4
     62	000074	010214 				MOV	R2,@R4		;R2=UPDATED STRING POINTER
     63	000076	166414 	000002 			SUB	2(R4),@R4	;@R4 = SIZE OF STRING
     64	000102	012603 				MOV	(SP)+,R3
     65	000104	012602 				MOV	(SP)+,R2
     66	000106	026461 	000000G	000000G	45$:	CMP	D.DFDV(R4),N.DVNM(R1) ;IF SAME DEVICE AND UNIT
     67	000114	001016 				BNE	50$
     68	000116	026461 	000000G	000000G		CMP	D.DFUN(R4),N.UNIT(R1) ;THEN USE THE ID - SPEEDIER
     69	000124	001012 				BNE	50$
     70					; DEFAULT DIRECTORY DEVICE AND UNIT AGREE, USE THE SAVED DIRECTORY ID
     71	000126	016461 	000000G	000000G		MOV	D.DFID(R4),N.DID(R1)
     72	000134	016461 	000002G	000002G		MOV	D.DFID+2(R4),N.DID+2(R1)
     73	000142	016461 	000004G	000004G		MOV	D.DFID+4(R4),N.DID+4(R1)
     74	000150	000425 				BR	85$
     75					;
     76					; THE DEFAULT DEVICE AND UNIT DO NOT AGREE, MUST TREAT
     77					; THE DEFAULT DIRECTORY STRING EXACTLY AS IF IT CAME FROM THE
     78					; USER.  LOOK IT UP, BUT ALSO SAVE THE ID, DEVICE AND UNIT
     79	000152	010246 			50$:	MOV	R2,-(SP)
     80	000154	010402 				MOV	R4,R2		;R2=DIRECTORY STRING DESCRIPTOR
     81	000156					CALL	@2(SP)		;EITHER ..DIRF OR ..DIDF
     82	000162	103417 				BCS	80$		;BRANCH IF FAILED TO FIND DIR ID
     83					;
     84					; SAVE THE ID FOR QUICKER HANDLING OF TASK DEFAULT DIRECTORY
     85					; WILL KEEP CHANGING IF BOUNCING AROUND TO DIFFERENT DEVICES WITH
     86					; THE DEFAULT DIRECTORY NAME ON EACH.
     87	000164	016162 	000000G	000000G		MOV	N.DID(R1),D.DFID(R2)
     88	000172	016162 	000002G	000002G		MOV	N.DID+2(R1),D.DFID+2(R2)
     89	000200	016162 	000004G	000004G		MOV	N.DID+4(R1),D.DFID+4(R2)
     90	000206	016162 	000000G	000000G		MOV	N.DVNM(R1),D.DFDV(R2)
     91	000214	016162 	000000G	000000G		MOV	N.UNIT(R1),D.DFUN(R2)
     92	000222	012602 			80$:	MOV	(SP)+,R2
     93	000224	005226 			85$:	INC	(SP)+		;RESTORE STACK
     94	000226					RETURN
     95					;
     96					;
     97	000230					$END	PARDI
     98					;
     99		000001 				.END
PARDI 0102MS, PARSE  DIRECTORY 	MACRO M1108  05-DEC-77 22:14  PAGE 8-1
SYMBOL TABLE

A.DFDR= ****** GX	FD.EOF= 000002   	N.DID = ****** GX	R$$ANI= 000000   	R$$11M= 000001
A.OWUI= ****** GX	FD.WRT= 000001   	N.DRPT= 000006   	R$$BBF= 000000   	SYDEV = 054523
BD.FRE= 000001   	HA.CHU= 000003   	N.DRSZ= 000004   	R$$DPB= 000001   	SYUNIT= 000000
DIRTYP= 015172   	HA.FP = 000002   	N.DVNM= ****** GX	R$$EIS= 000000   	WI.DLK= 000002
D.DFDV= ****** GX	HA.NAM= 000005   	N.DVPT= 000002   	R$$LCL= 000000   	WI.LCK= 000001
D.DFID= ****** GX	HA.TYP= 000006   	N.DVSZ= 000000   	R$$MUL= 000000   	$$    = 000076
D.DFUN= ****** GX	HA.UAT= 000004   	N.FNPT= 000012   	R$$OPF= 000000   	.FSRPT= ****** GX
FCSEFN= 000040   	HA.UI = 000001   	N.FNSZ= 000010   	R$$RSL= 000000   	.PPASC= ****** GX
FD.DVR= 000020   	HA.VER= 000007   	N.UNIT= ****** GX	R$$SEQ= 000000   	..PDI   000000RG
FD.EFB= 000004   	NB.DOT= 100000   	PP.SEP= 000002   	R$$SPL= 000000   	...CTL= 000001
FD.EF1= 000010   	NB.SMI= 040000   	PP.ZER= 000001

. ABS.	000000	   000
      	000230	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2595 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[41,10]PARDI,[41,20]PARDI/-SP=[41,30]FCSPRE,PARDI
PARDID 0102MS, PARSE TASK DEFAU	MACRO M1108  05-DEC-77 22:15  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
PARDID 0102MS, PARSE TASK DEFAU	MACRO M1108  05-DEC-77 22:15  PAGE 7


						.TITLE	PARDID 0102MS, PARSE TASK DEFAULT DIRECTORY NAME
						.IDENT	/0102MS/
      2					;
      3					;                             COPYRIGHT (C) 1974, 1978 BY
      4					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      5					;
      6					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      7					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      8					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      9					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     10					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     11					;
     12					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     13					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     14					;       CORPORATION.
     15					;
     16					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     17					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     18					;
     19					; SHAO-SUN CHIEN	28-JUN-74
     20					;
     21					;+
     22					;THIS ROUTINE IS A SHORTER VERSION OF THE PARSE DIRECTORY ROUTINE.
     23					; IT IS USED FOR THE CASE OF DEFAULT UIC. '..DIDF' IS THE
     24					; ENTRY POINT TO THE SHORTER VERSION OF FIND DIRECTORY ROUTINE,
     25					; DIDFND, AGAIN FOR THE SPECIAL CASE OF DEFAULT UIC.
     26					; CONTROL IS TRANSFERRED FROM THIS ROUTINE TO THE SECOND HALF OF
     27					; PARSE DIRECTORY ROUTINE, PARDI, AND THEN TO DIDFND.
     28					;-
     29
     30	000000	010746 			..PDID::MOV	PC,-(SP)	;SAVE TRANSFER ADDRESS
     31	000002	062716 	000000C			ADD	#..DIDF-.,(SP)	;ON STACK
     32	000006					CALLR	..PDI		;JUMP TO PARDI
     33					;
     34					;
     35	000012					$END	PARDID
     36					;
     37		000001 				.END
PARDID 0102MS, PARSE TASK DEFAU	MACRO M1108  05-DEC-77 22:15  PAGE 7-1
SYMBOL TABLE

BD.FRE= 000001   	HA.FP = 000002   	N.DRSZ= 000004   	R$$DPB= 000001   	SYDEV = 054523
DIRTYP= 015172   	HA.NAM= 000005   	N.DVPT= 000002   	R$$EIS= 000000   	SYUNIT= 000000
FCSEFN= 000040   	HA.TYP= 000006   	N.DVSZ= 000000   	R$$LCL= 000000   	WI.DLK= 000002
FD.DVR= 000020   	HA.UAT= 000004   	N.FNPT= 000012   	R$$MUL= 000000   	WI.LCK= 000001
FD.EFB= 000004   	HA.UI = 000001   	N.FNSZ= 000010   	R$$OPF= 000000   	..DIDF= ****** GX
FD.EF1= 000010   	HA.VER= 000007   	PP.SEP= 000002   	R$$RSL= 000000   	..PDI = ****** GX
FD.EOF= 000002   	NB.DOT= 100000   	PP.ZER= 000001   	R$$SEQ= 000000   	..PDID  000000RG
FD.WRT= 000001   	NB.SMI= 040000   	R$$ANI= 000000   	R$$SPL= 000000   	...CTL= 000001
HA.CHU= 000003   	N.DRPT= 000006   	R$$BBF= 000000   	R$$11M= 000001

. ABS.	000000	   000
      	000012	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2524 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[41,10]PARDID,[41,20]PARDID/-SP=[41,30]FCSPRE,PARDID
PARSDI 0102MS, PARSE DIRECTORY 	MACRO M1108  05-DEC-77 22:15  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
PARSDI 0102MS, PARSE DIRECTORY 	MACRO M1108  05-DEC-77 22:15  PAGE 7


						.TITLE	PARSDI 0102MS, PARSE DIRECTORY NAME
						.IDENT	/0102MS/
      2					;
      3					;                             COPYRIGHT (C) 1974, 1978 BY
      4					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      5					;
      6					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      7					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      8					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      9					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     10					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     11					;
     12					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     13					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     14					;       CORPORATION.
     15					;
     16					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     17					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     18					;
     19					; PETER H. LIPMAN
     20					; MODIFIED BY SHAO-SUN CHIEN	28-JUN-74
     21					;
     22
     23					;+
     24					; PARSE DIRECTORY NAME - FIRST HALF.
     25					;
     26					; CALLING SEQUENCE:
     27					;	CALL	.PRSDI
     28					; INPUTS:
     29					;	R0=FDB ADDRESS
     30					;	R1=ADDRESS OF FILE NAME BLOCK
     31					;	R2=POINTER TO DEV, DIR, AND NAME DESCRIPTORS
     32					;	R3=DEFAULT FILE NAME BLOCK OR ZERO IF NONE SPECIFIED
     33					;
     34					; OUTPUTS:
     35					;	C=0 IF SUCCESSFUL, C=1 IF ERROR, F.ERR SET TO REASON
     36					;	ALL REGISTERS PRESERVED IF RETURN FROM THIS MODULE,
     37					;	ELSE CONTROL IS TRANSFERRED TO PARDI, THE SECOND HALF
     38					;	OF PARSE FILE NAME ROUTINE, AND REGISTERS RESTORED AND
     39					;	CONDITION CODE SET ON RETURN TO CALLER THERE.
     40					;-
     41
     42	000000				.PRSDI::.SAVR1
     43	000004	012760 	000001 	000000G		MOV	#1,F.ERR(R0)
     44	000012	132760 	000000G	000000G	..PSDI::BITB	#FD.DIR,F.RCTL(R0)
     45	000020	001465 				BEQ	70$		;DEFAULT TO MFD FOR NON-DIRECTORY DEVICE
     46	000022	132760 	000000G	000000G		BITB	#FD.SDI,F.RCTL(R0) ;IF SINGLE DIRECTORY DEVICE
     47	000030	001061 				BNE	70$		;ALSO USE MFD
     48	000032	132760 	000000G	000000G		BITB	#FA.TMP,F.FACC(R0) ;IF A TEMPORARY FILE
     49	000040	001055 				BNE	70$		;SKIP UFD SEARCH
     50	000042	005702 				TST	R2
     51	000044	001415 				BEQ	30$		;BRANCH IF NULL DIRECTORY DESCRIPTOR
     52	000046	005762 	000004 			TST	N.DRSZ(R2)
     53	000052	001412 				BEQ	30$		;BRANCH IF NULL DIRECTORY DESCRIPTOR
     54	000054	052761 	000000G	000000G		BIS	#NB.DIR,N.STAT(R1) ;INDICATE EXPLICIT DIRECTORY STRING
     55	000062	010246 				MOV	R2,-(SP)
     56	000064	062702 	000004 			ADD	#N.DRSZ,R2	;R2=ADR OF DIRECTORY DESCRIPTOR
PARSDI 0102MS, PARSE DIRECTORY 	MACRO M1108  05-DEC-77 22:15  PAGE 7-1


     57	000070					CALL	..DIRF		;FIND THE DIRECTORY ID
     58	000074	012602 				MOV	(SP)+,R2
     59	000076					RETURN
PARSDI 0102MS, PARSE DIRECTORY 	MACRO M1108  05-DEC-77 22:15  PAGE 8


     61					;
     62					; NULL DIRECTORY DESCRIPTOR, SEE IF NULL DEFAULT DIRECTORY ID
     63	000100	005703 			30$:	TST	R3
     64	000102	001427 				BEQ	40$		;BRANCH IF NO DEFAULT NAME BLOCK
     65	000104	016304 	000000G			MOV	N.DID(R3),R4
     66	000110	001424 				BEQ	40$		;BRANCH IF NO DEFAULT ID SPECIFIED
     67	000112	005204 				INC	R4		;IF -1, THEN MFD
     68	000114	001410 				BEQ	35$		;UNIVERSAL FOR ALL DEVICES
     69					;
     70					; DIRECTORY ID IS SPECIFIED, USE IT ONLY IF DEVICE AND UNIT AGREE
     71	000116	026361 	000000G	000000G		CMP	N.DVNM(R3),N.DVNM(R1)
     72	000124	001016 				BNE	40$
     73	000126	026361 	000000G	000000G		CMP	N.UNIT(R3),N.UNIT(R1)
     74	000134	001012 				BNE	40$
     75	000136	016361 	000000G	000000G	35$:	MOV	N.DID(R3),N.DID(R1) ;MOVE THE DEFAULT DIR ID
     76	000144	016361 	000002G	000002G		MOV	N.DID+2(R3),N.DID+2(R1) ;TO THE FILE NAME BLOCK
     77	000152	016361 	000004G	000004G		MOV	N.DID+4(R3),N.DID+4(R1)
     78	000160					RETURN
     79					; CALL TASK DEFAULT DIRECTORY PARSE ROUTINE
     80	000162	010746 			40$:	MOV	 PC,-(SP)	;SAVE TRANSFER ADDRESS ON STACK
     81	000164	062716 	000000C			ADD	#..DIRF-.,(SP)	;PIC
     82	000170					CALLR	..PDI		;JUMP TO PARDI
     83					;
     84					; NULL TASK DEFULT DIRECTORY DESCRIPTOR - DEFAULT TO MFD
     85	000174	012761 	177777 	000000G	70$:	MOV	#-1,N.DID(R1)
     86	000202	012761 	177777 	000002G		MOV	#-1,N.DID+2(R1)
     87	000210	005061 	000004G			CLR	N.DID+4(R1)
     88	000214					RETURN
     89					;
     90					;
     91	000216					$END	PARSDI
     92					;
     93		000001 				.END
PARSDI 0102MS, PARSE DIRECTORY 	MACRO M1108  05-DEC-77 22:15  PAGE 8-1
SYMBOL TABLE

BD.FRE= 000001   	F.FACC= ****** GX	N.DID = ****** GX	R$$ANI= 000000   	SYDEV = 054523
DIRTYP= 015172   	F.RCTL= ****** GX	N.DRPT= 000006   	R$$BBF= 000000   	SYUNIT= 000000
FA.TMP= ****** GX	HA.CHU= 000003   	N.DRSZ= 000004   	R$$DPB= 000001   	WI.DLK= 000002
FCSEFN= 000040   	HA.FP = 000002   	N.DVNM= ****** GX	R$$EIS= 000000   	WI.LCK= 000001
FD.DIR= ****** GX	HA.NAM= 000005   	N.DVPT= 000002   	R$$LCL= 000000   	$$    = 000067
FD.DVR= 000020   	HA.TYP= 000006   	N.DVSZ= 000000   	R$$MUL= 000000   	.PRSDI  000000RG
FD.EFB= 000004   	HA.UAT= 000004   	N.FNPT= 000012   	R$$OPF= 000000   	.SAVR1= ****** GX
FD.EF1= 000010   	HA.UI = 000001   	N.FNSZ= 000010   	R$$RSL= 000000   	..DIRF= ****** GX
FD.EOF= 000002   	HA.VER= 000007   	N.STAT= ****** GX	R$$SEQ= 000000   	..PDI = ****** GX
FD.SDI= ****** GX	NB.DIR= ****** GX	N.UNIT= ****** GX	R$$SPL= 000000   	..PSDI  000012RG
FD.WRT= 000001   	NB.DOT= 100000   	PP.SEP= 000002   	R$$11M= 000001   	...CTL= 000001
F.ERR = ****** GX	NB.SMI= 040000   	PP.ZER= 000001

. ABS.	000000	   000
      	000216	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2575 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[41,10]PARSDI,[41,20]PARSDI/-SP=[41,30]FCSPRE,PARSDI
PARSDV 0102MS, PARSE DEVICE STR	MACRO M1108  05-DEC-77 22:15  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
PARSDV 0102MS, PARSE DEVICE STR	MACRO M1108  05-DEC-77 22:15  PAGE 7


						.TITLE	PARSDV 0102MS, PARSE DEVICE STRING
						.IDENT	/0102MS/
      2					;
      3					;                             COPYRIGHT (C) 1974, 1978 BY
      4					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      5					;
      6					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      7					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      8					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      9					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     10					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     11					;
     12					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     13					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     14					;       CORPORATION.
     15					;
     16					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     17					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     18					;
     19					; PETER H. LIPMAN
     20					; MODIFIED BY SHAO-SUN CHIEN	28-JUN-74
     21					;+
     22					; PARSE DEVICE STRING - ZERO THE FILE NAME BLOCK AND PARSE AND
     23					; ASSIGN THE LUN FOR THE SPECIFIED DEVICE AND UNIT
     24					;
     25					; CALLING SEQUENCE:
     26					;	CALL	.PRSDV
     27					; INPUTS:
     28					;	R0=FDB ADDRESS
     29					;	R1=ADDRESS OF FILE NAME BLOCK
     30					;	R2=POINTER TO DEV, DIR, AND NAME DESCRIPTORS
     31					;	R3=DEFAULT FILE NAME BLOCK OR ZERO IF NONE SPECIFIED
     32					; OUTPUTS:
     33					;	C=0 IF SUCCESSFUL, C=1 IF ERROR, F.ERR SET TO REASON
     34					;	ALL REGISTER PRESERVED
     35					;	N.DVNM(R1), N.UNIT(R1) SET TO DEVICE NAME AND UNIT
     36					;	LUN IN F.LUN(R0) ASSIGNED
     37					;	F.RCTL(R0) SET TO DEVICE CHARACTERISTICS BITS
     38					;	F.BBFS(R0), F.VBSZ(R0) SET TO DEFAULT BUFFER SIZE
     39					;
     40					; OPERATION:
     41					;	IF THE DEVICE IS SPECIFIED IN THE ASCII STRING SPECIFIED BY R2
     42					; THEN THIS DEVICE IS USED, IF THIS IS NULL, THE THE DEFAULT NAME BLOCK
     43					; DEVICE AND UNIT FIELDS ARE USED (N.DVNM(R3), N.UNIT(R3)). FINALLY
     44					; IF THE DEFAULT NAME BLOCK IS MISSING, OR THE DEVICE FIELD IS 0, THEN
     45					; THE CURRENT ASSIGNMENT OF THE LUN IS USED AND READ BACK INTO
     46					; N.DVNM(R1) AND N.UNIT(R1).
     47					;
     48					;
     49					;-
     50	000000				.PRSDV::.SAVR1
     51	000004	012760 	000001 	000000G		MOV	#1,F.ERR(R0)
     52	000012				..PSDV::
     53	000012	010104 				MOV	R1,R4		;ZERO THE FILE NAME BLOCK
     54	000014	012705 	000000G			MOV	#S.FNBW,R5	;R5=SIZE IN WORDS OF FNB
     55	000020	005024 			4$:	CLR	(R4)+
     56	000022					SOB	R5,4$
PARSDV 0102MS, PARSE DEVICE STR	MACRO M1108  05-DEC-77 22:15  PAGE 8


     58					;
     59					; PARSE THE DEVICE NAME AND UNIT
     60	000026	010346 				MOV	R3,-(SP)
     61	000030	010246 				MOV	R2,-(SP)
     62	000032	001437 				BEQ	20$		;BRANCH IF NULL DEVICE DESCRIPTOR
     63	000034	016205 	000002 			MOV	N.DVPT(R2),R5	;R5=ADDRESS FOR DEVICE STRING
     64	000040	016202 	000000 			MOV	N.DVSZ(R2),R2	;R2=SIZE IN BYTES OF DEVICE STRING
     65	000044	001432 				BEQ	20$		;BRANCH IF NULL DEVICE DESCRIPTOR
     66	000046	052761 	000000G	000000G		BIS	#NB.DEV,N.STAT(R1) ;NOTE EXPLICIT DEVICE SEEN
     67	000054	112561 	000000G			MOVB	(R5)+,N.DVNM(R1) ;SET DEVICE NAME
     68	000060	112561 	000001G			MOVB	(R5)+,N.DVNM+1(R1)
     69	000064	162702 	000002 			SUB	#2,R2		;ADJUST BYTE COUNT
     70	000070	001430 				BEQ	40$		;BRANCH IF NO UNIT SPECIFIED
     71	000072	002432 				BLT	78$		;ERROR IF ONLY 1 CHAR STRING, C BIT SET
     72	000074	010503 				MOV	R5,R3		;SAVE R5=BEGINNING OF UNIT NO.
     73	000076	005004 				CLR	R4		;INIT UNIT NO. BYTE COUNT
     74	000100	122723 	000072 		10$:	CMPB	#':,(R3)+	;IF FIND :
     75	000104	001401 				BEQ	15$		;THEN DON'T COUNT IT
     76	000106	005204 				INC	R4		;COUNT ALL OTHERS
     77					; IF MORE CHARS AFTER : THEN .ODCVT WILL COMPLAIN OF BAD NUMERIC SYNTAX
     78	000110				15$:	SOB	R2,10$
     79	000114	010103 				MOV	R1,R3
     80	000116	062703 	000000G			ADD	#N.UNIT,R3	;R3=ADR TO RETURN NUMBER
     81	000122					CALL	.ODCVT		;R4=SIZE OF STRING, R5=ADDRESS
     82	000126	103414 				BCS	78$
     83	000130	000410 				BR	40$
     84					;
     85					; NO EXPLICIT DEVICE, USE DEFAULT FROM DEFAULT NAME BLOCK
     86	000132	005703 			20$:	TST	R3
     87	000134	001406 				BEQ	40$		;BRANCH IF NO DEFAULT NAME BLOCK
     88	000136	016361 	000000G	000000G		MOV	N.UNIT(R3),N.UNIT(R1)
     89	000144	016361 	000000G	000000G		MOV	N.DVNM(R3),N.DVNM(R1)
     90					;
     91					; ASSIGN THE LOGICAL UNIT NUMBER
     92	000152				40$:	CALL	..ALUN
     93	000156	000403 				BR	85$
     94	000160	112760 	000000G	000000G	78$:	MOVB	#IE.BDV,F.ERR(R0)
     95	000166	012602 			85$:	MOV	(SP)+,R2
     96	000170	012603 				MOV	(SP)+,R3
     97	000172					RETURN
     98					;
     99					;
    100	000174					$END	PARSDV
    101					;
    102		000001 				.END
PARSDV 0102MS, PARSE DEVICE STR	MACRO M1108  05-DEC-77 22:15  PAGE 8-1
SYMBOL TABLE

BD.FRE= 000001   	HA.NAM= 000005   	N.DVNM= ****** GX	R$$DPB= 000001   	S.FNBW= ****** GX
DIRTYP= 015172   	HA.TYP= 000006   	N.DVPT= 000002   	R$$EIS= 000000   	WI.DLK= 000002
FCSEFN= 000040   	HA.UAT= 000004   	N.DVSZ= 000000   	R$$LCL= 000000   	WI.LCK= 000001
FD.DVR= 000020   	HA.UI = 000001   	N.FNPT= 000012   	R$$MUL= 000000   	$$    = 000067
FD.EFB= 000004   	HA.VER= 000007   	N.FNSZ= 000010   	R$$OPF= 000000   	.ODCVT= ****** GX
FD.EF1= 000010   	IE.BDV= ****** GX	N.STAT= ****** GX	R$$RSL= 000000   	.PRSDV  000000RG
FD.EOF= 000002   	NB.DEV= ****** GX	N.UNIT= ****** GX	R$$SEQ= 000000   	.SAVR1= ****** GX
FD.WRT= 000001   	NB.DOT= 100000   	PP.SEP= 000002   	R$$SPL= 000000   	..ALUN= ****** GX
F.ERR = ****** GX	NB.SMI= 040000   	PP.ZER= 000001   	R$$11M= 000001   	..PSDV  000012RG
HA.CHU= 000003   	N.DRPT= 000006   	R$$ANI= 000000   	SYDEV = 054523   	...CTL= 000001
HA.FP = 000002   	N.DRSZ= 000004   	R$$BBF= 000000   	SYUNIT= 000000

. ABS.	000000	   000
      	000174	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2570 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[41,10]PARSDV,[41,20]PARSDV/-SP=[41,30]FCSPRE,PARSDV
PARSE 0101MS, PARSE THE FILE NA	MACRO M1108  05-DEC-77 22:15  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
PARSE 0101MS, PARSE THE FILE NA	MACRO M1108  05-DEC-77 22:15  PAGE 7


						.TITLE	PARSE 0101MS, PARSE THE FILE NAME
						.IDENT	/0101MS/
      2					; ALTERED MONDAY 25-FEB-74 12:55
      3					; ALTERED FRIDAY 28-JUN-74  4:00	SHAO-SUN CHIEN
      4					;
      5					;                             COPYRIGHT (C) 1974, 1978 BY
      6					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      7					;
      8					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      9					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     10					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     11					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     12					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     13					;
     14					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     15					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     16					;       CORPORATION.
     17					;
     18					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     19					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     20					;
     21					; PETER H. LIPMAN 16-AUG-73
     22					;
     23					;+
     24					; SET UP FILE NAME BLOCK BY PARSING IF NECESSARY OR BY
     25					; ASSIGNING THE LUN IF THE FILE ID IS SET UP
     26					; CALLING SEQUENCE:
     27					;	CALL	..STFN
     28					; INPUTS:
     29					;	R0=FDB
     30					;OUTPUTS:
     31					;	R1=FILE NAME BLOCK ADDRESS
     32					;	R0 PRESERVED, R2-R5 DESTROYED
     33					;-
     34	000000	010001 			..STFN::MOV	R0,R1
     35	000002	062701 	000000G			ADD	#F.FNB,R1	;FORM R1=ADDRESS OF FILE NAME BLOCK
     36	000006	005711 				TST	@R1		;IS FILE ID ALREADY SET UP
     37	000010	001406 				BEQ	10$		;BRANCH IF NO
     38	000012	005760 	000000G			TST	F.BDB(R0)	;IF FILE IS ALREADY OPEN
     39	000016	001002 				BNE	5$		;SKIP THE ASSIGN LUN
     40	000020					CALL	..ALUN		;ASSIGN THE LUN ANYWAY
     41	000024				5$:	RETURN
     42					; FILE ID NOT SET UP, DO THE PARSE
     43	000026	016002 	000000G		10$:	MOV	F.DSPT(R0),R2
     44	000032	016003 	000000G			MOV	F.DFNB(R0),R3
     45	000036	000405 				BR	..PARS
PARSE 0101MS, PARSE THE FILE NA	MACRO M1108  05-DEC-77 22:15  PAGE 8


     47					;+
     48					; PARSE ROUTINE - ACCEPTS ADDRESS OF DEVICE, DIRECTORY, AND
     49					; FILE NAME DESCRIPTORS
     50					;
     51					; CALLING SEQUENCE
     52					;	CALL	..PARS
     53					; INPUTS:
     54					;	R0=FDB ADDRESS
     55					;	R1=ADDRESS OF FILE NAME BLOCK
     56					;	R2=POINTER TO DEV, DIR, AND NAME DESCRIPTORS
     57					;	R3=DEFAULT FILE NAME BLOCK OR ZERO IF NONE SPECIFIED
     58					; OUTPUTS:
     59					;	R0,R1 PRESERVED
     60					;	R2-R5 ALTERED
     61					;	C=0 FOR SUCCESSFUL PARSE
     62					;	C=1 FOR FAILURE IN PARSE, F.ERR SET TO REASON.
     63					; OPERATION:
     64					;	FILLS IN THE FILE NAME BLOCK FROM THE STRING AND FILLS IN
     65					; UNSPECIFIED FIELDS FROM THE DEFAULT FILE NAME BLOCK, IF PRESENT.
     66					; ALSO ASSIGNS THE LUN TO THE SPECIFIED DEVICE
     67					;
     68					; ALTERNATE ENTRY POINT:
     69					;	CALL	.PARSE
     70					; OPERATION:
     71					;	SAME AS ..PARS, EXCEPT IT PRESERVES ALL REGISTERS.  THIS ENTRY IS
     72					; INTENDED FOR THE USER LEVEL CALL.
     73					;
     74					;-
     75	000040				.PARSE::.SAVR1			;SAVE REGISTERS R1-R5
     76	000044	012760 	000001 	000000G		MOV	#1,F.ERR(R0)
     77	000052				..PARS::CALL	..PSDV		;PARSE THE DEVICE NAME
     78	000056	103405 				BCS	1$
     79	000060					CALL	..PSDI		;PARSE THE DIRECTORY NAME
     80	000064	103402 				BCS	1$
     81	000066					CALL	..PSFN		;PARSE THE FILE NAME DESCRIPTOR
     82	000072				1$:	RETURN
     83					;
     84					;
     85	000074					$END	PARSE
     86					;
     87		000001 				.END
PARSE 0101MS, PARSE THE FILE NA	MACRO M1108  05-DEC-77 22:15  PAGE 8-1
SYMBOL TABLE

BD.FRE= 000001   	F.ERR = ****** GX	N.DRPT= 000006   	R$$EIS= 000000   	WI.LCK= 000001
DIRTYP= 015172   	F.FNB = ****** GX	N.DRSZ= 000004   	R$$LCL= 000000   	$$    = 000067
FCSEFN= 000040   	HA.CHU= 000003   	N.DVPT= 000002   	R$$MUL= 000000   	.PARSE  000040RG
FD.DVR= 000020   	HA.FP = 000002   	N.DVSZ= 000000   	R$$OPF= 000000   	.SAVR1= ****** GX
FD.EFB= 000004   	HA.NAM= 000005   	N.FNPT= 000012   	R$$RSL= 000000   	..ALUN= ****** GX
FD.EF1= 000010   	HA.TYP= 000006   	N.FNSZ= 000010   	R$$SEQ= 000000   	..PARS  000052RG
FD.EOF= 000002   	HA.UAT= 000004   	PP.SEP= 000002   	R$$SPL= 000000   	..PSDI= ****** GX
FD.WRT= 000001   	HA.UI = 000001   	PP.ZER= 000001   	R$$11M= 000001   	..PSDV= ****** GX
F.BDB = ****** GX	HA.VER= 000007   	R$$ANI= 000000   	SYDEV = 054523   	..PSFN= ****** GX
F.DFNB= ****** GX	NB.DOT= 100000   	R$$BBF= 000000   	SYUNIT= 000000   	..STFN  000000RG
F.DSPT= ****** GX	NB.SMI= 040000   	R$$DPB= 000001   	WI.DLK= 000002   	...CTL= 000001

. ABS.	000000	   000
      	000074	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2554 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]PARSE,[41,20]PARSE/-SP=[41,30]FCSPRE,PARSE
PARSFN 0102MS, PARSE FILE NAME 	MACRO M1108  05-DEC-77 22:16  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
PARSFN 0102MS, PARSE FILE NAME 	MACRO M1108  05-DEC-77 22:16  PAGE 7


						.TITLE	PARSFN 0102MS, PARSE FILE NAME DESCRIPTOR
						.IDENT	/0102MS/
      2					;
      3					;                             COPYRIGHT (C) 1974, 1978 BY
      4					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      5					;
      6					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      7					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      8					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      9					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     10					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     11					;
     12					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     13					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     14					;       CORPORATION.
     15					;
     16					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     17					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     18					;
     19					; PETER H. LIPMAN
     20					; MODIFIED BY SHAO-SUN CHIEN	28-JUN-74
     21					;+
     22					; PARSE FILE NAME DESCRIPTOR - CALLED BY PARSE TO ESTABLISH THE
     23					; FILE NAME AND VERSION NUMBER ENTRIES OF FNB.
     24					;
     25					; INPUTS:
     26					;	R0=FDB ADDRESS
     27					;	R1=ADDRESS OF FILE NAME BLOCK
     28					;	R2=POINTER TO DEV, DIR, AND NAME DESCRIPTORS
     29					;	R3=DEFAULT FILE NAME BLOCK OR ZERO IF NONE SPECIFIED
     30					; OUTPUTS:
     31					;	C=0 IF SUCCESSFUL, C=1 IF ERROR, F.ERR SET TO REASON
     32					;	ALL REGISTERS PRESERVED.
     33					;-
     34	000000				.PRSFN::.SAVR1
     35	000004	012760 	000001 	000000G		MOV	#1,F.ERR(R0)
     36	000012	010346 			..PSFN::MOV	R3,-(SP)
     37	000014	005702 				TST	R2		;NO DESCRIPTOR POINTER?
     38	000016	001404 				BEQ	10$		;BRANCH IF YES
     39	000020	016203 	000012 			MOV	N.FNPT(R2),R3	;R3=ADDRESS OF STRING
     40	000024	016202 	000010 			MOV	N.FNSZ(R2),R2	;R2=SIZE OF STRING
     41	000030	010346 			10$:	MOV	R3,-(SP)	;SAVE STRING POINTER
     42	000032	010246 				MOV	R2,-(SP)	;SAVE STRING SIZE
     43
     44	000034	003571 			PARS1:	BLE	PRSDF		;BRANCH IF STRING IS NOW NULL
     45	000036	112304 			4$:	MOVB	(R3)+,R4	;GET NEXT CHARACTER OF STRING
     46	000040	022704 	000056 			CMP	#'.,R4		;IS IT A DOT?
     47	000044	001446 				BEQ	DOT		;BRANCH IF YES
     48	000046	022704 	000073 			CMP	#';,R4		;IS IT A SEMICOLON?
     49	000052	001500 				BEQ	SEMI		;BRANCH IF IT IS
     50	000054					SOB	R2,4$		;GO LOOK AT NEXT CHARACTER
PARSFN 0102MS, PARSE FILE NAME 	MACRO M1108  05-DEC-77 22:16  PAGE 8


     52					; NO MORE CHARACTERS IN STRING.  THE STRING PASSED OVER IS A
     53					; FILE NAME IF WE HAVN'T ALREADY SEEN ONE; A FILE TYPE IF WE HAVN'T
     54					; SEEN THAT, OR A VERSION.
     55	000060	005203 				INC	R3		;POSITION POINTER AS IF THERE WERE
     56									;A DELIMITER ON THE END.
     57					; HAVE WE ALREADY PASSED THE FILE NAME?
     58	000062	032761 	000000C	000000G		BIT	#NB.NAM!NB.DOT!NB.SMI,N.STAT(R1)
     59	000070	001445 				BEQ	FNAME		;BRANCH IF NO.
     60					; HAVE WE ALREADY PASSED THE FILE TYPE?
     61	000072	032761 	000000C	000000G		BIT	#NB.TYP!NB.SMI,N.STAT(R1)
     62	000100	001474 				BEQ	FTYPE		;BRANCH IF NO
     63					; THE FIELD JUST SCANNED IS A VERSION NUMBER
     64	000102	016605 	000002 		VERSN:	MOV	2(SP),R5	;R5=ADDRESS OF STRING
     65	000106	010304 				MOV	R3,R4		;CALCULATE R4=SIZE OF STRING
     66	000110	160504 				SUB	R5,R4
     67	000112	005304 				DEC	R4
     68	000114	122715 	000052 			CMPB	#'*,@R5		;WILD CARD VERSION?
     69	000120	001407 				BEQ	10$
     70	000122	010103 				MOV	R1,R3
     71	000124	062703 	000000G			ADD	#N.FVER,R3	;R3=ADDRESS TO RETURN NUMBER IN
     72	000130					CALL	.ODCVT		;CONVERT THE STRING TO A NUMBER
     73	000134	103404 				BCS	15$
     74	000136	000530 				BR	PRSDF		;ALL DONE WITH FILE NAME-
     75									;FILL IN DEFAULTS
     76	000140	022704 	000001 		10$:	CMP	#1,R4		;* SEEN, ONLY 1 CHAR?
     77	000144	001402 				BEQ	20$		;YES, IT'S OK
     78	000146	000167 	000360 		15$:	JMP	PRSBX		;SYNTAX ERROR
     79	000152	052761 	000000G	000000G	20$:	BIS	#NB.SVR,N.STAT(R1)
     80	000160	000517 				BR	PRSDF
     81					; FOUND DOT, NAME IN FRONT, ALSO NOTE THAT A TYPE WAS FOUND.  IF NULL
     82					; THEN THAT'S DIFFERENT FROM NULL AND NO DOT.  (I.E. NULL VS.  NOT SPECIFIED)
     83
     84	000162	032761 	040000 	000000G	DOT:	BIT	#NB.SMI,N.STAT(R1) ;IS THIS DOT PART OF VERSION NO.?
     85	000170	001402 				BEQ	10$		;BRANCH IF NO
     86	000172	005203 				INC	R3		;ASSUME DECIMAL VERSION NUMBER
     87	000174	000742 				BR	VERSN		;DOT IS PART OF THE STRING
     88	000176	052761 	100000 	000000G	10$:	BIS	#NB.DOT,N.STAT(R1) ;NOTE THAT DOT WAS SEEN
     89
     90	000204	010304 			FNAME:	MOV	R3,R4		;CALCULATE SIZE OF STRING
     91	000206	166604 	000002 			SUB	2(SP),R4	;TO SEE IF IT'S NULL
     92	000212	005304 				DEC	R4
     93	000214	001412 				BEQ	10$		;BRANCH IF IT IS NULL
     94	000216	052761 	000000G	000000G		BIS	#NB.NAM,N.STAT(R1) ;WE HAVE FOUND A FILE NAME
     95	000224	122776 	000052 	000002 		CMPB	#'*,@2(SP)	;WILD CARD IN FIRST CHARACTER?
     96	000232	001003 				BNE	10$
     97	000234	052761 	000000G	000000G		BIS	#NB.SNM,N.STAT(R1) ;INDICATE THAT A * WAS SEEN
     98	000242	012704 	000000G		10$:	MOV	#N.FNAM,R4	;R4=OFFSET FOR FILE NAME
     99	000246	012705 	000011 			MOV	#9.,R5		;R5=MAX SIZE OF FILE NAME
    100	000252	000432 				BR	PRSMV
PARSFN 0102MS, PARSE FILE NAME 	MACRO M1108  05-DEC-77 22:16  PAGE 9


    102					;
    103					; FOUND A SEMICOLON, THE PRECEEDING STRING IS A FILE NAME
    104					; IF NO FILE NAME WAS SEEN OR IT IS A FILE TYPE.
    105	000254	052761 	000000C	000000G	SEMI:	BIS	#NB.SMI!NB.VER,N.STAT(R1) ;INDICATE THAT SEMI WAS FOUND
    106	000262	032761 	000000C	000000G		BIT	#NB.NAM!NB.DOT,N.STAT(R1)  ;PAST A FILE NAME YET?
    107	000270	001745 				BEQ	FNAME		;BRANCH IF NO,THIS IS A FILE NAME
    108					; THIS IS A FILE TYPE STRING
    109	000272	010304 			FTYPE:	MOV	R3,R4		;CALCULATE STRING SIZE
    110	000274	166604 	000002 			SUB	2(SP),R4
    111	000300	005304 				DEC	R4		;TO SEE IF IT'S NULL
    112	000302	001412 				BEQ	10$		;BRANCH IF IT IS
    113	000304	052761 	000000G	000000G		BIS	#NB.TYP,N.STAT(R1) ;NOTE THAT WE SAW A FILE TYPE
    114	000312	122776 	000052 	000002 		CMPB	#'*,@2(SP)
    115	000320	001003 				BNE	10$
    116	000322	052761 	000000G	000000G		BIS	#NB.STP,N.STAT(R1) ;NOTE WILD CARD TYPE
    117	000330	012704 	000000G		10$:	MOV	#N.FTYP,R4	;R4=OFFSET FOR FILE TYPE STRING
    118	000334	012705 	000003 			MOV	#3,R5		;R5=MAX SIZE STRING
    119					; MOVE FILE NAME OR TYPE INTO ITS PLACE IN THE FILE NAME BLOCK
    120					; R1=FILE NAME BLOCK ADDRESS, R3=POINTER TO TERMINATING CHARACTER
    121					; R4=OFFSET IN FILE NAME BLOCK TO STORE STRING, R5=MAX NO.  OF BYTES IN
    122					; STRING.  0(SP)=PREVIOUS SIZE OF STRING, 2(SP)=STRING POINTER TO
    123					; BEGINNING OF NAME
    124
    125	000340	016602 	000002 		PRSMV:	MOV	2(SP),R2	;R2=PTR TO BEGINNING OF STRING
    126	000344	010366 	000002 			MOV	R3,2(SP)	;UPDATE STRING POINTER
    127	000350	160203 				SUB	R2,R3		;R3=NEW POINTER-OLD POINTER
    128	000352	160316 				SUB	R3,@SP		;UPDATE BYTE REMAINING IN STRING
    129	000354	005303 				DEC	R3		;R3=SIZE OF STRING,EXCLUDING DELIMITER
    130	000356	001414 				BEQ	10$		;BRANCH IF STRING IS NULL
    131	000360	122712 	000052 			CMPB	#'*,@R2		;DOES NAME START WITH WILD CARD?
    132	000364	001003 				BNE	2$		;BRANCH IF NO
    133	000366	022703 	000001 			CMP	#1,R3		;MUST BE THE ONLY CHAR
    134	000372	001406 				BEQ	10$		;IT IS,  IF NOT, ILL RAD50 CHAR
    135	000374	020503 			2$:	CMP	R5,R3		;SIZE LEGAL?
    136	000376	002455 				BLT	PRSBX		;BRANCH IF TOO BIG
    137	000400	060104 				ADD	R1,R4		;R4=ADDRESS TO MOVE STRING TO
    138	000402					CALL	..SGR5		;CONVERT ASCII STRIN TO RAD50
    139	000406	103451 				BCS	PRSBX		;BRANCH IF SYNTAX ERROR
    140					; DONE PUTTING NAME IN NAME BLOCK, GO DO THE NEXT PART OF THE STRING
    141	000410	016603 	000002 		10$:	MOV	2(SP),R3	;R3=ADDRESS OF STRING
    142	000414	011602 				MOV	@SP,R2		;R2=REMAINING SIZE OF STRING
    143	000416	000606 				BR	PARS1
PARSFN 0102MS, PARSE FILE NAME 	MACRO M1108  05-DEC-77 22:16  PAGE 10


    145					;
    146					; STRING PARSE IS COMPLETE-SET UP DEFAULT FIELDS.
    147	000420	062706 	000004 		PRSDF:	ADD	#4,SP		;GET RID OF STRING PTR AND SIZE
    148	000424	016103 	000000G		PRSDF1:	MOV	N.STAT(R1),R3	;R3 = STATUS BITS
    149	000430	032703 	100000 			BIT	#NB.DOT,R3	;IF DOT WAS SEEN
    150	000434	001403 				BEQ	2$
    151	000436	052761 	000000G	000000G		BIS	#NB.TYP,N.STAT(R1) ;INDICATE EXPLICIT TYPE FOUND
    152	000444	012602 			2$:	MOV	(SP)+,R2	;R2=DEFAULT NAME BLOCK ADDRESS
    153	000446	001430 				BEQ	8$		;BRANCH IF NO DEFAULT NAME BLOCK
    154	000450	032703 	000000G			BIT	#NB.NAM,R3 	;WAS A FILE NAME SPECIFIED?
    155	000454	001011 				BNE	4$		;BRANCH IF YES-NO DEFAULT NEEDED
    156	000456	016261 	000000G	000000G		MOV	N.FNAM(R2),N.FNAM(R1) ;MOV DEFAULT NAME FIELD INTO
    157	000464	016261 	000002G	000002G		MOV	N.FNAM+2(R2),N.FNAM+2(R1) ;FILE NAME BLOCK
    158	000472	016261 	000004G	000004G		MOV	N.FNAM+4(R2),N.FNAM+4(R1)
    159					; IF AN EXPLICIT FILE TYPE WAS FOUND OR IF A DOT WAS SEEN THEN
    160					; ASSUME FILE TYPE WAS EXPLICIT AND DON'T USE DEFAULT.
    161					; THIS ALLOWS   FILE.   TO MEAN AN EXPLICIT NULL TYPE.
    162	000500	032703 	000000C		4$:	BIT	#NB.TYP!NB.DOT,R3 ;WAS A FILE TYPE SPECIFIED?
    163	000504	001003 				BNE	6$		;BRANCH IF YES-NO DEFAULT NEEDED
    164	000506	016261 	000000G	000000G		MOV	N.FTYP(R2),N.FTYP(R1) ;MOVE THE DEFAULT FILE TYPE
    165	000514	032703 	000000C		6$:	BIT	#NB.VER!NB.SMI,R3  ;WAS A VERSION SPECIFIED?
    166	000520	001003 				BNE	8$		;BRANCH IF YES-
    167	000522	016261 	000000G	000000G		MOV	N.FVER(R2),N.FVER(R1) ;MOVE THE DEFAULT VERSION NUMBER
    168	000530				8$:	RETURN
    169
    170					; ERROR EXIT
    171	000532	062706 	000006 		PRSBX:	ADD	#6,SP
    172	000536	112760 	000000G	000000G		MOVB	#IE.BNM,F.ERR(R0)
    173	000544	000261 				SEC
    174	000546					RETURN
    175					;
    176					;
    177	000550					$END	PARSFN
    178					;
    179		000001 				.END
PARSFN 0102MS, PARSE FILE NAME 	MACRO M1108  05-DEC-77 22:16  PAGE 10-1
SYMBOL TABLE

BD.FRE= 000001   	HA.NAM= 000005   	N.DRPT= 000006   	PRSDF   000420R  	SEMI    000254R
DIRTYP= 015172   	HA.TYP= 000006   	N.DRSZ= 000004   	PRSDF1  000424R  	SYDEV = 054523
DOT     000162R  	HA.UAT= 000004   	N.DVPT= 000002   	PRSMV   000340R  	SYUNIT= 000000
FCSEFN= 000040   	HA.UI = 000001   	N.DVSZ= 000000   	R$$ANI= 000000   	VERSN   000102R
FD.DVR= 000020   	HA.VER= 000007   	N.FNAM= ****** GX	R$$BBF= 000000   	WI.DLK= 000002
FD.EFB= 000004   	IE.BNM= ****** GX	N.FNPT= 000012   	R$$DPB= 000001   	WI.LCK= 000001
FD.EF1= 000010   	NB.DOT= 100000   	N.FNSZ= 000010   	R$$EIS= 000000   	$$    = 000067
FD.EOF= 000002   	NB.NAM= ****** GX	N.FTYP= ****** GX	R$$LCL= 000000   	.ODCVT= ****** GX
FD.WRT= 000001   	NB.SMI= 040000   	N.FVER= ****** GX	R$$MUL= 000000   	.PRSFN  000000RG
FNAME   000204R  	NB.SNM= ****** GX	N.STAT= ****** GX	R$$OPF= 000000   	.SAVR1= ****** GX
FTYPE   000272R  	NB.STP= ****** GX	PARS1   000034R  	R$$RSL= 000000   	..PSFN  000012RG
F.ERR = ****** GX	NB.SVR= ****** GX	PP.SEP= 000002   	R$$SEQ= 000000   	..SGR5= ****** GX
HA.CHU= 000003   	NB.TYP= ****** GX	PP.ZER= 000001   	R$$SPL= 000000   	...CTL= 000001
HA.FP = 000002   	NB.VER= ****** GX	PRSBX   000532R  	R$$11M= 000001

. ABS.	000000	   000
      	000550	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2705 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:16
[41,10]PARSFN,[41,20]PARSFN/-SP=[41,30]FCSPRE,PARSFN
PGCR 0100MS, IS PUT/GET LEGAL?	MACRO M1108  05-DEC-77 22:16  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
PGCR 0100MS, IS PUT/GET LEGAL?	MACRO M1108  05-DEC-77 22:16  PAGE 7


						.TITLE	PGCR 0100MS, IS PUT/GET LEGAL?
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 17-AUG-73
     21					;
     22					;+
     23					; SUBROUTINE TO VERIFY THAT PUT OR GET IS LEGAL TO THIS FILE
     24					; CALLING SEQUENCE
     25					;	CALL	..PGCR
     26					; INPUTS:
     27					;	R0=FDB
     28					; OUTPUTS:
     29					;	C=0 FOR OPERATION OK, C=1 FOR NOT OK, F.ERR SET
     30					;	ALL REGISTERS PRESERVED
     31					;	RETURNS NORMALLY IF ACCESS IS ALLOWED
     32					;	FATAL ERROR IF NOT ALLOWED
     33					;-
     34						.IF	EQ,R$$SEQ	;SEQUENTIAL OR RANDOM ALLOWED
     35	000000	005760 	000000G		..PGCR::TST	F.BDB(R0)	;MUST BE NON-ZERO IF FILE IS OPEN
     36	000004	001416 				BEQ	20$		;BRANCH IF FILE NOT OPEN
     37	000006	132760 	000000G	000000G		BITB	#FD.RWM,F.RACC(R0) ;PUT/GET MODE (I.E. NOT READ/WRITE MODE)
     38	000014	001012 				BNE	20$		;BRANCH IF NOT PUT/GET MODE
     39	000016	132760 	000000G	000000G		BITB	#FD.RAN,F.RACC(R0) ;IF RANDOM MODE
     40	000024	001404 				BEQ	10$
     41	000026	132760 	000000G	000000G		BITB	#FD.SQD,F.RCTL(R0) ;MUST NOT BE SEQUENTIAL DEVICE
     42	000034	001007 				BNE	30$
     43	000036	000241 			10$:	CLC
     44	000040					RETURN
     45	000042	112760 	000000G	000000G	20$:	MOVB	#IE.ILL,F.ERR(R0) ;PUT/GET IS ILLEGAL
     46	000050	000261 				SEC
     47	000052					RETURN
     48						.ENDC
     49					;
     50						.IF	GT,R$$SEQ	;SEQUENTIAL ONLY
     51					..PGCS::TST	F.BDB(R0)	;MUST BE NON-ZERO IF FILE IS OPEN
     52						BEQ	20$		;BRANCH IF FILE NOT OPEN
     53						BITB	#FD.RWM,F.RACC(R0) ;IF READ/WRITE MODE
     54						BNE	20$		;THEN ILLEGAL
     55						BITB	#FD.RAN,F.RACC(R0) ;IF RANDOM MODE
     56						BNE	30$		;THEN ILLEGAL SEQ OPERATION
PGCR 0100MS, IS PUT/GET LEGAL?	MACRO M1108  05-DEC-77 22:16  PAGE 7-1


     57						CLC
     58						RETURN
     59					20$:	MOVB	#IE.ILL,F.ERR(R0) ;PUT/GET IS ILLEGAL
     60						SEC
     61						RETURN
     62						.ENDC
     63					;
     64	000054				30$:
     65						.IF	GT,R$$SEQ
     66					..SQER::
     67						.ENDC
     68	000054	112760 	000000G	000000G		MOVB	#IE.ISQ,F.ERR(R0) ;ILLEGAL SEQUENTIAL OPERATION
     69	000062	000261 				SEC
     70	000064					RETURN
     71					;
     72					;
     73	000066					$END	PGCR
     74					;
     75					;
     76		000001 				.END
PGCR 0100MS, IS PUT/GET LEGAL?	MACRO M1108  05-DEC-77 22:16  PAGE 7-2
SYMBOL TABLE

BD.FRE= 000001   	F.BDB = ****** GX	HA.VER= 000007   	N.FNSZ= 000010   	R$$RSL= 000000
DIRTYP= 015172   	F.ERR = ****** GX	IE.ILL= ****** GX	PP.SEP= 000002   	R$$SEQ= 000000
FCSEFN= 000040   	F.RACC= ****** GX	IE.ISQ= ****** GX	PP.ZER= 000001   	R$$SPL= 000000
FD.DVR= 000020   	F.RCTL= ****** GX	NB.DOT= 100000   	R$$ANI= 000000   	R$$11M= 000001
FD.EFB= 000004   	HA.CHU= 000003   	NB.SMI= 040000   	R$$BBF= 000000   	SYDEV = 054523
FD.EF1= 000010   	HA.FP = 000002   	N.DRPT= 000006   	R$$DPB= 000001   	SYUNIT= 000000
FD.EOF= 000002   	HA.NAM= 000005   	N.DRSZ= 000004   	R$$EIS= 000000   	WI.DLK= 000002
FD.RAN= ****** GX	HA.TYP= 000006   	N.DVPT= 000002   	R$$LCL= 000000   	WI.LCK= 000001
FD.RWM= ****** GX	HA.UAT= 000004   	N.DVSZ= 000000   	R$$MUL= 000000   	..PGCR  000000RG
FD.SQD= ****** GX	HA.UI = 000001   	N.FNPT= 000012   	R$$OPF= 000000   	...CTL= 000002
FD.WRT= 000001

. ABS.	000000	   000
      	000066	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2558 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]PGCR,[41,20]PGCR/-SP=[41,30]FCSPRE,PGCR
PGCS 0100MS, IS PUT/GET LEGAL?	MACRO M1108  05-DEC-77 22:16  PAGE 1


      1					;                             COPYRIGHT (C) 1975, 1978 BY
      2					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      3					;
      4					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      5					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      6					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      7					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
      8					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
      9					;
     10					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     11					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     12					;       CORPORATION.
     13					;
     14					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     15					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     16		000001 				R$$SEQ=1		;ASSEMBLE SEQUENTIAL PUT, GET, PGVFY
     17									;PRODUCING .PUTSQ, GETSQ, PGSEQ
PGCS 0100MS, IS PUT/GET LEGAL?	MACRO M1108  05-DEC-77 22:16  PAGE 2


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
PGCS 0100MS, IS PUT/GET LEGAL?	MACRO M1108  05-DEC-77 22:16  PAGE 8


						.TITLE	PGCS 0100MS, IS PUT/GET LEGAL?
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 17-AUG-73
     21					;
     22					;+
     23					; SUBROUTINE TO VERIFY THAT PUT OR GET IS LEGAL TO THIS FILE
     24					; CALLING SEQUENCE
     25					;	CALL	..PGCR
     26					; INPUTS:
     27					;	R0=FDB
     28					; OUTPUTS:
     29					;	C=0 FOR OPERATION OK, C=1 FOR NOT OK, F.ERR SET
     30					;	ALL REGISTERS PRESERVED
     31					;	RETURNS NORMALLY IF ACCESS IS ALLOWED
     32					;	FATAL ERROR IF NOT ALLOWED
     33					;-
     34						.IF	EQ,R$$SEQ	;SEQUENTIAL OR RANDOM ALLOWED
     35					..PGCR::TST	F.BDB(R0)	;MUST BE NON-ZERO IF FILE IS OPEN
     36						BEQ	20$		;BRANCH IF FILE NOT OPEN
     37						BITB	#FD.RWM,F.RACC(R0) ;PUT/GET MODE (I.E. NOT READ/WRITE MODE)
     38						BNE	20$		;BRANCH IF NOT PUT/GET MODE
     39						BITB	#FD.RAN,F.RACC(R0) ;IF RANDOM MODE
     40						BEQ	10$
     41						BITB	#FD.SQD,F.RCTL(R0) ;MUST NOT BE SEQUENTIAL DEVICE
     42						BNE	30$
     43					10$:	CLC
     44						RETURN
     45					20$:	MOVB	#IE.ILL,F.ERR(R0) ;PUT/GET IS ILLEGAL
     46						SEC
     47						RETURN
     48						.ENDC
     49					;
     50						.IF	GT,R$$SEQ	;SEQUENTIAL ONLY
     51	000000	005760 	000000G		..PGCS::TST	F.BDB(R0)	;MUST BE NON-ZERO IF FILE IS OPEN
     52	000004	001412 				BEQ	20$		;BRANCH IF FILE NOT OPEN
     53	000006	132760 	000000G	000000G		BITB	#FD.RWM,F.RACC(R0) ;IF READ/WRITE MODE
     54	000014	001006 				BNE	20$		;THEN ILLEGAL
     55	000016	132760 	000000G	000000G		BITB	#FD.RAN,F.RACC(R0) ;IF RANDOM MODE
     56	000024	001007 				BNE	30$		;THEN ILLEGAL SEQ OPERATION
PGCS 0100MS, IS PUT/GET LEGAL?	MACRO M1108  05-DEC-77 22:16  PAGE 8-1


     57	000026	000241 				CLC
     58	000030					RETURN
     59	000032	112760 	000000G	000000G	20$:	MOVB	#IE.ILL,F.ERR(R0) ;PUT/GET IS ILLEGAL
     60	000040	000261 				SEC
     61	000042					RETURN
     62						.ENDC
     63					;
     64	000044				30$:
     65						.IF	GT,R$$SEQ
     66	000044				..SQER::
     67						.ENDC
     68	000044	112760 	000000G	000000G		MOVB	#IE.ISQ,F.ERR(R0) ;ILLEGAL SEQUENTIAL OPERATION
     69	000052	000261 				SEC
     70	000054					RETURN
     71					;
     72					;
     73	000056					$END	PGCR
     74					;
     75					;
     76		000001 				.END
PGCS 0100MS, IS PUT/GET LEGAL?	MACRO M1108  05-DEC-77 22:16  PAGE 8-2
SYMBOL TABLE

BD.FRE= 000001   	F.BDB = ****** GX	IE.ILL= ****** GX	PP.SEP= 000002   	R$$SEQ= 000001
DIRTYP= 015172   	F.ERR = ****** GX	IE.ISQ= ****** GX	PP.ZER= 000001   	R$$SPL= 000000
FCSEFN= 000040   	F.RACC= ****** GX	NB.DOT= 100000   	R$$ANI= 000000   	R$$11M= 000001
FD.DVR= 000020   	HA.CHU= 000003   	NB.SMI= 040000   	R$$BBF= 000000   	SYDEV = 054523
FD.EFB= 000004   	HA.FP = 000002   	N.DRPT= 000006   	R$$DPB= 000001   	SYUNIT= 000000
FD.EF1= 000010   	HA.NAM= 000005   	N.DRSZ= 000004   	R$$EIS= 000000   	WI.DLK= 000002
FD.EOF= 000002   	HA.TYP= 000006   	N.DVPT= 000002   	R$$LCL= 000000   	WI.LCK= 000001
FD.RAN= ****** GX	HA.UAT= 000004   	N.DVSZ= 000000   	R$$MUL= 000000   	..PGCS  000000RG
FD.RWM= ****** GX	HA.UI = 000001   	N.FNPT= 000012   	R$$OPF= 000000   	..SQER  000044RG
FD.WRT= 000001   	HA.VER= 000007   	N.FNSZ= 000010   	R$$RSL= 000000   	...CTL= 000002

. ABS.	000000	   000
      	000056	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2540 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[41,10]PGCS,[41,20]PGCS/-SP=[41,30]GPSEQ,FCSPRE,PGCR
PNTMRK 0100MS, POINT AND MARK	MACRO M1108  05-DEC-77 22:16  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
PNTMRK 0100MS, POINT AND MARK	MACRO M1108  05-DEC-77 22:16  PAGE 7


						.TITLE	PNTMRK 0100MS, POINT AND MARK
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 11-AUG-73
     21					;
     22					;+
     23					; POINT - POSITION FILE AT SPECIFIED BLOCK ANG BYTE NUMBER
     24					; CALLING SEQUENCE
     25					;	CALL	.POINT
     26					; INPUTS:
     27					;	R0=FDB ADDRESS
     28					;	R1=HIGH ORDER BITS OF NEW VIRTUAL BLOCK NUMBER (VBN)
     29					;	R2=LOW ORDER BITS OF NEW VBN
     30					;	R3=BYTE NUMBER TO POSITION TO IN THE BLOCK, BETWEEN 0
     31					;		AND BBFS-1
     32					;
     33					; OUTPUTS:
     34					;	ALL REGISTERS PRESERVED
     35					;	F.VBN, F.VBN+2 SET TO NEW BLOCK NO.
     36					;	F.NREC SET TO BYTE IN BLOCK
     37					;	F.NRBD, F.NRBD+2 SET IF IN PARTIAL LOCATE MODE, THUS ALLOWING PUT
     38					;		LOCATE MODE, RANDOM BY DOING POINT, BUILD RECORD, PUT
     39					;	C=0 IF OK, C=1 IF ERROR, F.ERR TELLS ABOUT KIND OF ERROR
     40					;
     41					;
     42					;
     43					; OPERATION:
     44					;	IF THE BLOCK DESIRED IS DIFFERENT FROM THE CURRENT NO, THE
     45					; CURRENT ONE IS WRITTEN IF FD.WRT OF F.BKP1 IS SET AND THE NEW BLOCK
     46					; IS READ.  IF THE NEW POSITION IS AT OR BEYOND THE EOF, THEN
     47					; THE EOF ERROR CONDITION IS RETURNED WITH THE C BIT SET
     48					;-
     49	000000				.POINT::.SAVR1			;SAVE REGISTERS R1-R5
     50	000004	012760 	000001 	000000G		MOV	#1,F.ERR(R0)
     51	000012	132760 	000000G	000000G		BITB	#FD.REC,F.RCTL(R0) ;IF RECORD ORIENTED, THEN NOP
     52	000020	001005 				BNE	10$
     53	000022					CALL	..PNT1
     54	000026	103403 				BCS	20$
     55	000030					CALL	..RTAD		;RETURN REC ADR TO USER IN LOCATE MODE
     56	000034	000241 			10$:	CLC
PNTMRK 0100MS, POINT AND MARK	MACRO M1108  05-DEC-77 22:16  PAGE 7-1


     57	000036				20$:	RETURN
PNTMRK 0100MS, POINT AND MARK	MACRO M1108  05-DEC-77 22:16  PAGE 8


     59					;+
     60					; MARK THE POSITION OF THE FILE SO THAT IT CAN
     61					; BE CONVENIENTLY REPOSITIONED THERE
     62					; CALLING SEQUENCE:
     63					;	CALL	.MARK
     64					; INPUTS:
     65					;	R0=FDB
     66					; OUTPUTS:
     67					;	R1=HIGH ORDER BITS OF VIRTUAL BLOCK NUMBER
     68					;	R2=LOW ORDER BITS OF VIRTUAL BLOCK NUMBER
     69					;	R3=CURRENT POSITION WITHIN BLOCK (BYTE NUMBER)
     70					; OPERATION:
     71					;	IT IS INTENDED THAT THE USER WOULD CALL .MARK
     72					; TO GET THE NECESSARY PARAMETERS FOR A LATER CALL TO .POINT
     73					;-
     74	000040	016001 	000000G		.MARK::	MOV	F.VBN(R0),R1
     75	000044	016002 	000002G			MOV	F.VBN+2(R0),R2
     76	000050	016003 	000000G			MOV	F.NREC(R0),R3
     77	000054	066003 	000000G			ADD	F.VBSZ(R0),R3
     78	000060	166003 	000000G			SUB	F.EOBB(R0),R3
     79	000064					RETURN
     80					;
     81					;
     82	000066					$END	PNTMRK
     83					;
     84					;
     85		000001 				.END
PNTMRK 0100MS, POINT AND MARK	MACRO M1108  05-DEC-77 22:16  PAGE 8-1
SYMBOL TABLE

BD.FRE= 000001   	F.NREC= ****** GX	NB.DOT= 100000   	R$$BBF= 000000   	SYUNIT= 000000
DIRTYP= 015172   	F.RCTL= ****** GX	NB.SMI= 040000   	R$$DPB= 000001   	WI.DLK= 000002
FCSEFN= 000040   	F.VBN = ****** GX	N.DRPT= 000006   	R$$EIS= 000000   	WI.LCK= 000001
FD.DVR= 000020   	F.VBSZ= ****** GX	N.DRSZ= 000004   	R$$LCL= 000000   	$$    = 000067
FD.EFB= 000004   	HA.CHU= 000003   	N.DVPT= 000002   	R$$MUL= 000000   	.MARK   000040RG
FD.EF1= 000010   	HA.FP = 000002   	N.DVSZ= 000000   	R$$OPF= 000000   	.POINT  000000RG
FD.EOF= 000002   	HA.NAM= 000005   	N.FNPT= 000012   	R$$RSL= 000000   	.SAVR1= ****** GX
FD.REC= ****** GX	HA.TYP= 000006   	N.FNSZ= 000010   	R$$SEQ= 000000   	..PNT1= ****** GX
FD.WRT= 000001   	HA.UAT= 000004   	PP.SEP= 000002   	R$$SPL= 000000   	..RTAD= ****** GX
F.EOBB= ****** GX	HA.UI = 000001   	PP.ZER= 000001   	R$$11M= 000001   	...CTL= 000001
F.ERR = ****** GX	HA.VER= 000007   	R$$ANI= 000000   	SYDEV = 054523

. ABS.	000000	   000
      	000066	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2536 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]PNTMRK,[41,20]PNTMRK/-SP=[41,30]FCSPRE,PNTMRK
POINT 0100MS, SET FILE POSIT TO	MACRO M1108  05-DEC-77 22:17  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
POINT 0100MS, SET FILE POSIT TO	MACRO M1108  05-DEC-77 22:17  PAGE 7


						.TITLE	POINT 0100MS, SET FILE POSIT TO SPECIFIED VBN AND BYTE
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 11-AUG-73
     21					;
     22					;+
     23					; POINT - POSITION FILE AT SPECIFIED BLOCK ANG BYTE NUMBER
     24					; CALLING SEQUENCE
     25					;	CALL	..PNT1
     26					; INPUTS:
     27					;	R0=FDB ADDRESS
     28					;	R1=HIGH ORDER BITS OF NEW VIRTUAL BLOCK NUMBER (VBN)
     29					;	R2=LOW ORDER BITS OF NEW VBN
     30					;	R3=BYTE NUMBER TO POSITION TO IN THE BLOCK, BETWEEN 0
     31					;		AND BBFS-1
     32					;
     33					; OUTPUTS:
     34					;	R0 PRESERVED, R1-R5 ALTERED
     35					;	F.VBN, F.VBN+2 SET TO NEW BLOCK NO.
     36					;	F.NREC SET TO BYTE IN BLOCK
     37					;	C=0 IF OK, C=1 IF ERROR, F.ERR TELLS ABOUT KIND OF ERROR
     38					;
     39					;
     40					;
     41					; OPERATION:
     42					;	IF THE BLOCK DESIRED IS DIFFERENT FROM THE CURRENT NO, THE
     43					; CURRENT ONE IS WRITTEN IF FD.WRT OF F.BKP1 IS SET AND THE NEW BLOCK
     44					; IS READ.  IF THE NEW POSITION IS AT OR BEYOND THE EOF, THEN
     45					; THE EOF ERROR CONDITION IS RETURNED WITH THE C BIT SET
     46					;-
     47	000000				..PNT1::
     48						.IF	EQ,R$$BBF	;NO BIG BUFFERS
     49	000000	020260 	000002G			CMP	R2,F.VBN+2(R0)	;SAME BLOCK AS CURRENT ONE?
     50	000004	001015 				BNE	20$		;BRANCH IF NO.
     51	000006	020160 	000000G			CMP	R1,F.VBN(R0)	;HIGH ORDER BITS TOO?
     52	000012	001012 				BNE	20$		;BRANCH IF NOT THE SAME VBN
     53					; VBN IS THE CURRENT ONE, JUST SET NREC
     54	000014	016001 	000000G			MOV	F.EOBB(R0),R1
     55	000020	166001 	000000G			SUB	F.VBSZ(R0),R1
     56	000024	060301 				ADD	R3,R1
POINT 0100MS, SET FILE POSIT TO	MACRO M1108  05-DEC-77 22:17  PAGE 7-1


     57	000026	010160 	000000G			MOV	R1,F.NREC(R0)
     58	000032					CALL	..EFCK
     59	000036				10$:	RETURN
     60					;
     61	000040				20$:	CALL	..ALC1		;ALLOCATE SPACE IF NEEDED
     62	000044	103774 				BCS	10$		;BRANCH IF FAILED TO ALLOCATE SPACE
     63						.ENDC
     64					;
     65						.IF	GT,R$$BBF	;BUFFERS GREATER THAN 1 BLOCK
     66						CALL	..ALC1		;ALLOCATE SPACE IF NEEDED
     67						BCS	10$
     68						MOV	R1,R4		;DESIRED VBN IN R4,R5
     69						MOV	R2,R5
     70						CALL	INMBB1		;DESIRED VBN IN THIS BUFFER
     71						BCS	20$		;BRANCH IF NO
     72						ADD	R3,F.NREC(R0)	;EOBB AND NREC WERE SET UP
     73						MOV	R1,F.VBN(R0)
     74						MOV	R2,F.VBN+2(R0)
     75						CALL	..EFCK
     76					10$:	RETURN
     77					20$:
     78						.ENDC
     79					;
     80					; RESET THE VIRTUAL BLOCK NUMBER-WRITE (IF NECESSARY), THEN READ
     81	000046	010346 				MOV	R3,-(SP)	;SAVE THE BYTE OFFSET
     82	000050	010146 				MOV	R1,-(SP)	;HIGH ORDER BITS OF VBN
     83	000052	010246 				MOV	R2,-(SP)	;LOW ORDER BITS OF VBN
     84	000054	132760 	000001 	000000G		BITB	#FD.WRT,F.BKP1(R0) ;IF "DIRTY" BIT ISN'T SET
     85	000062	001403 				BEQ	40$		;SKIP THE WRITE
     86					; WRITE THE DIRTY BUFFER, FORCING THE WRITE OF A BIG BUFFER
     87	000064					CALL	..WTWD
     88	000070	103415 				BCS	60$
     89					; READ THE NEW VIRTUAL BLOCK NUMBER IN
     90	000072	012660 	000002G		40$:	MOV	(SP)+,F.VBN+2(R0) ;SET THE NEW VBN
     91	000076	012660 	000000G			MOV	(SP)+,F.VBN(R0)
     92	000102					CALL	..RWAC
     93	000106	062660 	000000G			ADD	(SP)+,F.NREC(R0) ;ADD IN BYTE OFFSET TO RECORD POINTER
     94	000112	105760 	000000G			TSTB	F.ERR(R0)
     95	000116	002404 				BLT	70$		;BRANCH IF ERROR FROM READ
     96	000120					CALLR	..EFC1		;CHECK FOR EOF, ..STEF DONE BY ..RWAT
     97					;
     98	000124	062706 	000006 		60$:	ADD	#6,SP
     99	000130	000261 			70$:	SEC
    100	000132					RETURN
    101					;
    102					;
    103	000134					$END	POINT
    104					;
    105					;
    106		000001 				.END
POINT 0100MS, SET FILE POSIT TO	MACRO M1108  05-DEC-77 22:17  PAGE 7-2
SYMBOL TABLE

BD.FRE= 000001   	F.NREC= ****** GX	NB.SMI= 040000   	R$$DPB= 000001   	WI.DLK= 000002
DIRTYP= 015172   	F.VBN = ****** GX	N.DRPT= 000006   	R$$EIS= 000000   	WI.LCK= 000001
FCSEFN= 000040   	F.VBSZ= ****** GX	N.DRSZ= 000004   	R$$LCL= 000000   	$$    = 000067
FD.DVR= 000020   	HA.CHU= 000003   	N.DVPT= 000002   	R$$MUL= 000000   	..ALC1= ****** GX
FD.EFB= 000004   	HA.FP = 000002   	N.DVSZ= 000000   	R$$OPF= 000000   	..EFCK= ****** GX
FD.EF1= 000010   	HA.NAM= 000005   	N.FNPT= 000012   	R$$RSL= 000000   	..EFC1= ****** GX
FD.EOF= 000002   	HA.TYP= 000006   	N.FNSZ= 000010   	R$$SEQ= 000000   	..PNT1  000000RG
FD.WRT= 000001   	HA.UAT= 000004   	PP.SEP= 000002   	R$$SPL= 000000   	..RWAC= ****** GX
F.BKP1= ****** GX	HA.UI = 000001   	PP.ZER= 000001   	R$$11M= 000001   	..WTWD= ****** GX
F.EOBB= ****** GX	HA.VER= 000007   	R$$ANI= 000000   	SYDEV = 054523   	...CTL= 000001
F.ERR = ****** GX	NB.DOT= 100000   	R$$BBF= 000000   	SYUNIT= 000000

. ABS.	000000	   000
      	000134	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2625 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[41,10]POINT,[41,20]POINT/-SP=[41,30]FCSPRE,POINT
POSIT 0103MS, CALCULATE FILE PO	MACRO M1108  05-DEC-77 22:17  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
POSIT 0103MS, CALCULATE FILE PO	MACRO M1108  05-DEC-77 22:17  PAGE 7


						.TITLE	POSIT 0103MS, CALCULATE FILE POSITION
						.IDENT	/0103MS/
      2					; ALTERED THURSDAY 18-APR-74 11:30 BY PETER LIPMAN
      3					; ALTERED THURSDAY 28-MAR-74 16:05 BY ANDREW GOLDSTEIN
      4					;
      5					;                             COPYRIGHT (C) 1973, 1978 BY
      6					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      7					;
      8					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      9					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     10					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     11					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     12					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     13					;
     14					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     15					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     16					;       CORPORATION.
     17					;
     18					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     19					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     20					;
     21					; PETER H. LIPMAN 11-AUG-73
     22					;
     23					;+
     24					; POSIT ALGORITHM
     25
     26					; CALCULATE  RCNM*RSIZ  IN TRIPLE PRECISION
     27					;   THEN DIVIDE BY BLKSZ
     28					;
     29					; RH = HIGH ORDER RECNUM
     30					; RL = LOW ORDER RECNUM
     31					; BS = BLOCK SIZE
     32					; RS = RECORD SIZE
     33					;
     34					;
     35					; RS*RH = P1,P2
     36					; RS*RL = P3,P4
     37					; P2+P3 = P5
     38					; C(P2+P3)+P1 = P6
     39					; PRODUCT = P6,P5,P4
     40					;
     41					; P6 GREATER OR EQUAL BS  THEN ERROR
     42					;
     43					; (P6,P5)/BS = D2,L2
     44					;
     45					; (L2,P4)/BS = D3,L3
     46					;
     47					;
     48					; D2,D3 = VBN
     49					; L3 = BYTE NO.
     50					;-
     51					;
     52	000000	012760 	000001 	000000G	.POSIT::MOV	#1,F.ERR(R0)
     53	000006	010446 				MOV	R4,-(SP)
     54	000010	010546 				MOV	R5,-(SP)
     55	000012					CALL	..PSIT
     56	000016	012605 				MOV	(SP)+,R5
POSIT 0103MS, CALCULATE FILE PO	MACRO M1108  05-DEC-77 22:17  PAGE 7-1


     57	000020	012604 				MOV	(SP)+,R4
     58	000022					RETURN
     59					;
     60
     61						.IF	EQ,R$$EIS
     62
     63	000024	010005 			..PSIT::MOV	R0,R5		; SAVE AWAY FDB POINTER
     64	000026	016504 	000000G			MOV	F.RSIZ(R5),R4	; GET RECORD SIZE
     65	000032	005204 				INC	R4		; ROUND UP TO NEXT WORD
     66	000034	042704 	000001 			BIC	#1,R4
     67	000040	010400 				MOV	R4,R0		; AND MAKE A COPY
     68	000042	132765 	000000G	000000G		BITB	#FD.BLK,F.RATT(R5) ;CAN RECORDS CROSS BLOCK BOUDARIES?
     69	000050	001057 				BNE	70$		;BRANCH IF NO
     70
     71					; COMPUTE RECORD POINTER FOR NORMAL CASE.
     72
     73	000052	016546 	000000G			MOV	F.RCNM(R5),-(SP) ; GET HIGH ORDER RECORD NUMBER
     74	000056	016503 	000002G			MOV	F.RCNM+2(R5),R3	; GET LOW ORDER RECORD NUMBER
     75	000062	162703 	000001 			SUB	#1,R3		; RECORD NUMBERS START AT 1
     76	000066	005616 				SBC	(SP)
     77	000070	002501 				BLT	50$		; RECORD NUMBER MUST BE 31 BITS, NON-ZERO
     78	000072	005002 				CLR	R2		; CLEAR HIGH ORDER MULTIPLICAND
     79	000074					CALL	$DMUL		; COMPUTE LOW ORDER PRODUCT (P3,P4)
     80
     81	000100	012603 				MOV	(SP)+,R3	; GET HIGH ORDER RECORD NUMBER AGAIN
     82	000102	001004 				BNE	10$		; UNLESS ZERO, PROCEED WITH REST OF MULTIPLY
     83	000104	010102 				MOV	R1,R2		; MOVE PRODUCT INTO POSITION FOR DIVIDE
     84	000106	010001 				MOV	R0,R1
     85	000110	005004 				CLR	R4		; CLEAR HIGH ORDER QUOTIENT
     86	000112	000423 				BR	20$		; AND GO RIGHT TO LOW ORDER DIVIDE
     87
     88	000114	010146 			10$:	MOV	R1,-(SP)	; SAVE P4
     89	000116	010046 				MOV	R0,-(SP)	; SAVE P3
     90	000120	005002 				CLR	R2
     91	000122	010400 				MOV	R4,R0		; GET RECORD SIZE AGAIN
     92	000124					CALL	$DMUL		; COMPUTE HIGH ORDER PRODUCT (P1,P2)
     93
     94	000130	010102 				MOV	R1,R2		; MOV PRODUCT INTO POSITION FOR DIVIDE
     95	000132	010001 				MOV	R0,R1
     96	000134	062602 				ADD	(SP)+,R2	; COMPUTE P5
     97	000136	005501 				ADC	R1		; AND P6
     98	000140	016500 	000000G			MOV	F.VBSZ(R5),R0	; GET DIVISOR (BLOCK SIZE)
     99	000144					CALL	$DDIV		; COMPUTE (D2,L2)
    100
    101	000150	005701 				TST	R1		; TEST HIGH ORDER QUOTIENT
    102	000152	001050 				BNE	50$		; THREE WORDS OF VBN IS TOO MUCH!
    103
    104	000154	010001 				MOV	R0,R1		; GET REMAINDER FOR NEXT DIVIDE
    105	000156	010204 				MOV	R2,R4		; SAVE AWAY REST OF QUOTIENT
    106	000160	012602 				MOV	(SP)+,R2	; GET P4 (REMEMBER P4?)
    107	000162	016500 	000000G		20$:	MOV	F.VBSZ(R5),R0	; AND THE DIVISOR (BS)
    108	000166					CALL	$DDIV		; AND COMPUTE (D3,L3)
    109	000172	060401 				ADD	R4,R1		; PUT BACK HIGH ORDER VBN (D2)
    110	000174	010003 				MOV	R0,R3		; AND GET REMAINDER FOR BYTE NO.
    111
    112	000176	010500 			60$:	MOV	R5,R0		; RESTORE THE FDB ADDRESS
    113	000200	062702 	000001 			ADD	#1,R2		; FIX VBN TO START WITH 1
POSIT 0103MS, CALCULATE FILE PO	MACRO M1108  05-DEC-77 22:17  PAGE 7-2


    114	000204	005501 				ADC	R1
    115	000206					RETURN
    116
    117					; THIS LEG OF CODE DOES THE COMPUTATION FOR RECORDS WHICH DO NOT CROSS
    118					; BLOCK BOUNDARIES.
    119
    120	000210	005001 			70$:	CLR	R1		; CLEAR HIGH ORDER DIVIDEND
    121	000212	016502 	000000G			MOV	F.VBSZ(R5),R2	; GET BLOCK SIZE
    122	000216					CALL	$DDIV		; COMPUTE NUMBER OF RECORDS PER BLOCK
    123	000222	010200 				MOV	R2,R0		; AND MOVE TO DIVISOR
    124
    125	000224	016501 	000000G			MOV	F.RCNM(R5),R1	; GET HIGH ORDER RECORD NUMBER
    126	000230	016502 	000002G			MOV	F.RCNM+2(R5),R2 ; GET LOW ORDER RECORD NUMBER
    127	000234	162702 	000001 			SUB	#1,R2		; FIX #1 RECORD BIAS
    128	000240	005601 				SBC	R1
    129	000242	002415 				BLT	45$		; RECORD NUMBER MUST BE 31 BITS, NON-ZERO
    130	000244					CALL	$DDIV		; AND COMPUTE THE BLOCK NUMBER
    131	000250	010246 				MOV	R2,-(SP)	; SAVE THE RESULT
    132	000252	010146 				MOV	R1,-(SP)
    133	000254	005001 				CLR	R1
    134	000256	010403 				MOV	R4,R3		; GET RECORD SIZE
    135	000260					CALL	$DMUL		; AND COMPUTE BYTE OFFSET
    136	000264	010103 				MOV	R1,R3		; POSITION FOR RETURN
    137	000266	012601 				MOV	(SP)+,R1	; RECOVER VBN
    138	000270	012602 				MOV	(SP)+,R2
    139	000272	000741 				BR	60$		; AND USE COMMON EXIT
    140
    141					; ERROR RETURNS FOR BAD RECORD NUMBERS
    142
    143	000274	005726 			50$:	TST	(SP)+		; CLEAN OFF THE STACK
    144	000276	010500 			45$:	MOV	R5,R0		; FIX FDB POINTER
    145	000300	112760 	000000G	000000G		MOVB	#IE.RCN,F.ERR(R0) ; SET ERROR CODE
    146	000306	000261 				SEC
    147	000310					RETURN
    148
    149
    150						.IFF
    151
    152					..PSIT::MOV	F.RSIZ(R0),R1
    153						INC	R1
    154						BIC	#1,R1
    155						BITB	#FD.BLK,F.RATT(R0) ;CAN RECORDS CROSS BLOCK BOUDARIES?
    156						BNE	70$		;BRANCH IF NO
    157						TST	F.RCNM(R0)
    158						BNE	10$		;IF DBL PRECISION, NEED FULL CALCULATION
    159						MOV	F.RCNM+2(R0),R2
    160						BLE	5$		;IF NEG, NEED DBL PRECISION, 0 ILLEGAL
    161						DEC	R2
    162						MUL	R1,R2
    163						DIV	F.VBSZ(R0),R2
    164						BVS	15$		;V BIT INDICATES NEED FOR DBL PRECISION
    165						CLR	R1
    166						BR	30$
    167					5$:	BEQ	50$		;RECORD NOS. START AT 1
    168						BR	15$
    169					10$:	BLT	50$		;MAX OF 31 BIT RECORD NO.
    170					15$:	MOV	F.RCNM+2(R0),-(SP)
POSIT 0103MS, CALCULATE FILE PO	MACRO M1108  05-DEC-77 22:17  PAGE 7-3


    171						MOV	F.RCNM(R0),-(SP)
    172						SUB	#1,2(SP)
    173						SBC	@SP
    174						MOV	@SP,R2		;RH
    175						MUL	R1,R2		;P1,P2
    176						MOV	R2,@SP		;P1
    177						MOV	R3,-(SP)	;P2
    178						MOV	4(SP),R2	;R2=RL
    179						CLR	-(SP)		;ZERO THE CARRY BIT TOO
    180						ROR	R2		;DIVIDE BY 2
    181						ADC	@SP		;SAVE CARRY
    182						MUL	R1,R2		;MUL BY RECSIZ
    183						ASHC	#1,R2		;MUL BY 2
    184						TST	(SP)+		;IF IT WAS ODD
    185						BEQ	20$
    186						ADD	R1,R3		;ADD BACK IN THE MULTIPLIER
    187						ADC	R2
    188					20$:				;AT LAST, R2,R3 =P3,P4
    189						ADD	R2,@SP		;P5=P2+P3
    190						ADC	2(SP)		;P6=P1+C
    191						MOV	R3,4(SP)
    192					;0(SP)=P5, 2(SP)=P6, 4(SP)=P4
    193
    194						MOV	2(SP),R2
    195						MOV	F.VBSZ(R0),R1
    196						MOV	@SP,R3
    197						DIV	R1,R2		;D2,L2
    198						BVS	45$		;BLOCK NO MUST FIT IN 31 BITS
    199						MOV	R2,@SP		;D2
    200						MOV	R3,R2
    201						MOV	4(SP),R3	;FORM L2,P4
    202						DIV	R1,R2		;D3,L3
    203						BVC	25$
    204					; V BIT SET MEANS RESULT WILL HAVE SIGN BIT SET
    205						MOV	R1,R4
    206						CLR	R5
    207						ASHC	#-1,R4
    208						SUB	R4,R2		;SUBTRACT 100000*R1 FROM DIVIDEND
    209						BCS	45$
    210						SUB	R5,R3
    211						SBC	R2
    212						BCS	45$
    213						DIV	R1,R2
    214						BVS	45$		;V BIT SHOULN'T BE SET THIS TIME
    215						BIS	#100000,R2	;FIX THE RESULT
    216					25$:	MOV	@SP,R1		;R1=HVBN, R2=LVBN, R3=BYTE
    217						ADD	#6,SP
    218
    219					30$:	ADD	#1,R2		;INCREMENT VBN SINCE START AT 1
    220						ADC	R1		;C IS CLEARED
    221						RETURN
    222
    223					45$:	ADD	#6,SP
    224					50$:	MOVB	#IE.RCN,F.ERR(R0)
    225						SEC
    226						RETURN
    227					;
POSIT 0103MS, CALCULATE FILE PO	MACRO M1108  05-DEC-77 22:17  PAGE 7-4


    228					; RECORDS ARE BLOCK ALLIGNED
    229					70$:	CLR	R4
    230						MOV	F.VBSZ(R0),R5
    231						DIV	R1,R4		;R4=NO. OF RECORDS PER BLOCK
    232						MOV	F.RCNM+2(R0),R3
    233						MOV	F.RCNM(R0),R2
    234						SUB	#1,R3
    235						SBC	R2
    236						BCS	50$		;BRANCH IF RECNUM WAS 0
    237						BNE	80$		;BRANCH IF DOUBLE PRECISION
    238						DIV	R4,R2		;R2=BLOCK NO (BASE 0),
    239									;R3= NO OF RECORDS IN THAT BLOCK
    240						MUL	R1,R3		;R3=NO. OF BYTES IN THAT BLOCK
    241						CLR	R1
    242						BR	30$
    243					;
    244					; DOUBLE PRECISION BLOCK ALLIGNED
    245					80$:	BLT	50$		;31 BIT RECORD NUMBERS
    246						ASHC	#1,R2
    247						MOV	R2,R5
    248						MOV	R4,-(SP)
    249						CLR	R4
    250						DIV	@SP,R4		;HIGH BIT *2/NREC PER BLOCK
    251						MOV	R5,R2		;USE REMAINDER AS NEW HIHG BITS
    252						ASHC	#-1,R2		;AND SHIFT BACK
    253						DIV	(SP)+,R2	;GUARANTEED 15 BIT RESULT IN R2
    254						MUL	R1,R3		;R3=REC SIZE *NO. OF RECS IN LAST BLOCK
    255						MOV	R4,R1		;HIGH ORDER BITS * 2
    256						ASL	R2		;C BIT CLEARED
    257						ROR	R1		;DIVIDE HIGH BITS BY 2, SET C
    258						ROR	R2		;ROTATE C BIT INTO HIGH BIT
    259						BR	30$
    260
    261						.ENDC
    262					;
    263					;
    264	000312					$END	POSIT
    265					;
    266					;
    267		000001 				.END
POSIT 0103MS, CALCULATE FILE PO	MACRO M1108  05-DEC-77 22:17  PAGE 7-5
SYMBOL TABLE

BD.FRE= 000001   	F.RCNM= ****** GX	NB.DOT= 100000   	R$$BBF= 000000   	SYDEV = 054523
DIRTYP= 015172   	F.RSIZ= ****** GX	NB.SMI= 040000   	R$$DPB= 000001   	SYUNIT= 000000
FCSEFN= 000040   	F.VBSZ= ****** GX	N.DRPT= 000006   	R$$EIS= 000000   	WI.DLK= 000002
FD.BLK= ****** GX	HA.CHU= 000003   	N.DRSZ= 000004   	R$$LCL= 000000   	WI.LCK= 000001
FD.DVR= 000020   	HA.FP = 000002   	N.DVPT= 000002   	R$$MUL= 000000   	$DDIV = ****** GX
FD.EFB= 000004   	HA.NAM= 000005   	N.DVSZ= 000000   	R$$OPF= 000000   	$DMUL = ****** GX
FD.EF1= 000010   	HA.TYP= 000006   	N.FNPT= 000012   	R$$RSL= 000000   	$$    = 000067
FD.EOF= 000002   	HA.UAT= 000004   	N.FNSZ= 000010   	R$$SEQ= 000000   	.POSIT  000000RG
FD.WRT= 000001   	HA.UI = 000001   	PP.SEP= 000002   	R$$SPL= 000000   	..PSIT  000024RG
F.ERR = ****** GX	HA.VER= 000007   	PP.ZER= 000001   	R$$11M= 000001   	...CTL= 000001
F.RATT= ****** GX	IE.RCN= ****** GX	R$$ANI= 000000

. ABS.	000000	   000
      	000312	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2559 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:16
[41,10]POSIT,[41,20]POSIT/-SP=[41,30]FCSPRE,POSIT
POSREC 0100MS, POSITION RANDOM 	MACRO M1108  05-DEC-77 22:17  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
POSREC 0100MS, POSITION RANDOM 	MACRO M1108  05-DEC-77 22:17  PAGE 7


						.TITLE	POSREC 0100MS, POSITION RANDOM RECORD
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 11-AUG-73
     21					;
     22					;+
     23					; POSITION FILE TO PUT OR GET SPECIFIED RECORD NUMBER
     24					; CALLING SEQUENCE
     25					;	CALL	.POSRC
     26					; INPUTS:
     27					;	R0=FDB
     28					;	F.RCNM,F.RCNM+2 CONTAIN THE DESIRED RECORD NUMBER
     29					; OUTPUTS:
     30					;	C=0 IF OK, C=1 IF ERROR, F.ERR TELLS WHAT HAPPENED
     31					;	ALL REGISTERS PRESERVED
     32					;	FDB SET UP TO POINT AT DESIRED RECORD
     33					;		F.VBN, F.NREC ARE SET UP
     34					;		F.NRBD, F.NRBD+2 ARE SET IF IN PARTIAL LOCATE MODE
     35					;-
     36	000000				.POSRC::.SAVR1
     37	000004	012760 	000001 	000000G		MOV	#1,F.ERR(R0)
     38	000012	132760 	000000G	000000G		BITB	#FD.REC,F.RCTL(R0) ;NOP IF RECORD ORIENTED
     39	000020	001004 				BNE	POSRCX
     40					; ENTER HERE TO AVOID SAVING THE REGISTERS - ONLY R0 PRESERVED
     41	000022				..PSR1::CALL	..PSRC
     42	000026					CALL	..RTAD		;RETURN BUF ADR IN PARTIAL LOCATE MODE
     43	000032				POSRCX:	CALLR	..FCSX
     44					;
     45	000036				..PSRC::CALL	..PSIT		;CALCULATE VBN AND BYTE
     46	000042	103402 				BCS	10$		;BRANCH IF BAD RECORD NUMBER OR SIZE
     47	000044					CALL	..PNT1		;POSITION THE FILE
     48	000050				10$:	RETURN
     49					;
     50					;
     51	000052					$END	POSREC
     52					;
     53					;
     54		000001 				.END
POSREC 0100MS, POSITION RANDOM 	MACRO M1108  05-DEC-77 22:17  PAGE 7-1
SYMBOL TABLE

BD.FRE= 000001   	HA.CHU= 000003   	N.DVPT= 000002   	R$$LCL= 000000   	$$    = 000067
DIRTYP= 015172   	HA.FP = 000002   	N.DVSZ= 000000   	R$$MUL= 000000   	.POSRC  000000RG
FCSEFN= 000040   	HA.NAM= 000005   	N.FNPT= 000012   	R$$OPF= 000000   	.SAVR1= ****** GX
FD.DVR= 000020   	HA.TYP= 000006   	N.FNSZ= 000010   	R$$RSL= 000000   	..FCSX= ****** GX
FD.EFB= 000004   	HA.UAT= 000004   	POSRCX  000032R  	R$$SEQ= 000000   	..PNT1= ****** GX
FD.EF1= 000010   	HA.UI = 000001   	PP.SEP= 000002   	R$$SPL= 000000   	..PSIT= ****** GX
FD.EOF= 000002   	HA.VER= 000007   	PP.ZER= 000001   	R$$11M= 000001   	..PSRC  000036RG
FD.REC= ****** GX	NB.DOT= 100000   	R$$ANI= 000000   	SYDEV = 054523   	..PSR1  000022RG
FD.WRT= 000001   	NB.SMI= 040000   	R$$BBF= 000000   	SYUNIT= 000000   	..RTAD= ****** GX
F.ERR = ****** GX	N.DRPT= 000006   	R$$DPB= 000001   	WI.DLK= 000002   	...CTL= 000001
F.RCTL= ****** GX	N.DRSZ= 000004   	R$$EIS= 000000   	WI.LCK= 000001

. ABS.	000000	   000
      	000052	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2539 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]POSREC,[41,20]POSREC/-SP=[41,30]FCSPRE,POSREC
PPNASC 0104MS, CONVERT PPN TO A	MACRO M1108  05-DEC-77 22:17  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
PPNASC 0104MS, CONVERT PPN TO A	MACRO M1108  05-DEC-77 22:17  PAGE 7


						.TITLE	PPNASC 0104MS, CONVERT PPN TO ASCII STRING
						.IDENT	/0104MS/
      2					;
      3					;                             COPYRIGHT (C) 1975, 1978 BY
      4					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      5					;
      6					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      7					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      8					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      9					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     10					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     11					;
     12					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     13					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     14					;       CORPORATION.
     15					;
     16					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     17					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     18					;
     19					; PETER H. LIPMAN
     20					;+
     21					; CONVERT PPN TO ASCII STRING
     22					; CALLING SEQUENCE:
     23					;	CALL	.PPASC
     24					; INPUTS:
     25					;	R2=STRING ADDRESS TO PUT ASCII CHARS IN
     26					;	R3=PPN - .BYTE PROG,PROJ
     27					;	R4=FLAGS
     28					;		BIT 0 = 0 MEANS SUPPRESS LEADING ZEROS
     29					;		      = 1 MEANS DON'T SUPPRESS
     30					;		BIT 1 = 0 MEANS PUT SEPARATORS IN STRING ([,])
     31					;		      = 1 MEANS SUPPRESS SEPARATORS
     32					; OUTPUTS:
     33					;	R2 UPDATED STRING POINTER
     34					;	ALL OTHER REGISTERS PRESERVED
     35					;-
     36	000000				.PPASC::
     37	000000	010546 				MOV	R5,-(SP)
     38	000002	010446 				MOV	R4,-(SP)
     39	000004	010346 				MOV	R3,-(SP)
     40	000006	032704 	000002 			BIT	#PP.SEP,R4
     41	000012	001002 				BNE	10$		;BRANCH IF SUPPRESSING SEPARATORS
     42	000014	112722 	000133 			MOVB	#'[,(R2)+
     43	000020	000303 			10$:	SWAB	R3		;TRANSLATE THE PROJECT NUMBER FIRST
     44	000022					CALL	BYTASC		;TRANSLATE FIRST BYTE TO ASCII
     45	000026	032704 	000002 			BIT	#PP.SEP,R4
     46	000032	001002 				BNE	20$		;BRANCH IF SUPPRESSING SEPARATORS
     47	000034	112722 	000054 			MOVB	#',,(R2)+	;PUT COMMA IN STRING
     48	000040	111603 			20$:	MOVB	@SP,R3		;R3=PROGRAMMER NUMBER
     49	000042					CALL	BYTASC		;CONVERT IT TO ASCII
     50	000046	032704 	000002 			BIT	#PP.SEP,R4
     51	000052	001002 				BNE	30$		;BRANCH IF SUPPRESSING SEPARATORS
     52	000054	112722 	000135 			MOVB	#'],(R2)+	;PUT RIGHT BRACKET IN STRING
     53	000060	012603 			30$:	MOV	(SP)+,R3
     54	000062	012604 				MOV	(SP)+,R4
     55	000064	012605 				MOV	(SP)+,R5
     56	000066					RETURN
PPNASC 0104MS, CONVERT PPN TO A	MACRO M1108  05-DEC-77 22:17  PAGE 8


     58					;+
     59					; CONVERT BYTE TO OCTAL ASCII
     60					; CALLING SEQUENCE:
     61					;	CALL	BYTASC
     62					; INPUTS:
     63					;	R2=STRING ADDRESS TO PUT ASCII BYTES IN
     64					;	R3=BYTE TO CONVERT
     65					;	R4=FLAGS, BIT 0 SET MEANS DON'T SUPPRESS LEADING ZEROS
     66					; OUTPUTS:
     67					;	R2=UPDATED STRING POINTER
     68					;	R0,R1,R4 PRESERVED, R3,R5 DESTROYED
     69					;-
     70	000070	042703 	177400 		BYTASC:	BIC	#177400,R3
     71						.IF	GT,R$$EIS
     72						ASH	#2,R3		;FIRST DIGIT ONLY 2 BITS
     73						.IFF
     74	000074	006303 				ASL	R3
     75	000076	006303 				ASL	R3
     76						.ENDC
     77	000100	012705 	000003 			MOV	#3,R5		;CONVERT 3 DIGITS
     78	000104	032704 	000001 			BIT	#PP.ZER,R4
     79	000110	001011 				BNE	10$		;BRANCH IF NOT SUPPRESSING ZEROS
     80	000112	032703 	177400 		5$:	BIT	#177400,R3	;THIS DIGIT ZERO?
     81	000116	001006 				BNE	10$		;BRANCH IF NO, END SUPPRESS LOOP
     82						.IF	GT,R$$EIS
     83						ASH	#3,R3
     84						.IFF
     85	000120	006303 				ASL	R3
     86	000122	006303 				ASL	R3
     87	000124	006303 				ASL	R3
     88						.ENDC
     89	000126					SOB	R5,5$		;CHECK NEXT CHARACTER
     90	000132	005205 				INC	R5		;BYTE WAS 0, PUT ONE DIGIT OF 0
     91	000134	000303 			10$:	SWAB	R3
     92	000136	062703 	000060 			ADD	#'0,R3		;CONVERT TO ASCII DIGIT
     93	000142	110322 				MOVB	R3,(R2)+	;STORE THE BYTE
     94	000144	105003 				CLRB	R3		;ZERO THE BYTE
     95	000146	000303 				SWAB	R3		;AND SET UP FOR NEXT DIGIT
     96						.IF	GT,R$$EIS
     97						ASH	#3,R3
     98						.IFF
     99	000150	006303 				ASL	R3
    100	000152	006303 				ASL	R3
    101	000154	006303 				ASL	R3
    102						.ENDC
    103	000156					SOB	R5,10$
    104	000162					RETURN
    105					;
    106					;
    107	000164					$END	PPNASC
    108					;
    109		000001 				.END
PPNASC 0104MS, CONVERT PPN TO A	MACRO M1108  05-DEC-77 22:17  PAGE 8-1
SYMBOL TABLE

BD.FRE= 000001   	HA.CHU= 000003   	N.DRPT= 000006   	R$$BBF= 000000   	R$$11M= 000001
BYTASC  000070R  	HA.FP = 000002   	N.DRSZ= 000004   	R$$DPB= 000001   	SYDEV = 054523
DIRTYP= 015172   	HA.NAM= 000005   	N.DVPT= 000002   	R$$EIS= 000000   	SYUNIT= 000000
FCSEFN= 000040   	HA.TYP= 000006   	N.DVSZ= 000000   	R$$LCL= 000000   	WI.DLK= 000002
FD.DVR= 000020   	HA.UAT= 000004   	N.FNPT= 000012   	R$$MUL= 000000   	WI.LCK= 000001
FD.EFB= 000004   	HA.UI = 000001   	N.FNSZ= 000010   	R$$OPF= 000000   	$$    = 000067
FD.EF1= 000010   	HA.VER= 000007   	PP.SEP= 000002   	R$$RSL= 000000   	.PPASC  000000RG
FD.EOF= 000002   	NB.DOT= 100000   	PP.ZER= 000001   	R$$SEQ= 000000   	...CTL= 000001
FD.WRT= 000001   	NB.SMI= 040000   	R$$ANI= 000000   	R$$SPL= 000000

. ABS.	000000	   000
      	000164	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2541 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]PPNASC,[41,20]PPNASC/-SP=[41,30]FCSPRE,PPNASC
PPNR50 0104MS, TRANSLATE PPN TO	MACRO M1108  05-DEC-77 22:18  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
PPNR50 0104MS, TRANSLATE PPN TO	MACRO M1108  05-DEC-77 22:18  PAGE 7


						.TITLE	PPNR50 0104MS, TRANSLATE PPN TO RAD50 FORM
						.IDENT	/0104MS/
      2					;
      3					;                             COPYRIGHT (C) 1974, 1978 BY
      4					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      5					;
      6					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      7					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      8					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      9					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     10					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     11					;
     12					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     13					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     14					;       CORPORATION.
     15					;
     16					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     17					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     18					;
     19					;
     20					;
     21					; D.N.CUTLER	3-JUL-74
     22					; COMMENTED BY S.CHIEN	12-JUL-74
     23					;
     24					;
     25					;+
     26					; TRANSLATE PPN TO TWO RAD50 WORDS
     27					;
     28					; CALLING SEQUENCE:
     29					;	CALL .PPR50
     30					;
     31					; INPUT:
     32					;	R2 = PPN - .BYTE   PROG,PROJ
     33					;	R1 = ADDRESS TO STORE RAD50 STRING
     34					; OUTPUT:
     35					;	R0,R4,R5 PRESERVED
     36					;	R1,R2,R3 DESTROYED
     37					;-
     38					;
PPNR50 0104MS, TRANSLATE PPN TO	MACRO M1108  05-DEC-77 22:18  PAGE 8


     40	000000				.PPR50::CALL	10$		;CONVERT PROJ NUMBER
     41	000004	005721 				TST	(R1)+		;CONVERT PROG NUMBER
     42	000006	005011 			10$:	CLR	(R1)		;INITIAL CONDITION OF ALGORITHM
     43	000010	005003 				CLR	R3		;CLEAR ACCUMULATOR
     44	000012					CALL	20$		;CONVERT HIGH OCTAL DIGIT
     45	000016					CALL	(PC)		;CONVERT 2 REMAINING LOW OCTAL DIGITS
     46	000020	011146 				MOV	(R1),-(SP)	;RAD50 FORM OF OCTAL DIGIT
     47	000022	006311 				ASL	(R1)		;2N
     48	000024	006311 				ASL	(R1)		;4N
     49	000026	062611 				ADD	(SP)+,(R1)	;N+4N=5N
     50	000030	006311 				ASL	(R1)		;10N
     51	000032	006311 				ASL	(R1)		;20N
     52	000034	006311 				ASL	(R1)		;40N (RAD 50)
     53	000036	005003 				CLR	R3		;GET READY FOR NEXT OCTAL DIGIT
     54	000040	006302 				ASL	R2		;SHIFT ONE BIT FROM R2
     55	000042	006103 				ROL	R3		;INTO R3
     56	000044	006302 			20$:	ASL	R2		;
     57	000046	006103 				ROL	R3		;
     58	000050	006302 				ASL	R2		;
     59	000052	006103 				ROL	R3		;
     60	000054	062703 	000036 			ADD	#36,R3		;ADD RAD50 FORM OF 0
     61	000060	060311 				ADD	R3,(R1)		;ACCUMULATE RESULT
     62	000062					RETURN
     63					;
     64	000064					$END	PPNR50
     65					;
     66		000001 				.END
PPNR50 0104MS, TRANSLATE PPN TO	MACRO M1108  05-DEC-77 22:18  PAGE 8-1
SYMBOL TABLE

BD.FRE= 000001   	HA.FP = 000002   	N.DRSZ= 000004   	R$$DPB= 000001   	R$$11M= 000001
DIRTYP= 015172   	HA.NAM= 000005   	N.DVPT= 000002   	R$$EIS= 000000   	SYDEV = 054523
FCSEFN= 000040   	HA.TYP= 000006   	N.DVSZ= 000000   	R$$LCL= 000000   	SYUNIT= 000000
FD.DVR= 000020   	HA.UAT= 000004   	N.FNPT= 000012   	R$$MUL= 000000   	WI.DLK= 000002
FD.EFB= 000004   	HA.UI = 000001   	N.FNSZ= 000010   	R$$OPF= 000000   	WI.LCK= 000001
FD.EF1= 000010   	HA.VER= 000007   	PP.SEP= 000002   	R$$RSL= 000000   	$$    = 000017
FD.EOF= 000002   	NB.DOT= 100000   	PP.ZER= 000001   	R$$SEQ= 000000   	.PPR50  000000RG
FD.WRT= 000001   	NB.SMI= 040000   	R$$ANI= 000000   	R$$SPL= 000000   	...CTL= 000001
HA.CHU= 000003   	N.DRPT= 000006   	R$$BBF= 000000

. ABS.	000000	   000
      	000064	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2521 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]PPNR50,[41,20]PPNR50/-SP=[41,30]FCSPRE,PPNR50
$PRINT	MACRO M1108  05-DEC-77 22:17  PAGE 1


      1					;                             COPYRIGHT (C) 1975, 1978 BY
      2					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      3					;
      4					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      5					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      6					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      7					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
      8					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
      9					;
     10					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     11					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     12					;       CORPORATION.
     13					;
     14					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     15					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     16
     17
     18
     19
     20
     21						.TITLE $PRINT
     22	000000	000240 			$PRINT::	NOP
     23		000001 				.END
$PRINT	MACRO M1108  05-DEC-77 22:17  PAGE 1-1
SYMBOL TABLE

$PRINT  000000RG

. ABS.	000000	   000
      	000002	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  29 WORDS  ( 1 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:02
[41,10]PRINT,[41,20]PRINT/-SP=[41,30]PRINT
.PRINT -- DUMMY PRINT SPOOLER M	MACRO M1108  05-DEC-77 22:17  PAGE 1


      1						.TITLE	.PRINT -- DUMMY PRINT SPOOLER MODULE
      2
      3
      4					;                             COPYRIGHT (C) 1975, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19
     20
     21					;	J. MASSE	31-JUL-76
     22
     23
     24	000000	000207 			.PRINT::RTS	PC		; JUST RETURN
     25
     26
     27		000001 				.END
.PRINT -- DUMMY PRINT SPOOLER M	MACRO M1108  05-DEC-77 22:17  PAGE 1-1
SYMBOL TABLE

.PRINT  000000RG

. ABS.	000000	   000
      	000002	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  34 WORDS  ( 1 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:02
[41,10]PRINT1,[41,20]PRINT1/-SP=[41,30]PRINT1
PUT 0101MS, PUT RECORD ROUTINE	MACRO M1108  05-DEC-77 22:18  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
PUT 0101MS, PUT RECORD ROUTINE	MACRO M1108  05-DEC-77 22:18  PAGE 7


						.TITLE	PUT 0101MS, PUT RECORD ROUTINE
						.IDENT	/0101MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 13-JULY-73
     21					;
PUT 0101MS, PUT RECORD ROUTINE	MACRO M1108  05-DEC-77 22:18  PAGE 8


     23					;+
     24					; .PUT IS A SUBROUTINE TO WRITE LOGICAL RECORDS TO A FILE.
     25					;
     26					; CALLING SEQUENCE:
     27					;	JSR PC,.PUT
     28					; INPUTS:
     29					;	R0=FDB ADDRESS
     30					; OUTPUTS:
     31					;	F.NRBD+2=ADDRESS OF NEXT RECORD BUFFER IF IN PARTIAL LOCATE MODE.
     32					; OPERATION:
     33					;	ALL INFORMATION REQUIRED BY THE .PUT ROUTINE MUST BE
     34					; PRESENT IN THE FDB.  THIS INCLUDES THE ADDRESS OF THE RECORD
     35					; BUFFER, AND THE NUMBER OF BYTES TO BE WRITTEN.
     36					;
     37					;-
     38						.IF	EQ,R$$SEQ	;IF SEQUENTIAL OR RANDOM ALLOWED
     39	000000				.PUT::	.SAVR1			;SAVE REGISTERS R1-R5
     40	000004					CALL	..PGCR		;VERIFY THAT PUT/GET IS LEGAL
     41						.ENDC
     42					;
     43						.IF	GT,R$$SEQ	;IF SEQUENTIAL ONLY
     44					.PUTSQ::.SAVR1
     45						CALL	..PGCS
     46						.ENDC
     47					;
     48	000010	103535 				BCS	PUTX1		;BRANCH IF IT ISN'T
     49	000012	016003 	000000G			MOV	F.NRBD(R0),R3	;R3=SIZE OF RECORD IN BYTES
     50	000016	002525 				BLT	PTBIG		;BRANCH IF RECORD TOO BIG
     51	000020	012760 	000001 	000000G		MOV	#1,F.ERR(R0)	;INIT THE ERROR RETURN CODE
     52	000026	132760 	000000G	000000G		BITB	#FD.REC,F.RCTL(R0) ;RECORD ORIENTED DEVICE?
     53	000034	001524 				BEQ	PTBLK		;BRANCH IF BLOCK ORIENTED
     54					; RECORD ORIENTED DEVICE
     55					; CALCULATE CARRIAGE CONTROL CHARACTER ON TOP OF STACK
     56	000036	016001 	000002G			MOV	F.NRBD+2(R0),R1	;R1=ADDRESS OF RECORD DATA
     57	000042	016002 	000000G			MOV	F.NREC(R0),R2	;R2=ADR IN BLOCK BUFFER TO PUT RECORD
     58	000046	005046 				CLR	-(SP)		;ASSUME ZERO CARRIAGE CONTROL
     59	000050	132760 	000000G	000000G		BITB	#FD.CCL,F.RCTL(R0) ;IS THIS A CARRIAGE CONTROL DEVICE?
     60	000056	001414 				BEQ	1$		;BRANCH IF NOT
     61	000060	132760 	000000C	000000G		BITB	#FD.FTN!FD.CR,F.RATT(R0) ;ANY CARRIAGE CONTROL
     62	000066	001410 				BEQ	1$		;BRANCH IF NONE
     63	000070	012716 	000040 			MOV	#' ,@SP		;ASSUME BLANK CARRIAGE CONTROL
     64	000074	132760 	000000G	000000G		BITB	#FD.FTN,F.RATT(R0) ;FORTRAN CARRIAGE CONTROL
     65	000102	001402 				BEQ	1$		;BRANCH IF NO
     66	000104	012716 	177777 			MOV	#-1,@SP		;NEGATIVE MEANS FORTRAN CARRIAGE CONTROL
     67	000110	020102 			1$:	CMP	R1,R2		;IF THESE ARE EQUAL THEN DON'T NEED TO MOVE RECORD
     68	000112	001440 				BEQ	10$		;BRANCH IF NO MOVE IS NECESSARY
     69	000114	010346 			2$:	MOV	R3,-(SP)	;R3=NO. OF BYTES TO MOVE AND WRITE
     70	000116	020360 	000000G			CMP	R3,F.BBFS(R0)	;WILL IT FIT IN BLOCK BUFFER
     71	000122	101402 				BLOS	4$		;BRANCH IF YES
     72	000124	016003 	000000G			MOV	F.BBFS(R0),R3	;NO, JUST FILL THE BUFFER
     73	000130	160316 			4$:	SUB	R3,@SP		;UPDATE BYTES REMAINING
     74	000132	010346 				MOV	R3,-(SP)	;SAVE THE NO. OF BYTES BEING MOVED.
     75	000134					CALL	..MVR1		;MOVE THEM INTO THE BUFFER
     76	000140	012602 				MOV	(SP)+,R2	;NO. OF BYTES TO WRITE
     77	000142	010146 				MOV	R1,-(SP)	;SAVE BYTE POINTER TO REST OF USER'S RECORD
     78	000144	016001 	000000G			MOV	F.NREC(R0),R1	;ADDRESS OF BUFFER TO WRITE
PUT 0101MS, PUT RECORD ROUTINE	MACRO M1108  05-DEC-77 22:18  PAGE 9


     80					; O(SP) IS BYTE ADDRESS OF THE REST OF THE USER'S RECORD
     81					; 2(SP) IS NO. OF BYTES NOT YET MOVED, 4(SP)=CARRIAGE CONTROL
     82					; CHARACTER WITH NEGATIVE FOR FORTRAN CARRIAGE CONTROL
     83	000150	016603 	000004 			MOV	4(SP),R3	;R3=CARRIAGE CONTROL
     84	000154	005066 	000004 			CLR	4(SP)		;FURTHER PIECES OF REC USE NULL CAR CTL
     85	000160					CALL	ADJREC		;ADJUST FOR FTN CAR CTL, AND NULL REC
     86	000164					CALL	..WTW1		;WRITE THE RECORD AND WAIT FOR I/O DONE
     87	000170	042760 	000001 	000000G		BIC	#1,F.NREC(R0)	;IN CASE FTN CAR CTL INCREMENTED IT
     88	000176	012601 				MOV	(SP)+,R1	;RESTORE SOURCE RECORD POINTER
     89	000200	016002 	000000G			MOV	F.NREC(R0),R2	;R2=DESTINATION OF REST OF RECORD
     90	000204	012603 				MOV	(SP)+,R3	;NO. OF BYTES NOT YET WRITTEN
     91	000206	003342 				BGT	2$		;BRANCH IF MORE TO DO
     92	000210	005726 				TST	(SP)+		;POP THE CARRIAGE CONTROL CHARACTER
     93	000212	000415 				BR	18$
     94					; NO RECORD MOVE WAS NECESSARY-JUST WRITE THE RECORD
     95	000214	016002 	000000G		10$:	MOV	F.NRBD(R0),R2	;R2=NO. OF BYTES TO WRITE
     96	000220	012603 				MOV	(SP)+,R3	;GET CARRIAGE CONTROL CHARACTER
     97	000222	020260 	000000G			CMP	R2,F.BBFS(R0)	;IF IT DIDN'T FIT IN BUFFER
     98	000226	003021 				BGT	PTBIG		;THEN HE OVERWROTE SOME STUFF
     99	000230					CALL	ADJREC		;ADJUST FOR FTN CAR CTL AND NULL REC
    100	000234					CALL	..WTW1		;WRITE THE RECORD AND WAIT FOR I/O DONE
    101	000240	042760 	000001 	000000G		BIC	#1,F.NREC(R0)	;IN CASE FTN CAR CTL INCREMENTED IT
    102	000246				18$:	CALL	..RTAD		;RETURN NEXT RECORD ADR TO USER IF LOCATE MODE
    103	000252	122760 	000000G	000000G		CMPB	#IE.DAO,F.ERR(R0) ;IGNORE DATA OVERFLOW FROM REC DEVICE
    104	000260	001007 				BNE	PUTX
    105	000262	012760 	000001 	000000G		MOV	#1,F.ERR(R0)
    106	000270	000403 				BR	PUTX
    107
    108					; USER OVER-FILLED THE BLOCK BUFFER BY WRITING TOO MANY BYTES
    109					; INTO IT IN PARTIAL LOCATE MODE - INDICATE RECORD TOO BIG
    110	000272	112760 	000000G	000000G	PTBIG:	MOVB	#IE.RBG,F.ERR(R0)
    111					;
    112					; EXIT FROM PUT
    113	000300				PUTX:	CALL	..FCSX
    114	000304				PUTX1:	RETURN
PUT 0101MS, PUT RECORD ROUTINE	MACRO M1108  05-DEC-77 22:18  PAGE 10


    116					; THIS IS A BLOCK ORIENTED DEVICE, ADD THE RECORD TO THE BLOCK.
    117	000306				PTBLK:
    118						.IF	EQ,R$$SEQ	;SEQUENTIAL OR RANDOM ALLOWED
    119	000306	132760 	000000G	000000G		BITB	#FD.RAN,F.RACC(R0) ;RANDOM MODE PUT?
    120	000314	001410 				BEQ	20$		;BRANCH IF NO
    121	000316					CALL	..PSRC		;CALC NEW VBN AND NREC, AND POSITION THE FILE
    122	000322	103032 				BCC	25$		;BRANCH IF NOT POSITIONED AT EOF
    123					; ERROR INDICATION FROM ..PSRC MIGHT BE EOF WHICH WOULD INDICATE THAT FILE
    124					; IS POSITIONED AT OR BEYOND THE CURRENT END OF FILE
    125	000324	122760 	000000G	000000G		CMPB	#IE.EOF,F.ERR(R0) ;IF EOF ERROR, THEN VBN > EFBK
    126	000332	001432 				BEQ	30$		;BRANCH IF EOF CONDITION
    127	000334	000761 				BR	PUTX		;IT'S SOME OTHER ERROR
    128						.ENDC
    129					;
    130					; SEQUENTIAL PUT - IF IN INSERT RECORD MODE, THEN IT MAY NOT BE PUTTING AT EOF
    131					; IF IN PUT TRUNCATE MODE, THEN BY DEFINITION THIS PUT IS AT EOF
    132	000336	026060 	000000G	000000G	20$:	CMP	F.NREC(R0),F.EOBB(R0)
    133	000344	001012 				BNE	22$
    134					; NREC = EOBB IN THE SPECIAL CASE THAT USER DID GET, GET, ..., GET, PUT
    135					; AND THE LAST RECORD GOTTEN ENDED AT EOBB.  PERFORM THE
    136					; WRITE OF THE BUFFER IF DIRTY, AND READ THE NEXT EVEN IF PUTTING
    137					; AT EOF.  THIS IS THE ONLY CASE OF A POSSIBLY UNNECESSARY
    138					; I/O OPERATION.  IT COULD RETURN A SPURIOUS EOF CONDITION. IGNORE IT
    139						.IF	EQ,R$$SEQ
    140	000346					CALL	..RDRN
    141	000352	103007 				BCC	22$
    142	000354	122760 	000000G	000000G		CMPB	#IE.EOF,F.ERR(R0)
    143	000362	001346 				BNE	PUTX		;BRANCH IF REAL ERROR
    144	000364	012760 	000001 	000000G		MOV	#1,F.ERR(R0)	;RESET SPURIOUS EOF
    145						.ENDC
    146					;
    147						.IF	GT,R$$SEQ
    148						CALLR	..SQER		;ILLEGAL SEQUENTIAL OPERATION
    149						.ENDC
    150					;
    151	000372	132760 	000000G	000000G	22$:	BITB	#FD.INS,F.RACC(R0) ;SEQUENTIAL INSERT MODE?
    152	000400	001412 				BEQ	40$		;BRANCH IF NO, TRUNCATE MODE
    153					; MUST SEE IF POSITIONED AT OR BEYOND EOF
    154	000402					CALL	..EFCK
    155	000406	103404 				BCS	30$		;BRANCH IF AT OR BEYOND EOF
    156	000410	142760 	000002 	000000G	25$:	BICB	#FD.EOF,F.BKP1(R0) ;NOT PUTTING AT EOF
    157	000416	000406 				BR	PTBLK1
    158	000420	012760 	000001 	000000G	30$:	MOV	#1,F.ERR(R0)	;RESET EOF ERROR CONDITION
    159	000426	152760 	000006 	000000G	40$:	BISB	#FD.EOF!FD.EFB,F.BKP1(R0) ;SAY "PUTTING AT EOF"
    160	000434	016001 	000002G		PTBLK1:	MOV	F.NRBD+2(R0),R1	;R1=ADDRESS OF RECORD DATA
    161	000440	016002 	000000G			MOV	F.NREC(R0),R2	;R2=ADDRESS IN BLOCK BUFFER TO PUT RECORD
    162	000444	016003 	000000G		5$:	MOV	F.NRBD(R0),R3	;R3=SIZE OF RECORD
    163	000450	122760 	000000G	000000G		CMPB	#R.VAR,F.RTYP(R0) ;IF VARIABLE LENGTH RECORD
    164	000456	001006 				BNE	12$
    165	000460	010322 				MOV	R3,(R2)+ 	;STORE RECORD SIZE AS FIRST
    166									;WORD OF RECORD
    167	000462	020360 	000000G			CMP	R3,F.RSIZ(R0)	;IS THIS A LARGER RECORD THAN CURRENT BIGGEST
    168	000466	003402 				BLE	12$		;BRANCH IF NO
    169	000470	010360 	000000G			MOV	R3,F.RSIZ(R0)	;RECORD LARGEST RECORD SIZE
    170	000474	020102 			12$:	CMP	R1,R2		;IF THESE ARE SAME,THEN DON'T MOVE THE RECORD
    171	000476	001463 				BEQ	50$		;BRANCH IF NO MOVE IS NECESSARY
    172	000500	010346 				MOV	R3,-(SP)	;SAVE NUMBER OF BYTES STILL TO BE PUT
PUT 0101MS, PUT RECORD ROUTINE	MACRO M1108  05-DEC-77 22:18  PAGE 10-1


    173	000502	016003 	000000G		24$:	MOV	F.EOBB(R0),R3	;CALCULATE ROOM LEFT IN THIS BUFFER
    174	000506	160203 				SUB	R2,R3
    175	000510	021603 				CMP	@SP,R3		;ENOUGH ROOM FOR REST OF THIS RECORD?
PUT 0101MS, PUT RECORD ROUTINE	MACRO M1108  05-DEC-77 22:18  PAGE 11


    177
    178	000512	003451 				BLE	48$		;BRANCH IF YES, MOVE LAST PART
    179	000514	132760 	000000G	000000G		BITB	#FD.BLK,F.RATT(R0) ;CAN RECORD CROSS BLOCK BDRY
    180	000522	001421 				BEQ	28$		;BRANCH IF YES
    181	000524	011646 				MOV	(SP),-(SP)	;PUT NUMBER OF BYTES STILL TO BE MOVED ON TOP
    182	000526	122760 	000000G	000000G		CMPB	#R.VAR,F.RTYP(R0) ;IF VARIABLE LENGTH RECORDS
    183	000534	001010 				BNE	26$
    184	000536	062716 	000002 			ADD	#2,(SP)		;ACCOUNT FOR EXTRA 2 BYTES OF RECORD SIZE
    185	000542	022660 	000000G			CMP	(SP)+,F.VBSZ(R0) ;IS RECORD TOO BIG?
    186	000546	003132 				BGT	80$		;YES, POP 1 WORD AND GIVE ERROR
    187	000550	012742 	177777 			MOV	#-1,-(R2)	;SET END OF BLOCK RECORD SIZE
    188	000554	000407 				BR	32$
    189	000556	022660 	000000G		26$:	CMP	(SP)+,F.VBSZ(R0)	;IS RECORD TOO BIG
    190	000562	003124 				BGT	80$		;YES
    191	000564	000403 				BR	32$
    192	000566	160316 			28$:	SUB	R3,@SP		;UPDATE BYTE COUNT REMAINING
    193	000570					CALL 	..MVR1		;FILL THE BUFFER WITH THIS PART OF RECORD
    194	000574	010146 			32$:	MOV	R1,-(SP)	;SAVE SOURCE POINTER
    195	000576					CALL 	..WTWA		;WRITE THE BLOCK AND WAIT FOR I/O DONE
    196	000602					CALL	UPDEOF		;UPDATE EFBK IF NECESSARY
    197					;
    198						.IF	EQ,R$$SEQ
    199	000606	103002 				BCC	36$		;BRANCH IF PUTTING AT EOF
    200	000610					CALL	..RWAC		;OTHERWISE READ CURRENT BLOCK
    201						.ENDC
    202					;
    203						.IF	GT,R$$SEQ
    204						BCS	90$
    205						.ENDC
    206					;
    207	000614	012601 			36$:	MOV	(SP)+,R1	;RESTORE THE SOURCE POINTER
    208	000616	016002 	000000G			MOV	F.NREC(R0),R2	;SET DESTINATION POINTER TO BEGIN OF BLOCK
    209	000622	132760 	000000G	000000G		BITB	#FD.BLK,F.RATT(R0) ;IF REC NOT CROSS BLOCK BDRY
    210	000630	001724 				BEQ	24$
    211	000632	005726 				TST	(SP)+		;CLEAN CONT OFF STACK
    212	000634	000703 				BR	5$
    213					; MOVE LAST PART OF RECORD,IT FITS IN BLOCK BUFFER
    214					; TOP OF STACK HAS HOW MANY BYTES TO MOVE
    215	000636	012603 			48$:	MOV	(SP)+,R3	;GET THE REMAINING BYTE COUNT
    216	000640					CALL	..MVR1		;MOVE THE LAST PART OF THE RECORD
    217	000644	000401 				BR	52$		;R2 POINTS AT END OF RECORD.
    218					; DATA WAS PUT IN BUFFER BY USER, NO MOVE NECESSARY
    219					; VERIFY THAT HE DIDN'T OVERFLOW THE BUFFER
    220					; R1=R2= ADDRESS OF BEGINNING OF RECORD IN BLOCK BUFFER
    221					; R3=SIZE OF RECORD IN BYTES
    222	000646	060302 			50$:	ADD	R3,R2		;CALCULATE END OF RECORD POINTER
    223	000650	005202 			52$:	INC	R2		;ROUNDUP TO WORD BOUNDARY
    224	000652	042702 	000001 			BIC	#1,R2
    225	000656	010260 	000000G			MOV	R2,F.NREC(R0)	;BEGINNING OF NEXT RECORD
    226	000662					CALL	UPDEOF		;UPDATE EFBK AND FFBY IF AT EOF
    227	000666	062760 	000001 	000002G		ADD	#1,F.RCNM+2(R0)	;BUMP THE RECORD NUMBER FOR NEXT PUT
    228	000674	005560 	000000G			ADC	F.RCNM(R0)
    229	000700	152760 	000001 	000000G		BISB	#FD.WRT,F.BKP1(R0) ;NOTE THAT THIS BUFFER MUST BE WRITTEN
    230	000706	132760 	000000G	000000G		BITB	#FD.BLK,F.RATT(R0) ;CAN REC CROSS BLOCK BDRY?
    231	000714	001414 				BEQ	56$		;BRANCH IF YES
    232	000716	122760 	000000G	000000G		CMPB	#R.FIX,F.RTYP(R0) ;IF NO, AND FIXED LENGTH
    233	000724	001010 				BNE	56$
PUT 0101MS, PUT RECORD ROUTINE	MACRO M1108  05-DEC-77 22:18  PAGE 11-1


    234	000726	016002 	000000G			MOV	F.NREC(R0),R2
    235	000732	066002 	000000G			ADD	F.RSIZ(R0),R2	;SEE IF NEXT REC WOULD FORCE IT OVER
    236	000736	020260 	000000G			CMP	R2,F.EOBB(R0)	;IF IT WOULD TREAT AS IF BUF FULL
    237	000742	101430 				BLOS	68$
    238	000744	000405 				BR	58$
    239	000746	026060 	000000G	000000G	56$:	CMP	F.NREC(R0),F.EOBB(R0) ;IS BUFFER FULL?
    240	000754	101030 				BHI	82$		;BRANCH IF BUFFER IS OVER-FULL
    241	000756	103422 				BLO	68$		;BRANCH IF BUFFER NOT FULL
    242	000760	132760 	000000G	000000G	58$:	BITB	#FD.RAN,F.RACC(R0)
    243	000766	001016 				BNE	68$		;SKIP THIS STUFF IF RANDOM MODE
    244	000770					CALL	..WTWA		;WRITE FULL BUFFER, WAIT FOR I/O DONE
    245	000774					CALL	UPDEOF		;UPDATE EFBK AND FFBY IF AT EOF
    246					;
    247						.IF	EQ,R$$SEQ
    248	001000	103011 				BCC	68$		;BRANCH IF PUTTING AT EOF (EOF UPDATED)
    249	001002					CALL	..RWAC		;SINCE PUTTING IN MIDDLE OF FILE,
    250									;MUST READ THE CURRENT BLOCK
    251	001006	122760 	000000G	000000G		CMPB	#IE.EOF,F.ERR(R0) ;SINCE ACTUALLY SETTING UP NEXT RECORD
    252	001014	001003 				BNE	68$		;COULD GET EOF INDICATION
    253	001016	012760 	000001 	000000G		MOV	#1,F.ERR(R0)	;RESET IT
    254						.ENDC
    255					;
    256						.IF	GT,R$$SEQ
    257						BCS	92$
    258						.ENDC
    259					;
    260					; NREC POINTS TO BEGINNING OF NEXT RECORD, SET NRBA IF IN PARTIAL LOCATE MODE
    261	001024				68$:	CALL	..RTAD		;RETURN ADDRESS FOR NEXT RECORD TO USER
    262	001030	000167 	177244 			JMP	PUTX
    263					;
    264					; RECORD TOO BIG
    265	001034	005726 			80$:	TST	(SP)+
    266	001036	000167 	177230 		82$:	JMP	PTBIG
    267					;
    268						.IF	GT,R$$SEQ
    269					90$:	ADD	#4,SP
    270					92$:	CALLR	..SQER
    271						.ENDC
PUT 0101MS, PUT RECORD ROUTINE	MACRO M1108  05-DEC-77 22:18  PAGE 12


    273					; ADJUST RECORD ADDRESS AND SIZE FOR FTN CARRIAGE CONTROL AND
    274					; NULL RECORDS.  R1= ADDRESS OF RECORD TO BE WRITTEN, R2= BYTE COUNT
    275					; R3= CARRIAGE CONTROL CHAR (-1 MEANS FTN CAR CTL)
    276					;
    277	001042	005703 			ADJREC:	TST	R3		;IF FTN CAR CTL
    278	001044	002006 				BGE	10$
    279	001046	012703 	000040 			MOV	#' ,R3		;BLANK CAR CTL IF NULL FTN RECORD
    280	001052	005702 				TST	R2		;IS IT NULL?
    281	001054	001404 				BEQ	15$
    282	001056	112103 				MOVB	(R1)+,R3	;THEN PICK UP CAR CTL CHAR
    283	001060	005302 				DEC	R2		;AND ADJUST BYTE COUNT
    284	001062	005702 			10$:	TST	R2		;IF RECORD IS EMPTY
    285	001064	001002 				BNE	20$
    286	001066	105011 			15$:	CLRB	@R1		;THEN SEND 1 NULL INSTEAD
    287	001070	005202 				INC	R2		;FIX BYTE COUNT
    288	001072				20$:	RETURN
    289					;+
    290					; UPDATE EOF IF FD.EOF IN F.BKP1 IS SET
    291					; CALLING SEQUENCE:
    292					;	CALL	UPDEOF
    293					; INPUTS:
    294					;	R0 = FDB
    295					; OUTPUTS:
    296					;	C=1 IF NOT AT EOF (FD.EOF IS ZERO)
    297					;	C=0 IF FD.EOF = 1 AND IN THIS CASE, EFBK AND FFBY ARE UPDATED
    298					;	R0,R1-R5 PRESERVED
    299					;	R2 ALTERED IF EFBK AND FFBY ARE UPDATED (C=0)
    300					;-
    301	001074	132760 	000002 	000000G	UPDEOF:	BITB	#FD.EOF,F.BKP1(R0) ;PUTTING AT EOF?
    302	001102	001002 				BNE	10$		;BRANCH IF YES, UPDATE EOF
    303	001104	000261 				SEC			;INDICATE NOT AT EOF
    304	001106					RETURN
    305	001110	016060 	000000G	000000G	10$:	MOV	F.VBN(R0),F.EFBK(R0) ;UPDATE END OF FILE BLOCK NUMBER
    306	001116	016060 	000002G	000002G		MOV	F.VBN+2(R0),F.EFBK+2(R0)
    307	001124	016002 	000000G			MOV	F.NREC(R0),R2	;CALCULATE FIRST FREE BYTE
    308	001130	066002 	000000G			ADD	F.VBSZ(R0),R2
    309	001134	166002 	000000G			SUB	F.EOBB(R0),R2
    310	001140	010260 	000000G			MOV	R2,F.FFBY(R0)	;NOTE WHERE CURRENT EOF IS
    311	001144	000241 				CLC
    312	001146					RETURN
    313					;
    314					;
    315	001150					$END	PUT
    316					;
    317					;
    318		000001 				.END
PUT 0101MS, PUT RECORD ROUTINE	MACRO M1108  05-DEC-77 22:18  PAGE 12-1
SYMBOL TABLE

ADJREC  001042R  	F.EFBK= ****** GX	HA.UAT= 000004   	PTBLK1  000434R  	UPDEOF  001074R
BD.FRE= 000001   	F.EOBB= ****** GX	HA.UI = 000001   	PUTX    000300R  	WI.DLK= 000002
DIRTYP= 015172   	F.ERR = ****** GX	HA.VER= 000007   	PUTX1   000304R  	WI.LCK= 000001
FCSEFN= 000040   	F.FFBY= ****** GX	IE.DAO= ****** GX	R$$ANI= 000000   	$$    = 000067
FD.BLK= ****** GX	F.NRBD= ****** GX	IE.EOF= ****** GX	R$$BBF= 000000   	.PUT    000000RG
FD.CCL= ****** GX	F.NREC= ****** GX	IE.RBG= ****** GX	R$$DPB= 000001   	.SAVR1= ****** GX
FD.CR = ****** GX	F.RACC= ****** GX	NB.DOT= 100000   	R$$EIS= 000000   	..EFCK= ****** GX
FD.DVR= 000020   	F.RATT= ****** GX	NB.SMI= 040000   	R$$LCL= 000000   	..FCSX= ****** GX
FD.EFB= 000004   	F.RCNM= ****** GX	N.DRPT= 000006   	R$$MUL= 000000   	..MVR1= ****** GX
FD.EF1= 000010   	F.RCTL= ****** GX	N.DRSZ= 000004   	R$$OPF= 000000   	..PGCR= ****** GX
FD.EOF= 000002   	F.RSIZ= ****** GX	N.DVPT= 000002   	R$$RSL= 000000   	..PSRC= ****** GX
FD.FTN= ****** GX	F.RTYP= ****** GX	N.DVSZ= 000000   	R$$SEQ= 000000   	..RDRN= ****** GX
FD.INS= ****** GX	F.VBN = ****** GX	N.FNPT= 000012   	R$$SPL= 000000   	..RTAD= ****** GX
FD.RAN= ****** GX	F.VBSZ= ****** GX	N.FNSZ= 000010   	R$$11M= 000001   	..RWAC= ****** GX
FD.REC= ****** GX	HA.CHU= 000003   	PP.SEP= 000002   	R.FIX = ****** GX	..WTWA= ****** GX
FD.WRT= 000001   	HA.FP = 000002   	PP.ZER= 000001   	R.VAR = ****** GX	..WTW1= ****** GX
F.BBFS= ****** GX	HA.NAM= 000005   	PTBIG   000272R  	SYDEV = 054523   	...CTL= 000002
F.BKP1= ****** GX	HA.TYP= 000006   	PTBLK   000306R  	SYUNIT= 000000

. ABS.	000000	   000
      	001150	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2881 WORDS  ( 12 PAGES)
DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:00:22
[41,10]PUT,[41,20]PUT/-SP=[41,30]FCSPRE,PUT
PUTSQ 0101MS, PUT RECORD ROUTIN	MACRO M1108  05-DEC-77 22:18  PAGE 1


      1					;                             COPYRIGHT (C) 1975, 1978 BY
      2					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      3					;
      4					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      5					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      6					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      7					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
      8					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
      9					;
     10					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     11					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     12					;       CORPORATION.
     13					;
     14					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     15					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     16		000001 				R$$SEQ=1		;ASSEMBLE SEQUENTIAL PUT, GET, PGVFY
     17									;PRODUCING .PUTSQ, GETSQ, PGSEQ
PUTSQ 0101MS, PUT RECORD ROUTIN	MACRO M1108  05-DEC-77 22:18  PAGE 2


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
PUTSQ 0101MS, PUT RECORD ROUTIN	MACRO M1108  05-DEC-77 22:18  PAGE 8


						.TITLE	PUTSQ 0101MS, PUT RECORD ROUTINE
						.IDENT	/0101MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 13-JULY-73
     21					;
PUTSQ 0101MS, PUT RECORD ROUTIN	MACRO M1108  05-DEC-77 22:18  PAGE 9


     23					;+
     24					; .PUT IS A SUBROUTINE TO WRITE LOGICAL RECORDS TO A FILE.
     25					;
     26					; CALLING SEQUENCE:
     27					;	JSR PC,.PUT
     28					; INPUTS:
     29					;	R0=FDB ADDRESS
     30					; OUTPUTS:
     31					;	F.NRBD+2=ADDRESS OF NEXT RECORD BUFFER IF IN PARTIAL LOCATE MODE.
     32					; OPERATION:
     33					;	ALL INFORMATION REQUIRED BY THE .PUT ROUTINE MUST BE
     34					; PRESENT IN THE FDB.  THIS INCLUDES THE ADDRESS OF THE RECORD
     35					; BUFFER, AND THE NUMBER OF BYTES TO BE WRITTEN.
     36					;
     37					;-
     38						.IF	EQ,R$$SEQ	;IF SEQUENTIAL OR RANDOM ALLOWED
     39					.PUT::	.SAVR1			;SAVE REGISTERS R1-R5
     40						CALL	..PGCR		;VERIFY THAT PUT/GET IS LEGAL
     41						.ENDC
     42					;
     43						.IF	GT,R$$SEQ	;IF SEQUENTIAL ONLY
     44	000000				.PUTSQ::.SAVR1
     45	000004					CALL	..PGCS
     46						.ENDC
     47					;
     48	000010	103535 				BCS	PUTX1		;BRANCH IF IT ISN'T
     49	000012	016003 	000000G			MOV	F.NRBD(R0),R3	;R3=SIZE OF RECORD IN BYTES
     50	000016	002525 				BLT	PTBIG		;BRANCH IF RECORD TOO BIG
     51	000020	012760 	000001 	000000G		MOV	#1,F.ERR(R0)	;INIT THE ERROR RETURN CODE
     52	000026	132760 	000000G	000000G		BITB	#FD.REC,F.RCTL(R0) ;RECORD ORIENTED DEVICE?
     53	000034	001524 				BEQ	PTBLK		;BRANCH IF BLOCK ORIENTED
     54					; RECORD ORIENTED DEVICE
     55					; CALCULATE CARRIAGE CONTROL CHARACTER ON TOP OF STACK
     56	000036	016001 	000002G			MOV	F.NRBD+2(R0),R1	;R1=ADDRESS OF RECORD DATA
     57	000042	016002 	000000G			MOV	F.NREC(R0),R2	;R2=ADR IN BLOCK BUFFER TO PUT RECORD
     58	000046	005046 				CLR	-(SP)		;ASSUME ZERO CARRIAGE CONTROL
     59	000050	132760 	000000G	000000G		BITB	#FD.CCL,F.RCTL(R0) ;IS THIS A CARRIAGE CONTROL DEVICE?
     60	000056	001414 				BEQ	1$		;BRANCH IF NOT
     61	000060	132760 	000000C	000000G		BITB	#FD.FTN!FD.CR,F.RATT(R0) ;ANY CARRIAGE CONTROL
     62	000066	001410 				BEQ	1$		;BRANCH IF NONE
     63	000070	012716 	000040 			MOV	#' ,@SP		;ASSUME BLANK CARRIAGE CONTROL
     64	000074	132760 	000000G	000000G		BITB	#FD.FTN,F.RATT(R0) ;FORTRAN CARRIAGE CONTROL
     65	000102	001402 				BEQ	1$		;BRANCH IF NO
     66	000104	012716 	177777 			MOV	#-1,@SP		;NEGATIVE MEANS FORTRAN CARRIAGE CONTROL
     67	000110	020102 			1$:	CMP	R1,R2		;IF THESE ARE EQUAL THEN DON'T NEED TO MOVE RECORD
     68	000112	001440 				BEQ	10$		;BRANCH IF NO MOVE IS NECESSARY
     69	000114	010346 			2$:	MOV	R3,-(SP)	;R3=NO. OF BYTES TO MOVE AND WRITE
     70	000116	020360 	000000G			CMP	R3,F.BBFS(R0)	;WILL IT FIT IN BLOCK BUFFER
     71	000122	101402 				BLOS	4$		;BRANCH IF YES
     72	000124	016003 	000000G			MOV	F.BBFS(R0),R3	;NO, JUST FILL THE BUFFER
     73	000130	160316 			4$:	SUB	R3,@SP		;UPDATE BYTES REMAINING
     74	000132	010346 				MOV	R3,-(SP)	;SAVE THE NO. OF BYTES BEING MOVED.
     75	000134					CALL	..MVR1		;MOVE THEM INTO THE BUFFER
     76	000140	012602 				MOV	(SP)+,R2	;NO. OF BYTES TO WRITE
     77	000142	010146 				MOV	R1,-(SP)	;SAVE BYTE POINTER TO REST OF USER'S RECORD
     78	000144	016001 	000000G			MOV	F.NREC(R0),R1	;ADDRESS OF BUFFER TO WRITE
PUTSQ 0101MS, PUT RECORD ROUTIN	MACRO M1108  05-DEC-77 22:18  PAGE 10


     80					; O(SP) IS BYTE ADDRESS OF THE REST OF THE USER'S RECORD
     81					; 2(SP) IS NO. OF BYTES NOT YET MOVED, 4(SP)=CARRIAGE CONTROL
     82					; CHARACTER WITH NEGATIVE FOR FORTRAN CARRIAGE CONTROL
     83	000150	016603 	000004 			MOV	4(SP),R3	;R3=CARRIAGE CONTROL
     84	000154	005066 	000004 			CLR	4(SP)		;FURTHER PIECES OF REC USE NULL CAR CTL
     85	000160					CALL	ADJREC		;ADJUST FOR FTN CAR CTL, AND NULL REC
     86	000164					CALL	..WTW1		;WRITE THE RECORD AND WAIT FOR I/O DONE
     87	000170	042760 	000001 	000000G		BIC	#1,F.NREC(R0)	;IN CASE FTN CAR CTL INCREMENTED IT
     88	000176	012601 				MOV	(SP)+,R1	;RESTORE SOURCE RECORD POINTER
     89	000200	016002 	000000G			MOV	F.NREC(R0),R2	;R2=DESTINATION OF REST OF RECORD
     90	000204	012603 				MOV	(SP)+,R3	;NO. OF BYTES NOT YET WRITTEN
     91	000206	003342 				BGT	2$		;BRANCH IF MORE TO DO
     92	000210	005726 				TST	(SP)+		;POP THE CARRIAGE CONTROL CHARACTER
     93	000212	000415 				BR	18$
     94					; NO RECORD MOVE WAS NECESSARY-JUST WRITE THE RECORD
     95	000214	016002 	000000G		10$:	MOV	F.NRBD(R0),R2	;R2=NO. OF BYTES TO WRITE
     96	000220	012603 				MOV	(SP)+,R3	;GET CARRIAGE CONTROL CHARACTER
     97	000222	020260 	000000G			CMP	R2,F.BBFS(R0)	;IF IT DIDN'T FIT IN BUFFER
     98	000226	003021 				BGT	PTBIG		;THEN HE OVERWROTE SOME STUFF
     99	000230					CALL	ADJREC		;ADJUST FOR FTN CAR CTL AND NULL REC
    100	000234					CALL	..WTW1		;WRITE THE RECORD AND WAIT FOR I/O DONE
    101	000240	042760 	000001 	000000G		BIC	#1,F.NREC(R0)	;IN CASE FTN CAR CTL INCREMENTED IT
    102	000246				18$:	CALL	..RTAD		;RETURN NEXT RECORD ADR TO USER IF LOCATE MODE
    103	000252	122760 	000000G	000000G		CMPB	#IE.DAO,F.ERR(R0) ;IGNORE DATA OVERFLOW FROM REC DEVICE
    104	000260	001007 				BNE	PUTX
    105	000262	012760 	000001 	000000G		MOV	#1,F.ERR(R0)
    106	000270	000403 				BR	PUTX
    107
    108					; USER OVER-FILLED THE BLOCK BUFFER BY WRITING TOO MANY BYTES
    109					; INTO IT IN PARTIAL LOCATE MODE - INDICATE RECORD TOO BIG
    110	000272	112760 	000000G	000000G	PTBIG:	MOVB	#IE.RBG,F.ERR(R0)
    111					;
    112					; EXIT FROM PUT
    113	000300				PUTX:	CALL	..FCSX
    114	000304				PUTX1:	RETURN
PUTSQ 0101MS, PUT RECORD ROUTIN	MACRO M1108  05-DEC-77 22:18  PAGE 11


    116					; THIS IS A BLOCK ORIENTED DEVICE, ADD THE RECORD TO THE BLOCK.
    117	000306				PTBLK:
    118						.IF	EQ,R$$SEQ	;SEQUENTIAL OR RANDOM ALLOWED
    119						BITB	#FD.RAN,F.RACC(R0) ;RANDOM MODE PUT?
    120						BEQ	20$		;BRANCH IF NO
    121						CALL	..PSRC		;CALC NEW VBN AND NREC, AND POSITION THE FILE
    122						BCC	25$		;BRANCH IF NOT POSITIONED AT EOF
    123					; ERROR INDICATION FROM ..PSRC MIGHT BE EOF WHICH WOULD INDICATE THAT FILE
    124					; IS POSITIONED AT OR BEYOND THE CURRENT END OF FILE
    125						CMPB	#IE.EOF,F.ERR(R0) ;IF EOF ERROR, THEN VBN > EFBK
    126						BEQ	30$		;BRANCH IF EOF CONDITION
    127						BR	PUTX		;IT'S SOME OTHER ERROR
    128						.ENDC
    129					;
    130					; SEQUENTIAL PUT - IF IN INSERT RECORD MODE, THEN IT MAY NOT BE PUTTING AT EOF
    131					; IF IN PUT TRUNCATE MODE, THEN BY DEFINITION THIS PUT IS AT EOF
    132	000306	026060 	000000G	000000G	20$:	CMP	F.NREC(R0),F.EOBB(R0)
    133	000314	001002 				BNE	22$
    134					; NREC = EOBB IN THE SPECIAL CASE THAT USER DID GET, GET, ..., GET, PUT
    135					; AND THE LAST RECORD GOTTEN ENDED AT EOBB.  PERFORM THE
    136					; WRITE OF THE BUFFER IF DIRTY, AND READ THE NEXT EVEN IF PUTTING
    137					; AT EOF.  THIS IS THE ONLY CASE OF A POSSIBLY UNNECESSARY
    138					; I/O OPERATION.  IT COULD RETURN A SPURIOUS EOF CONDITION. IGNORE IT
    139						.IF	EQ,R$$SEQ
    140						CALL	..RDRN
    141						BCC	22$
    142						CMPB	#IE.EOF,F.ERR(R0)
    143						BNE	PUTX		;BRANCH IF REAL ERROR
    144						MOV	#1,F.ERR(R0)	;RESET SPURIOUS EOF
    145						.ENDC
    146					;
    147						.IF	GT,R$$SEQ
    148	000316					CALLR	..SQER		;ILLEGAL SEQUENTIAL OPERATION
    149						.ENDC
    150					;
    151	000322	132760 	000000G	000000G	22$:	BITB	#FD.INS,F.RACC(R0) ;SEQUENTIAL INSERT MODE?
    152	000330	001412 				BEQ	40$		;BRANCH IF NO, TRUNCATE MODE
    153					; MUST SEE IF POSITIONED AT OR BEYOND EOF
    154	000332					CALL	..EFCK
    155	000336	103404 				BCS	30$		;BRANCH IF AT OR BEYOND EOF
    156	000340	142760 	000002 	000000G	25$:	BICB	#FD.EOF,F.BKP1(R0) ;NOT PUTTING AT EOF
    157	000346	000406 				BR	PTBLK1
    158	000350	012760 	000001 	000000G	30$:	MOV	#1,F.ERR(R0)	;RESET EOF ERROR CONDITION
    159	000356	152760 	000006 	000000G	40$:	BISB	#FD.EOF!FD.EFB,F.BKP1(R0) ;SAY "PUTTING AT EOF"
    160	000364	016001 	000002G		PTBLK1:	MOV	F.NRBD+2(R0),R1	;R1=ADDRESS OF RECORD DATA
    161	000370	016002 	000000G			MOV	F.NREC(R0),R2	;R2=ADDRESS IN BLOCK BUFFER TO PUT RECORD
    162	000374	016003 	000000G		5$:	MOV	F.NRBD(R0),R3	;R3=SIZE OF RECORD
    163	000400	122760 	000000G	000000G		CMPB	#R.VAR,F.RTYP(R0) ;IF VARIABLE LENGTH RECORD
    164	000406	001006 				BNE	12$
    165	000410	010322 				MOV	R3,(R2)+ 	;STORE RECORD SIZE AS FIRST
    166									;WORD OF RECORD
    167	000412	020360 	000000G			CMP	R3,F.RSIZ(R0)	;IS THIS A LARGER RECORD THAN CURRENT BIGGEST
    168	000416	003402 				BLE	12$		;BRANCH IF NO
    169	000420	010360 	000000G			MOV	R3,F.RSIZ(R0)	;RECORD LARGEST RECORD SIZE
    170	000424	020102 			12$:	CMP	R1,R2		;IF THESE ARE SAME,THEN DON'T MOVE THE RECORD
    171	000426	001461 				BEQ	50$		;BRANCH IF NO MOVE IS NECESSARY
    172	000430	010346 				MOV	R3,-(SP)	;SAVE NUMBER OF BYTES STILL TO BE PUT
PUTSQ 0101MS, PUT RECORD ROUTIN	MACRO M1108  05-DEC-77 22:18  PAGE 11-1


    173	000432	016003 	000000G		24$:	MOV	F.EOBB(R0),R3	;CALCULATE ROOM LEFT IN THIS BUFFER
    174	000436	160203 				SUB	R2,R3
    175	000440	021603 				CMP	@SP,R3		;ENOUGH ROOM FOR REST OF THIS RECORD?
PUTSQ 0101MS, PUT RECORD ROUTIN	MACRO M1108  05-DEC-77 22:18  PAGE 12


    177
    178	000442	003447 				BLE	48$		;BRANCH IF YES, MOVE LAST PART
    179	000444	132760 	000000G	000000G		BITB	#FD.BLK,F.RATT(R0) ;CAN RECORD CROSS BLOCK BDRY
    180	000452	001421 				BEQ	28$		;BRANCH IF YES
    181	000454	011646 				MOV	(SP),-(SP)	;PUT NUMBER OF BYTES STILL TO BE MOVED ON TOP
    182	000456	122760 	000000G	000000G		CMPB	#R.VAR,F.RTYP(R0) ;IF VARIABLE LENGTH RECORDS
    183	000464	001010 				BNE	26$
    184	000466	062716 	000002 			ADD	#2,(SP)		;ACCOUNT FOR EXTRA 2 BYTES OF RECORD SIZE
    185	000472	022660 	000000G			CMP	(SP)+,F.VBSZ(R0) ;IS RECORD TOO BIG?
    186	000476	003117 				BGT	80$		;YES, POP 1 WORD AND GIVE ERROR
    187	000500	012742 	177777 			MOV	#-1,-(R2)	;SET END OF BLOCK RECORD SIZE
    188	000504	000407 				BR	32$
    189	000506	022660 	000000G		26$:	CMP	(SP)+,F.VBSZ(R0)	;IS RECORD TOO BIG
    190	000512	003111 				BGT	80$		;YES
    191	000514	000403 				BR	32$
    192	000516	160316 			28$:	SUB	R3,@SP		;UPDATE BYTE COUNT REMAINING
    193	000520					CALL 	..MVR1		;FILL THE BUFFER WITH THIS PART OF RECORD
    194	000524	010146 			32$:	MOV	R1,-(SP)	;SAVE SOURCE POINTER
    195	000526					CALL 	..WTWA		;WRITE THE BLOCK AND WAIT FOR I/O DONE
    196	000532					CALL	UPDEOF		;UPDATE EFBK IF NECESSARY
    197					;
    198						.IF	EQ,R$$SEQ
    199						BCC	36$		;BRANCH IF PUTTING AT EOF
    200						CALL	..RWAC		;OTHERWISE READ CURRENT BLOCK
    201						.ENDC
    202					;
    203						.IF	GT,R$$SEQ
    204	000536	103502 				BCS	90$
    205						.ENDC
    206					;
    207	000540	012601 			36$:	MOV	(SP)+,R1	;RESTORE THE SOURCE POINTER
    208	000542	016002 	000000G			MOV	F.NREC(R0),R2	;SET DESTINATION POINTER TO BEGIN OF BLOCK
    209	000546	132760 	000000G	000000G		BITB	#FD.BLK,F.RATT(R0) ;IF REC NOT CROSS BLOCK BDRY
    210	000554	001726 				BEQ	24$
    211	000556	005726 				TST	(SP)+		;CLEAN CONT OFF STACK
    212	000560	000705 				BR	5$
    213					; MOVE LAST PART OF RECORD,IT FITS IN BLOCK BUFFER
    214					; TOP OF STACK HAS HOW MANY BYTES TO MOVE
    215	000562	012603 			48$:	MOV	(SP)+,R3	;GET THE REMAINING BYTE COUNT
    216	000564					CALL	..MVR1		;MOVE THE LAST PART OF THE RECORD
    217	000570	000401 				BR	52$		;R2 POINTS AT END OF RECORD.
    218					; DATA WAS PUT IN BUFFER BY USER, NO MOVE NECESSARY
    219					; VERIFY THAT HE DIDN'T OVERFLOW THE BUFFER
    220					; R1=R2= ADDRESS OF BEGINNING OF RECORD IN BLOCK BUFFER
    221					; R3=SIZE OF RECORD IN BYTES
    222	000572	060302 			50$:	ADD	R3,R2		;CALCULATE END OF RECORD POINTER
    223	000574	005202 			52$:	INC	R2		;ROUNDUP TO WORD BOUNDARY
    224	000576	042702 	000001 			BIC	#1,R2
    225	000602	010260 	000000G			MOV	R2,F.NREC(R0)	;BEGINNING OF NEXT RECORD
    226	000606					CALL	UPDEOF		;UPDATE EFBK AND FFBY IF AT EOF
    227	000612	062760 	000001 	000002G		ADD	#1,F.RCNM+2(R0)	;BUMP THE RECORD NUMBER FOR NEXT PUT
    228	000620	005560 	000000G			ADC	F.RCNM(R0)
    229	000624	152760 	000001 	000000G		BISB	#FD.WRT,F.BKP1(R0) ;NOTE THAT THIS BUFFER MUST BE WRITTEN
    230	000632	132760 	000000G	000000G		BITB	#FD.BLK,F.RATT(R0) ;CAN REC CROSS BLOCK BDRY?
    231	000640	001414 				BEQ	56$		;BRANCH IF YES
    232	000642	122760 	000000G	000000G		CMPB	#R.FIX,F.RTYP(R0) ;IF NO, AND FIXED LENGTH
    233	000650	001010 				BNE	56$
PUTSQ 0101MS, PUT RECORD ROUTIN	MACRO M1108  05-DEC-77 22:18  PAGE 12-1


    234	000652	016002 	000000G			MOV	F.NREC(R0),R2
    235	000656	066002 	000000G			ADD	F.RSIZ(R0),R2	;SEE IF NEXT REC WOULD FORCE IT OVER
    236	000662	020260 	000000G			CMP	R2,F.EOBB(R0)	;IF IT WOULD TREAT AS IF BUF FULL
    237	000666	101417 				BLOS	68$
    238	000670	000405 				BR	58$
    239	000672	026060 	000000G	000000G	56$:	CMP	F.NREC(R0),F.EOBB(R0) ;IS BUFFER FULL?
    240	000700	101017 				BHI	82$		;BRANCH IF BUFFER IS OVER-FULL
    241	000702	103411 				BLO	68$		;BRANCH IF BUFFER NOT FULL
    242	000704	132760 	000000G	000000G	58$:	BITB	#FD.RAN,F.RACC(R0)
    243	000712	001005 				BNE	68$		;SKIP THIS STUFF IF RANDOM MODE
    244	000714					CALL	..WTWA		;WRITE FULL BUFFER, WAIT FOR I/O DONE
    245	000720					CALL	UPDEOF		;UPDATE EFBK AND FFBY IF AT EOF
    246					;
    247						.IF	EQ,R$$SEQ
    248						BCC	68$		;BRANCH IF PUTTING AT EOF (EOF UPDATED)
    249						CALL	..RWAC		;SINCE PUTTING IN MIDDLE OF FILE,
    250									;MUST READ THE CURRENT BLOCK
    251						CMPB	#IE.EOF,F.ERR(R0) ;SINCE ACTUALLY SETTING UP NEXT RECORD
    252						BNE	68$		;COULD GET EOF INDICATION
    253						MOV	#1,F.ERR(R0)	;RESET IT
    254						.ENDC
    255					;
    256						.IF	GT,R$$SEQ
    257	000724	103411 				BCS	92$
    258						.ENDC
    259					;
    260					; NREC POINTS TO BEGINNING OF NEXT RECORD, SET NRBA IF IN PARTIAL LOCATE MODE
    261	000726				68$:	CALL	..RTAD		;RETURN ADDRESS FOR NEXT RECORD TO USER
    262	000732	000167 	177342 			JMP	PUTX
    263					;
    264					; RECORD TOO BIG
    265	000736	005726 			80$:	TST	(SP)+
    266	000740	000167 	177326 		82$:	JMP	PTBIG
    267					;
    268						.IF	GT,R$$SEQ
    269	000744	062706 	000004 		90$:	ADD	#4,SP
    270	000750				92$:	CALLR	..SQER
    271						.ENDC
PUTSQ 0101MS, PUT RECORD ROUTIN	MACRO M1108  05-DEC-77 22:18  PAGE 13


    273					; ADJUST RECORD ADDRESS AND SIZE FOR FTN CARRIAGE CONTROL AND
    274					; NULL RECORDS.  R1= ADDRESS OF RECORD TO BE WRITTEN, R2= BYTE COUNT
    275					; R3= CARRIAGE CONTROL CHAR (-1 MEANS FTN CAR CTL)
    276					;
    277	000754	005703 			ADJREC:	TST	R3		;IF FTN CAR CTL
    278	000756	002006 				BGE	10$
    279	000760	012703 	000040 			MOV	#' ,R3		;BLANK CAR CTL IF NULL FTN RECORD
    280	000764	005702 				TST	R2		;IS IT NULL?
    281	000766	001404 				BEQ	15$
    282	000770	112103 				MOVB	(R1)+,R3	;THEN PICK UP CAR CTL CHAR
    283	000772	005302 				DEC	R2		;AND ADJUST BYTE COUNT
    284	000774	005702 			10$:	TST	R2		;IF RECORD IS EMPTY
    285	000776	001002 				BNE	20$
    286	001000	105011 			15$:	CLRB	@R1		;THEN SEND 1 NULL INSTEAD
    287	001002	005202 				INC	R2		;FIX BYTE COUNT
    288	001004				20$:	RETURN
    289					;+
    290					; UPDATE EOF IF FD.EOF IN F.BKP1 IS SET
    291					; CALLING SEQUENCE:
    292					;	CALL	UPDEOF
    293					; INPUTS:
    294					;	R0 = FDB
    295					; OUTPUTS:
    296					;	C=1 IF NOT AT EOF (FD.EOF IS ZERO)
    297					;	C=0 IF FD.EOF = 1 AND IN THIS CASE, EFBK AND FFBY ARE UPDATED
    298					;	R0,R1-R5 PRESERVED
    299					;	R2 ALTERED IF EFBK AND FFBY ARE UPDATED (C=0)
    300					;-
    301	001006	132760 	000002 	000000G	UPDEOF:	BITB	#FD.EOF,F.BKP1(R0) ;PUTTING AT EOF?
    302	001014	001002 				BNE	10$		;BRANCH IF YES, UPDATE EOF
    303	001016	000261 				SEC			;INDICATE NOT AT EOF
    304	001020					RETURN
    305	001022	016060 	000000G	000000G	10$:	MOV	F.VBN(R0),F.EFBK(R0) ;UPDATE END OF FILE BLOCK NUMBER
    306	001030	016060 	000002G	000002G		MOV	F.VBN+2(R0),F.EFBK+2(R0)
    307	001036	016002 	000000G			MOV	F.NREC(R0),R2	;CALCULATE FIRST FREE BYTE
    308	001042	066002 	000000G			ADD	F.VBSZ(R0),R2
    309	001046	166002 	000000G			SUB	F.EOBB(R0),R2
    310	001052	010260 	000000G			MOV	R2,F.FFBY(R0)	;NOTE WHERE CURRENT EOF IS
    311	001056	000241 				CLC
    312	001060					RETURN
    313					;
    314					;
    315	001062					$END	PUT
    316					;
    317					;
    318		000001 				.END
PUTSQ 0101MS, PUT RECORD ROUTIN	MACRO M1108  05-DEC-77 22:18  PAGE 13-1
SYMBOL TABLE

ADJREC  000754R  	F.EFBK= ****** GX	HA.TYP= 000006   	PTBLK   000306R  	SYDEV = 054523
BD.FRE= 000001   	F.EOBB= ****** GX	HA.UAT= 000004   	PTBLK1  000364R  	SYUNIT= 000000
DIRTYP= 015172   	F.ERR = ****** GX	HA.UI = 000001   	PUTX    000300R  	UPDEOF  001006R
FCSEFN= 000040   	F.FFBY= ****** GX	HA.VER= 000007   	PUTX1   000304R  	WI.DLK= 000002
FD.BLK= ****** GX	F.NRBD= ****** GX	IE.DAO= ****** GX	R$$ANI= 000000   	WI.LCK= 000001
FD.CCL= ****** GX	F.NREC= ****** GX	IE.RBG= ****** GX	R$$BBF= 000000   	$$    = 000067
FD.CR = ****** GX	F.RACC= ****** GX	NB.DOT= 100000   	R$$DPB= 000001   	.PUTSQ  000000RG
FD.DVR= 000020   	F.RATT= ****** GX	NB.SMI= 040000   	R$$EIS= 000000   	.SAVR1= ****** GX
FD.EFB= 000004   	F.RCNM= ****** GX	N.DRPT= 000006   	R$$LCL= 000000   	..EFCK= ****** GX
FD.EF1= 000010   	F.RCTL= ****** GX	N.DRSZ= 000004   	R$$MUL= 000000   	..FCSX= ****** GX
FD.EOF= 000002   	F.RSIZ= ****** GX	N.DVPT= 000002   	R$$OPF= 000000   	..MVR1= ****** GX
FD.FTN= ****** GX	F.RTYP= ****** GX	N.DVSZ= 000000   	R$$RSL= 000000   	..PGCS= ****** GX
FD.INS= ****** GX	F.VBN = ****** GX	N.FNPT= 000012   	R$$SEQ= 000001   	..RTAD= ****** GX
FD.RAN= ****** GX	F.VBSZ= ****** GX	N.FNSZ= 000010   	R$$SPL= 000000   	..SQER= ****** GX
FD.REC= ****** GX	HA.CHU= 000003   	PP.SEP= 000002   	R$$11M= 000001   	..WTWA= ****** GX
FD.WRT= 000001   	HA.FP = 000002   	PP.ZER= 000001   	R.FIX = ****** GX	..WTW1= ****** GX
F.BBFS= ****** GX	HA.NAM= 000005   	PTBIG   000272R  	R.VAR = ****** GX	...CTL= 000002
F.BKP1= ****** GX

. ABS.	000000	   000
      	001062	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2866 WORDS  ( 12 PAGES)
DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:00:23
[41,10]PUTSQ,[41,20]PUTSQ/-SP=[41,30]GPSEQ,FCSPRE,PUT
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 1


      1						.TITLE	QIOMAC - QIOSYM MACRO DEFINITION
      2					; ALTERED SUNDAY 24-NOV-74 13:00
      3					; ALTERED TUESDAY 28-JAN-75 13:50:00
      4					;
      5					; ***** ALWAYS UPDATE THE FOLLOWING TWO LINES TOGETHER
      6						.IDENT	/0300/
      7		000300 				QI.VER=0300
      8					;
      9					;                             COPYRIGHT (C) 1973, 1978 BY
     10					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
     11					;
     12					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
     13					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     14					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     15					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     16					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     17					;
     18					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     19					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     20					;       CORPORATION.
     21					;
     22					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     23					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     24
     25					;
     26					; PETER H. LIPMAN 1-OCT-73
     27					;
     28					;+
     29					; MACRO TO DEFINE STANDARD QUEUE I/O DIRECTIVE FUNCTION VALUES
     30					; AND IOSB RETURN VALUES.  TO INVOKE AT ASSEMBLY TIME (WITH LOCAL
     31					; DEFINITION) USE:
     32					;
     33					;	QIOSY$		;DEFINE SYMBOLS
     34					;
     35					; TO OBTAIN GLOBAL DEFINITION OF THESE SYMBOLS USE:
     36					;
     37					;	QIOSY$ DEF$G	;SYMBOLS DEFINED GLOBALLY
     38					;
     39					; THE MACRO CAN BE CALLED ONCE ONLY AND THEN
     40					; REDEFINES ITSELF AS NULL.
     41					;-
     42
     43						.MACRO	QIOSY$	$$$GBL,$$$MSG
     44						.IIF	IDN,<$$$GBL>,<DEF$G>,	.GLOBL	QI.VER
     45						.IF	IDN,<$$$MSG>,<DEF$S>
     46						$$$MAX=0
     47						$$MSG=1
     48						.IFF
     49						$$MSG=0
     50						.ENDC
     51						.MCALL	IOERR$
     52						IOERR$	$$$GBL	 	;I/O ERROR CODES FROM HANDLERS, FCP, FCS
     53						.MCALL	DRERR$
     54						DRERR$	$$$GBL	 	;DIRECTIVE STATUS WORD ERROR CODES
     55						.IF	DIF,<$$$MSG>,<DEF$S>
     56						.MCALL	FILIO$
     57						FILIO$	$$$GBL		;DEFINE GENERAL QI/O FUNCTION CODES
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 1-1


     58						.MCALL	SPCIO$
     59						SPCIO$	$$$GBL		;DEVICE DEPENDENT I/O FUNCTION CODES
     60						.MACRO	QIOSY$	ARG,ARG1,ARG2	;RECLAIM MACRO STORAGE
     61						.ENDM	QIOSY$
     62						.ENDC
     63						.ENDM	QIOSY$
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 2


     65
     66					;
     67					; DEFINE THE ERROR CODES RETURNED BY DEVICE HANDLER AND FILE PRIMITIVES
     68					; IN THE FIRST WORD OF THE I/O STATUS BLOCK
     69					; THESE CODES ARE ALSO RETURNED BY FILE CONTROL SERVICES (FCS) IN THE
     70					; BYTE F.ERR IN THE FILE DESCRIPTOR BLOCK (FDB)
     71					;	THE BYTE F.ERR+1 IS 0 IF F.ERR CONTAINS A HANDLER OR FCP ERROR CODE.
     72					;
     73						.MACRO	IOERR$	$$$GBL
     74						.MCALL	.IOER.,DEFIN$
     75						.IF	IDN,<$$$GBL>,<DEF$G>
     76						...GBL=1
     77						.IFF
     78						...GBL=0
     79						.ENDC
     80						.IIF	NDF,$$MSG,$$MSG=0
     81					;
     82					; SYSTEM STANDARD CODES, USED BY ALL FUNCTIONS
     83					;
     84						.IOER.	IE.BAD,-01.,<BAD PARAMETERS>
     85						.IOER.	IE.EBX,-02.,<E BOX STOPPED>
     86						.IOER.	IE.IFC,-02.,<INVALID FUNCTION CODE>
     87						.IOER.	IE.DNR,-03.,<DEVICE NOT READY>
     88						.IOER.	IE.VER,-04.,<PARITY ERROR ON DEVICE>
     89						.IOER.	IE.ONP,-05.,<HARDWARE OPTION NOT PRESENT>
     90						.IOER.	IE.SPC,-06.,<ILLEGAL USER BUFFER>
     91						.IOER.	IE.DNA,-07.,<DEVICE NOT ATTACHED>
     92						.IOER.	IE.DAA,-08.,<DEVICE ALREADY ATTACHED>
     93						.IOER.	IE.DUN,-09.,<DEVICE NOT ATTACHABLE>
     94						.IOER.	IE.EOF,-10.,<END OF FILE DETECTED>
     95						.IOER.	IE.EOV,-11.,<END OF VOLUME DETECTED>
     96						.IOER.	IE.WLK,-12.,<WRITE ATTEMPTED TO LOCKED UNIT>
     97						.IOER.	IE.DAO,-13.,<DATA OVERRUN>
     98						.IOER.	IE.SRE,-14.,<SEND/RECEIVE FAILURE>
     99						.IOER.	IE.ABO,-15.,<REQUEST TERMINATED>
    100						.IOER.	IE.PRI,-16.,<PRIVILEGE VIOLATION>
    101						.IOER.	IE.RSU,-17.,<SHARABLE RESOURCE IN USE>
    102						.IOER.	IE.OVR,-18.,<ILLEGAL OVERLAY REQUEST>
    103						.IOER.	IE.BYT,-19.,<ODD BYTE COUNT (OR VIRTUAL ADDRESS)>
    104						.IOER.	IE.BLK,-20.,<LOGICAL BLOCK NUMBER TOO LARGE>
    105						.IOER.	IE.MOD,-21.,<INVALID UDC MODULE #>
    106						.IOER.	IE.CON,-22.,<UDC CONNECT ERROR>
    107						.IOER.	IE.BBE,-56.,<BAD BLOCK ON DEVICE>
    108						.IOER.	IE.STK,-58.,<NOT ENOUGH STACK SPACE (FCS OR FCP)>
    109						.IOER.	IE.FHE,-59.,<FATAL HARDWARE ERROR ON DEVICE>
    110						.IOER.	IE.EOT,-62.,<END OF TAPE DETECTED>
    111						.IOER.	IE.OFL,-65.,<DEVICE OFF LINE>
    112
    113
    114					;
    115					; FILE PRIMITIVE CODES
    116					;
    117
    118						.IOER.	IE.NOD,-23.,<CALLER'S NODES EXHAUSTED>
    119						.IOER.	IE.DFU,-24.,<DEVICE FULL>
    120						.IOER.	IE.IFU,-25.,<INDEX FILE FULL>
    121						.IOER.	IE.NSF,-26.,<NO SUCH FILE>
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 2-1


    122						.IOER.	IE.LCK,-27.,<LOCKED FROM WRITE ACCESS>
    123						.IOER.	IE.HFU,-28.,<FILE HEADER FULL>
    124						.IOER.	IE.WAC,-29.,<ACCESSED FOR WRITE>
    125						.IOER.	IE.CKS,-30.,<FILE HEADER CHECKSUM FAILURE>
    126						.IOER.	IE.WAT,-31.,<ATTRIBUTE CONTROL LIST FORMAT ERROR>
    127						.IOER.	IE.RER,-32.,<FILE PROCESSOR DEVICE READ ERROR>
    128						.IOER.	IE.WER,-33.,<FILE PROCESSOR DEVICE WRITE ERROR>
    129						.IOER.	IE.ALN,-34.,<FILE ALREADY ACCESSED ON LUN>
    130						.IOER.	IE.SNC,-35.,<FILE ID, FILE NUMBER CHECK>
    131						.IOER.	IE.SQC,-36.,<FILE ID, SEQUENCE NUMBER CHECK>
    132						.IOER.	IE.NLN,-37.,<NO FILE ACCESSED ON LUN>
    133						.IOER.	IE.CLO,-38.,<FILE WAS NOT PROPERLY CLOSED>
    134						.IOER.	IE.DUP,-57.,<ENTER - DUPLICATE ENTRY IN DIRECTORY>
    135						.IOER.	IE.BVR,-63.,<BAD VERSION NUMBER>
    136						.IOER.	IE.BHD,-64.,<BAD FILE HEADER>
    137						.IOER.	IE.EXP,-66.,<FILE EXPIRATION DATE NOT REACHED>
    138						.IOER.	IE.BTF,-67.,<BAD TAPE FORMAT>
    139
    140					;
    141					; FILE CONTROL SERVICES CODES
    142					;
    143
    144						.IOER.	IE.NBF,-39.,<OPEN - NO BUFFER SPACE AVAILABLE FOR FILE>
    145						.IOER.	IE.RBG,-40.,<ILLEGAL RECORD SIZE>
    146						.IOER.	IE.NBK,-41.,<FILE EXCEEDS SPACE ALLOCATED, NO BLOCKS>
    147						.IOER.	IE.ILL,-42.,<ILLEGAL OPERATION ON FILE DESCRIPTOR BLOCK>
    148						.IOER.	IE.BTP,-43.,<BAD RECORD TYPE>
    149						.IOER.	IE.RAC,-44.,<ILLEGAL RECORD ACCESS BITS SET>
    150						.IOER.	IE.RAT,-45.,<ILLEGAL RECORD ATTRIBUTES BITS SET>
    151						.IOER.	IE.RCN,-46.,<ILLEGAL RECORD NUMBER - TOO LARGE>
    152						.IOER.	IE.MBK,-47.,<MULTIPLE BLOCK READ/WRITE - NOT IMPLEMENTED YET>
    153						.IOER.	IE.2DV,-48.,<RENAME - 2 DIFFERENT DEVICES>
    154						.IOER.	IE.FEX,-49.,<RENAME - NEW FILE NAME ALREADY IN USE>
    155						.IOER.	IE.BDR,-50.,<BAD DIRECTORY FILE>
    156						.IOER.	IE.RNM,-51.,<CAN'T RENAME OLD FILE SYSTEM>
    157						.IOER.	IE.BDI,-52.,<BAD DIRECTORY SYNTAX>
    158						.IOER.	IE.FOP,-53.,<FILE ALREADY OPEN>
    159						.IOER.	IE.BNM,-54.,<BAD FILE NAME>
    160						.IOER.	IE.BDV,-55.,<BAD DEVICE NAME>
    161						.IOER.	IE.NFI,-60.,<FILE ID WAS NOT SPECIFIED>
    162						.IOER.	IE.ISQ,-61.,<ILLEGAL SEQUENTIAL OPERATION>
    163						.IOER.	IE.NNC,-68.,<NOT ANSI 'D' FORMAT BYTE COUNT>
    164
    165					;
    166					; SUCCESSFUL RETURN CODES---
    167					;
    168
    169						DEFIN$	IS.PND,+00.	;OPERATION PENDING
    170						DEFIN$	IS.SUC,+01.	;OPERATION COMPLETE, SUCCESS
    171						DEFIN$	IS.RDD,+02.	;READ DELETED DATA (FLOPPY)
    172						DEFIN$	IS.BV,+05.	;ON A/D READ, AT LEAST ONE BAD VALUE
    173									;WAS READ (REMAINDER MAY BE GOOD).
    174									;BAD CHANNEL IS INDICATED BY A
    175									;NEGATIVE VALUE IN THE BUFFER.
    176
    177
    178					;
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 2-2


    179					; TTY SUCCESS CODES:
    180					;
    181
    182						DEFIN$	IS.CR,<15*400+1> ;CARRIAGE RETURN WAS TERMINATOR
    183						DEFIN$	IS.ESC,<33*400+1> ;ESCAPE (ALTMODE) WAS TERMINATOR
    184
    185
    186					; ******
    187					;
    188					; THE NEXT AVAILABLE ERROR NUMBER IS: -69.
    189					; ALL LOWER NUMBERS ARE IN USE!!
    190					;
    191					; *****
    192						.IF	EQ,$$MSG
    193						.MACRO	IOERR$	A
    194						.ENDM	IOERR$
    195						.ENDC
    196						.ENDM	IOERR$
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 3


    198					;
    199					; DEFINE THE DIRECTIVE ERROR CODES RETURNED IN THE DIRECTIVE STATUS WORD
    200					;
    201					;	FILE CONTROL SERVICES (FCS) RETURNS THESE CODES IN THE BYTE F.ERR
    202					; OF THE FILE DESCRIPTOR BLOCK (FDB).  TO DISTINGUISH THEM FROM THE
    203					; OVERLAPPING CODES FROM HANDLER AND FILE PRIMITIVES, THE BYTE
    204					; F.ERR+1 IN THE FDB WILL BE NEGATIVE FOR A DIRECTIVE ERROR CODE.
    205					;
    206						.MACRO	DRERR$	$$$GBL
    207						.MCALL	.QIOE.,DEFIN$
    208						.IF	IDN,<$$$GBL>,<DEF$G>
    209						...GBL=1
    210						.IFF
    211						...GBL=0
    212						.ENDC
    213						.IIF	NDF,$$MSG,$$MSG=0
    214					;
    215					; STANDARD ERROR CODES RETURNED BY DIRECTIVES IN THE DIRECTIVE STATUS WORD
    216					;
    217						.QIOE.	IE.UPN,-01.,<INSUFFICIENT DYNAMIC STORAGE>
    218						.QIOE.	IE.INS,-02.,<SPECIFIED TASK NOT INSTALLED>
    219						.QIOE.	IE.ULN,-05.,<UN-ASSIGNED LUN>
    220						.QIOE.	IE.HWR,-06.,<HANDLER TASK NOT RESIDENT>
    221						.QIOE.	IE.ACT,-07.,<TASK NOT ACTIVE>
    222						.QIOE.	IE.ITS,-08.,<DIRECTIVE INCONSISTENT WITH TASK STATE>
    223						.QIOE.	IE.CKP,-10.,<ISSUING TASK NOT CHECKPOINTABLE>
    224					;
    225					;
    226					;
    227						.QIOE.	IE.AST,-80.,<DIRECTIVE ISSUED/NOT ISSUED FROM AST>
    228						.QIOE.	IE.LNL,-90.,<LUN LOCKED IN USE>
    229						.QIOE.	IE.IDU,-92.,<INVALID DEVICE OR UNIT>
    230						.QIOE.	IE.ITI,-93.,<INVALID TIME PARAMETERS>
    231						.QIOE.	IE.IPR,-95.,<INVALID PRIORITY ( .GT. 250.)>
    232						.QIOE.	IE.ILU,-96.,<INVALID LUN>
    233						.QIOE.	IE.IEF,-97.,<INVALID EVENT ( .GT. 64.)>
    234						.QIOE.	IE.ADP,-98.,<PART OF DPB OUT OF USER'S SPACE>
    235						.QIOE.	IE.SDP,-99.,<DIC OR DPB SIZE INVALID>
    236					;
    237					; SUCCESS CODES FROM DIRECTIVES - PLACED IN THE DIRECTIVE STATUS WORD
    238					;
    239						DEFIN$	IS.CLR,0	;EVENT FLAG WAS CLEAR
    240									;FROM CLEAR EVENT FLAG DIRECTIVE
    241						DEFIN$	IS.SET,2	;EVENT FLAG WAS SET
    242									;FROM SET EVENT FLAG DIRECTIVE
    243					;
    244					;
    245						.IF	EQ,$$MSG
    246						.MACRO	DRERR$	A
    247						.ENDM	DRERR$
    248						.ENDC
    249						.ENDM	DRERR$
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 4


    251					;
    252					; DEFINE THE GENERAL QI/O FUNCTION CODES - DEVICE INDEPENDENT
    253					;
    254						.MACRO	FILIO$	$$$GBL
    255						.MCALL	.WORD.,DEFIN$
    256						.IF	IDN,<$$$GBL>,<DEF$G>
    257						...GBL=1
    258						.IFF
    259						...GBL=0
    260						.ENDC
    261					;
    262					; GENERAL QI/O QUALIFIER BYTE DEFINITIONS
    263					;
    264						.WORD.	IQ.X,001,000	;NO ERROR RECOVERY
    265						.WORD.	IQ.Q,002,000	;QUEUE REQUEST IN EXPRESS QUEUE
    266					;;;	.WORD.	IQ.,004,000	;RESERVED
    267					;
    268					; EXPRESS QUEUE COMMANDS
    269					;
    270
    271						.WORD.	IO.KIL,012,000	;KILL CURRENT REQUEST
    272						.WORD.	IO.RDN,022,000	;I/O RUNDOWN
    273						.WORD.	IO.UNL,042,000	;UNLOAD I/O HANDLER TASK
    274						.WORD.	IO.LTK,050,000	;LOAD A TASK IMAGE FILE
    275						.WORD.	IO.RTK,060,000	;RECORD A TASK IMAGE FILE
    276					;
    277					; GENERAL DEVICE HANDLER CODES
    278					;
    279						.WORD.	IO.WLB,000,001	;WRITE LOGICAL BLOCK
    280						.WORD.	IO.RLB,000,002	;READ LOGICAL BLOCK
    281						.WORD.	IO.LOV,010,002	;LOAD OVERLAY (DISK DRIVER)
    282						.WORD.	IO.ATT,000,003	;ATTACH A DEVICE TO A TASK
    283						.WORD.	IO.DET,000,004	;DETACH A DEVICE FROM A TASK
    284					;
    285					; DIRECTORY PRIMITIVE CODES
    286					;
    287						.WORD.	IO.FNA,000,011	;FIND FILE NAME IN DIRECTORY
    288						.WORD.	IO.RNA,000,013	;REMOVE FILE NAME FROM DIRECTORY
    289						.WORD.	IO.ENA,000,014	;ENTER FILE NAME IN DIRECTORY
    290					;
    291					; FILE PRIMITIVE CODES
    292					;
    293						.WORD.	IO.CLN,000,007	;CLOSE OUT LUN
    294						.WORD.	IO.ACR,000,015	;ACCESS FOR READ
    295						.WORD.	IO.ACW,000,016	;ACCESS FOR WRITE
    296						.WORD.	IO.ACE,000,017	;ACCESS FOR EXTEND
    297						.WORD.	IO.DAC,000,020	;DE-ACCESS FILE
    298						.WORD.	IO.RVB,000,021	;READ VIRITUAL BLOCK
    299						.WORD.	IO.WVB,000,022	;WRITE VIRITUAL BLOCK
    300						.WORD.	IO.EXT,000,023	;EXTEND FILE
    301						.WORD.	IO.CRE,000,024	;CREATE FILE
    302						.WORD.	IO.DEL,000,025	;DELETE FILE
    303						.WORD.	IO.RAT,000,026	;READ FILE ATTRIBUTES
    304						.WORD.	IO.WAT,000,027	;WRITE FILE ATTRIBUTES
    305						.WORD.	IO.APV,010,030	;PRIVILEGED ACP CONTROL
    306						.WORD.	IO.APC,000,030	;ACP CONTROL
    307					;
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 4-1


    308					;
    309						.MACRO	FILIO$	A
    310						.ENDM	FILIO$
    311						.ENDM	FILIO$
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 5


    313					;
    314					; DEFINE THE QI/O FUNCTION CODES THAT ARE SPECIFIC TO INDIVIDUAL DEVICES
    315					;
    316						.MACRO	SPCIO$	$$$GBL
    317						.MCALL	.WORD.,DEFIN$
    318						.IF	IDN,<$$$GBL>,<DEF$G>
    319						...GBL=1
    320						.IFF
    321						...GBL=0
    322						.ENDC
    323					;
    324					; QI/O FUNCTION CODES FOR SPECIFIC DEVICE DEPENDENT FUNCTIONS
    325					;
    326						.WORD.	IO.WLV,100,001	;WRITE LOGICAL REVERSE (DECTAPE)
    327						.WORD.	IO.WLS,010,001	;(COMMUNICATIONS) WRITE PRECEDED BY SYNC TRAIN
    328						.WORD.	IO.RLV,100,002	;READ REVERSE (DECTAPE)
    329						.WORD.	IO.RNC,004,002	;READ - NO LOWER CASE CONVERT (TTY)
    330						.WORD.	IO.RAL,010,002	;READ PASSING ALL CHARACTERS (TTY)
    331						.WORD.	IO.RNE,020,002	;READ WITHOUT ECHO (TTY)
    332						.WORD.	IO.RDB,200,002	;READ BINARY MODE (CARD READER)
    333						.WORD.	IO.RHD,010,002	;(COMMUNICATIONS) READ, STRIP SYNC
    334						.WORD.	IO.CRC,020,002	;(COMMUNICATIONS) READ, DON'T CLEAR CRC
    335						.WORD.	IO.R1C,000,005	;READ SINGLE CHANNEL (AFC, AD01, UDC)
    336						.WORD.	IO.INL,000,005	;(COMMUNICATIONS) INITIALIZATION FUNCTION
    337						.WORD.	IO.TRM,010,005	;(COMMUNICATIONS) TERMINATION FUNCTION
    338						.WORD.	IO.RBC,000,006	;READ MULTICHANNELS (BUFFER DEFINES CHANNELS)
    339						.WORD.	IO.MOD,000,006	;(COMMUNICATIONS) SETMODE FUNCTION FAMILY
    340						.WORD.	IO.HDX,010,006	;(COMMUNICATIONS) SET UNIT HALF DUPLEX
    341						.WORD.	IO.FDX,020,006	;(COMMUNICATIONS) SET UNIT FULL DUPLEX
    342						.WORD.	IO.SYN,040,006	;(COMMUNICATIONS) SPECIFY SYNC CHARACTER
    343						.WORD.	IO.RTC,000,007	;READ CHANNEL - TIME BASED
    344						.WORD.	IO.RWD,000,005	;REWIND (MAGTAPE, DECTAPE)
    345						.WORD.	IO.SPB,020,005	;MAGTAPE, SPACE "N" BLOCKS
    346						.WORD.	IO.SPF,040,005	;MAGTAPE, SPACE "N" EOF MARKS
    347						.WORD.	IO.EOF,000,006	;MAGTAPE, WRITE EOF
    348						.WORD.	IO.STC,100,005	;MAGTAPE, SET CHARACTERISTIC
    349						.WORD.	IO.SEC,120,005	;MAGTAPE, SENSE CHARACTERISTIC
    350						.WORD.	IO.RWU,140,005	;REWIND AND UNLOAD (MAGTAPE, DECTAPE)
    351						.WORD.	IO.SMO,160,005	;MAGTAPE, MOUNT & SET CHARACTERISTICS
    352						.WORD.	IO.SAO,000,010	;UDC SINGLE CHANNEL ANALOG OUTPUT
    353						.WORD.	IO.SSO,000,011	;UDC SINGLE SHOT, SINGLE POINT
    354						.WORD.	IO.MSO,000,012	;UDC SINGLE SHOT, MULTI-POINT
    355						.WORD.	IO.SLO,000,013	;UDC LATCHING, SINGLE POINT
    356						.WORD.	IO.MLO,000,014	;UDC LATCHING, MULTI-POINT
    357						.WORD.	IO.LED,000,024	;LPS11 WRITE LED DISPLAY LIGHTS
    358						.WORD.	IO.SDO,000,025	;LPS11 WRITE DIGITAL OUTPUT REGISTER
    359						.WORD.	IO.SDI,000,026	;LPS11 READ DIGITAL INPUT REGISTER
    360						.WORD.	IO.SCS,000,026	;UDC CONTACT SENSE, SINGLE POINT
    361						.WORD.	IO.REL,000,027	;LPS11 WRITE RELAY
    362						.WORD.	IO.MCS,000,027	;UDC CONTACT SENSE, MULTI-POINT
    363						.WORD.	IO.ADS,000,030	;LPS11 SYNCHRONOUS A/D SAMPLING
    364						.WORD.	IO.CCI,000,030	;UDC CONTACT INT - CONNECT
    365						.WORD.	IO.MDI,000,031	;LPS11 SYNCHRONOUS DIGITAL INPUT
    366						.WORD.	IO.DCI,000,031	;UDC CONTACT INT - DISCONNECT
    367						.WORD.	IO.XMT,000,031	;(COMMUNICATIONS) TRANSMIT SPECIFIED BLOCK WITH ACK
    368						.WORD.	IO.XNA,010,031	;(COMMUNICATIONS) TRANSMIT WITHOUT ACK
    369						.WORD.	IO.HIS,000,032	;LPS11 SYNCHRONOUS HISTOGRAM SAMPLING
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 5-1


    370						.WORD.	IO.RCI,000,032	;UDC CONTACT INT - READ
    371						.WORD.	IO.RCV,000,032	;(COMMUNICATIONS) RECEIVE DATA IN BUFFER SPECIFIED
    372						.WORD.	IO.MDO,000,033	;LPS11 SYNCHRONOUS DIGITAL OUTPUT
    373						.WORD.	IO.CTI,000,033	;UDC TIMER - CONNECT
    374						.WORD.	IO.CON,000,033	;(COMMUNICATIONS) COMMUNICATIONS CONNECT FUNCTION
    375						.WORD.	IO.DTI,000,034	;UDC TIMER - DISCONNECT
    376						.WORD.	IO.DIS,000,034	;(COMMUNICATIONS) COMMUNICATIONS DISCONNECT FUNCTION
    377						.WORD.	IO.MDA,000,034	;LPS11 SYNCHRONOUS D/A OUTPUT
    378						.WORD.	IO.RTI,000,035	;UDC TIMER - READ
    379						.WORD.	IO.CTL,000,035	;(COMMUNICATIONS) NETWORK CONTROL FUNCTION
    380						.WORD.	IO.STP,000,035	;LPS11 STOP IN PROGRESS FUNCTION
    381						.WORD.	IO.ITI,000,036	;UDC TIMER - INITIALIZE
    382						.WORD.	IO.SHT,010,005	;SET HORIZONTAL TAB POSITIONS
    383						.WORD.	IO.SST,030,005	;SET SPECIAL TERMINATOR CHARACTERS
    384						.WORD.	IO.SEM,040,005	;SET TERMINAL MODE (CHARACTERISTICS)
    385						.WORD.	IO.SNM,050,005	;SENSE TERMINAL MODE
    386						.WORD.	IO.CCT,060,005	;CONNECT TO REMOTE TERMINAL (AUTO DIALOUT)
    387						.WORD.	IO.DCT,070,005	;DISCONNECT FROM REMOTE TERMINAL (HANGUP)
    388						.WORD.	IO.ESA,100,005	;ENABLE STATUS AST
    389					;
    390					;
    391						.MACRO	SPCIO$	A
    392						.ENDM	SPCIO$
    393						.ENDM	SPCIO$
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 6


    395					;
    396					; HANDLER ERROR CODES RETURNED IN I/O STATUS BLOCK ARE DEFINED THROUGH THIS
    397					; MACRO WHICH THEN CONDITIONALLY INVOKES THE MESSAGE GENERATING MACRO
    398					; FOR THE QIOSYM.MSG FILE
    399					;
    400						.MACRO	.IOER.	SYM,LO,MSG
    401						DEFIN$	SYM,LO
    402						.IF	GT,$$MSG
    403						.MCALL	.IOMG.
    404						.IOMG.	SYM,LO,<MSG>
    405						.ENDC
    406						.ENDM	.IOER.
    407					;
    408					; QI/O ERROR CODES ARE DEFINED THOUGH THIS MACRO WHICH THEN INVOKES THE
    409					; ERROR MESSAGE GENERATING MACRO, ERROR CODES -129 THROUGH -256
    410					; ARE USED IN THE QIOSYM.MSG FILE
    411					;
    412						.MACRO	.QIOE.	SYM,LO,MSG
    413						DEFIN$	SYM,LO
    414						.IF	GT,$$MSG
    415						.MCALL	.IOMG.
    416						.IOMG.	SYM,<LO-128.>,<MSG>
    417						.ENDC
    418						.ENDM	.QIOE.
    419					;
    420					; CONDITIONALLY GENERATE DATA FOR WRITING A MESSAGE FILE FOR MO
    421					;
    422						.MACRO	.IOMG.	SYM,LO,MSG
    423						.WORD	-<LO>
    424						.ASCIZ	^MSG^
    425						.EVEN
    426						.IIF	LT,<$$$MAX+<LO>>,$$$MAX=-<LO>
    427						.ENDM	.IOMG.
    428					;
    429					; DEFINE THE SYMBOL SYM WHERE LO IS IS THE LOW ORDER BYTE, HI IS THE HIGH BYTE
    430					;
    431						.MACRO	.WORD.	SYM,LO,HI
    432						DEFIN$	SYM,<HI*400+LO>
    433						.ENDM	.WORD.
QIOSYM	MACRO M1108  05-DEC-77 23:45  PAGE 7


      1						.TITLE	QIOSYM
      2					; ALTERED THURSDAY 6-DEC-73 11:00
      3					;
      4					; COPYRIGHT (C) 1975, DIGITAL EQUIPMENT CORP., MAYNARD MASS.
      5					; COPYRIGHT (C) 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					; PETER H. LIPMAN 1-OCT-73
     20					;
     21						.MCALL	QIOSY$
     22	000000					QIOSY$	DEF$G		;DEFINE QIO SYMBOLS GLOBALLY
     23		000001 				.END
QIOSYM	MACRO M1108  05-DEC-77 23:45  PAGE 7-1
SYMBOL TABLE

IE.ABO= 177761 G 	IE.IDU= 177644 G 	IE.STK= 177706 G 	IO.HIS= 015000 G 	IO.SDI= 013000 G
IE.ACT= 177771 G 	IE.IEF= 177637 G 	IE.ULN= 177773 G 	IO.INL= 002400 G 	IO.SDO= 012400 G
IE.ADP= 177636 G 	IE.IFC= 177776 G 	IE.UPN= 177777 G 	IO.ITI= 017000 G 	IO.SEC= 002520 G
IE.ALN= 177736 G 	IE.IFU= 177747 G 	IE.VER= 177774 G 	IO.KIL= 000012 G 	IO.SEM= 002440 G
IE.AST= 177660 G 	IE.ILL= 177726 G 	IE.WAC= 177743 G 	IO.LED= 012000 G 	IO.SHT= 002410 G
IE.BAD= 177777 G 	IE.ILU= 177640 G 	IE.WAT= 177741 G 	IO.LOV= 001010 G 	IO.SLO= 005400 G
IE.BBE= 177710 G 	IE.INS= 177776 G 	IE.WER= 177737 G 	IO.LTK= 000050 G 	IO.SMO= 002560 G
IE.BDI= 177714 G 	IE.IPR= 177641 G 	IE.WLK= 177764 G 	IO.MCS= 013400 G 	IO.SNM= 002450 G
IE.BDR= 177716 G 	IE.ISQ= 177703 G 	IE.2DV= 177720 G 	IO.MDA= 016000 G 	IO.SPB= 002420 G
IE.BDV= 177711 G 	IE.ITI= 177643 G 	IO.ACE= 007400 G 	IO.MDI= 014400 G 	IO.SPF= 002440 G
IE.BHD= 177700 G 	IE.ITS= 177770 G 	IO.ACR= 006400 G 	IO.MDO= 015400 G 	IO.SSO= 004400 G
IE.BLK= 177754 G 	IE.LCK= 177745 G 	IO.ACW= 007000 G 	IO.MLO= 006000 G 	IO.SST= 002430 G
IE.BNM= 177712 G 	IE.LNL= 177646 G 	IO.ADS= 014000 G 	IO.MOD= 003000 G 	IO.STC= 002500 G
IE.BTF= 177675 G 	IE.MBK= 177721 G 	IO.APC= 014000 G 	IO.MSO= 005000 G 	IO.STP= 016400 G
IE.BTP= 177725 G 	IE.MOD= 177753 G 	IO.APV= 014010 G 	IO.RAL= 001010 G 	IO.SYN= 003040 G
IE.BVR= 177701 G 	IE.NBF= 177731 G 	IO.ATT= 001400 G 	IO.RAT= 013000 G 	IO.TRM= 002410 G
IE.BYT= 177755 G 	IE.NBK= 177727 G 	IO.CCI= 014000 G 	IO.RBC= 003000 G 	IO.UNL= 000042 G
IE.CKP= 177766 G 	IE.NFI= 177704 G 	IO.CCT= 002460 G 	IO.RCI= 015000 G 	IO.WAT= 013400 G
IE.CKS= 177742 G 	IE.NLN= 177733 G 	IO.CLN= 003400 G 	IO.RCV= 015000 G 	IO.WLB= 000400 G
IE.CLO= 177732 G 	IE.NNC= 177674 G 	IO.CON= 015400 G 	IO.RDB= 001200 G 	IO.WLS= 000410 G
IE.CON= 177752 G 	IE.NOD= 177751 G 	IO.CRC= 001020 G 	IO.RDN= 000022 G 	IO.WLV= 000500 G
IE.DAA= 177770 G 	IE.NSF= 177746 G 	IO.CRE= 012000 G 	IO.REL= 013400 G 	IO.WVB= 011000 G
IE.DAO= 177763 G 	IE.OFL= 177677 G 	IO.CTI= 015400 G 	IO.RHD= 001010 G 	IO.XMT= 014400 G
IE.DFU= 177750 G 	IE.ONP= 177773 G 	IO.CTL= 016400 G 	IO.RLB= 001000 G 	IO.XNA= 014410 G
IE.DNA= 177771 G 	IE.OVR= 177756 G 	IO.DAC= 010000 G 	IO.RLV= 001100 G 	IQ.Q  = 000002 G
IE.DNR= 177775 G 	IE.PRI= 177760 G 	IO.DCI= 014400 G 	IO.RNA= 005400 G 	IQ.X  = 000001 G
IE.DUN= 177767 G 	IE.RAC= 177724 G 	IO.DCT= 002470 G 	IO.RNC= 001004 G 	IS.BV = 000005 G
IE.DUP= 177707 G 	IE.RAT= 177723 G 	IO.DEL= 012400 G 	IO.RNE= 001020 G 	IS.CLR= 000000 G
IE.EBX= 177776 G 	IE.RBG= 177730 G 	IO.DET= 002000 G 	IO.RTC= 003400 G 	IS.CR = 006401 G
IE.EOF= 177766 G 	IE.RCN= 177722 G 	IO.DIS= 016000 G 	IO.RTI= 016400 G 	IS.ESC= 015401 G
IE.EOT= 177702 G 	IE.RER= 177740 G 	IO.DTI= 016000 G 	IO.RTK= 000060 G 	IS.PND= 000000 G
IE.EOV= 177765 G 	IE.RNM= 177715 G 	IO.ENA= 006000 G 	IO.RVB= 010400 G 	IS.RDD= 000002 G
IE.EXP= 177676 G 	IE.RSU= 177757 G 	IO.EOF= 003000 G 	IO.RWD= 002400 G 	IS.SET= 000002 G
IE.FEX= 177717 G 	IE.SDP= 177635 G 	IO.ESA= 002500 G 	IO.RWU= 002540 G 	IS.SUC= 000001 G
IE.FHE= 177705 G 	IE.SNC= 177735 G 	IO.EXT= 011400 G 	IO.R1C= 002400 G 	QI.VER= 000300 G
IE.FOP= 177713 G 	IE.SPC= 177772 G 	IO.FDX= 003020 G 	IO.SAO= 004000 G 	$$MSG = 000000
IE.HFU= 177744 G 	IE.SQC= 177734 G 	IO.FNA= 004400 G 	IO.SCS= 013000 G 	...GBL= 000001
IE.HWR= 177772 G 	IE.SRE= 177762 G 	IO.HDX= 003010 G

. ABS.	000000	   000
      	000000	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  7810 WORDS  ( 31 PAGES)
DYNAMIC MEMORY:  8384 WORDS  ( 32 PAGES)
ELAPSED TIME:  00:01:11
[46,10]QIOSYM,[46,20]QIOSYM/-SP=[30,30]QIOMAC,[46,30]QIOSYM
RDRN 0100MS, READ NEXT BLOCK RA	MACRO M1108  05-DEC-77 22:19  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
RDRN 0100MS, READ NEXT BLOCK RA	MACRO M1108  05-DEC-77 22:19  PAGE 7


						.TITLE	RDRN 0100MS, READ NEXT BLOCK RANDOM
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 21-AUG-73
     21					;
     22					; READ THE NEXT BLOCK FROM THE FILE, WRITING THE CURRENT ONE
     23					; IF THE "DIRTY BIT" IS SET, ALL REGISTERS DESTROYED, EXCEPT R0
     24	000000	132760 	000001 	000000G	..RDRN::BITB	#FD.WRT,F.BKP1(R0) ;MUST WE WRITE THE BLOCK
     25	000006	001412 				BEQ	10$		;BRANCH IF NO
     26	000010					CALL	..WTWA
     27	000014	162760 	000001 	000002G		SUB	#1,F.VBN+2(R0)	;DECREMENT VBN BECAUSE ..WTWA BUMPED IT
     28	000022	005660 	000000G			SBC	F.VBN(R0)
     29	000026	105760 	000000G			TSTB	F.ERR(R0)
     30	000032	003405 				BLE	20$		;BRANCH IF ERROR WRITING
     31	000034				10$:	CALL	..RWAT
     32	000040	105760 	000000G			TSTB	F.ERR(R0)	;ANY ERRORS? - CLEARS CARRY BIT
     33	000044	003001 				BGT	30$
     34	000046	000261 			20$:	SEC
     35	000050				30$:	RETURN
     36					;
     37					;
     38	000052					$END	RDRN
     39					;
     40					;
     41		000001 				.END
RDRN 0100MS, READ NEXT BLOCK RA	MACRO M1108  05-DEC-77 22:19  PAGE 7-1
SYMBOL TABLE

BD.FRE= 000001   	F.VBN = ****** GX	N.DRPT= 000006   	R$$DPB= 000001   	SYDEV = 054523
DIRTYP= 015172   	HA.CHU= 000003   	N.DRSZ= 000004   	R$$EIS= 000000   	SYUNIT= 000000
FCSEFN= 000040   	HA.FP = 000002   	N.DVPT= 000002   	R$$LCL= 000000   	WI.DLK= 000002
FD.DVR= 000020   	HA.NAM= 000005   	N.DVSZ= 000000   	R$$MUL= 000000   	WI.LCK= 000001
FD.EFB= 000004   	HA.TYP= 000006   	N.FNPT= 000012   	R$$OPF= 000000   	$$    = 000067
FD.EF1= 000010   	HA.UAT= 000004   	N.FNSZ= 000010   	R$$RSL= 000000   	..RDRN  000000RG
FD.EOF= 000002   	HA.UI = 000001   	PP.SEP= 000002   	R$$SEQ= 000000   	..RWAT= ****** GX
FD.WRT= 000001   	HA.VER= 000007   	PP.ZER= 000001   	R$$SPL= 000000   	..WTWA= ****** GX
F.BKP1= ****** GX	NB.DOT= 100000   	R$$ANI= 000000   	R$$11M= 000001   	...CTL= 000001
F.ERR = ****** GX	NB.SMI= 040000   	R$$BBF= 000000

. ABS.	000000	   000
      	000052	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2519 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]RDRN,[41,20]RDRN/-SP=[41,30]FCSPRE,RDRN
RDWAIT 0101S, READ VBN AND WAIT	MACRO M1108  05-DEC-77 22:19  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
RDWAIT 0101S, READ VBN AND WAIT	MACRO M1108  05-DEC-77 22:19  PAGE 7


						.TITLE	RDWAIT 0101S, READ VBN AND WAIT
						.IDENT	/0101S/
      2					; ALTERED MONDAY 25-FEB-74 13:05
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 16-AUG-73
     21					;
RDWAIT 0101S, READ VBN AND WAIT	MACRO M1108  05-DEC-77 22:19  PAGE 8


     23					;+
     24					; READ AND WAIT FOR I/O DONE
     25					; CALLING SEQUENCE:
     26					;	CALL	..RWAT		;READ NEXT VBN
     27					;	CALL	..RWAC		;READ CURRENT VBN
     28					; INPUTS:
     29					;	RO=FDB
     30					;	F.BDB(R0)+#S.BFHD = BUFFER ADDRESS
     31					;	F.BBFS(R0) = NO. OF BYTES TO READ
     32					; OUTPUTS:
     33					;	C=0 IF NO ERROR C=1 IF ERROR, F.ERR SET
     34					;	R0 PRESERVED R1-R5 ALTERED
     35					;	F.NREC(R0)=ADDRESS OF 1ST BYTE OF DATA FOR VBN
     36					;	F.EOBB(R0)=ADDR OF LAST +1 BYTE IN DESIRED VBN
     37					; OPERATION:
     38					;	USE ..RWAT FOR RECORD ORIENTED TRANSFERS
     39					; NOT RWDATC.
     40					;-
     41	000000				..RWAT::
     42	000000	132760 	000000G	000000G		BITB	#FD.REC,F.RCTL(R0)
     43	000006	001016 				BNE	RDWA05
     44	000010	062760 	000001 	000002G		ADD	#1,F.VBN+2(R0)
     45	000016	005560 	000000G			ADC	F.VBN(R0)
     46	000022				..RWAC::CALL	..SEFB
     47	000026	103006 				BCC	10$
     48	000030	016001 	000000G			MOV	F.BDB(R0),R1
     49	000034					CALL	..BDRC		;SET NREC AND EOBB
     50	000040	000261 				SEC
     51	000042					RETURN
     52	000044				10$:
     53						.IF	GT,R$$BBF	;BUFFERS BIGGER THAN 1 BLOCK
     54						MOV	F.BDB(R0),R1
     55						BITB	#BD.FRE,B.BFST(R1)
     56						BNE	RDWA05
     57						CALL	INMBB		;IS DESIRED VBN IN THIS BUFFER
     58						BCC	RDWA15		;IF YES, ALL DONE, EXIT
     59						.ENDC
     60	000044				RDWA05:
     61						.IF	GT,R$$MBF	;MULTIPLE BUFFERING
     62						BITB	#FD.RAH,F.MBFG(R0) ;ARE WE DOING READ AHEAD?
     63						BNE	RDWTMB		;BRANCH IF YES
     64						MOV	F.BDB(R0),R1
     65						CALL	..BDRC
     66						.ENDC
     67					; SINGLE BUFFERING
     68	000044				RDWA10:	CALL	..BKRG
     69	000050					CALL	..RBLK
     70	000054					CALL	..WAST
     71	000060	103401 				BCS	RDWA20
     72	000062				RDWA15:	RETURN
     73	000064				RDWA20:	CALL	..WAND		;WAIT FOR NODE IF OUT OF NODES
     74	000070	103365 				BCC	RDWA10
     75						.IF	GT,R$$BBF
     76						CALL	RSTEOF		;IGNORE EOF ERROR
     77						.ENDC
     78	000072					RETURN
     79					; THIS CODE HANDLES MULTIPLE BUFFERS AND READ AHEAD
RDWAIT 0101S, READ VBN AND WAIT	MACRO M1108  05-DEC-77 22:19  PAGE 8-1


     80						.IF	GT,R$$MBF
     81					RDWTMB:
     82						MOV	F.BDB(R0),R4	;R4=ADR OF BUFFER CONTROL BLOCK
     83						CLR	R5
     84						BISB	F.MBC1(R0),R5	;R5=NO OF BUFFERS IN RING
     85						BR	40$		;GOT TO BOTTOM OF LOOP-SKIP 1ST BUFFER
     86					; SEE IF NEXT BUFFER IN BUFFER RING HAS I/O DONE AND
     87					; CONTAINS THE DESIRED VBN
     88					10$:	TSTB	@R4		;WAIT FOR I/O DONE
     89						BNE	20$
     90						CALL	..WAEF
     91						BR	10$
     92					20$:	BITB	#BD.FRE,B.BFST(R4)
     93						BNE	45$		;BRANCH IF BUFFER CONTAINS NO DATA
     94					; NEXT BUFFER IS READY - IF RECORD MODE THEN THIS IS THE
     95					; DESIRED ONE - OTHERWISE CHECK VBN
     96						BITB	#FD.REC,F.RCTL(R0)
     97						BNE	50$
     98						.IF	GT,R$$BBF
     99						MOV	R5,-(SP)
    100						CALL	INMBB1
    101						MOV	(SP)+,R5
    102						MOV	F.BDB(R0),R4
    103						BCC	60$
    104						.ENDC
    105						.IF	EQ,R$$BBF
    106						CMP	F.VBN(R0),B.VBN(R4)
    107						BNE	40$
    108						CMP	F.VBN+2(R0),B.VBN+2(R4)
    109						BEQ	50$
    110						.ENDC
    111					40$:	BISB	#BD.FRE,B.BFST(R4)
    112					45$:	MOV	B.NXBD(R4),R4	;GET NEXT BUFFER ADDR
    113						MOV	R4,F.BDB(R0)
    114						SOB	R5,10$
    115					; NOTE THAT DESIRED VBN MUST ALSO BE READ
    116						CLR	F.EOBB(R0)
    117						BR	RDWTRA
    118					; BUFFER IN R4=F.BDB CONTAINS DESIRED VBN,
    119					; MUST  SET F.NREC, F.EOBB
    120					50$:	MOV	R4,R5
    121						ADD	#S.BFHD,R5
    122						MOV	R5,F.NREC(R0)
    123						ADD	2(R4),R5
    124						MOV	R5,F.EOBB(R0)
    125					; IF MULTIPLE BLOCK BUFFER REENTERS THE STREAM HERE WITH
    126					; F.NREC, F.EOBB ALL SET UP
    127						.IF	GT,R$$BBF
    128					60$:	MOV	R4,R1
    129						MOVB	@R1,F.ERR(R0)
    130						CALL	RSTEOF
    131						BCC	RDWTRA
    132						RETURN
    133						.ENDC
    134						.IF	EQ,R$$BBF
    135						MOVB	@R4,F.ERR(R0)
    136						BGT	RDWTRA
RDWAIT 0101S, READ VBN AND WAIT	MACRO M1108  05-DEC-77 22:19  PAGE 8-2


    137						SEC
    138						RETURN
    139						.ENDC
    140					; START READ AHEAD FOR ALL FREE BUFFERS IN RING
    141					; R4=F.BDB(R0)=BUFFER ADDRESS
    142					RDWTRA:
    143						CLR	R5
    144						BISB	F.MBC1(R0),R5	;R5=NO. OF BUFFERS IN RING
    145					; EOBB CONTAINS 0  WHEN ALL BUFFERS NEED TO BE READ INTO
    146						TST	F.EOBB(R0)
    147						BNE	50$		;BRANCH IF 1ST BUFFER IS ALL SET.
    148						MOV	F.VBN(R0),R1	;DESIRED VBN FOR 1ST BUFFER
    149						MOV	F.VBN+2(R0),R2
    150						BR	40$
    151					; R1,R2=VBN USED IN LAST READ, R4=NEXT BUFFER
    152					20$:	BITB	#FD.REC,F.RCTL(R0) ;IF RECORD DEVICE
    153						BNE	26$		;DON'T CHECK VBN FOR END OF FILE
    154						.IF	GT,R$$BBF	;LARGE BLOCK BUFFERS
    155						MOVB	F.BGBC(R0),R3	;BIG BUFFER BLOCK COUNT
    156						ADD	R3,R2
    157						.ENDC
    158						.IF	EQ,R$$BBF
    159						ADD	#1,R2
    160						.ENDC
    161						ADC	R1		;R1,R2=NEXT VNB TO USE
    162					; TERMINATE READ AHEAD SCAN IF BEYOND EFBK
    163						CMP	R1,F.EFBK(R0)
    164						BNE	24$
    165						CMP	R2,F.EFBK+2(R0)
    166					24$:	BHI	80$		;BRANCH IF BEYOND EOF
    167						BLO	26$		;BRANCH IF BEFORE EOF
    168						TST	F.FFBY(R0)	;IF ZERO, THEN BEYOND EOF
    169						BEQ	80$
    170					26$:	BITB	#BD.FRE,B.BFST(R4) ;IF BUFFER IS BUSY
    171						BNE	40$		;BRANCH IF FREE
    172					; THIS BUFFER CONTAINS DATA OR WILL WHEN IO DONE.
    173					; IF ITS THE RIGHT VBN, THEN PROCEED WITH SCAN.
    174					; IF NOT AND IO IS DONE, THEN ISSUE QIO FOR DESIRED
    175					; VBN, AND FINALLY IF IO PENDING, THEN TERMINATE
    176					; READ AHEAD SCAN.
    177						CMP	R1,B.VBN(R4)
    178						BNE	30$
    179						CMP	R2,B.VBN+2(R4)
    180						BEQ	60$		;BRANCH IF VBN IS THE SAME
    181					30$:	TSTB	@R4
    182						BEQ	80$		;IF IO PENDING, STOP SCAN
    183					40$:	MOV	R1,B.VBN(R4)	;SET DESIRED VBN
    184						MOV	R2,B.VBN+2(R4)
    185						MOV	F.BBFS(R0),B.BBFS(R4) ;NO OF BYTES TO READ
    186						BICB	#BD.FRE,B.BFST(R4) ;NOTE BUFFER BUSY
    187					45$:	MOV	F.BDB(R0),-(SP)
    188						MOV	R5,-(SP)
    189						MOV	R4,F.BDB(R0)
    190						CALL	..BKRG
    191						CALL	..RBLK
    192						MOV	F.BDB(R0),R4
    193						MOV	(SP)+,R5
RDWAIT 0101S, READ VBN AND WAIT	MACRO M1108  05-DEC-77 22:19  PAGE 8-3


    194						MOV	(SP)+,F.BDB(R0)
    195						BCC	50$
    196					; IF OUT OF NODE ERROR AND IF THIS BUFFER IS THE ONE THE
    197					; USER WANTS NEXT (AS OPPOSED TO READ AHEAD) THEN
    198					; WAIT FOR A NODE. OTHERWISE TERMINATE THE READ
    199					; AHEAD
    200						CMP	R4,F.BDB(R0)
    201						BNE	80$		;BRANCH IS READ AHEAD BUFFER
    202						CALL	..WAND		;WAIT FOR A NODE
    203						BCC	45$		;TRY THE QIO AGAIN
    204						BR	80$		;BRANCH IF NOT OUT OF NODE ERROR
    205					;
    206					; R4 = BUFFER ADDRESS OF PENDING OR COMPLETE READ
    207					; SET UP TO START A READ ON THE NEXT BUFFER
    208					; ON RECORD DEVICE, MUST NOT START NEXT READ UNLESS PREVIOUS
    209					; IS COMPLETE AND SUCCESSFUL
    210					;
    211					50$:	BITB	#FD.REC,F.RCTL(R0) ;IF RECORD DEVICE
    212						BEQ	55$
    213						CMP	#1,R5		;AND NOT THE LAST BUFFER
    214						BEQ	55$
    215						MOV	R4,R1
    216						CALL	..WAIT		;WAIT FOR I/O DONE
    217						BCS	80$		;TERMINATE READ AHEAD SCAN IF ERROR
    218					55$:	MOV	B.VBN(R4),R1
    219						MOV	B.VBN+2(R4),R2
    220					60$:	MOV	B.NXBD(R4),R4
    221						DEC	R5
    222						BNE	20$
    223					; END OF READ AHEAD SCAN, IF EOBB CONTAINS 0, THEN
    224					; DESIRED VBN IS NOT READY. IF EOBB CONTAINS 1
    225					; THEN DON'T WAIT FOR THIS VBN TO BE READY
    226					; CALLED BY OPEN TO START READ AHEAD
    227					80$:	TST	F.EOBB(R0)
    228						BNE	90$
    229						MOV	F.BDB(R0),R1
    230						CALL	..WAST		;WAIT AND SET NREC,EOBB
    231						.IF	GT,R$$BBF
    232						CALL	RSTEOF
    233						.ENDC
    234						RETURN
    235					90$:	CALL	..FCSX
    236						RETURN
    237						.ENDC			;END OF MULTIPLE BUFFER READ AHEAD CODE
    238					;
    239					;
    240	000074					$END	RDWAIT
    241					;
    242					;
    243		000001 				.END
RDWAIT 0101S, READ VBN AND WAIT	MACRO M1108  05-DEC-77 22:19  PAGE 8-4
SYMBOL TABLE

BD.FRE= 000001   	HA.CHU= 000003   	N.DVSZ= 000000   	R$$EIS= 000000   	WI.LCK= 000001
DIRTYP= 015172   	HA.FP = 000002   	N.FNPT= 000012   	R$$LCL= 000000   	$$    = 000067
FCSEFN= 000040   	HA.NAM= 000005   	N.FNSZ= 000010   	R$$MBF= 000000   	..BDRC= ****** GX
FD.DVR= 000020   	HA.TYP= 000006   	PP.SEP= 000002   	R$$MUL= 000000   	..BKRG= ****** GX
FD.EFB= 000004   	HA.UAT= 000004   	PP.ZER= 000001   	R$$OPF= 000000   	..RBLK= ****** GX
FD.EF1= 000010   	HA.UI = 000001   	RDWA05  000044R  	R$$RSL= 000000   	..RWAC  000022RG
FD.EOF= 000002   	HA.VER= 000007   	RDWA10  000044R  	R$$SEQ= 000000   	..RWAT  000000RG
FD.REC= ****** GX	NB.DOT= 100000   	RDWA15  000062R  	R$$SPL= 000000   	..SEFB= ****** GX
FD.WRT= 000001   	NB.SMI= 040000   	RDWA20  000064R  	R$$11M= 000001   	..WAND= ****** GX
F.BDB = ****** GX	N.DRPT= 000006   	R$$ANI= 000000   	SYDEV = 054523   	..WAST= ****** GX
F.RCTL= ****** GX	N.DRSZ= 000004   	R$$BBF= 000000   	SYUNIT= 000000   	...CTL= 000001
F.VBN = ****** GX	N.DVPT= 000002   	R$$DPB= 000001   	WI.DLK= 000002

. ABS.	000000	   000
      	000074	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2556 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:14
[41,10]RDWAIT,[41,20]RDWAIT/-SP=[41,30]FCSPRE,RDWAIT
RDWRIT 0102MS, COMMON ROUTINES 	MACRO M1108  05-DEC-77 22:19  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
RDWRIT 0102MS, COMMON ROUTINES 	MACRO M1108  05-DEC-77 22:19  PAGE 7


						.TITLE	RDWRIT 0102MS, COMMON ROUTINES FOR READ AND WRITE
						.IDENT	/0102MS/
      2					; ALTERED WEDNESDAY 13-FEB-74 16:45
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 11-AUG-73
     21					;
RDWRIT 0102MS, COMMON ROUTINES 	MACRO M1108  05-DEC-77 22:19  PAGE 8


     23					;+
     24					; VERIFY READ/WRITE PARAMETERS
     25					; CALLING SEQUENCE:
     26					;	CALL	..RWCK
     27					; INPUTS:
     28					;	R0=FDB
     29					; OUTPUTS:
     30					;	C=0 IF READ/WRITE IS OK
     31					;	C=1 IF NOT LEGAL, F.ERR SET TO REASON
     32					;	ALL REGISTERS PRESERVED
     33					; OPERATION:
     34					;	CHECKS THAT FILE IS OPEN IN READ/WRITE MODE,
     35					; THAT DEVICE IS BLOCK ORIENTED AND THAT BYTE COUNT IS
     36					; NO GREATER THAN THE BLOCK SIZE
     37					;-
     38	000000	005760 	000000G		..RWCK::TST	F.BDB(R0)
     39	000004	001422 				BEQ	20$		;BRANCH IF FILE NOT OPEN
     40	000006	132760 	000000G	000000G		BITB	#FD.RWM,F.RACC(R0)  ;READ/WRITE BIT MUST BE SET
     41	000014	001416 				BEQ	20$
     42	000016	132760 	000000G	000000G		BITB	#FD.REC,F.RCTL(R0)  ;ILLEGAL IF RECORD ORIENTED DEVICE
     43	000024	001012 				BNE	20$
     44	000026	026060 	000000G	000000G		CMP	F.BKDS(R0),F.VBSZ(R0)  ;MUST BE 1 BLOCK OR LESS FOR NOW
     45	000034	003002 				BGT	10$
     46	000036	000241 				CLC
     47	000040					RETURN
     48
     49	000042	112760 	000000G	000000G	10$:	MOVB	#IE.MBK,F.ERR(R0)
     50	000050	000403 				BR	30$
     51	000052	112760 	000000G	000000G	20$:	MOVB	#IE.ILL,F.ERR(R0)
     52	000060	000261 			30$:	SEC
     53	000062					RETURN
     54					;+
     55					; COMMON CODE FOR READ/WRITE - ISSUE THE QI/O AND BUMP THE
     56					; VBN
     57					; CALLING SEQUENCE:
     58					;	CALL	..WTRD
     59					; INPUTS:
     60					;	R0=FDB
     61					;	R4=I/O FUNCTION CODE FOR READ/WRITE LOGICAL BLOCK
     62					; OUTPUTS:
     63					;	R0 PRESERVED R1-R5 DESTROYED
     64					;	C=0 FOR SUCCESS, C=1 FOR ERROR, F.ERR IS SET
     65					;-
     66	000064	012760 	000001 	000000G	..WTRD::MOV	#1,F.ERR(R0)	;INIT ERROR CODE TO SUCCESSFUL
     67	000072					CALL	..IDPB		;INIT THE DPB AND SET R5 TO PARAM BLOCK
     68	000076	016025 	000002G			MOV	F.BKDS+2(R0),(R5)+ ;ADDRESS TO TRANSFER
     69	000102	016025 	000000G			MOV	F.BKDS(R0),(R5)+ ;SIZE IN BYTES OF TRANSFER
     70	000106	005025 				CLR	(R5)+		;NO CARRIAGE CONTROL
     71	000110	016025 	000000G			MOV	F.BKVB(R0),(R5)+ ;HIGH ORDER VBN
     72	000114	016015 	000002G			MOV	F.BKVB+2(R0),(R5) ;LOW ORDER VBN
     73	000120	162705 	000024 			SUB	#10.*2,R5	;R5 BACK TO BEGINNING OF DPB
     74	000124	016001 	000000G			MOV	F.BKST(R0),R1	;R1=I/O STATUS BLOCK ADDRESS
     75	000130	016002 	000000G			MOV	F.BKDN(R0),R2	;R2=I/O DONE AST ADDRESS OR 0 IF NONE
     76	000134	012703 	006001 			MOV	#12.*400+1,R3	;R3=DIRECTIVE CODE AND DPB SIZE
     77	000140					CALL	..XQI1		;ISSUE THE QI/O
     78	000144	103406 				BCS	20$		;BRANCH IF QI/O FAILED
     79	000146	062760 	000001 	000002G		ADD	#1,F.VBN+2(R0)	;INCREMENT THE VBN FOR AUTOMATIC
RDWRIT 0102MS, COMMON ROUTINES 	MACRO M1108  05-DEC-77 22:19  PAGE 8-1


     80	000154	005560 	000000G			ADC	F.VBN(R0)	;SEQUENTIAL OPERATION - C =0
     81	000160					RETURN
     82
     83	000162	013760 	000000G	000000G	20$:	MOV	@#$DSW,F.ERR(R0)  ;RETURN QI/O ERROR CODE IN F.ERR
     84	000170					RETURN
     85					;
     86					;
     87	000172					$END	RDWRIT
     88					;
     89					;
     90		000001 				.END
RDWRIT 0102MS, COMMON ROUTINES 	MACRO M1108  05-DEC-77 22:19  PAGE 8-2
SYMBOL TABLE

BD.FRE= 000001   	F.BKST= ****** GX	HA.UI = 000001   	PP.SEP= 000002   	R$$11M= 000001
DIRTYP= 015172   	F.BKVB= ****** GX	HA.VER= 000007   	PP.ZER= 000001   	SYDEV = 054523
FCSEFN= 000040   	F.ERR = ****** GX	IE.ILL= ****** GX	R$$ANI= 000000   	SYUNIT= 000000
FD.DVR= 000020   	F.RACC= ****** GX	IE.MBK= ****** GX	R$$BBF= 000000   	WI.DLK= 000002
FD.EFB= 000004   	F.RCTL= ****** GX	NB.DOT= 100000   	R$$DPB= 000001   	WI.LCK= 000001
FD.EF1= 000010   	F.VBN = ****** GX	NB.SMI= 040000   	R$$EIS= 000000   	$DSW  = ****** GX
FD.EOF= 000002   	F.VBSZ= ****** GX	N.DRPT= 000006   	R$$LCL= 000000   	$$    = 000067
FD.REC= ****** GX	HA.CHU= 000003   	N.DRSZ= 000004   	R$$MUL= 000000   	..IDPB= ****** GX
FD.RWM= ****** GX	HA.FP = 000002   	N.DVPT= 000002   	R$$OPF= 000000   	..RWCK  000000RG
FD.WRT= 000001   	HA.NAM= 000005   	N.DVSZ= 000000   	R$$RSL= 000000   	..WTRD  000064RG
F.BDB = ****** GX	HA.TYP= 000006   	N.FNPT= 000012   	R$$SEQ= 000000   	..XQI1= ****** GX
F.BKDN= ****** GX	HA.UAT= 000004   	N.FNSZ= 000010   	R$$SPL= 000000   	...CTL= 000001
F.BKDS= ****** GX

. ABS.	000000	   000
      	000172	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2630 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[41,10]RDWRIT,[41,20]RDWRIT/-SP=[41,30]FCSPRE,RDWRIT
READ 0100MS, FCS READ VIRTUAL B	MACRO M1108  05-DEC-77 22:19  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
READ 0100MS, FCS READ VIRTUAL B	MACRO M1108  05-DEC-77 22:19  PAGE 7


						.TITLE	READ 0100MS, FCS READ VIRTUAL BLOCK
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 16-JULY-73
     21					;
READ 0100MS, FCS READ VIRTUAL B	MACRO M1108  05-DEC-77 22:19  PAGE 8


     23					;+
     24					; ISSUE QI/O TO READ VIRTUAL BLOCK READ/WRITE MODE
     25					; CALLING SEQUENCE:
     26					;	CALL	.READ
     27					; INPUTS:
     28					;	F.BKVB(R0),F.BDVB+2(R0)=DESIRED VIRTUAL BLOCK NUMBER
     29					;	F.BKDS(R0)=NO OF BYTES TO READ
     30					;	F.BKDS+2(R0)ADDRESS TO READ DATA INTO
     31					;	F.BKEF(R0)=EVENT FLAG USE FCS DEFAULT IF 0
     32					;	F.BKST(R0)=ADDRESS OF I/O STATUS BLOCK OR 0
     33					;	F.BKDN(R0)=ADDRESS OF I/O DONE AST OF 0
     34					; OUTPUTS:
     35					;	C=0 IF QI/O WAS ISSUED SUCCESSFULLY
     36					;	C=1 IF ERROR, F.ERR(R0) SET TO ERROR CODE
     37					;	ALL REGISTERS PRESERVED
     38					;	F.BKVB(R0),F.BKVB+2(R0) IS INCREMENTED AFTER QI/O
     39					; OPERATION:
     40					;	WILL RETURN EOF ERROR IF THE SPECIFIED VBN
     41					; IS BEYOND THE END OF FILE. RETURNS THE LOW BYTE OF
     42					; THE DIRECTIVE STATUS WORD IN F.ERR(R0) IF QI/O FAILED.
     43					; INCREMENTS THE VIRTUAL BLOCK NUMBER AFTER ISSUING THE
     44					; QI/O FOR AUTOMATIC SEQUENTIAL ACCESS. THE FOLLOWING
     45					; RESTRICTIONS APPLY:
     46					;	1) THIS ROUTINE ONLY WORKS FOR BLOCK ORIENTED
     47					; DEVICE, RECORD ORIENTED DEVICES ARE EXPLICITLY EXCLUDED.
     48					;	2) THE NUMBER OF BYTES TO TRANSFER IS LIMITED TO
     49					; NO MORE THAN 1 BLOCK (512. BYTES).
     50					;-
     51	000000				.READ::	.SAVR1
     52	000004					CALL	..RWCK
     53	000010	103407 				BCS	10$
     54	000012					CALL	..SEFB
     55	000016	103404 				BCS	10$
     56	000020	012704 	000000G			MOV	#IO.RVB,R4
     57	000024					CALL	..WTRD		;ISSUE THE QI/O
     58	000030				10$:	RETURN
     59					;
     60					;
     61	000032					$END	READ
     62					;
     63					;
     64		000001 				.END
READ 0100MS, FCS READ VIRTUAL B	MACRO M1108  05-DEC-77 22:19  PAGE 8-1
SYMBOL TABLE

BD.FRE= 000001   	HA.NAM= 000005   	N.DVPT= 000002   	R$$LCL= 000000   	WI.DLK= 000002
DIRTYP= 015172   	HA.TYP= 000006   	N.DVSZ= 000000   	R$$MUL= 000000   	WI.LCK= 000001
FCSEFN= 000040   	HA.UAT= 000004   	N.FNPT= 000012   	R$$OPF= 000000   	$$    = 000067
FD.DVR= 000020   	HA.UI = 000001   	N.FNSZ= 000010   	R$$RSL= 000000   	.READ   000000RG
FD.EFB= 000004   	HA.VER= 000007   	PP.SEP= 000002   	R$$SEQ= 000000   	.SAVR1= ****** GX
FD.EF1= 000010   	IO.RVB= ****** GX	PP.ZER= 000001   	R$$SPL= 000000   	..RWCK= ****** GX
FD.EOF= 000002   	NB.DOT= 100000   	R$$ANI= 000000   	R$$11M= 000001   	..SEFB= ****** GX
FD.WRT= 000001   	NB.SMI= 040000   	R$$BBF= 000000   	SYDEV = 054523   	..WTRD= ****** GX
HA.CHU= 000003   	N.DRPT= 000006   	R$$DPB= 000001   	SYUNIT= 000000   	...CTL= 000001
HA.FP = 000002   	N.DRSZ= 000004   	R$$EIS= 000000

. ABS.	000000	   000
      	000032	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2509 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]READ,[41,20]READ/-SP=[41,30]FCSPRE,READ
RENAME 0100MS, RENAME FILE	MACRO M1108  05-DEC-77 22:20  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
RENAME 0100MS, RENAME FILE	MACRO M1108  05-DEC-77 22:20  PAGE 7


						.TITLE	RENAME 0100MS, RENAME FILE
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 17-AUG-73
     21					;
RENAME 0100MS, RENAME FILE	MACRO M1108  05-DEC-77 22:20  PAGE 8


     23
     24					;+
     25					; CLOSE (IF NECESSARY) AND RENAME AN EXISTING FILE TO A NEW NAME.
     26					; CALLING SEQUENCE:
     27					;	CALL	.RENAM
     28					; INPUTS:
     29					;	R0=FDB ADDRESS OF EXISTING FILE, CAN BE OPEN OR CLOSED
     30					;	R1=FDB WITH THE NEW FILE NAME TO USE
     31					; OUTPUTS:
     32					;	C=0 FOR SUCCESS, C=1 FOR ERROR F.ERR TELLS WHAT KIND
     33					;	R0 FDB WILL BE CLOSED IF IT WAS OPEN
     34					;	ALL REGISTERS PRESERVED
     35					;-
     36	000000				.RENAM::.SAVR1
     37	000004	012760 	000001 	000000G		MOV	#1,F.ERR(R0)	;INIT ERROR CODE TO SUCCESSFUL
     38	000012	010046 				MOV	R0,-(SP)
     39	000014	010146 				MOV	R1,-(SP)	;SAVE THE FDB ADDRESSES
     40	000016	016002 	000000G			MOV	F.FNB(R0),R2	;CLOSE FILE IF NECESSARY SAVING FILE ID
     41	000022					CLOSE$	R0
     42	000026	103511 				BCS	RENMX1
     43	000030	010260 	000000G			MOV	R2,F.FNB(R0)
     44					;
     45	000034					CALL	..STFN		;DO THE PARSE FOR THE EXISTING FILE
     46									;UNLESS FNB IS ALREADY SET UP
     47	000040	103504 				BCS	RENMX1
     48	000042	005711 				TST	@R1		;SKIP THE FIND IF THE FILE ID IS SET
     49	000044	001003 				BNE	10$
     50	000046					CALL	..FIND		;LOOKUP THE FILE AND MAKE SURE IT'S REAL
     51	000052	103477 				BCS	RENMX1		;BRANCH IF IT DOESN'T EXIST
     52					;
     53					; NOW SEE IF NEW FILE NAME IS OK, MUST NOT ALREADY BE IN USE!
     54	000054	011600 			10$:	MOV	@SP,R0
     55	000056					CALL	..STFN		;DO PARSE IF NECESSARY
     56	000062	103465 				BCS	RENMX3
     57	000064	005761 	000000G			TST	N.FVER(R1)	;IF EXPLICIT VERSION NUMBER
     58	000070	001412 				BEQ	20$
     59	000072					CALL	..FIND		;THEN MUST SEE IF FILE EXISTS
     60	000076	103054 				BCC	RNMBX2		;BRANCH IF IT DOES, ERROR
     61	000100	122760 	000000G	000000G		CMPB	#IE.NSF,F.ERR(R0) ;MUST HAVE RETURNED "NO SUCH FILE"
     62	000106	001053 				BNE	RENMX3		;ERROR IF IT DIDN'T
     63	000110	012760 	000001 	000000G		MOV	#1,F.ERR(R0)	;RESET THE ERROR CONDITION
     64					;
     65					; NOW VERIFY THAT BOTH FDB'S REFER TO THE SAME DEVICE AND UNIT
     66	000116	016601 	000002 		20$:	MOV	2(SP),R1	;R1=EXISTING FILE FDB
     67	000122	026061 	000000G	000000G		CMP	F.DVNM(R0),F.DVNM(R1) ;IF NOT SAME DEVICE AND UNIT,
     68	000130	001033 				BNE	RNMBX3		;THEN CANNOT RENAME
     69	000132	026061 	000000G	000000G		CMP	F.UNIT(R0),F.UNIT(R1)
     70	000140	001027 				BNE	RNMBX3
     71
     72	000142	016160 	000000G	000000G		MOV	F.FNB(R1),F.FNB(R0) ;MOVE EXISTING FILE ID TO
     73	000150	016160 	000002G	000002G		MOV	F.FNB+2(R1),F.FNB+2(R0) ;THE NEW NAME FDB
     74	000156	016160 	000004G	000004G		MOV	F.FNB+4(R1),F.FNB+4(R0)
     75
     76	000164	010001 				MOV	R0,R1
     77	000166	062701 	000000G			ADD	#F.FNB,R1	;R1=FNB ADDRESS
     78	000172					CALL	..ENTR		;..ENTR THE NEW FILENAME
     79	000176	103417 				BCS	RENMX3
RENAME 0100MS, RENAME FILE	MACRO M1108  05-DEC-77 22:20  PAGE 8-1


     80
     81	000200	016600 	000002 			MOV	2(SP),R0	;R0=EXISTING FILE FDB
     82	000204	010001 				MOV	R0,R1
     83	000206	062701 	000000G			ADD	#F.FNB,R1
     84	000212					CALL	..RMOV		;REMOVE THE EXISTING NAME
     85	000216	000415 				BR	RENMX1
     86					;
     87					; ERROR EXITS WITH R0 = FDB OF NEW FILE NAME
     88	000220	112760 	000000G	000000G	RNMBX3:	MOVB	#IE.2DV,F.ERR(R0) ;CANNOT RENAME ACROSS DEVICES
     89	000226	000403 				BR	RENMX3
     90	000230	112760 	000000G	000000G	RNMBX2:	MOVB	#IE.FEX,F.ERR(R0) ;NEW FILE NAME ALREADY EXISTS
     91	000236	012601 			RENMX3:	MOV	(SP)+,R1
     92	000240	012600 				MOV	(SP)+,R0
     93	000242	116160 	000000G	000000G		MOVB	F.ERR(R1),F.ERR(R0) ;MOVE THE ERR CODE TO THE REAL FDB
     94	000250	000402 				BR	RENMX2
     95					;
     96					; ERROR EXITS WITH R0 =FDB OF EXISTING FILE
     97	000252	012601 			RENMX1:	MOV	(SP)+,R1
     98	000254	012600 				MOV	(SP)+,R0
     99	000256	005060 	000000G		RENMX2:	CLR	F.FNB(R0)
    100	000262	005061 	000000G			CLR	F.FNB(R1)
    101	000266					CALLR	..FCSX
    102					;
    103					;
    104	000272					$END	RENAME
    105					;
    106					;
    107		000001 				.END
RENAME 0100MS, RENAME FILE	MACRO M1108  05-DEC-77 22:20  PAGE 8-2
SYMBOL TABLE

BD.FRE= 000001   	HA.FP = 000002   	N.DVPT= 000002   	R$$ANI= 000000   	WI.DLK= 000002
DIRTYP= 015172   	HA.NAM= 000005   	N.DVSZ= 000000   	R$$BBF= 000000   	WI.LCK= 000001
FCSEFN= 000040   	HA.TYP= 000006   	N.FNPT= 000012   	R$$DPB= 000001   	$$    = 000067
FD.DVR= 000020   	HA.UAT= 000004   	N.FNSZ= 000010   	R$$EIS= 000000   	.CLOSE= ****** G
FD.EFB= 000004   	HA.UI = 000001   	N.FVER= ****** GX	R$$LCL= 000000   	.RENAM  000000RG
FD.EF1= 000010   	HA.VER= 000007   	PAR$$$= 000000   	R$$MUL= 000000   	.SAVR1= ****** GX
FD.EOF= 000002   	IE.FEX= ****** GX	PP.SEP= 000002   	R$$OPF= 000000   	..ENTR= ****** GX
FD.WRT= 000001   	IE.NSF= ****** GX	PP.ZER= 000001   	R$$RSL= 000000   	..FCSX= ****** GX
F.DVNM= ****** GX	IE.2DV= ****** GX	RENMX1  000252R  	R$$SEQ= 000000   	..FIND= ****** GX
F.ERR = ****** GX	NB.DOT= 100000   	RENMX2  000256R  	R$$SPL= 000000   	..RMOV= ****** GX
F.FNB = ****** GX	NB.SMI= 040000   	RENMX3  000236R  	R$$11M= 000001   	..STFN= ****** GX
F.UNIT= ****** GX	N.DRPT= 000006   	RNMBX2  000230R  	SYDEV = 054523   	...CTL= 000001
HA.CHU= 000003   	N.DRSZ= 000004   	RNMBX3  000220R  	SYUNIT= 000000

. ABS.	000000	   000
      	000272	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2774 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:15
[41,10]RENAME,[41,20]RENAME/-SP=[41,30]FCSPRE,RENAME
RETADR 0100MS, RETURN BUF ADDRE	MACRO M1108  05-DEC-77 22:20  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
RETADR 0100MS, RETURN BUF ADDRE	MACRO M1108  05-DEC-77 22:20  PAGE 7


						.TITLE	RETADR 0100MS, RETURN BUF ADDRESS TO USER
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;                             COPYRIGHT (C) 193, 1978 BY
      4					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      5					;
      6					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      7					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      8					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
      9					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     10					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     11					;
     12					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     13					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     14					;       CORPORATION.
     15					;
     16					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     17					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     18					;
     19					;
     20					; PETER H. LIPMAN 11-AUG-73
     21					;
     22					;+
     23					; RETURN BUFFER ADDRESS TO USER IN PARTIAL LOCATE MODE
     24					; CALLING SEQUENCE:
     25					;	CALL	..RTAD
     26					; INPUTS:
     27					;	R0=FDB ADDRESS
     28					; OUTPUTS:
     29					;	F.NRBD+2 =POINTER TO BLOCK BUFFER OR USER'S RECORD BUFFER
     30					;		IF RECORD WOULDN'T FIT IN BLOCK BUFFER
     31					;	R2 DESTROYED, ALL OTHERS PRESERVED
     32					;-
     33	000000	132760 	000000G	000000G	..RTAD::BITB	#FD.PLC,F.RACC(R0) ;IF NOT LOCATE MODE, THEN NOP
     34	000006	001437 				BEQ	30$
     35	000010	016002 	000000G			MOV	F.NREC(R0),R2
     36	000014	132760 	000000G	000000G		BITB	#FD.REC,F.RCTL(R0) ;RECORD ORIENTED DEVICE?
     37	000022	001005 				BNE	5$		;BRANCH IF YES - SKIP VARIABLE LEN LOGIC
     38	000024	122760 	000000G	000000G		CMPB	#R.VAR,F.RTYP(R0) ;VARIABLE LENGTH RECORDS?
     39	000032	001001 				BNE	5$		;BRANCH IF NO
     40	000034	005722 				TST	(R2)+		;LEAVE ROOM FOR BYTE COUNT
     41	000036	010260 	000002G		5$:	MOV	R2,F.NRBD+2(R0)	;ASSUME MAX SIZE RECORD FITS
     42	000042	016060 	000000G	000000G		MOV	F.URBD(R0),F.NRBD(R0) ;RETURN SIZE OF BUFFER
     43	000050	122760 	000000G	000000G		CMPB	#R.FIX,F.RTYP(R0) ;IF FIXED LENGTH
     44	000056	001003 				BNE	10$
     45	000060	016060 	000000G	000000G		MOV	F.RSIZ(R0),F.NRBD(R0) ;USE FIXED SIZE
     46	000066	066002 	000000G		10$:	ADD	F.NRBD(R0),R2	;SEE IF RECORD WILL FIT
     47	000072	020260 	000000G			CMP	R2,F.EOBB(R0)	;WILL IT FIT?
     48	000076	101403 				BLOS	30$		;BRANCH IF IT WIL
     49	000100	016060 	000002G	000002G		MOV	F.URBD+2(R0),F.NRBD+2(R0) ;MAX RECORD WON'T FIT
     50									;POINT HIM AT HIS RECORD BUFFER
     51	000106				30$:	RETURN
     52					;
     53					;
     54	000110					$END	RETADR
     55					;
     56					;
RETADR 0100MS, RETURN BUF ADDRE	MACRO M1108  05-DEC-77 22:20  PAGE 7-1


     57		000001 				.END
RETADR 0100MS, RETURN BUF ADDRE	MACRO M1108  05-DEC-77 22:20  PAGE 7-2
SYMBOL TABLE

BD.FRE= 000001   	F.NRBD= ****** GX	HA.UAT= 000004   	PP.SEP= 000002   	R$$SPL= 000000
DIRTYP= 015172   	F.NREC= ****** GX	HA.UI = 000001   	PP.ZER= 000001   	R$$11M= 000001
FCSEFN= 000040   	F.RACC= ****** GX	HA.VER= 000007   	R$$ANI= 000000   	R.FIX = ****** GX
FD.DVR= 000020   	F.RCTL= ****** GX	NB.DOT= 100000   	R$$BBF= 000000   	R.VAR = ****** GX
FD.EFB= 000004   	F.RSIZ= ****** GX	NB.SMI= 040000   	R$$DPB= 000001   	SYDEV = 054523
FD.EF1= 000010   	F.RTYP= ****** GX	N.DRPT= 000006   	R$$EIS= 000000   	SYUNIT= 000000
FD.EOF= 000002   	F.URBD= ****** GX	N.DRSZ= 000004   	R$$LCL= 000000   	WI.DLK= 000002
FD.PLC= ****** GX	HA.CHU= 000003   	N.DVPT= 000002   	R$$MUL= 000000   	WI.LCK= 000001
FD.REC= ****** GX	HA.FP = 000002   	N.DVSZ= 000000   	R$$OPF= 000000   	..RTAD  000000RG
FD.WRT= 000001   	HA.NAM= 000005   	N.FNPT= 000012   	R$$RSL= 000000   	...CTL= 000001
F.EOBB= ****** GX	HA.TYP= 000006   	N.FNSZ= 000010   	R$$SEQ= 000000

. ABS.	000000	   000
      	000110	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2575 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[41,10]RETADR,[41,20]RETADR/-SP=[41,30]FCSPRE,RETADR
RQLCB	MACRO M1108  05-DEC-77 23:43  PAGE 2


      1						.TITLE	RQLCB
      2						.IDENT	/03/								;**NEW**
      3															;**-2
      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 6-OCT-72
     22					;
     23					; BEST/FIRST FIT DYNAMIC CORE ALLOCATION ROUTINES
     24					;
     25					; DATA STRUCTURES
     26					;
     27					; FREE BLOCK LIST HEADER:
     28					;
     29					;	FREEHD:	.WORD	NEXT	;POINTER TO NEXT FREE BLOCK OR 0
     30					;		.WORD	0	;ALWAYS ZERO
     31					;
     32					; FREE BLOCK:
     33					;
     34					;	FREEBK:	.WORD	NEXT	;POINTER TO NEXT OR 0
     35					;		.WORD	SIZE	;SIZE OF BLOCK IN BYTES
     36					;
     37					; NOTE: THE FREE BLOCK LIST IS ORDERED BY THE CORE ADDRESS OF THE BLOCKS
     38					;	THEMSELVES. THIS IS SO GARBAGE COLLECTION AND BLOCK AGGLOMERATIO
     39					;	CAN BE PERFORMED WITH LITTLE OVERHEAD.
     40					;+
     41					; **-$RLCB-RELEASE CORE BLOCK
     42					;
     43					; THIS SUBROUTINE IS CALLED TO RELEASE A CORE BLOCK TO THE FREE LIST.
     44					; THE FREE LIST IS SEARCHED UNTIL THE PROPER SLOT IS FOUND AND THE
     45					; BLOCK IS MERGED INTO THE FREE LIST. IF THE BLOCK BEING RELEASED
     46					; CAN BE AGGLOMERATED WITH A BLOCK ALREADY IN THE FREE LIST, THEN THE
     47					; BLOCKS ARE AGGLOMERATED AND THE NEW BLOCK IS MERGED INTO THE FREE
     48					; LIST.
     49					;
     50					; INPUTS:
     51					;
     52					;	R0=ADDRESS OF FREE BLOCK LIST HEAD.
     53					;	R1=SIZE OF BLOCK TO RELEASE IN BYTES.
     54					;	R2=ADDRESS OF BLOCK TO RELEASE.
     55					;
     56					; OUTPUTS:
     57					;
RQLCB	MACRO M1108  05-DEC-77 23:43  PAGE 2-1


     58					;	NONE.
     59					;-
     60
     61	000000					.PSECT	$$RESL								;**NEW**
     62	000000				$RLCB::	SAVRG			;SAVE NONVOLITILE REGISTERS
     63	000004	062701 	000003 			ADD	#3,R1		;ROUND UP TO NEXT 2 WORD BOUNDRY
     64	000010	042701 	000003 			BIC	#3,R1		;CLEAR EXCESS BITS
     65	000014	001431 				BEQ	5$		;IF EQ VERGESSEN!!!
     66	000016	011003 			1$:	MOV	(R0),R3		;GET ADDRESS OF NEXT IN LIST
     67	000020	001404 				BEQ	2$		;IF EQ END OF CHAIN
     68	000022	020203 				CMP	R2,R3		;COMPARE ADDRESSES
     69	000024	103402 				BLO	2$		;IF LO FOUND SLOT
     70	000026	010300 				MOV	R3,R0		;SET NEW PREVIOUS ADDRESS
     71	000030	000772 				BR	1$		;GO AGAIN
     72	000032	010312 			2$:	MOV	R3,(R2)		;ASSUME NO AGGLOMERATION
     73	000034	010204 				MOV	R2,R4		;CALCULATE ADDRESS OF NEXT BLOCK
     74	000036	060104 				ADD	R1,R4		;ADD IN BLOCK SIZE
     75	000040	020304 				CMP	R3,R4		;COMPARE ADDRESSES
     76	000042	001002 				BNE	3$		;IF NE DO NOT MERGE BLOCKS
     77	000044	012312 				MOV	(R3)+,(R2)	;SET NEW FORWARD LINK
     78	000046	061301 				ADD	(R3),R1		;ADJUST SIZE
     79	000050	010210 			3$:	MOV	R2,(R0)		;ASSUME NO AGGLOMERATION
     80	000052	010004 				MOV	R0,R4		;CALCULATE ADDRESS OF NEXT BLOCK
     81	000054	066004 	000002 			ADD	2(R0),R4	;ADD IN BLOCK SIZE
     82	000060	020204 				CMP	R2,R4		;COMPARE ADDRESSES
     83	000062	001004 				BNE	4$		;IF NE DO NOT MERGE
     84	000064	011210 				MOV	(R2),(R0)	;SET NEW FORWARD LINK
     85	000066	066001 	000002 			ADD	2(R0),R1	;ADJUST SIZE
     86	000072	010002 				MOV	R0,R2		;SET NEW BASE ADDRESS OF BLOCK
     87	000074	010162 	000002 		4$:	MOV	R1,2(R2)	;SET SIZE OF BLOCK
     88	000100				5$:	RETURN			;
     89
     90					;+
     91					; **-$RQCB-REQUEST CORE BLOCK
     92					;
     93					; THIS ROUTINE IS CALLED TO REQUEST A CORE BLOCK FROM THE FREE LIST.
     94					; THE SELECTION IS MADE EITHER FIRST FIT OR BEST FIT ACCORDING TO THE
     95					; THE INPUT PARAMETERS.
     96					;
     97					; INPUTS:
     98					;
     99					;	R0=ADDRESS OF FREE BLOCK LIST HEAD.
    100					;	R1=SIZE OF BLOCK REQUESTED IN BYTES.
    101					;		IF R1 IS GE 0, THEN BEST FIT IS USED.
    102					;		IF R1 IS LT 0, THEN FIRST FIT IS USED.
    103					;
    104					;	IN EITHER CASE THE MAGNITUDE OF R1 IS THE SIZE OF THE BLOCK.
    105					;
    106					; OUTPUTS:
    107					;
    108					;	C=1 IF REQUEST CANNOT BE FULFILLED.
    109					;	C=0 IF REQUEST IS SATISFIED.
    110					;		R0=ADDRESS OF REQUESTED CORE BLOCK.
    111					;-
    112
    113	000102				$RQCB::	SAVRG			;SAVE NONVOLITILE REGISTERS
    114	000106	005004 				CLR	R4		;CLEAR PREVIOUS BLOCK ADDRESS
RQLCB	MACRO M1108  05-DEC-77 23:43  PAGE 2-2


    115	000110	005005 				CLR	R5		;CLEAR FOUND BLOCK ADDRESS
    116	000112	010102 				MOV	R1,R2		;SET TYPE OF FIT FLAG
    117	000114	100001 				BPL	1$		;IF PL BEST FIT
    118	000116	005401 				NEG	R1		;MAKE SIZE POSITIVE
    119	000120	062701 	000003 		1$:	ADD	#3,R1		;ROUND TO NEXT 2 WORD BOUNDRY
    120	000124	042701 	000003 			BIC	#3,R1		;CLEAR EXCESS BITS
    121	000130	001441 				BEQ	9$		;IF EQ VERGESSEN!!!
    122	000132	011003 			2$:	MOV	(R0),R3		;GET ADDR OF NEXT
    123	000134	001417 				BEQ	5$		;IF EQ END OF LIST
    124	000136	020163 	000002 			CMP	R1,2(R3)	;BLOCK BIG ENOUGH?
    125	000142	101012 				BHI	4$		;IF HI NO
    126	000144	005702 				TST	R2		;FIRST/BEST FIT?
    127	000146	100420 				BMI	6$		;IF MI FIRST FIT
    128	000150	005705 				TST	R5		;FIND PREVIOUS BLOCK?
    129	000152	001404 				BEQ	3$		;IF EQ NO
    130	000154	026563 	000002 	000002 		CMP	2(R5),2(R3)	;COMPARE BLOCK SIZES
    131	000162	101402 				BLOS	4$		;IF LOS PREVIOUS WINS
    132	000164	010004 			3$:	MOV	R0,R4		;SET ADDR OF PREV
    133	000166	010305 				MOV	R3,R5		;SET ADDR OF BLOCK
    134	000170	010300 			4$:	MOV	R3,R0		;SET NEW PREV ADDR
    135	000172	000757 				BR	2$		;GO AGAIN
    136	000174	005702 			5$:	TST	R2		;FIRST/BEST FIT?
    137	000176	100416 				BMI	9$		;IF MI FIRST FIT
    138	000200	005705 				TST	R5		;FIND A BLOCK?
    139	000202	001414 				BEQ	9$		;IF EQ NO
    140	000204	010400 				MOV	R4,R0		;RETRIEVE ADDR OF PREV
    141	000206	010503 				MOV	R5,R3		;RETRIEVE ADDR OF BLOCK
    142	000210	160163 	000002 		6$:	SUB	R1,2(R3)	;REDUCE SIZE OF BLOCK
    143	000214	001403 				BEQ	7$		;IF EQ NONE LEFT
    144	000216	066303 	000002 			ADD	2(R3),R3	;CALCULATE ADDRESS OF BLOCK
    145	000222	000401 				BR	8$		;
    146	000224	011310 			7$:	MOV	(R3),(R0)	;LINK PREV TO NEXT
    147	000226	010300 			8$:	MOV	R3,R0		;SET ADDRESS OF BLOCK
    148	000230	000241 				CLC			;CLEAR CARRY
    149	000232	000401 				BR	10$		;
    150	000234	000261 			9$:	SEC			;SET CARRY
    151	000236				10$:	RETURN			;
    152
    153		000001 				.END			;
RQLCB	MACRO M1108  05-DEC-77 23:43  PAGE 2-3
SYMBOL TABLE

CR    = 000015   	HT    = 000011   	R$$11M= 000000   	VT    = 000013   	$RQCB   000102RG    002
FF    = 000014   	LF    = 000012   	SPA   = 000040   	$RLCB   000000RG    002	$SAVRG= ****** GX

. ABS.	000000	   000
      	000000	   001
$$RESL	000240	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  602 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:07
[46,10]RQLCB,[46,20]RQLCB/-SP=[46,30]MACFLM.,RQLCB.003
RSTFDB 0101S, RESET FDB	MACRO M1108  05-DEC-77 22:20  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
RSTFDB 0101S, RESET FDB	MACRO M1108  05-DEC-77 22:20  PAGE 7


						.TITLE	RSTFDB 0101S, RESET FDB
						.IDENT	/0101S/
      2					; ALTERED TUESDAY 4-JUNE-74 14:45
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 13-JULY-73
     21					;
     22					; RESET THE FDB _ RELEASE THE BLOCK BUFFER IF NECESSARY, AND CLEAR THE
     23					; FDB CELLS THAT ARE SUPPOSED TO BE REINITIALIZED
     24	000000				..RFDB::
     25	000000	132760 	000000G	000000G		BITB	#FD.RWM,F.RACC(R0) ;IF READ/WRITE MODE, DON'T RELEASE BUFFER
     26	000006	001021 				BNE	60$
     27	000010				40$:
     28						.IF	EQ,R$$MBF	;IF NO MULTIPLE BUFFERING
     29	000010	016002 	000000G			MOV	F.BDB(R0),R2	;R2=ADDRESS OF BUFFER TO RELEASE
     30	000014	001416 				BEQ	60$		;BRANCH IF NO BUFFER TO RELEASE
     31					; RELEASE THE BLOCK BUFFER, R2=ADDRESS OF BUFFER
     32	000016	016001 	000000G			MOV	F.BBFS(R0),R1	;SIZE OF BLOCK BUFFER
     33	000022	062701 	000000G			ADD	#S.BFHD,R1	;ADD IN SIZE OF BUFFER HEADER
     34	000026	010046 				MOV	R0,-(SP)	;SAVE FDB ADDRESS
     35	000030	013700 	000000G			MOV	@#.FSRPT,R0	;ALLOCATION CONTROL BLOCK FOR FSR
     36	000034					CALL	$RLCB		;RELEASE BUFFER
     37	000040	012600 				MOV	(SP)+,R0	;RESTORE FDB POINTER
     38						.ENDC
     39					;
     40						.IF	GT,R$$MBF	;IF MULTIPLE BUFFERING
     41						MOV	F.BDB(R0),R3
     42						BEQ	60$		;BRANCH IF NO BUFFERS TO RELEASE
     43						CLR	R5
     44						BISB	F.MBC1(R0),R5	;NO. OF BUFFERS TO RELEASE
     45						MOV	R0,R4		;PRESERVE FDB ADDRESS
     46					50$:	MOV	@#.FSRPT,R0
     47						MOV	F.BBFS(R4),R1
     48						ADD	#S.BFHD,R1	;R1=NO OF BYTES TO RELEASE
     49						MOV	R3,R2		;R2=ADDRESS OF BUFFER TO RELEAE
     50						CALL	$RLCB
     51						MOV	B.NXBD(R3),R3
     52						SOB	R5,50$		;RELEASE ALL BUFFERS
     53						MOV	R4,R0		;RESTORE FDB ADDRESS
     54						.ENDC
     55					;
     56					; OPEN FOR RECORD I/O - CLEAR SOME RECORD ORIENTED CELLS
RSTFDB 0101S, RESET FDB	MACRO M1108  05-DEC-77 22:20  PAGE 7-1


     57	000042	005060 	000000G			CLR	F.NRBD(R0)
     58	000046	005060 	000002G			CLR	F.NRBD+2(R0)
     59					;
     60					; OPEN FOR RECORD OR BLOCK ORIENTED I/O
     61	000052	005060 	000000G		60$:	CLR	F.BDB(R0)	;MARK FILE CLOSED
     62	000056	005060 	000000G			CLR	F.FNB(R0)	;ZERO THE FILE ID
     63	000062	005060 	000000G			CLR	F.OVBS(R0)	;ZERO THE OVERIDE BUF SIZE
     64	000066	005060 	000000G			CLR	F.CNTG(R0)	;ZERO THE CONTIGUOUS SIZE
     65	000072	005060 	000000G			CLR	F.STBK(R0)	;ZERO THE STATISTICS BLOCK ADDRESS
     66	000076	142760 	000000G	000000G		BICB	#FA.TMP,F.FACC(R0) ;RESET THE TEMP BIT IN FACC
     67									;SO THAT PARSE WILL NOT BE CONFUSED
     68					;
     69						.IF	GT,R$$MBF	;IF MULTIPLE BUFFERING
     70						CLRB	F.MBFG(R0)
     71						.ENDC
     72					;
     73	000104					RETURN
     74					;
     75					;
     76	000106					$END	RSTFDB
     77					;
     78					;
     79		000001 				.END
RSTFDB 0101S, RESET FDB	MACRO M1108  05-DEC-77 22:20  PAGE 7-2
SYMBOL TABLE

BD.FRE= 000001   	F.CNTG= ****** GX	HA.UI = 000001   	R$$ANI= 000000   	R$$11M= 000001
DIRTYP= 015172   	F.FACC= ****** GX	HA.VER= 000007   	R$$BBF= 000000   	SYDEV = 054523
FA.TMP= ****** GX	F.FNB = ****** GX	NB.DOT= 100000   	R$$DPB= 000001   	SYUNIT= 000000
FCSEFN= 000040   	F.NRBD= ****** GX	NB.SMI= 040000   	R$$EIS= 000000   	S.BFHD= ****** GX
FD.DVR= 000020   	F.OVBS= ****** GX	N.DRPT= 000006   	R$$LCL= 000000   	WI.DLK= 000002
FD.EFB= 000004   	F.RACC= ****** GX	N.DRSZ= 000004   	R$$MBF= 000000   	WI.LCK= 000001
FD.EF1= 000010   	F.STBK= ****** GX	N.DVPT= 000002   	R$$MUL= 000000   	$RLCB = ****** GX
FD.EOF= 000002   	HA.CHU= 000003   	N.DVSZ= 000000   	R$$OPF= 000000   	$$    = 000067
FD.RWM= ****** GX	HA.FP = 000002   	N.FNPT= 000012   	R$$RSL= 000000   	.FSRPT= ****** GX
FD.WRT= 000001   	HA.NAM= 000005   	N.FNSZ= 000010   	R$$SEQ= 000000   	..RFDB  000000RG
F.BBFS= ****** GX	HA.TYP= 000006   	PP.SEP= 000002   	R$$SPL= 000000   	...CTL= 000001
F.BDB = ****** GX	HA.UAT= 000004   	PP.ZER= 000001

. ABS.	000000	   000
      	000106	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2524 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]RSTFDB,[41,20]RSTFDB/-SP=[41,30]FCSPRE,RSTFDB
RWBLK 0101S, READ WRITE VIRTUAL	MACRO M1108  05-DEC-77 22:20  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
RWBLK 0101S, READ WRITE VIRTUAL	MACRO M1108  05-DEC-77 22:20  PAGE 7


						.TITLE	RWBLK 0101S, READ WRITE VIRTUAL BLOCK
						.IDENT	/0101S/
      2					; ALTERED WEDNESDAY 13-FEB-74 16:45
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 11-AUG-73
     21					;
RWBLK 0101S, READ WRITE VIRTUAL	MACRO M1108  05-DEC-77 22:20  PAGE 8


     23					;+
     24					; ROUTINE TO READ AND WRITE BLOCK TO A LUN
     25					; CALLING SEQUENCE:
     26					;	CALL	..RBLK		;TO READ A BLOCK
     27					;	CALL	..WBLK		;TO WRITE A BLOCK
     28					; INPUTS:
     29					;	R0=FDB
     30					;	R1=ADDRESS OF DATA BUFFER
     31					;	R2=NO. OF BYTES
     32					;	R3=CARRIAGE CONTROL CHARACTER
     33					; OUTPUTS:
     34					;	R0 PRESERVED
     35					;	R1 = ADDRESS OF I/O STATUS BLOCK
     36					;	R2-R5 ARE DESTROYED
     37					; OPERATION:
     38					;	INVOKES THE READ/WRITE VIRTUAL BLOCK QI/O.  IT ASSUMES THAT THE
     39					; RELATION BETWEEN THE BUF ADR AND I/O STATUS BLOCK IS THAT THE I/O
     40					; STATUS BLOCK IS AT THE FRONT OF THE BUFFER HEADER WHICH IMMEDIATELY
     41					; PRECEEDS THE BUFFER.  THE DPB IS BUILT ON THE STACK
     42					; AND ONCE THE QI/O IS ISSUED AND THE C BIT CHECKED FOR ERROR,
     43					; THE ROUTINE RETURNS TO THE CALLER.  THERE IS NO IMPLIED WAIT
     44					; FOR I/O COMPLETION.
     45					;-
     46						.ENABL	LSB
     47	000000	012704 	000000G		..RBLK::MOV	#IO.RVB,R4	;READ VIRTUAL BLOCK
     48	000004	000402 				BR	10$
     49	000006	012704 	000000G		..WBLK::MOV	#IO.WVB,R4	;WRITE VIRTUAL BLOCK
     50	000012				10$:	CALL	..IDPB		;INIT DPB AND SET R5 TO PARAM BLOCK
     51	000016	010125 				MOV	R1,(R5)+	;ADDRESS OF DATA BUFFER
     52	000020	010225 				MOV	R2,(R5)+	;SIZE OF DATA BUFFER
     53	000022	010325 				MOV	R3,(R5)+	;CARRIAGE CONTROL INFORMATION
     54
     55						.IF	EQ,R$$MBF+R$$BBF ;IF SINGLE BUFFERED FCS
     56	000024	016025 	000000G			MOV	F.VBN(R0),(R5)+	;HIGH WORD OF VBN
     57	000030	016015 	000002G			MOV	F.VBN+2(R0),(R5) ;LOW WORD OF VBN
     58	000034	162705 	000024 			SUB	#10.*2,R5	;SET R5 TO TOP OF DPB
     59	000040					CALLR	..QIOW		;ISSUE THE QI/O, WAIT, AND RETURN
     60
     61						.IFF			;IF MULTIPLE BUFFERED FCS
     62						MOV	F.BDB(R0),R1
     63						MOV	B.VBN(R1),(R5)+	;HIGH VBN FROM BUFFER DESCRIPTOR AREA
     64						MOV	B.VBN+2(R1),(R5) ;LOW ORDER VBN
     65						SUB	#10.*2,R5	;R5 RESET TO TOP OF DPB
     66						MOV	#12.*400+1,R3	;ASSUME QI/O AND NO WAIT (ASYNCHRONOUS)
     67					;
     68						.IF	EQ,R$$11M
     69						CMP	#IO.RVB,R4	;READ VIRTUAL BLOCK?
     70						BNE	20$		;BRANCH IF WRITE
     71						BITB	#FD.RAH,F.MBFG(R0) ;READ AHEAD?
     72						BR	30$
     73					20$:	BITB	#FD.WBH,F.MBFG(R0) ;WRITE BEHIND?
     74					30$:	BNE	40$		;BRANCH IF NOT SUPPOSED TO WAIT
     75						MOV	#12.*400+3,R3	;USE QI/O AND WAIT
     76						.ENDC
     77					;
     78					40$:	CALLR	..XQIO		;ISSUE THE QI/O, WAIT MAYBE, AND RETURN
     79						.ENDC
RWBLK 0101S, READ WRITE VIRTUAL	MACRO M1108  05-DEC-77 22:20  PAGE 8-1


     80
     81						.DSABL	LSB
     82					;
     83					;
     84	000044					$END	RWBLK
     85					;
     86					;
     87		000001 				.END
RWBLK 0101S, READ WRITE VIRTUAL	MACRO M1108  05-DEC-77 22:20  PAGE 8-2
SYMBOL TABLE

BD.FRE= 000001   	HA.FP = 000002   	N.DRPT= 000006   	R$$DPB= 000001   	SYDEV = 054523
DIRTYP= 015172   	HA.NAM= 000005   	N.DRSZ= 000004   	R$$EIS= 000000   	SYUNIT= 000000
FCSEFN= 000040   	HA.TYP= 000006   	N.DVPT= 000002   	R$$LCL= 000000   	WI.DLK= 000002
FD.DVR= 000020   	HA.UAT= 000004   	N.DVSZ= 000000   	R$$MBF= 000000   	WI.LCK= 000001
FD.EFB= 000004   	HA.UI = 000001   	N.FNPT= 000012   	R$$MUL= 000000   	$$    = 000067
FD.EF1= 000010   	HA.VER= 000007   	N.FNSZ= 000010   	R$$OPF= 000000   	..IDPB= ****** GX
FD.EOF= 000002   	IO.RVB= ****** GX	PP.SEP= 000002   	R$$RSL= 000000   	..QIOW= ****** GX
FD.WRT= 000001   	IO.WVB= ****** GX	PP.ZER= 000001   	R$$SEQ= 000000   	..RBLK  000000RG
F.VBN = ****** GX	NB.DOT= 100000   	R$$ANI= 000000   	R$$SPL= 000000   	..WBLK  000006RG
HA.CHU= 000003   	NB.SMI= 040000   	R$$BBF= 000000   	R$$11M= 000001   	...CTL= 000001

. ABS.	000000	   000
      	000044	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2519 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[41,10]RWBLK,[41,20]RWBLK/-SP=[41,30]FCSPRE,RWBLK
RWFSR2 0100MS, READ/WRITE FSR2	MACRO M1108  05-DEC-77 22:21  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
RWFSR2 0100MS, READ/WRITE FSR2	MACRO M1108  05-DEC-77 22:21  PAGE 7


						.TITLE	RWFSR2 0100MS, READ/WRITE FSR2
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 17-AUG-73
     21					;
RWFSR2 0100MS, READ/WRITE FSR2	MACRO M1108  05-DEC-77 22:21  PAGE 8


     23					;+
     24					; READ THE DEFAULT DIRECTORY STRING DESCRIPTOR
     25					; CALLING SEQUENCE:
     26					;	CALL	.RDFDR
     27					; INPUTS:
     28					;	NONE
     29					; OUTPUTS:
     30					;	R1=SIZE OF DEFAULT DIRECTORY STRING
     31					;	R2=ADDRESS OF DEFAULT DIRECTORY STRING
     32					;	OTHER REGISTERS PRESERVED
     33					;-
     34	000000	013701 	000000G		.RDFDR::MOV	@#.FSRPT,R1
     35	000004	062701 	000000G			ADD	#A.DFDR,R1	;R1=ADDRESS OF DEFAULT DIRECTORY DESCRIPTOR
     36	000010	016102 	000002 			MOV	2(R1),R2
     37	000014	011101 				MOV	@R1,R1
     38	000016	002001 				BGE	10$
     39	000020	005001 				CLR	R1		;RETURN NULL STRING IF NOT INITED
     40	000022				10$:	RETURN
     41					;
     42					;+
     43					; WRITE THE DEFAULT DIRECTORY STRING DESCRIPTOR
     44					; CALLING SEQUENCE:
     45					;	CALL	.WDFDR
     46					; INPUTS:
     47					;	R1=SIZE OF DEFAULT DIRECTORY STRING
     48					;	R2=ADDRESS OF DEFAULT DIRECTORY STRING
     49					; OUTPUTS:
     50					;	ALL REGISTERS PRESERVED
     51					;-
     52	000024	010046 			.WDFDR::MOV	R0,-(SP)
     53	000026	013700 	000000G			MOV	@#.FSRPT,R0
     54	000032	062700 	000000G			ADD	#A.DFDR,R0	;R0=DEFAULT DIRECTORY STRING DESCRIPTOR
     55	000036	010110 				MOV	R1,@R0
     56	000040	010260 	000002 			MOV	R2,2(R0)
     57	000044	005060 	000000G			CLR	D.DFDV(R0)	;FORCES AN INITIAL FIND TO GET THE ID
     58	000050	012600 				MOV	(SP)+,R0
     59	000052					RETURN
     60					;
     61					; READ AND WRITE DEFAULT FILE PROTECTION
     62					; READ INTO R1, SET FROM R1
     63	000054	013701 	000000G		.RDFFP::MOV	@#.FSRPT,R1
     64	000060	016101 	000000G			MOV	A.FIPR(R1),R1
     65	000064					RETURN
     66
     67	000066	010146 			.WDFFP::MOV	R1,-(SP)
     68	000070	013701 	000000G			MOV	@#.FSRPT,R1
     69	000074	011661 	000000G			MOV	@SP,A.FIPR(R1)
     70	000100	012601 				MOV	(SP)+,R1
     71	000102					RETURN
     72					;
     73					; READ AND WRITE FILE OWNER
     74					; READ INTO R1, WRITE FROM R1
     75					; FORMAT = .BYTE PROGRAMMER, PROJECT
     76					;
     77	000104				.RFOWN::
     78	000104	013701 	000000G			MOV	@#.FSRPT,R1
     79	000110	016101 	000000G			MOV	A.OWUI(R1),R1
RWFSR2 0100MS, READ/WRITE FSR2	MACRO M1108  05-DEC-77 22:21  PAGE 8-1


     80	000114					RETURN
     81	000116				.WFOWN::
     82	000116	010146 				MOV	R1,-(SP)
     83	000120	013701 	000000G			MOV	@#.FSRPT,R1
     84	000124	011661 	000000G			MOV	(SP),A.OWUI(R1)
     85	000130	012601 				MOV	(SP)+,R1
     86	000132					RETURN
     87					;
     88					;
     89	000134					$END	RWFSR2
     90					;
     91					;
     92		000001 				.END
RWFSR2 0100MS, READ/WRITE FSR2	MACRO M1108  05-DEC-77 22:21  PAGE 8-2
SYMBOL TABLE

A.DFDR= ****** GX	FD.WRT= 000001   	N.DRSZ= 000004   	R$$EIS= 000000   	WI.DLK= 000002
A.FIPR= ****** GX	HA.CHU= 000003   	N.DVPT= 000002   	R$$LCL= 000000   	WI.LCK= 000001
A.OWUI= ****** GX	HA.FP = 000002   	N.DVSZ= 000000   	R$$MUL= 000000   	.FSRPT= ****** GX
BD.FRE= 000001   	HA.NAM= 000005   	N.FNPT= 000012   	R$$OPF= 000000   	.RDFDR  000000RG
DIRTYP= 015172   	HA.TYP= 000006   	N.FNSZ= 000010   	R$$RSL= 000000   	.RDFFP  000054RG
D.DFDV= ****** GX	HA.UAT= 000004   	PP.SEP= 000002   	R$$SEQ= 000000   	.RFOWN  000104RG
FCSEFN= 000040   	HA.UI = 000001   	PP.ZER= 000001   	R$$SPL= 000000   	.WDFDR  000024RG
FD.DVR= 000020   	HA.VER= 000007   	R$$ANI= 000000   	R$$11M= 000001   	.WDFFP  000066RG
FD.EFB= 000004   	NB.DOT= 100000   	R$$BBF= 000000   	SYDEV = 054523   	.WFOWN  000116RG
FD.EF1= 000010   	NB.SMI= 040000   	R$$DPB= 000001   	SYUNIT= 000000   	...CTL= 000001
FD.EOF= 000002   	N.DRPT= 000006

. ABS.	000000	   000
      	000134	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2521 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]RWFSR2,[41,20]RWFSR2/-SP=[41,30]FCSPRE,RWFSR2
SAVAL	MACRO M1108  05-DEC-77 23:43  PAGE 2


      1						.TITLE	SAVAL
      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 25-JUN-74
     22					;
     23					; SUBROUTINE TO SAVE AND RESTORE R0 - R5
     24					;
     25					; MACRO LIBRARY CALLS
     26					;
     27
     28						.MCALL	CALL,RETURN
     29
     30					;+
     31					; **-$SAVAL-SAVE AND RESTORE R0-R5
     32					;
     33					; THIS MODULE IS ENTERED VIA A 'JSR	PC,$SAVAL' TO SAVE AND
     34					; SUBSEQUENTLY RESTORE REGISTERS R0 THROUGH R5. AFTER STORING THE
     35					; REGISTER CONTENTS ON THE STACK A CO-ROUTINE CALL IS MADE TO
     36					; THE CALLING ROUTINE. A SUBSEQUENT 'RTS	PC' CAUSES THIS
     37					; SUBROUTINE TO RESTORE ALL REGISTERS AND EXIT VIA AN  'RTS	PC'.
     38					;
     39					; ALL REGISTER CONTENTS ARE PRESERVED.
     40					;-
     41
     42	000000				$SAVAL::				;
     43	000000	010446 				MOV	R4,-(SP)		; SAVE R4
     44	000002	010346 				MOV	R3,-(SP)		; SAVE R3
     45	000004	010246 				MOV	R2,-(SP)		; SAVE R2
     46	000006	010146 				MOV	R1,-(SP)		; SAVE R1
     47	000010	010046 				MOV	R0,-(SP)		; SAVE R0
     48	000012	016646 	000012 			MOV	12(SP),-(SP)		; COPY RETURN
     49	000016	010566 	000014 			MOV	R5,14(SP)		; SAVE R5
     50	000022					CALL	@(SP)+			; CALL THE CALLER
     51	000024	012600 				MOV	(SP)+,R0		; RESTORE R0
     52	000026	012601 				MOV	(SP)+,R1		; RESTORE R1
     53	000030	012602 				MOV	(SP)+,R2		; RESTORE R2
     54	000032	012603 				MOV	(SP)+,R3		; RESTORE R3
     55	000034	012604 				MOV	(SP)+,R4		; RESTORE R4
     56	000036	012605 				MOV	(SP)+,R5		; RESTORE R5
     57	000040					RETURN				;
SAVAL	MACRO M1108  05-DEC-77 23:43  PAGE 2-1


     58
     59		000001 				.END
SAVAL	MACRO M1108  05-DEC-77 23:43  PAGE 2-2
SYMBOL TABLE

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

. ABS.	000000	   000
      	000042	   001
ERRORS DETECTED:  0

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


      1						.TITLE	SAVRG
      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 18-NOV-72
     22					;
     23					;+
     24					; **-$SAVRG-SAVE/RESTORE NONVOLITILE REGISTERS
     25					;
     26					; JSR R5,$SAVRG
     27					;-
     28
     29	000000					.PSECT	$$RESL								;**NEW**
     30	000000	010446 			$SAVRG::MOV	R4,-(SP)	;SAVE R4 AND R3
     31	000002	010346 				MOV	R3,-(SP)	;
     32	000004	010546 				MOV	R5,-(SP)	;PUT RETURN ADDRESS ON STACK
     33	000006	016605 	000006 			MOV	6(SP),R5	;RETRIEVE REAL R5
     34	000012					CALL	@(SP)+		;CALL THE CALLER
     35	000014	012603 				MOV	(SP)+,R3	;RESTORE NONVOLITILE REGISTERS
     36	000016	012604 				MOV	(SP)+,R4	;
     37	000020	012605 				MOV	(SP)+,R5	;
     38	000022					RETURN			;
     39
     40		000001 				.END
SAVRG	MACRO M1108  05-DEC-77 23:43  PAGE 2-1
SYMBOL TABLE

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

. ABS.	000000	   000
      	000000	   001
$$RESL	000024	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  532 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:05
[46,10]SAVRG,[46,20]SAVRG/-SP=[46,30]MACFLM.,SAVRG.003
SAVR1	MACRO M1108  05-DEC-77 22:21  PAGE 1


      1						.TITLE	SAVR1
      2					; ALTERED 21-MAR-73 13:30
      3						.IDENT	/0101/
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 21-MARCH-73
     21					;
     22	000000					.PSECT	$$RESL
     23					;
     24						.MCALL	CALL,RETURN
     25					;+
     26					; SUBROUTINE TO SAVE REGISTERS R1-R5 AND RESTORE THEM ON RETURN
     27					; CALLING SEQUENCE:
     28					;	JSR R5,SAVR1
     29					; INPUTS:
     30					;	NONE
     31					; OUPUTS:
     32					;	NONE
     33					; OPERATION:
     34					;	THE ROUTINE IS A COROUTINE WHICH SAVES R1-R5
     35					; ON THE STACK, AND THEN CALLS THE CALLER.  THE RETURN FROM THE
     36					; CALLER THEN POPS THE SAVED REGISTERS AND DOES A RETURN.
     37					;-
     38
     39	000000	010446 			.SAVR1::MOV R4,-(SP)		;SAVE R4,R3,R2,R1
     40	000002	010346 				MOV R3,-(SP)
     41	000004	010246 				MOV R2,-(SP)
     42	000006	010146 				MOV R1,-(SP)
     43	000010	010546 				MOV R5,-(SP)		;PUT RETURN ADDRESS ON STACK
     44	000012	016605 	000012 			MOV 10.(SP),R5		;RETRIEVE REAL R5
     45	000016					CALL @(SP)+		;CALL THE CALLER
     46	000020	012601 				MOV (SP)+,R1		;RESTORE R1,R2,R3,R4,R5
     47	000022	012602 				MOV (SP)+,R2
     48	000024	012603 				MOV (SP)+,R3
     49	000026	012604 				MOV (SP)+,R4
     50	000030	012605 				MOV (SP)+,R5
     51	000032					RETURN
     52					;
     53					;
     54		000001 				.END
SAVR1	MACRO M1108  05-DEC-77 22:21  PAGE 1-1
SYMBOL TABLE

$$    = 000036   	.SAVR1  000000RG    002

. ABS.	000000	   000
      	000000	   001
$$RESL	000034	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  164 WORDS  ( 1 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:03
[41,10]SAVR1,[41,20]SAVR1/-SP=[41,30]SAVR1
SAVR1	MACRO M1108  05-DEC-77 23:43  PAGE 2


      1						.TITLE	SAVR1
      2					; ALTERED 21-MAR-73 13:30
      3						.IDENT	/0101/
      4					; COPYRIGHT 1973, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
      5					;
      6					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
      7					; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
      8					;
      9					; PETER H. LIPMAN 21-MARCH-73
     10					;
     11	000000					.PSECT	$$RESL
     12					;
     13						.MCALL	CALL,RETURN
     14					;+
     15					; SUBROUTINE TO SAVE REGISTERS R1-R5 AND RESTORE THEM ON RETURN
     16					; CALLING SEQUENCE:
     17					;	JSR R5,SAVR1
     18					; INPUTS:
     19					;	NONE
     20					; OUPUTS:
     21					;	NONE
     22					; OPERATION:
     23					;	THE ROUTINE IS A COROUTINE WHICH SAVES R1-R5
     24					; ON THE STACK, AND THEN CALLS THE CALLER.  THE RETURN FROM THE
     25					; CALLER THEN POPS THE SAVED REGISTERS AND DOES A RETURN.
     26					;-
     27
     28	000000	010446 			.SAVR1::MOV R4,-(SP)		;SAVE R4,R3,R2,R1
     29	000002	010346 				MOV R3,-(SP)
     30	000004	010246 				MOV R2,-(SP)
     31	000006	010146 				MOV R1,-(SP)
     32	000010	010546 				MOV R5,-(SP)		;PUT RETURN ADDRESS ON STACK
     33	000012	016605 	000012 			MOV 10.(SP),R5		;RETRIEVE REAL R5
     34	000016					CALL @(SP)+		;CALL THE CALLER
     35	000020	012601 				MOV (SP)+,R1		;RESTORE R1,R2,R3,R4,R5
     36	000022	012602 				MOV (SP)+,R2
     37	000024	012603 				MOV (SP)+,R3
     38	000026	012604 				MOV (SP)+,R4
     39	000030	012605 				MOV (SP)+,R5
     40	000032					RETURN
     41					;
     42					;
     43		000001 				.END
SAVR1	MACRO M1108  05-DEC-77 23:43  PAGE 2-1
SYMBOL TABLE

CR    = 000015   	HT    = 000011   	R$$11M= 000000   	VT    = 000013   	.SAVR1  000000RG    002
FF    = 000014   	LF    = 000012   	SPA   = 000040   	$$    = 000001

. ABS.	000000	   000
      	000000	   001
$$RESL	000034	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  532 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:05
[46,10]SAVR1,[46,20]SAVR1/-SP=[46,30]MACFLM.,SAVR1
SAVVR	MACRO M1108  05-DEC-77 23:43  PAGE 2


      1						.TITLE	SAVVR
      2						.IDENT	/02/							;**NEW**
      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 02
     20					;
     21					; D.N. CUTLER 18-NOV-72
     22					;
     23					;+
     24					; **-$SAVVR-SAVE/RESTORE VOLITILE REGISTERS
     25					;
     26					; JSR R2,$SAVVR
     27					;-
     28
     29	000000	010146 			$SAVVR::MOV	R1,-(SP)	;SAVE R1 AND R0
     30	000002	010046 				MOV	R0,-(SP)	;
     31	000004	010246 				MOV	R2,-(SP)	;SET RETURN ADDRESS
     32	000006	016602 	000006 			MOV	6(SP),R2	;RESTORE R2
     33	000012					CALL	@(SP)+		;CALL THE CALLER
     34	000014	012600 				MOV	(SP)+,R0	;RESTORE REGISTERS
     35	000016	012601 				MOV	(SP)+,R1	;
     36	000020	012602 				MOV	(SP)+,R2	;
     37	000022					RETURN			;
     38
     39		000001 				.END
SAVVR	MACRO M1108  05-DEC-77 23:43  PAGE 2-1
SYMBOL TABLE

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

. ABS.	000000	   000
      	000024	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  522 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:05
[46,10]SAVVR,[46,20]SAVVR/-SP=[46,30]MACFLM.,SAVVR.002
UDIREC 0100MS, USER DIRECTORY P	MACRO M1108  05-DEC-77 22:21  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
UDIREC 0100MS, USER DIRECTORY P	MACRO M1108  05-DEC-77 22:21  PAGE 7


						.TITLE	UDIREC 0100MS, USER DIRECTORY PRIMITVE CALLS
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 17-AUG-73
     21					;
UDIREC 0100MS, USER DIRECTORY P	MACRO M1108  05-DEC-77 22:21  PAGE 8


     23					;+
     24					; .ENTER, .FIND, .REMOVE, USER INTERFACE TO DIRECTORY PRIMITVES
     25					; CALLING SEQUENCE:
     26					;	CALL	.ENTER
     27					;	CALL	.FIND
     28					;	CALL	.REMOV
     29					; INPUTS:
     30					;	R0=FDB ADDRESS
     31					;	R1=FILE NAME BLOCK ADDRESS
     32					;	F.LUN(R0) = LUN TO USE
     33					;	F.EFN(R0) = EVENT FLAG TO USE
     34					;	N.DVNM(R1)=DEVICE NAME
     35					;	N.UNIT(R1)=UNIT
     36					;	N.DID(R1)=3 WORD DIRECTORY ID OF DESIRED DIRECTORY FILE
     37					;	REST OF FILE NAME BLOCK SET APPROPRIATELY
     38					; OUTPUTS:
     39					;	C=0 FOR SUCCESS, FILE NAME BLOCK SET UP WITH FILE ID
     40					;	C=1 FOR FAILURE, F.ERR(R0) SET TO REASON
     41					;	ALL REGISTERS PRESERVED
     42					;	F.LUN(R0) ASSIGNED TO DEVICE AND UNIT IN FNB
     43					;-
     44					;
     45					;
     46					; ENTER A NEW FILE NAME IN THE SPECIFIED DIRECTORY
     47	000000				.ENTER::.SAVR1
     48	000004					CALL	FIND1
     49	000010	103402 				BCS	10$
     50	000012					CALL	..ENTR
     51	000016				10$:	RETURN
     52					;
     53					; REMOVE THE SPECIFIED FILE FROM THE SPECIFIED DIRECTORY
     54					; RETURNING IT'S FILE ID
     55	000020				.REMOV::.SAVR1
     56	000024					CALL	FIND1
     57	000030	103402 				BCS	10$
     58	000032					CALL	..RMOV
     59	000036				10$:	RETURN
     60					;
     61					; FIND THE SPECIFIED FILE NAME IN THE SPECIFIED DIRECTORY, AND
     62					; RETURN THE FILE ID AND ANY FILE NAME FIELDS THAT WERE
     63					; WILD CARD OR DEFAULTED.
     64	000040				.FIND::	.SAVR1
     65	000044					CALL	FIND1
     66	000050	103402 				BCS	10$
     67	000052					CALL	..FIND
     68	000056				10$:	RETURN
     69					;
     70					; COMMON ROUTINE TO ASSIGN LUN FOR .ENTER, .REMOV, .FIND
     71	000060	012760 	000001 	000000G	FIND1:	MOV	#1,F.ERR(R0)
     72	000066					CALLR	..ALUN		;ASSIGN THE LUN
     73					;
     74					;
     75	000072					$END	UDIREC
     76					;
     77					;
     78		000001 				.END
UDIREC 0100MS, USER DIRECTORY P	MACRO M1108  05-DEC-77 22:21  PAGE 8-1
SYMBOL TABLE

BD.FRE= 000001   	HA.FP = 000002   	N.DVSZ= 000000   	R$$MUL= 000000   	$$    = 000067
DIRTYP= 015172   	HA.NAM= 000005   	N.FNPT= 000012   	R$$OPF= 000000   	.ENTER  000000RG
FCSEFN= 000040   	HA.TYP= 000006   	N.FNSZ= 000010   	R$$RSL= 000000   	.FIND   000040RG
FD.DVR= 000020   	HA.UAT= 000004   	PP.SEP= 000002   	R$$SEQ= 000000   	.REMOV  000020RG
FD.EFB= 000004   	HA.UI = 000001   	PP.ZER= 000001   	R$$SPL= 000000   	.SAVR1= ****** GX
FD.EF1= 000010   	HA.VER= 000007   	R$$ANI= 000000   	R$$11M= 000001   	..ALUN= ****** GX
FD.EOF= 000002   	NB.DOT= 100000   	R$$BBF= 000000   	SYDEV = 054523   	..ENTR= ****** GX
FD.WRT= 000001   	NB.SMI= 040000   	R$$DPB= 000001   	SYUNIT= 000000   	..FIND= ****** GX
FIND1   000060R  	N.DRPT= 000006   	R$$EIS= 000000   	WI.DLK= 000002   	..RMOV= ****** GX
F.ERR = ****** GX	N.DRSZ= 000004   	R$$LCL= 000000   	WI.LCK= 000001   	...CTL= 000001
HA.CHU= 000003   	N.DVPT= 000002

. ABS.	000000	   000
      	000072	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2575 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]UDIREC,[41,20]UDIREC/-SP=[41,30]FCSPRE,UDIREC
WAITI 0100MS, WAIT FOR I/O DONE	MACRO M1108  05-DEC-77 22:21  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
WAITI 0100MS, WAIT FOR I/O DONE	MACRO M1108  05-DEC-77 22:21  PAGE 7


						.TITLE	WAITI 0100MS, WAIT FOR I/O DONE - INTERNAL
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 10-OCT-73
     21					;
WAITI 0100MS, WAIT FOR I/O DONE	MACRO M1108  05-DEC-77 22:21  PAGE 8


     23					;+
     24					; ISSUE QI/O AND WAIT FOR I/O COMPLETION
     25					; CALLING SEQUENCE:
     26					;	CALL	..QIOW
     27					; INPUTS:
     28					;	R0=FDB ADDRESS
     29					;	R4=I/O FUNCTION CODE
     30					; OUTPUTS:
     31					;	C=0 IF SUCCESSFUL, C=1 IF ERROR, F.ERR SET
     32					;	R1=I/O STATUS BLOCK ADDRESS
     33					;	R0 PRESERVED
     34					;	R2-R5 ALTERED
     35					;-
     36	000000	013705 	000000G		..QIOW::MOV	@#.FSRPT,R5
     37	000004	062705 	000000G			ADD	#A.DPB,R5	;R5=DPB ADDRESS
     38
     39						.IF	EQ,R$$11M	;IF THIS IS RSX11D
     40						MOV	#12.*400+3,R3	;USE THE QI/O AND WAIT DIRECTIVE
     41
     42						.IFF			;BUT RSX11M DOESN'T HAVE IT
     43	000010	012703 	006001 			MOV	#12.*400+1,R3	;SO USE QI/O
     44
     45						.ENDC
     46	000014					CALL	..XQIO		;ISSUE THE QI/O AND WAIT MAYBE
     47					;
     48					; AND NOW DROP THROUGH TO ..WAIT WHICH WILL AT LEAST SET F.ERR
     49					; AND WILL WAIT ON THE EVENT FLAG IF NECESSARY
     50					;
     51					;+
     52					; WAIT FOR I/O DONE FOR I/O STATUS BLOCK
     53					; CALLING SEQUENCE:
     54					;	CALL	..WAIT
     55					; INPUTS:
     56					;	R0=RDB
     57					;	R1=I/O STATUS BLOCK ADDRESS
     58					; OUTPUTS:
     59					;	C=0 IF NO ERROR, C=1 IF ERROR FROM HANDLER
     60					;	F.ERR(R0), SET WITH I/O STATUS CODE
     61					;	ALL REGISTERS PRESERVED
     62					;-
     63	000020	111160 	000000G		..WAIT::MOVB	@R1,F.ERR(R0)
     64	000024	001402 				BEQ	20$
     65	000026					CALLR	..FCSX
     66	000032				20$:	CALL	..WAEF
     67	000036	000770 				BR	..WAIT
     68					;+
     69					; WAIT FOR EVENT FLAG IN FDB AND CLEAR IT WHEN SET
     70					; CALLING SEQUENCE:
     71					;	CALL	..WAEF
     72					; INPUTS:
     73					;	R0=FDB
     74					; OUTPUTS:
     75					;	ALL REGISTERS PRESERVED
     76					;	NO SIDE EFFECTS
     77					;-
     78	000040				..WAEF::
     79	000040	010146 				MOV	R1,-(SP)
WAITI 0100MS, WAIT FOR I/O DONE	MACRO M1108  05-DEC-77 22:21  PAGE 8-1


     80	000042	116001 	000000G			MOVB	F.EFN(R0),R1
     81	000046	001002 				BNE	10$
     82	000050	012701 	000040 			MOV	#FCSEFN,R1
     83	000054				10$:	WTSE$S	R1
     84	000064	103407 				BCS	20$
     85	000066					CLEF$S	R1
     86	000076	103402 				BCS	20$
     87	000100	012601 				MOV	(SP)+,R1
     88	000102					RETURN
     89	000104				20$:	CALL	.FATAL
     90					;
     91					;
     92	000110					$END	WAITI
     93					;
     94					;
     95		000001 				.END
WAITI 0100MS, WAIT FOR I/O DONE	MACRO M1108  05-DEC-77 22:21  PAGE 8-2
SYMBOL TABLE

A.DPB = ****** GX	HA.CHU= 000003   	N.DVPT= 000002   	R$$LCL= 000000   	WI.LCK= 000001
BD.FRE= 000001   	HA.FP = 000002   	N.DVSZ= 000000   	R$$MUL= 000000   	$$    = 000067
DIRTYP= 015172   	HA.NAM= 000005   	N.FNPT= 000012   	R$$OPF= 000000   	.FATAL= ****** GX
FCSEFN= 000040   	HA.TYP= 000006   	N.FNSZ= 000010   	R$$RSL= 000000   	.FSRPT= ****** GX
FD.DVR= 000020   	HA.UAT= 000004   	PP.SEP= 000002   	R$$SEQ= 000000   	..FCSX= ****** GX
FD.EFB= 000004   	HA.UI = 000001   	PP.ZER= 000001   	R$$SPL= 000000   	..QIOW  000000RG
FD.EF1= 000010   	HA.VER= 000007   	R$$ANI= 000000   	R$$11M= 000001   	..WAEF  000040RG
FD.EOF= 000002   	NB.DOT= 100000   	R$$BBF= 000000   	SYDEV = 054523   	..WAIT  000020RG
FD.WRT= 000001   	NB.SMI= 040000   	R$$DPB= 000001   	SYUNIT= 000000   	..XQIO= ****** GX
F.EFN = ****** GX	N.DRPT= 000006   	R$$EIS= 000000   	WI.DLK= 000002   	...CTL= 000001
F.ERR = ****** GX	N.DRSZ= 000004

. ABS.	000000	   000
      	000110	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2775 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:14
[41,10]WAITI,[41,20]WAITI/-SP=[41,30]FCSPRE,WAITI
WAITU 0100MS, WAIT FOR I/O DONE	MACRO M1108  05-DEC-77 22:21  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
WAITU 0100MS, WAIT FOR I/O DONE	MACRO M1108  05-DEC-77 22:21  PAGE 7


						.TITLE	WAITU 0100MS, WAIT FOR I/O DONE - USER INTERFACE
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 10-OCT-73
     21					;
WAITU 0100MS, WAIT FOR I/O DONE	MACRO M1108  05-DEC-77 22:21  PAGE 8


     23					;+
     24					; WAIT FOR I/O COMPLETION FROM PREVIOUSLY ISSUED READ$ OR WRITE$
     25					; CALLING SEQUENCE
     26					;	CALL	.WAIT
     27					; INPUTS:
     28					;	R0=FDB
     29					; OUTPUTS:
     30					;	C=0 FOR I/O COMPLETED WITHOUT ERROR
     31					;	C=1 IF ERROR FROM THE SPECIFIED I/O REQUEST, F.ERR SET
     32					;	ALL REGISTERS PRESERVED
     33					;-
     34	000000				.WAIT::	.SAVR1
     35	000004	016001 	000000G			MOV	F.BKST(R0),R1	;ADR OF I/O STATUS BLOCK
     36	000010	001002 				BNE	10$		;IF NON ZERO, NORMAL WAIT
     37	000012					CALLR	..WAEF		;OTHERWISE JUST WAIT FOR EVENT FLAG
     38	000016				10$:	CALLR	..WAIT		;WAIT FOR I/O COMPLETION
     39					;
     40					;
     41	000022					$END	WAITU
     42					;
     43					;
     44		000001 				.END
WAITU 0100MS, WAIT FOR I/O DONE	MACRO M1108  05-DEC-77 22:21  PAGE 8-1
SYMBOL TABLE

BD.FRE= 000001   	HA.FP = 000002   	N.DRSZ= 000004   	R$$DPB= 000001   	SYDEV = 054523
DIRTYP= 015172   	HA.NAM= 000005   	N.DVPT= 000002   	R$$EIS= 000000   	SYUNIT= 000000
FCSEFN= 000040   	HA.TYP= 000006   	N.DVSZ= 000000   	R$$LCL= 000000   	WI.DLK= 000002
FD.DVR= 000020   	HA.UAT= 000004   	N.FNPT= 000012   	R$$MUL= 000000   	WI.LCK= 000001
FD.EFB= 000004   	HA.UI = 000001   	N.FNSZ= 000010   	R$$OPF= 000000   	.SAVR1= ****** GX
FD.EF1= 000010   	HA.VER= 000007   	PP.SEP= 000002   	R$$RSL= 000000   	.WAIT   000000RG
FD.EOF= 000002   	NB.DOT= 100000   	PP.ZER= 000001   	R$$SEQ= 000000   	..WAEF= ****** GX
FD.WRT= 000001   	NB.SMI= 040000   	R$$ANI= 000000   	R$$SPL= 000000   	..WAIT= ****** GX
F.BKST= ****** GX	N.DRPT= 000006   	R$$BBF= 000000   	R$$11M= 000001   	...CTL= 000001
HA.CHU= 000003

. ABS.	000000	   000
      	000022	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2539 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[41,10]WAITU,[41,20]WAITU/-SP=[41,30]FCSPRE,WAITU
WATNOD 0100MS, WAIT IF OUT OF N	MACRO M1108  05-DEC-77 22:22  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
WATNOD 0100MS, WAIT IF OUT OF N	MACRO M1108  05-DEC-77 22:22  PAGE 7


						.TITLE	WATNOD 0100MS, WAIT IF OUT OF NODES
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 10-OCT-73
     21					;
     22					;+
     23					; SEE IF I/O STATUS SHOWS "OUT OF NODES" ERROR
     24					; AND IF IT DOES, WAIT FOR SIGNIFICANT EVENT.
     25					; CALLING SEQUENCE:
     26					;	CALL	..WAND
     27					; INPUTS;
     28					;	R0=RDB
     29					;	R1=I/O STATUS BLOCK ADDRESS
     30					; OUTPUTS:
     31					;	C=1 IF OUT OF NODES AND WAIT WAS COMPLETED.
     32					;	C=1 IF ERROR WAS NOT "OUT OF NODE"
     33					;	ALL REGISTERS PRESERVED
     34					;-
     35	000000	122711 	000000G		..WAND::CMPB	#IE.UPN,@R1
     36	000004	001402 				BEQ	10$
     37	000006	000261 				SEC
     38	000010					RETURN
     39	000012				10$:	WSIG$S
     40	000020					RETURN
     41					;
     42					;
     43	000022					$END	WATNOD
     44					;
     45					;
     46		000001 				.END
WATNOD 0100MS, WAIT IF OUT OF N	MACRO M1108  05-DEC-77 22:22  PAGE 7-1
SYMBOL TABLE

BD.FRE= 000001   	HA.FP = 000002   	N.DRPT= 000006   	R$$BBF= 000000   	R$$SPL= 000000
DIRTYP= 015172   	HA.NAM= 000005   	N.DRSZ= 000004   	R$$DPB= 000001   	R$$11M= 000001
FCSEFN= 000040   	HA.TYP= 000006   	N.DVPT= 000002   	R$$EIS= 000000   	SYDEV = 054523
FD.DVR= 000020   	HA.UAT= 000004   	N.DVSZ= 000000   	R$$LCL= 000000   	SYUNIT= 000000
FD.EFB= 000004   	HA.UI = 000001   	N.FNPT= 000012   	R$$MUL= 000000   	WI.DLK= 000002
FD.EF1= 000010   	HA.VER= 000007   	N.FNSZ= 000010   	R$$OPF= 000000   	WI.LCK= 000001
FD.EOF= 000002   	IE.UPN= ****** GX	PP.SEP= 000002   	R$$RSL= 000000   	..WAND  000000RG
FD.WRT= 000001   	NB.DOT= 100000   	PP.ZER= 000001   	R$$SEQ= 000000   	...CTL= 000001
HA.CHU= 000003   	NB.SMI= 040000   	R$$ANI= 000000

. ABS.	000000	   000
      	000022	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2624 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[41,10]WATNOD,[41,20]WATNOD/-SP=[41,30]FCSPRE,WATNOD
WATSET 0101MS, WAIT FOR I/O DON	MACRO M1108  05-DEC-77 22:22  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
WATSET 0101MS, WAIT FOR I/O DON	MACRO M1108  05-DEC-77 22:22  PAGE 7


						.TITLE	WATSET 0101MS, WAIT FOR I/O DONE, SET REC POINTERS
						.IDENT	/0101MS/
      2					; ALTERED TUESDAY 18-JUN-74 13:00
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 10-OCT-73
     21					;
WATSET 0101MS, WAIT FOR I/O DON	MACRO M1108  05-DEC-77 22:22  PAGE 8


     23					;+
     24					; WAIT FOR IO DONE ON SPECIFIED IO STATUS BLOCK AND
     25					; SET F.NREC, F.EOBB AS WELL AS F.ERR
     26					; CALLING SEQUENCE:
     27					;	CALL	..WAST
     28					; INPUTS:
     29					;	R0=FDB
     30					;	R1=IO STATUS BLOCK ADR
     31					; OUTPUTS
     32					;	C=0 IF OK, C=1 IF ERROR
     33					;	F.ERR SET TO IO STATUS CODE
     34					;	F.NREC TO BEGIN OF DATA
     35					;	F.EOBB TO END OF DATA (VBN)
     36					;	R0,R1 R3-R5 PRESERVED R2 ALTERED
     37					;-
     38	000000				..WAST::
     39	000000					CALL	..WAIT
     40	000004	016102 	000002 			MOV	2(R1),R2	;NO. OF BYTES XFERRED
     41						.IF	GT,R$$BBF	;BUFFERS BIGGER THAN 1 BLOCK
     42						BITB	#FD.REC,F.RCTL(R0)
     43						BNE	10$
     44						CMP	R2,F.VBSZ(R0)	;IF BIGGER, USE VB SIZE
     45						BLOS	10$
     46						MOV	F.VBSZ(R0),R2
     47					10$:
     48						.ENDC
     49	000010	010146 				MOV	R1,-(SP)	;PRESERVE R1
     50	000012	062701 	000000G			ADD	#S.BFHD,R1
     51	000016	010160 	000000G			MOV	R1,F.NREC(R0)
     52	000022	060201 				ADD	R2,R1
     53	000024	010160 	000000G			MOV	R1,F.EOBB(R0)
     54	000030	012601 				MOV	(SP)+,R1	;RESTORE R1
     55	000032					CALLR	..FCSX
     56					;
     57					;
     58	000036					$END	WATSET
     59					;
     60					;
     61		000001 				.END
WATSET 0101MS, WAIT FOR I/O DON	MACRO M1108  05-DEC-77 22:22  PAGE 8-1
SYMBOL TABLE

BD.FRE= 000001   	HA.CHU= 000003   	N.DRSZ= 000004   	R$$EIS= 000000   	SYUNIT= 000000
DIRTYP= 015172   	HA.FP = 000002   	N.DVPT= 000002   	R$$LCL= 000000   	S.BFHD= ****** GX
FCSEFN= 000040   	HA.NAM= 000005   	N.DVSZ= 000000   	R$$MUL= 000000   	WI.DLK= 000002
FD.DVR= 000020   	HA.TYP= 000006   	N.FNPT= 000012   	R$$OPF= 000000   	WI.LCK= 000001
FD.EFB= 000004   	HA.UAT= 000004   	N.FNSZ= 000010   	R$$RSL= 000000   	$$    = 000067
FD.EF1= 000010   	HA.UI = 000001   	PP.SEP= 000002   	R$$SEQ= 000000   	..FCSX= ****** GX
FD.EOF= 000002   	HA.VER= 000007   	PP.ZER= 000001   	R$$SPL= 000000   	..WAIT= ****** GX
FD.WRT= 000001   	NB.DOT= 100000   	R$$ANI= 000000   	R$$11M= 000001   	..WAST  000000RG
F.EOBB= ****** GX	NB.SMI= 040000   	R$$BBF= 000000   	SYDEV = 054523   	...CTL= 000001
F.NREC= ****** GX	N.DRPT= 000006   	R$$DPB= 000001

. ABS.	000000	   000
      	000036	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2544 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[41,10]WATSET,[41,20]WATSET/-SP=[41,30]FCSPRE,WATSET
WRITE 0101MS, FCS WRITE VIRTUAL	MACRO M1108  05-DEC-77 22:22  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
WRITE 0101MS, FCS WRITE VIRTUAL	MACRO M1108  05-DEC-77 22:22  PAGE 7


						.TITLE	WRITE 0101MS, FCS WRITE VIRTUAL BLOCK
						.IDENT	/0101MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					; ALTERED WED 16-FEB-75 13:30
      4					;
      5					;                             COPYRIGHT (C) 1973, 1978 BY
      6					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      7					;
      8					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      9					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     10					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     11					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     12					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     13					;
     14					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     15					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     16					;       CORPORATION.
     17					;
     18					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     19					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     20					;
     21					; PETER H. LIPMAN 11-AUG-73
     22					;
WRITE 0101MS, FCS WRITE VIRTUAL	MACRO M1108  05-DEC-77 22:22  PAGE 8


     24					;+
     25					; ISSUE THE QI/O WRITE VIRTUAL BLOCK-READ/WRITE MODE
     26					; CALLING SEQUENCE:
     27					;	CALL	.WRITE
     28					; INPUTS:
     29					;	R0=FDB ADDRESS
     30					;	F.BKVB(R0)F.BKVB+2(R0)=DESIRED VIRTUAL BLOCK NUMBER
     31					;	F.BKDS(R0)=NO. OF BYTES TO WRITE
     32					;	F.BKDS+2(R0)=ADDRESS TO WRITE DATA FROM
     33					;	F.BKEF(R0)=EVENT FLAG - USE FCS DEFAULT IF 0.
     34					;	F.BKST(R0)=ADDRESS OF I/O STATUS BLOCK OR 0
     35					;	F.BKDN(R0)=ADDRESS OF I/O DONE AST ADDRESS OR 0
     36					; OUTPUTS:
     37					;	C=0 IF QI/O WAS ISSUED SUCCESSFULLY
     38					;	C=1 IF ERROR, F.ERR(R0) SET TO ERRORS CODE
     39					;	ALL REGISTERS PRESERCED
     40					;	F.BKVB(R0),F.BKVB+2(R0) IS INCREMENTED AFTER QI/O
     41					;
     42					; OPERATION:
     43					;	ALLOCATES SPACE TO THE FILE IF DESIRED VBN IS
     44					; BEYOND THE CURRENTLY ALLOCATED SPACE. KEEPS TRADE OF THE
     45					; HIGHEST VBN WRITTEN FOR EOF INFORMATION. RETURNS THE
     46					; LOW BYTE OF THE DIRECTIVE STATUS WORD IN F.ERR(R0) IF
     47					; THE QI/O FAILED. INCREMENTS THE VBN AFTER THE QI/O
     48					; IS ISSUED FOR AUTOMATIC SEQUENTIAL WRITING. THE
     49					; FOLLOWING RESTRICTIONS APPLY:
     50					;	1) THIS ROUTINE ONLY WORKS FOR BLOCK ORIENTED BYTES,
     51					; RECORD ORIENTED DEVIES ARE XPLICITLY EXCLUDED.
     52					;	2) THE NUMBER OF BYTES TO TRANSFER IS LIMITED TO
     53					; NO MORE THAN 1 BLOCK (512. BYTES).
     54					;-
     55	000000				.WRITE::.SAVR1
     56	000004					CALL	..RWCK
     57	000010	103436 				BCS	30$
     58	000012					CALL	..SEFB
     59	000016	103007 				BCC	10$
     60
     61					;WRITING AT OR BEYOND EOF
     62
     63	000020	016001 	000000G			MOV	F.VBN(R0),R1
     64	000024	016002 	000002G			MOV	F.VBN+2(R0),R2
     65	000030					CALL	..ALC1		;CHECK IT ALLOCATED SPACE IS SUFFICIENT
     66	000034	103424 				BCS	30$		;BRANCH IF COULDN'T ALLOCATE NEEDED SPACE
     67
     68	000036	012704 	000000G		10$:	MOV	#IO.WVB,R4
     69	000042					CALL	..WTRD		;ISSUE THE QI/O
     70	000046	132760 	000004 	000000G		BITB	#FD.EFB,F.BKP1(R0)  ;WAITING NEW EOF?
     71	000054	001410 				BEQ	20$		;BRANCH IF NO
     72	000056	016060 	000000G	000000G		MOV	F.VBN(R0),F.EFBK(R0)  ;EFBK = INCREMENTED BLOCK NO.
     73	000064	016060 	000002G	000002G		MOV	F.VBN+2(R0),F.EFBK+2(R0)
     74	000072	005060 	000000G			CLR	F.FFBY(R0)	;AND INDICATE FIRST BYTE IN BLOCK
     75	000076	105760 	000000G		20$:	TSTB	F.ERR(R0)	;SEE IF ERROR - CLEARS CARRY
     76	000102	003001 				BGT	30$		;BRANCH IF NO ERROR
     77	000104	000261 				SEC
     78	000106				30$:	RETURN
     79					;
     80					;
WRITE 0101MS, FCS WRITE VIRTUAL	MACRO M1108  05-DEC-77 22:22  PAGE 8-1


     81	000110					$END	WRITE
     82					;
     83					;
     84		000001 				.END
WRITE 0101MS, FCS WRITE VIRTUAL	MACRO M1108  05-DEC-77 22:22  PAGE 8-2
SYMBOL TABLE

BD.FRE= 000001   	F.FFBY= ****** GX	NB.SMI= 040000   	R$$DPB= 000001   	WI.DLK= 000002
DIRTYP= 015172   	F.VBN = ****** GX	N.DRPT= 000006   	R$$EIS= 000000   	WI.LCK= 000001
FCSEFN= 000040   	HA.CHU= 000003   	N.DRSZ= 000004   	R$$LCL= 000000   	$$    = 000067
FD.DVR= 000020   	HA.FP = 000002   	N.DVPT= 000002   	R$$MUL= 000000   	.SAVR1= ****** GX
FD.EFB= 000004   	HA.NAM= 000005   	N.DVSZ= 000000   	R$$OPF= 000000   	.WRITE  000000RG
FD.EF1= 000010   	HA.TYP= 000006   	N.FNPT= 000012   	R$$RSL= 000000   	..ALC1= ****** GX
FD.EOF= 000002   	HA.UAT= 000004   	N.FNSZ= 000010   	R$$SEQ= 000000   	..RWCK= ****** GX
FD.WRT= 000001   	HA.UI = 000001   	PP.SEP= 000002   	R$$SPL= 000000   	..SEFB= ****** GX
F.BKP1= ****** GX	HA.VER= 000007   	PP.ZER= 000001   	R$$11M= 000001   	..WTRD= ****** GX
F.EFBK= ****** GX	IO.WVB= ****** GX	R$$ANI= 000000   	SYDEV = 054523   	...CTL= 000001
F.ERR = ****** GX	NB.DOT= 100000   	R$$BBF= 000000   	SYUNIT= 000000

. ABS.	000000	   000
      	000110	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2549 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[41,10]WRITE,[41,20]WRITE/-SP=[41,30]FCSPRE,WRITE
WTWAIT 0100S, WRITE VBN AND WAI	MACRO M1108  05-DEC-77 22:22  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
WTWAIT 0100S, WRITE VBN AND WAI	MACRO M1108  05-DEC-77 22:22  PAGE 7


						.TITLE	WTWAIT 0100S, WRITE VBN AND WAIT
						.IDENT	/0100S/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 16-AUG-73
     21					;
WTWAIT 0100S, WRITE VBN AND WAI	MACRO M1108  05-DEC-77 22:22  PAGE 8


     23					;+
     24					;
     25					; WRITE VBN AND RETURN WITH NEXT BUFFERS SET UP TO
     26					; PUT DATA IN
     27					; CALLING SEQUENCE:
     28					;	CALL	..WTWA
     29					; INPUTS:
     30					;	R0=FDB
     31					;	F.BDB+#S.BFHD=ADDRESS OF DATA
     32					;	F.BBFS(R0)=NO. OF BYTES TO WRITE
     33					;	0=CARRIAGE CONTROL
     34					; ALTERNATE ENTRY:
     35					;	CALL	..WTW1
     36					; INPUTS;
     37					;	R0=FDB
     38					;	R1=ADDRESS OF DATA
     39					;	R2=NO. OF BYTES TO WRITE
     40					;	R3=CARRIAGE CONTROL BUFFER
     41					; OUTPUTS:
     42					;	C=0 IF OK, C=1 IF ERROR, F.ERR(R0) SET
     43					;	R0=PRESERVED, R1-R5 ALTERED
     44					;	F.NREC(R0),F.EOBB(R0)SET FOR NEXT PUT'S
     45					;	F.BDB(R0)SET TO BUFFER DESCRIPTOR IN USE
     46					;
     47					; OPERATION:
     48					; IF WRITE ERROR OCCURRED WITH WRITE BEHIND LOGIC
     49					; ENABLED, THEN F.BDB WILL POINT TO THE BAD BUFFER.
     50					; THIS WILL HAPPEN ON A SUBSEQUENT WRITE AS SOON AS THE ERROR IS NOTICED.
     51					; ALTERNATE ENTRY:
     52					;	CALL	..WTWD
     53					; OPERATION:
     54					;	IDENTICAL TO ..WTWA EXCEPT THAT IT FORCES
     55					; A WRITE OF A BIG BUFFER EVEN IF THE WRITE WOULD NORMALLY
     56					; HAVE BEEN DELAYED BY JUST POSITIONING TO THE NEXT BLOCK IN
     57					; THE BUFFER. IF R$$BBF IS 0 THEN ..WTWD=..WTWA.
     58					;-
     59	000000				..WTWD::
     60						.IF	GT,R$$BBF
     61						BISB	#FD.BGD,F.MBFG(R0)	;FORCE DUMP OF BUFFER
     62						CALL	..WTWA
     63						BICB	#FD.BGD,F.MBFG(R0)
     64						RETURN
     65
     66						.ENDC
     67	000000				..WTWA::CALL	..BKRG
     68	000004				..WTW1::
     69	000004	132760 	000004 	000000G		BITB	#FD.EFB,F.BKP1(R0) ;PUTTING AT EOF?
     70	000012	001403 				BEQ	10$		;BRANCH IF NO.
     71	000014					CALL	..ALOC		;ALLOCATE SPACE IF NECESSARY
     72	000020	103441 				BCS	90$		;BRANCH IF FAILED TO ALLOCATE.
     73	000022				10$:
     74						.IF	GT,R$$BBF
     75						BITB	#FD.BGB,F.MBFG(R0) ;BIG BUFFERS ACTIVE?
     76						BEQ	30$		;BRANCH IF NO.
     77						BITB	#FD.BGD,F.MBFG(R0) ;DUMP THE BIG BUFFER?
     78						BNE	30$		;BRANCH IF YES
     79						MOV	F.BDB(R0),R4
WTWAIT 0100S, WRITE VBN AND WAI	MACRO M1108  05-DEC-77 22:22  PAGE 8-1


     80						MOV	R4,R5
     81						ADD	#S.BFHD,R5
     82						ADD	B.BBFS(R4),R5	;R5=END OF BIG BUFFER
     83						CMP	F.EOBB(R0),R5	;IS EOBB AT END OF BIG BUFFER?
     84						BHIS	30$		;BRANCH IS YES, WRITE IT
     85						MOV	F.EOBB(R0),R4	;THIS BECOMES BEGINNING OF NEXT VBN
     86						MOV	R4,F.NREC(R0)	;
     87						ADD	F.VBSZ(R0)	;R4=AND OF NEXT VBN
     88						CMP	R4,R5		;BEYOND END OF BUFFER?
     89						BLOS	20$		;BRANCH IF NO
     90						MOV	R5,R4		;YES, USE END OF BIG BUFFER
     91					20$:	MOV	R4,F.EOBB(R0)
     92						ADD	#1,F.VBN+2(R0)
     93						ADC	F.VBN(R0)
     94						BR	85$
     95						.ENDC
     96					; WRITE THIS BLOCK, R1,R2,R3 ALL SET MUST SAVE
     97					; FOR RETRY IF NO NODES AVAILABLE
     98					;
     99	000022	010146 			30$:	MOV	R1,-(SP)
    100	000024	010246 				MOV	R2,-(SP)
    101	000026	010346 				MOV	R3,-(SP)
    102	000030					CALL	..WBLK		;ISSUE QIO WRITE VIRTUAL BLOCK
    103	000034	103010 				BCC	40$		;BRANCH IF SUCCESSFUL
    104	000036	012603 				MOV	(SP)+,R3	;FAILED TO QIO
    105	000040	012602 				MOV	(SP)+,R2
    106	000042	012604 				MOV	(SP)+,R4	;
    107	000044					CALL	..WAND		;OUT OF NODES? -WAIT IF YES
    108	000050	103411 				BCS	82$		;BRANCH IF SOME OTHER ERROR
    109	000052	010401 				MOV	R4,R1
    110	000054	000762 				BR	30$		;TRY QIO AGAIN
    111	000056	062706 	000006 		40$:	ADD	#6,SP
    112	000062	142760 	000001 	000000G		BICB	#FD.WRT,F.BKP1(R0) ;RESET "DIRTY"BUFFER BIT
    113						.IF	GT,R$$MBF	;MULTIPLE BUFFERING
    114						BITB	#FD.WBH,F.MBFG(R0) ;IS WRITE BEHIND ACTIVE?
    115						BEQ	80$		;BRANCH IF NO, SINGLE BUFFERING
    116					; WITH WRITE AHEAD, SCAN ENTIRE BUFFER RING LOOKING
    117					; FOR BUFFER WITH I/O STATUS NON ZERO. SAVE
    118					; FIRST OF THESE IN F.BDB-IF FIND ONE WITH
    119					; NEGATIVE STATUS (UNLESS EOF IN R$$BBF) SET THAT
    120					; ONE UP AS F.BDB AND RETURN ERROR.
    121					50$:	MOV	F.BDB(R0),R4
    122						CLR	R5
    123						BISB	F.MBC1(R0),R5
    124						CLR	R1		;INITIALIZE TO NO BUFFER AVAILABLE
    125					55$:
    126						TSTB	@R4		;SCAN ENTIRE BUFFER RING
    127						BEQ	60$		;
    128						BLT	70$		;NEGATIVE MEANS WRITE ERROR
    129						MOV	R4,R1		;R1=BUFFER THAT IS AVAILABLE
    130					60$:	MOV	B.NXBD(R4),R4
    131						SOB	R5,55$
    132						TST	R1		;FOUND A FREE BUFER?
    133						BNE	75$		;BRANCH IF YES
    134						CALL	..WAEF		;WAIT FOR EVENT FLAG
    135						BR	50$		;AND TRY AGAIN
    136					70$:	MOV	R4,R1
WTWAIT 0100S, WRITE VBN AND WAI	MACRO M1108  05-DEC-77 22:22  PAGE 8-2


    137						.IF	GT,R$$BBF	;IF BIG BUFFERS
    138						CALL	RSTEOF		;IGNORE EOF ERROR
    139						BCC	60$		;BRANCH IF IT WS EOF
    140						.ENDC
    141					75$:	MOV	R1,F.BDB(R0)
    142						BR	82$
    143						.ENDC
    144					; SINGLE BUFFERING, WAIT FOR I/O DONE, R1=F.BDB
    145	000070				80$:	CALL	..WAIT
    146						.IF	GT,R$$BBF
    147						CALL	RSTEOF
    148						.ENDC
    149					; R1=F.BDB=BUFFER DESCRIPTOR ADDRESS
    150	000074	062760 	000001 	000002G	82$:	ADD	#1,F.VBN+2(R0)	;INCREMENT VIRTUAL BLOCK NUMBER
    151	000102	005560 	000000G			ADC	F.VBN(R0)
    152	000106					CALL	..BDRC
    153	000112	117060 	000000G	000000G	85$:	MOVB	@F.BDB(R0),F.ERR(R0)
    154	000120					CALL	..FCSX
    155	000124				90$:	RETURN
    156					;
    157					;
    158	000126					$END	WTWAIT
    159					;
    160					;
    161		000001 				.END
WTWAIT 0100S, WRITE VBN AND WAI	MACRO M1108  05-DEC-77 22:22  PAGE 8-3
SYMBOL TABLE

BD.FRE= 000001   	HA.CHU= 000003   	N.DVSZ= 000000   	R$$MUL= 000000   	..ALOC= ****** GX
DIRTYP= 015172   	HA.FP = 000002   	N.FNPT= 000012   	R$$OPF= 000000   	..BDRC= ****** GX
FCSEFN= 000040   	HA.NAM= 000005   	N.FNSZ= 000010   	R$$RSL= 000000   	..BKRG= ****** GX
FD.DVR= 000020   	HA.TYP= 000006   	PP.SEP= 000002   	R$$SEQ= 000000   	..FCSX= ****** GX
FD.EFB= 000004   	HA.UAT= 000004   	PP.ZER= 000001   	R$$SPL= 000000   	..WAIT= ****** GX
FD.EF1= 000010   	HA.UI = 000001   	R$$ANI= 000000   	R$$11M= 000001   	..WAND= ****** GX
FD.EOF= 000002   	HA.VER= 000007   	R$$BBF= 000000   	SYDEV = 054523   	..WBLK= ****** GX
FD.WRT= 000001   	NB.DOT= 100000   	R$$DPB= 000001   	SYUNIT= 000000   	..WTWA  000000RG
F.BDB = ****** GX	NB.SMI= 040000   	R$$EIS= 000000   	WI.DLK= 000002   	..WTWD  000000RG
F.BKP1= ****** GX	N.DRPT= 000006   	R$$LCL= 000000   	WI.LCK= 000001   	..WTW1  000004RG
F.ERR = ****** GX	N.DRSZ= 000004   	R$$MBF= 000000   	$$    = 000067   	...CTL= 000001
F.VBN = ****** GX	N.DVPT= 000002

. ABS.	000000	   000
      	000126	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2580 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:14
[41,10]WTWAIT,[41,20]WTWAIT/-SP=[41,30]FCSPRE,WTWAIT
XQIOI 0101MS, EXECUTE QI/O - IN	MACRO M1108  05-DEC-77 22:23  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
XQIOI 0101MS, EXECUTE QI/O - IN	MACRO M1108  05-DEC-77 22:23  PAGE 7


						.TITLE	XQIOI 0101MS, EXECUTE QI/O - INTERNAL
						.IDENT	/0101MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1975, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 10-OCT-73
     21					;
XQIOI 0101MS, EXECUTE QI/O - IN	MACRO M1108  05-DEC-77 22:23  PAGE 8


     23					;+
     24					; BUILD THE STANDARD 6 WORD QI/O DPB IN SPECIFIED AREA
     25					; AND ISSUE THE QI/O
     26					; CALLING SEQUENCE:
     27					;	CALL	..XQIO
     28					; INPUTS:
     29					;	R0=FDB
     30					;	R4=I/O FUNCTION CODE
     31					;	R3=DIRECTIVE CODE AND DPB SIZE
     32					;	R5=DPB ADDRESS
     33					; OUTPUTS:
     34					;	R1=I/O STATUS BLOCK ADDRESS
     35					;	R0 PRESERVED, R2-R5 ALTERED
     36					;	C=0 IF OK, C=1 IF ERROR, F.ERR SET FROM
     37					;	    DIRECTIVE STATUS WORD
     38					; ALTERNATE ENTRY:
     39					;	CALL	..XQI1
     40					; INPUTS:
     41					;	R1=I/O STATUS BLOCK ADDRESS OR 0
     42					;	R2=I/O DONE AST ADDRESS OR 0
     43					;	R0=FDB
     44					;	R4=I/O FUNCTION CODE
     45					;	R3=DIC & DPB SIZE
     46					; OPERATION:
     47					; THE SPECIALIZED QI/O FUNCTION PARAMETERS HAVE ALREADY
     48					; BEEN PLACED IN THE QI/O DPB.  THIS ROUTINE PLACES THE
     49					; STANDARD 6 WORDS INTO THE DPB, USING THE DEFAULT EVENT
     50					; FLAG IF F.EFN(R0)=0, AND USING THE SCRATCH I/O STATUS
     51					; BLOCK IN THE FILE STORAGE REGION IF THE F.BDB(R0)=0.
     52					; THEN IT ISSUES THE QI/O
     53					;-
     54	000000				..XQIO::
     55	000000	016001 	000000G			MOV	F.BDB(R0),R1	;ADDRESS OF I/O STATUS BLOCK
     56	000004	001003 				BNE	10$		;UNLESS FILE ISN'T OPEN
     57	000006	010501 				MOV	R5,R1		;IN WHICH CASE USE THE SCRATCH
     58	000010	062701 	000000C			ADD	#A.IOST-A.DPB,R1 ;I/O STATUS BLOCK IN THE FSR
     59	000014	005002 			10$:	CLR	R2		;NO I/O DONE AST
     60
     61	000016	010546 			..XQI1::MOV	R5,-(SP)	;PUSH DPB ADDRESS
     62	000020	010325 				MOV	R3,(R5)+	;STORE DIRECTIVE CODE AND DPB SIZE
     63	000022	010425 				MOV	R4,(R5)+	;STORE I/O FUNCTION CODE
     64	000024	116025 	000000G			MOVB	F.LUN(R0),(R5)+	;STORE LUN
     65	000030	105025 				CLRB	(R5)+		;ZERO PRIORITY (DEFAULT)
     66	000032	116004 	000000G			MOVB	F.EFN(R0),R4	;R4=EFN IF SPECIFIED
     67	000036	001002 				BNE	10$
     68	000040	012704 	000040 			MOV	#FCSEFN,R4	;USE DEFAULT IF NOT SPECIFIED
     69	000044	010425 			10$:	MOV	R4,(R5)+	;STORE EVENT FLAG
     70	000046	010125 				MOV	R1,(R5)+	;STORE I/O STATUS BLOCK ADDRESS
     71	000050	010215 				MOV	R2,(R5)		;STORE I/O DONE AST ADDRESS
     72	000052					DIR$			;ISSUE THE DIRECTIVE, DPB ADR ON STACK
     73	000054	103007 				BCC	20$		;BRANCH IF SUCCESSFUL
     74	000056	010104 				MOV	R1,R4		;ANY I/O STATUS BLOCK?
     75	000060	001405 				BEQ	20$		;BRANCH IF NO
     76	000062	113711 	000000G			MOVB	@#$DSW,(R1)	;STORE ERROR CODE IN I/O STATUS BLOCK
     77	000066	112760 	177777 	000001G		MOVB	#-1,F.ERR+1(R0)	;DISTINGUISH QI/O ERRORS FORM HANDLER
     78	000074				20$:	RETURN
     79					;
XQIOI 0101MS, EXECUTE QI/O - IN	MACRO M1108  05-DEC-77 22:23  PAGE 8-1


     80					;+
     81					; INITIALIZE THE DPB FOR A QI/O
     82					; CALLING SEQUENCE:
     83					;	CALL	..IDPB
     84					; INPUTS:
     85					;	NONE
     86					; OUTPUTS:
     87					;	R5=ADDRESS OF PARAMETER AREA OF DPB
     88					;	R0-R4 PRESERVED
     89					; OPERATION:
     90					;	ZEROS THE 6 WORDS OF QI/O PARAMETERS AND RETURNS THE ADDRESS
     91					; OF THE BEGINNING OF THE PARAMETERS IN R5
     92					;-
     93	000076				..IDPB::
     94	000076	013705 	000000G			MOV	@#.FSRPT,R5
     95	000102	062705 	000030G			ADD	#A.DPB+24.,R5	;R5=ADR OF END OF PARAMETER BLOCK
     96	000106	010446 				MOV	R4,-(SP)		;SAVE R4
     97	000110	012704 	000006 			MOV	#6,R4
     98	000114	005045 			10$:	CLR	-(R5)
     99	000116					SOB	R4,10$
    100	000122	012604 				MOV	(SP)+,R4
    101	000124					RETURN
    102					;
    103					;
    104	000126					$END	XQIOI
    105					;
    106					;
    107		000001 				.END
XQIOI 0101MS, EXECUTE QI/O - IN	MACRO M1108  05-DEC-77 22:23  PAGE 8-2
SYMBOL TABLE

A.DPB = ****** GX	F.EFN = ****** GX	NB.SMI= 040000   	R$$BBF= 000000   	SYDEV = 054523
A.IOST= ****** GX	F.ERR = ****** GX	N.DRPT= 000006   	R$$DPB= 000001   	SYUNIT= 000000
BD.FRE= 000001   	F.LUN = ****** GX	N.DRSZ= 000004   	R$$EIS= 000000   	WI.DLK= 000002
DIRTYP= 015172   	HA.CHU= 000003   	N.DVPT= 000002   	R$$LCL= 000000   	WI.LCK= 000001
FCSEFN= 000040   	HA.FP = 000002   	N.DVSZ= 000000   	R$$MUL= 000000   	$DSW  = ****** GX
FD.DVR= 000020   	HA.NAM= 000005   	N.FNPT= 000012   	R$$OPF= 000000   	.FSRPT= ****** GX
FD.EFB= 000004   	HA.TYP= 000006   	N.FNSZ= 000010   	R$$RSL= 000000   	..IDPB  000076RG
FD.EF1= 000010   	HA.UAT= 000004   	PP.SEP= 000002   	R$$SEQ= 000000   	..XQIO  000000RG
FD.EOF= 000002   	HA.UI = 000001   	PP.ZER= 000001   	R$$SPL= 000000   	..XQI1  000016RG
FD.WRT= 000001   	HA.VER= 000007   	R$$ANI= 000000   	R$$11M= 000001   	...CTL= 000001
F.BDB = ****** GX	NB.DOT= 100000

. ABS.	000000	   000
      	000126	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2688 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[41,10]XQIOI,[41,20]XQIOI/-SP=[41,30]FCSPRE,XQIOI
XQIOU 0100MS, EXECUTE QI/O - US	MACRO M1108  05-DEC-77 22:23  PAGE 1


      1					;<BELANGER>FCSPRE.MAC.1,  9-NOV-76 11:24:23, EDIT BY BELANGER
XQIOU 0100MS, EXECUTE QI/O - US	MACRO M1108  05-DEC-77 22:23  PAGE 7


						.TITLE	XQIOU 0100MS, EXECUTE QI/O - USER INTERFACE
						.IDENT	/0100MS/
      2					; ALTERED FRIDAY 8-FEB-74 16:20
      3					;
      4					;                             COPYRIGHT (C) 1973, 1978 BY
      5					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      6					;
      7					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
      8					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
      9					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     10					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     11					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     12					;
     13					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     14					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     15					;       CORPORATION.
     16					;
     17					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     18					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     19					;
     20					; PETER H. LIPMAN 10-OCT-73
     21					;
XQIOU 0100MS, EXECUTE QI/O - US	MACRO M1108  05-DEC-77 22:23  PAGE 8


     23					;+
     24					; EXECUTE A QI/O SYSTEM DIRECTIVE, AND WAIT FOR IT'S COMPLETION
     25					; CALLING SEQUENCE:
     26					;	CALL	.XQIO
     27					; INPUTS:
     28					;	R0=FDB ADDRESS, LUN AND EVENT FLAG USED
     29					;	R1=I/O FUNCTION CODE
     30					;	R2=NO. OF EXTRA PARAMETERS BEYOND THE STANDARD QI/O DPB
     31					;	R3=ADDRESS OF EXTRA PARAMETER BLOCK, IF R2 IS NON-ZERO
     32					; OUTPUTS:
     33					;	C=0 IF OK, C=1 IF ERROR, F.ERR SET TO REASON WHY
     34					;	ALL REGISTERS PRESERVED
     35					;-
     36	000000				.XQIO::.SAVR1
     37	000004	012760 	000001 	000000G		MOV	#1,F.ERR(R0)
     38	000012	010104 				MOV	R1,R4		;I/O FUNCTION CODE
     39	000014					CALL	..IDPB		;INIT THE DPB, SET R5 TO PARAM BLOCK
     40	000020	005702 				TST	R2
     41	000022	001403 				BEQ	20$
     42	000024	012325 			10$:	MOV	(R3)+,(R5)+	;MOVE THE PARAMTERS TO THE DPB
     43	000026					SOB	R2,10$
     44	000032				20$:	CALLR	..QIOW		;ISSUE THE QI/O, WAIT, AND RETURN
     45					;
     46					;
     47	000036					$END	XQIOU
     48					;
     49					;
     50		000001 				.END
XQIOU 0100MS, EXECUTE QI/O - US	MACRO M1108  05-DEC-77 22:23  PAGE 8-1
SYMBOL TABLE

BD.FRE= 000001   	HA.FP = 000002   	N.DVPT= 000002   	R$$EIS= 000000   	SYUNIT= 000000
DIRTYP= 015172   	HA.NAM= 000005   	N.DVSZ= 000000   	R$$LCL= 000000   	WI.DLK= 000002
FCSEFN= 000040   	HA.TYP= 000006   	N.FNPT= 000012   	R$$MUL= 000000   	WI.LCK= 000001
FD.DVR= 000020   	HA.UAT= 000004   	N.FNSZ= 000010   	R$$OPF= 000000   	$$    = 000067
FD.EFB= 000004   	HA.UI = 000001   	PP.SEP= 000002   	R$$RSL= 000000   	.SAVR1= ****** GX
FD.EF1= 000010   	HA.VER= 000007   	PP.ZER= 000001   	R$$SEQ= 000000   	.XQIO   000000RG
FD.EOF= 000002   	NB.DOT= 100000   	R$$ANI= 000000   	R$$SPL= 000000   	..IDPB= ****** GX
FD.WRT= 000001   	NB.SMI= 040000   	R$$BBF= 000000   	R$$11M= 000001   	..QIOW= ****** GX
F.ERR = ****** GX	N.DRPT= 000006   	R$$DPB= 000001   	SYDEV = 054523   	...CTL= 000001
HA.CHU= 000003   	N.DRSZ= 000004

. ABS.	000000	   000
      	000036	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2541 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[41,10]XQIOU,[41,20]XQIOU/-SP=[41,30]FCSPRE,XQIOU
ALERR	MACRO M1108  05-DEC-77 23:40  PAGE 3


      1						.TITLE	ALERR
      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 09-JUN-74
     22					;
     23					; MACRO LIBRARY CALLS
     24					;
     25
     26						.MCALL	DRERR$,WSIG$S
     27
     28					;
     29					; DEFINE DIRECTIVE STATUS ERROR CODES
     30					;
     31
     32	000000					DRERR$
     33
     34					;+
     35					; **-$ALERR-SUBROUTINE TO HANDLE AUTOLOAD ERRORS
     36					;
     37					; THIS ROUTINE IS CALLED TO PERFORM PARTIAL ERROR RECOVERY WHENEVER A
     38					; SEQMENT LOAD FAILURE OCCURS WHILE AN AUTOLOAD REQUEST IS IN PROGRESS.
     39					; IT IS ONE OF THE OVERLAY RUNTIME ROUTINES.
     40					;
     41					; INPUTS:
     42					;
     43					;	R2 = ADDRESS OF SEGMENT DESCRIPTOR OF SEGMENT
     44					;		WHERE LOAD FAILURE OCCURED.
     45					;
     46					; THE ROUTINE EXECUTES A 'WAITFOR SIGNIFICANT EVENT' DIRECTIVE IF THE DIRECTIVE
     47					; STATUS WORD CONTAINS ERROR CODE 'IE.UPN' (UNAVAILABLE POOL NODE) ELSE A
     48					; BPT INSTRUCTION IS EXECUTED. ON COMPLETION OF THE WAIT A RETURN WILL CAUSE
     49					; THE RUNTIME SYSTEM TO RE-TRY THE LOAD OVERLAY REQUEST. THE CONTENTS OF ALL
     50					; REGISTERS MUST BE PRESERVED.
     51					;
     52					; A RETURN IN-LINE FROM THE BPT SST WILL CAUSE A RE-TRY AS DESCRIBED ABOVE.
     53					;-
     54
     55	000000					.PSECT	$$ALER
     56
     57	000000				$ALERR::			;
ALERR	MACRO M1108  05-DEC-77 23:40  PAGE 3-1


     58	000000	023727 	000000G	177777 		CMP	@#$DSW,#IE.UPN	; UNAVAILABLE POOL NODE?
     59	000006	001004 				BNE	10$		; IF NE CAUSE BPT SST
     60	000010					WSIG$S			; WAIT FOR SIGNIFICANT EVENT
     61	000016	000401 				BR	20$		; EXIT TO RE-TRY
     62	000020				10$:				;
     63	000020	000003 				BPT			; GENERATE BPT SST
     64	000022				20$:				;
     65	000022					RETURN			; EXIT AND RE-TRY LOAD
     66
     67		000001 				.END
ALERR	MACRO M1108  05-DEC-77 23:40  PAGE 3-2
SYMBOL TABLE

CR    = 000015   	IE.IPR= 177641   	S$GATL  000152   	S$GRO   000030   	T$RDWN  000010
FF    = 000014   	IE.ITI= 177643   	S$GBLK  000002   	S$GRW   000032   	T$RLDA  000002
HT    = 000011   	IE.ITS= 177770   	S$GCST  000024   	S$GRWB  000162   	T$RLNG  000004
IE.ACT= 177771   	IE.LNL= 177646   	S$GDWN  000012   	S$GSEG  000164   	T$RNME  000014
IE.ADP= 177636   	IE.SDP= 177635   	S$GELT  000146   	S$GSEQ  000166   	T$RNXT  000012
IE.AST= 177660   	IE.ULN= 177773   	S$GLDA  000004   	S$GSTB  000036   	T$RUP   000006
IE.CKP= 177766   	IE.UPN= 177777   	S$GLGH  000172   	S$GSTS  000000   	VT    = 000013
IE.HWR= 177772   	IS.CLR= 000000   	S$GLNG  000006   	S$GUND  000140   	$ALERR  000000RG    002
IE.IDU= 177644   	IS.SET= 000002   	S$GMEM  000160   	S$GUP   000010   	$DSW  = ****** GX
IE.IEF= 177637   	LF    = 000012   	S$GNME  000020   	S$GVAD  000142   	$$MSG = 000000
IE.ILU= 177640   	R$$11M= 000000   	S$GNXT  000014   	S$ZSEG  000020   	...GBL= 000000
IE.INS= 177776   	SPA   = 000040   	S$GPRV  000016   	T$RBLK  000000

. ABS.	000172	   000
      	000000	   001
$$ALER	000024	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1544 WORDS  ( 7 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[46,10]ALERR,[46,20]ALERR/-SP=[46,30]MACFLM.,SEGDF.005,ALERR.000
AUTO	MACRO M1108  05-DEC-77 23:40  PAGE 3


      1						.TITLE	AUTO
      2						.IDENT	/07/                                                            ;**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 07
     21					;                                                                               ;**-1
     22					; D. N. CUTLER/C. MONIA 11-JAN-74
     23					;
     24					; MODIFICATIONS:
     25					;
     26					; NO.		DATE		PROGRAMMER
     27					; ---		----		----------
     28					;
     29					; 021		11-JAN-74	C. MONIA
     30					;
     31					;+
     32					; **-$AUTO-AUTOLOAD SEGMENT                                                     ;**-13
     33					;
     34					; THIS ROUTINE IS CALLED VIA A JSR INSTRUCTION FROM AN AUTOLOAD VEC-
     35					; TOR TO TRANSPARENTLY LOAD A SEGMENT. IT IS ONE OF THE RUN TIME
     36					; OVERLAY ROUTINES. IF THE SPECIFIED SEGMENT IS IN MEMORY, THEN CON-
     37					; TROL IS TRANSFERED DIRECTLY TO THE AUTOLOAD ENTRY POINT. ELSE ALL
     38					; APPROPRIATE SEGMENTS ARE MARKED OUT OF MEMORY AND THE PATH TO THE
     39					; SPECIFIED SEGMENT IS LOADED. CONTROL IS THEN TRANSFERED TO THE AUTO-
     40					; LOAD ENTRY POINT.
     41					;
     42					; INPUTS:
     43					;
     44					;	(SP) = ADDRESS OF 2 WORD AUTOLOAD PACKET                                ;**NEW**
     45					;                                                                               ;**-1
     46					; 	PACKET FORMAT:
     47					;
     48					;	.WORD	CALL SEG
     49					;	.WORD	AUTO ENT                                                        ;**-1
     50					;
     51					;	WHERE:
     52					;
     53					;	CALL SEG=ADDRESS OF SEGMENT DESCRIPTOR OF THE SEGMENT THAT CON-
     54					;		TROL IS TO BE TRANSFERED INTO.
     55					;	AUTO ENT=ADDRESS OF THE AUTOLOAD ENTRY POINT IN THE CALLED SEG-         ;**-1
     56					;		MENT.
     57					;
AUTO	MACRO M1108  05-DEC-77 23:40  PAGE 3-1


     58					; OUTPUTS:
     59					;
     60					;	THE APPROPRIATE SEGMENTS ARE MARKED OUT OF MEMORY, THE PATH IS
     61					;	LOADED TO THE CALLED SEGMENT, AND CONTROL IS TRANSFERED TO THE
     62					;	AUTOLOAD ENTRY POINT.
     63					;
     64					;	NOTE:	IF A LOAD ERROR OCCURS THEN A CALL TO '$ALERR' IS EXECUTED      ;**NEW**
     65					;		TO ACCOMPLISH ERROR RECOVERY. ON RETURN, THE REQUEST TO         ;**NEW**
     66					;		READ THE SEGMENT IS REPEATED. THE RECOVERY ROUTINE IS           ;**NEW**
     67					;		SUPPLIED WITH THE FOLLOWING INPUTS:                             ;**NEW**
     68					;                                                                               ;**NEW**
     69					;		R2 = ADDRESS OF SEGMENT DESCRIPTOR BEING PROCESSED WHEN         ;**NEW**
     70					;		      LOAD ERROR OCCURRED.                                      ;**NEW**
     71					;                                                                               ;**NEW**
     72					;		'$ALERR' IS NORMALLY INCLUDED DIRECTLY IN THE TASK IMAGE        ;**NEW**
     73					;		RATHER THAN WITHIN A RESIDENT LIBRARY TO FACILITATE SUBSTITU-   ;**NEW**
     74					;		TION OF A USER-WRITTEN RECOVERY PROCEDURE AT LINK TIME          ;**NEW**
     75					;-                                                                              ;**-6
     76
     77	000000					.PSECT	$$AUTO
     78	000000	017646 	000000 		$AUTO::	MOV	@(SP),-(SP)	;GET ADDR OF CALLED SEGMENT DESCRIPTOR
     79	000004	032736 	010000 			BIT	#10000,@(SP)+	; SEGMENT IN MEMORY?
     80	000010	001003 				BNE	AUTO1		; IF NE NO                                      ;**NEW**
     81	000012	062716 	000002 			ADD	#2,(SP)		; POINT TO ENTRY POINT ADDRESS                  ;**NEW**
     82	000016	013607 				MOV	@(SP)+,PC	;TRANSFER CONTROL TO ENTRY POINT                ;**-2
     83	000020				AUTO1:				;                                               ;**NEW**
     84	000020					SAVRG			; SAVE R3,R4,R5                                 ;**NEW**
     85					                                                                                ;**NEW**
     86					;                                                                               ;**NEW**
     87					; AT THIS POINT STACK CONTENTS ARE:                                             ;**NEW**
     88					;                                                                               ;**NEW**
     89					;	SP+10 = ADDRESS OF 2-WORD PACKET                                        ;**NEW**
     90					;	SP+06 = SAVED R5                                                        ;**NEW**
     91					;	SP+04 = SAVED R4                                                        ;**NEW**
     92					;	SP+02 = SAVED R3                                                        ;**NEW**
     93					;	SP+00 = RETURN TO REGISTER RESTORE ROUTINE                              ;**NEW**
     94					;                                                                               ;**NEW**
     95					                                                                                ;**NEW**
     96	000024	010246 				MOV	R2,-(SP)	; SAVE R2                                       ;**NEW**
     97	000026	016605 	000012 			MOV	12(SP),R5	; GET ADDRESS OF PACKET                         ;**NEW**
     98	000032	012502 				MOV	(R5)+,R2	; GET SEGMENT DESCRIPTOR ADDRESS                ;**NEW**
     99	000034	011566 	000012 			MOV	(R5),12(SP)	; SET RETURN TO ENTRY POINT                     ;**NEW**
    100	000040					CALL	$MARKS		; MARK APPROPRIATE SEGMENTS OUT OF MEMORY       ;**NEW**
    101	000044				20$:				;                                               ;**NEW**
    102	000044	005005 				CLR	R5		; NO AST TRAP ADDRESS                           ;**NEW**
    103	000046	005004 				CLR	R4		; NO I/O STATUS DOUBLEWORD                      ;**NEW**
    104	000050	005003 				CLR	R3		; SYNCHRONOUS LOAD REQUEST                      ;**NEW**
    105	000052				30$:				;                                               ;**NEW**
    106	000052	005762 	000004 			TST	T$RLNG(R2)	; TEST FOR ZERO LENGTH SEGMENT                  ;**NEW**
    107	000056	001004 				BNE	40$		; IF NE READ IN SEGMENT                         ;**NEW**
    108	000060	042762 	010000 	000000 		BIC	#10000,T$RBLK(R2) ; ELSE MARK SEGMENT IN MEMORY                   ;**NEW**
    109	000066	000403 				BR	50$		; PROCESS NEXT SEGMENT                          ;**NEW**
    110	000070				40$:				;                                               ;**NEW**
    111	000070					CALL	$RDSEG		; READ IN SEGMENT                               ;**NEW**
    112	000074	103412 				BCS	70$		; IF C/S ERROR                                  ;**NEW**
    113	000076				50$:				;                                               ;**NEW**
    114	000076	016202 	000010 			MOV	T$RDWN(R2),R2	; GET NEXT LINK DOWN                            ;**NEW**
AUTO	MACRO M1108  05-DEC-77 23:40  PAGE 3-2


    115	000102	001405 				BEQ	60$		; IF EQ ROOT SEGMENT                            ;**NEW**
    116	000104	032762 	010000 	000000 		BIT	#10000,T$RBLK(R2) ; SEGMENT IN MEMORY ?
    117	000112	001354 				BNE	20$		; IF NE NO                                      ;**NEW**
    118	000114	000770 				BR	50$		; GET NEXT LINK DOWN                            ;**NEW**
    119	000116				60$:				;                                               ;**NEW**
    120	000116	012602 				MOV	(SP)+,R2	; RESTORE R2                                    ;**NEW**
    121	000120					RETURN			; ENTER CALLER'S ROUTINE                        ;**NEW**
    122					                                                                                ;**NEW**
    123					;                                                                               ;**NEW**
    124					; LOAD REQUEST ERROR                                                            ;**NEW**
    125					;                                                                               ;**NEW**
    126					                                                                                ;**NEW**
    127	000122				70$:				;                                               ;**NEW**
    128	000122	013703 	000000G			MOV	@#N.OVPT,R3	; GET WORK AREA VECTOR                          ;**NEW**
    129	000126					CALL	@N.ALER(R3)	; CALL ERROR RECOVERY ROUTINE                   ;**NEW**
    130	000132	000744 				BR	20$		; RETRY LOAD REQUEST                            ;**NEW**
    131					                                                                                ;**-49
    132		000001 				.END
AUTO	MACRO M1108  05-DEC-77 23:40  PAGE 3-3
SYMBOL TABLE

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

. ABS.	000172	   000
      	000000	   001
$$AUTO	000134	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1153 WORDS  ( 5 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:11
[46,10]AUTO,[46,20]AUTO/-SP=[46,30]MACFLM.,SEGDF.005,AUTO.007
CATB	MACRO M1108  05-DEC-77 23:41  PAGE 2


      1						.TITLE	CATB
      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					;                                                                               ;**-11
     22					; D.N. CUTLER 22-AUG-72
     23					;                                                                               ;**NEW**
     24					;                                                                               ;**NEW**
     25					; MODIFICATIONS                                                                 ;**NEW**
     26					;                                                                               ;**NEW**
     27					; NO.		DATE		PROGRAMMER                                      ;**NEW**
     28					; ---		----		----------                                      ;**NEW**
     29					;                                                                               ;**NEW**
     30					; 019		07-JAN-74	C. MONIA                                        ;**NEW**
     31					;                                                                               ;**NEW**
     32					;
     33					; ASCII TO BINARY CONVERSION ROUTINES
     34					;
     35					                                                                                ;**-4
     36					;+
     37					; **-$CDTB-CONVERT DECIMAL TO BINARY
     38					; **-$COTB-CONVERT OCTAL TO BINARY
     39					;
     40					; INPUTS:
     41					;
     42					;	R0=ADDRESS OF NEXT BYTE IN INPUT BUFFER.
     43					;
     44					; OUTPUTS:
     45					;
     46					;		R0=ADDRESS OF NEXT BYTE IN INPUT BUFFER.
     47					;		R1=CONVERTED NUMBER.
     48					;		R2=TERMINAL CHARACTER.
     49					;-
     50
     51	000000				$CDTB::				;                                               ;**NEW**
     52	000000	012702 	000012 			MOV	#10.,R2		;SET BASE 10. CONVERSION RADIX                  ;**-1
     53	000004	000402 				BR	COTB		;
     54	000006				$COTB::				;                                               ;**NEW**
     55	000006	012702 	000010 			MOV	#8.,R2		;SET BASE 8. CONVERSION RADIX                   ;**-1
     56	000012				COTB:	SAVRG			;SAVE NONVOLITILE REGISTERS
     57	000016	005001 				CLR	R1		;CLEAR ACCUMULATED VALUE
CATB	MACRO M1108  05-DEC-77 23:41  PAGE 2-1


     58	000020	112005 			1$:	MOVB	(R0)+,R5	;GET NEXT BYTE
     59	000022	122705 	000040 			CMPB	#' ,R5		;BLANK?
     60	000026	001774 				BEQ	1$		;IF EQ YES
     61	000030	122705 	000011 			CMPB	#HT,R5		;HT?
     62	000034	001771 				BEQ	1$		;IF EQ YES
     63	000036				2$:				;                                               ;**NEW**
     64	000036	162705 	000060 			SUB	#'0,R5		;++019 SUBTRACT CHARACTER BIAS                  ;**NEW**
     65	000042	120502 				CMPB	R5,R2		;++019 CHECK AGAINST BASE                       ;**NEW**
     66	000044	103010 				BHIS	3$		;++019 IF HIS OUT OF RANGE                      ;**NEW**
     67					                                                                                ;**NEW**
     68						.IF	DF	V1145                                                   ;**NEW**
     69					                                                                                ;**NEW**
     70						MUL	R2,R1		;++019 MULTIPLY RESULT BY BASE                  ;**NEW**
     71					                                                                                ;**NEW**
     72						.IFF                                                                    ;**NEW**
     73					                                                                                ;**NEW**
     74	000046	010004 				MOV	R0,R4		;++019 SAVE STRING POINTER                      ;**NEW**
     75	000050	010200 				MOV	R2,R0		;++019 SET MULTIPLICAND                         ;**NEW**
     76	000052					CALL	$MUL		;++019 MULTIPLY EM UP                           ;**NEW**
     77	000056	010400 				MOV	R4,R0		;++019 RESTORE POINTER                          ;**NEW**
     78					                                                                                ;**NEW**
     79						.ENDC                                                                   ;**NEW**
     80					                                                                                ;**NEW**
     81	000060	060501 				ADD	R5,R1		;++019 ACCUMULATE RESULT                        ;**NEW**
     82	000062	112005 				MOVB	(R0)+,R5	;++019 FETCH NEXT CHARACTER                     ;**NEW**
     83	000064	000764 				BR	2$		;++019 GO AGAIN                                 ;**NEW**
     84	000066				3$:				;++019                                          ;**NEW**
     85	000066	116002 	177777 			MOVB	-1(R0),R2	;++019 GET TERMINAL CHARACTER                   ;**NEW**
     86	000072					RETURN                                                                  ;**NEW**
     87					                                                                                ;**-29
     88		000001 				.END
CATB	MACRO M1108  05-DEC-77 23:41  PAGE 2-2
SYMBOL TABLE

COTB    000012R  	HT    = 000011   	SPA   = 000040   	$COTB   000006RG 	$SAVRG= ****** GX
CR    = 000015   	LF    = 000012   	VT    = 000013   	$MUL  = ****** GX	$$    = 000001
FF    = 000014   	R$$11M= 000000   	$CDTB   000000RG

. ABS.	000000	   000
      	000074	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  562 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
[46,10]CATB,[46,20]CATB/-SP=[46,30]MACFLM.,CATB.003
CAT5	MACRO M1108  05-DEC-77 23:41  PAGE 2


      1						.TITLE	CAT5
      2						.IDENT	/02/							;**NEW**
      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 02                                                                   ;**NEW**
     20					;
     21					; D. N. CUTLER/C. MONIA 13-MAY-74
     22					;
     23					; ASCII TO RAD50 CONVERSION ROUTINE
     24					;
     25					; LOCAL DATA
     26					;
     27
     28	000000	   132 	   101 	   071 	CNTRL:	.BYTE	'Z,'A,'9,'0,'$,' ,'. ;CONTROL BYTE STRING
	000003	   060 	   044 	   040
	000006	   056
     29
     30						.EVEN
     31
     32	000010	003100 			CVTBL:	.WORD	50*50		;RAD50 PACK MULTIPLICATION
     33	000012	000050 				.WORD	50		;
     34	000014	000001 				.WORD	1		;
     35
     36					;+
     37					; **-$CAT5-CONVERT ASCII TO RAD50
     38					;
     39					; INPUTS:
     40					;
     41					;	R0=ADDRESS OF NEXT CHARACTER IN INPUT BUFFER.
     42					;	R1=PERIOD DISPOSITION FLAG.
     43					;		IF R1 EQ 0, THEN PERIOD IS A TERMINATOR.
     44					;		IF R1 NE 0, THEN PERIOD IS A RAD50 CHARACTER.
     45					;
     46					; OUTPUTS:
     47					;
     48					;	C=1 IF SCAN WAS TERMINATED BY A NON-RAD50 CHARACTER.
     49					;	C=0 IF THREE RAD50 CHARACTERS WERE CONVERTED.
     50					;	NOTE: IF EITHER CASE THE FOLLOWING VALUES ARE RETURNED.
     51					;		R0=ADDRESS OF NEXT CHARACTER IN INPUT BUFFER.
     52					;		R1=PACKED RAD50 CHARACTERS.
     53					;		R2=TERMINAL CHARACTER.
     54					;-
     55
CAT5	MACRO M1108  05-DEC-77 23:41  PAGE 2-1


     56	000016				$CAT5::	SAVRG			;SAVE NONVOLITILE REGISTERS
     57	000022	010146 				MOV	R1,-(SP)	;SAVE PERIOD DISPOSITION FLAG
     58	000024	005001 				CLR	R1		;CLEAR ACCUMULATION
     59	000026	012703 	000010'			MOV	#CVTBL,R3	;GET ADDRESS OF CONVERSION TABLE
     60	000032	112005 			10$:	MOVB	(R0)+,R5	;GET NEXT CHARACTER
     61	000034	012704 	000000'			MOV	#CNTRL,R4	;GET ADDRESS OF CONTROL STRING
     62	000040	122405 				CMPB	(R4)+,R5	;RAD50 CHARACTER?
     63	000042	103446 				BLO	60$		;IF LO NO
     64	000044	122405 				CMPB	(R4)+,R5	;ALPHABETIC?
     65	000046	101423 				BLOS	50$		;IF LOS YES
     66	000050	122405 				CMPB	(R4)+,R5	;RAD50 CHARACTER?
     67	000052	103442 				BLO	60$		;IF LO NO
     68	000054	122405 				CMPB	(R4)+,R5	;NUMERIC?
     69	000056	101415 				BLOS	40$		;IF LOS YES
     70	000060					JOL	30$		;"$" SIGN?
     71	000064					JOL	60$		;"SPACE"?
     72	000070	005716 				TST	(SP)		;PERIOD RAD50 CHARACTER?
     73	000072	001432 				BEQ	60$		;IF EQ NO
     74	000074					JOL	40$		;"."?
     75	000100	000427 				BR	60$		;
     76	000102	162705 	000027 		20$:	SUB	#' -11,R5	;SPACE
     77	000106	162705 	177767 		30$:	SUB	#11-22,R5	;"$"
     78	000112	162705 	177722 		40$:	SUB	#22-100,R5	;PERIOD/DIGIT
     79	000116	162705 	000100 		50$:	SUB	#100,R5		;ALPHABETIC
     80
     81
     82						.IF	DF	V1145
     83
     84						MUL	(R3)+,R5	;SCALE RAD50 CHARACTER
     85
     86						.ENDC
     87
     88
     89						.IF	NDF	V1145
     90
     91	000122	010046 				MOV	R0,-(SP)	;SAVE NEXT BYTE ADDRESS
     92	000124	012300 				MOV	(R3)+,R0	;GET CONVERSION CONSTANT
     93	000126	010146 				MOV	R1,-(SP)	;SAVE ACCUMULATION
     94	000130	010501 				MOV	R5,R1		;SET MULTIPLIER
     95	000132					CALL	$MUL		;SCALE RAD50 CHARACTER
     96	000136	010105 				MOV	R1,R5		;RESULT TO R5
     97	000140	012601 				MOV	(SP)+,R1	;RETRIEVE PREVIOUS ACCUMULATION
     98	000142	012600 				MOV	(SP)+,R0	;RETRIEVE NEXT BYTE ADDRESS
     99
    100						.ENDC
    101
    102
    103	000144	060501 				ADD	R5,R1		;ACCUMULATE RESULT
    104	000146	020327 	000016'			CMP	R3,#CVTBL+6	;CONVERTED THREE YET?
    105	000152	103727 				BLO	10$		;IF LO NO
    106	000154	005726 				TST	(SP)+		;CLEAN STACK-CLEAR CARRY
    107	000156	000402 				BR	70$		;
    108	000160	005726 			60$:	TST	(SP)+		;CLEAN STACK
    109	000162	000261 				SEC			;SET CARRY
    110	000164	116002 	177777 		70$:	MOVB	-1(R0),R2	;GET TERMINAL CHARACTER
    111	000170					RETURN			;
    112
CAT5	MACRO M1108  05-DEC-77 23:41  PAGE 2-2


    113		000001 				.END
CAT5	MACRO M1108  05-DEC-77 23:41  PAGE 2-3
SYMBOL TABLE

CNTRL   000000R  	FF    = 000014   	R$$11M= 000000   	$CAT5   000016RG 	$SAVRG= ****** GX
CR    = 000015   	HT    = 000011   	SPA   = 000040   	$MUL  = ****** GX	$$    = 000001
CVTBL   000010R  	LF    = 000012   	VT    = 000013

. ABS.	000000	   000
      	000172	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  587 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
[46,10]CAT5,[46,20]CAT5/-SP=[46,30]MACFLM.,CAT5.002
CBTA	MACRO M1108  05-DEC-77 23:41  PAGE 2


      1						.TITLE	CBTA
      2						.IDENT	/03/                                                            ;**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 03                                                                    ;**NEW**
     20					;                                                                               ;**-1
     21					; D. N. CUTLER/C. MONIA 06-APR-74
     22					;                                                                               ;**NEW**
     23					; MODIFICATIONS:                                                                ;**NEW**
     24					;                                                                               ;**NEW**
     25					; NO.		DATE		PROGRAMMER                                      ;**NEW**
     26					; ---		----		----------                                      ;**NEW**
     27					;                                                                               ;**NEW**
     28					; 030		07-JAN-75	C. MONIA                                        ;**NEW**
     29					;                                                                               ;**NEW**
     30					;+
     31					; **-$CBDAT-CONVERT DATE TO TWO DIGIT DECIMAL MAGNITUDE
     32					; **-$CBDMG-CONVERT BINARY TO DECIMAL MAGNITUDE
     33					; **-$CBDSG-CONVERT BINARY TO DECIMAL SIGNED
     34					; **-$CBOMG-CONVERT BINARY TO OCTAL MAGNITUDE
     35					; **-$CBOSG-CONVERT BINARY TO OCTAL SIGNED
     36					; **-$CBTMG-CONVERT BINARY BYTE TO OCTAL MAGNITUDE                              ;**NEW**
     37					;
     38					; INPUTS:
     39					;
     40					;	R0=ADDRESS TO STORE FIRST BYTE IN OUTPUT STRING.
     41					;	R1=NUMBER TO BE CONVERTED.
     42					;	R2=ZERO SUPPRESSION INDICATOR.
     43					;		IF R2 EQ 0, THEN SUPPRESS ZEROS.
     44					;		IF R2 NE 0, THEN DO NOT SUPPRESS ZEROS.
     45					;
     46					; OUTPUTS:
     47					;
     48					;	R0=ADDRESS OF NEXT BYTE AFTER LAST DIGIT STORED.
     49					;-
     50
     51	000000				$CBTMG::			;                                               ;**NEW**
     52	000000					SAVRG			;++030 SAVE NONVOLATILE REGISTERS               ;**NEW**
     53	000004	042701 	177400 			BIC	#177400,R1	;++030 CLEAR HIGH BYTE                          ;**NEW**
     54	000010	012703 	000003 			MOV	#3,R3		;++030 SET MAXIMUM DIGITS                       ;**NEW**
     55	000014	000432 				BR	CBOM1		;++030                                          ;**NEW**
     56	000016				$CBDAT::			;
     57	000016					SAVRG			; SAVE NONVOLATILE REGISTERS
CBTA	MACRO M1108  05-DEC-77 23:41  PAGE 2-1


     58	000022	012703 	000002 			MOV	#2,R3		; SET MAXIMUM DIGITS
     59	000026	000411 				BR	CBD		;
     60	000030	005701 			$CBDSG::TST	R1		;NEGATIVE NUMBER?
     61	000032	100003 				BPL	$CBDMG		;IF PL NO
     62	000034	112720 	000055 			MOVB	#'-,(R0)+	;INSERT A MINUS SIGN
     63	000040	005401 				NEG	R1		;MAKE VALUE POSITIVE
     64	000042				$CBDMG::SAVRG			;SAVE NONVOLITILE REGISTERS
     65	000046	012703 	000005 			MOV	#5,R3		;SET MAXIMUM DIGITS
     66	000052				CBD:				;
     67	000052	012705 	000012 			MOV	#10.,R5		;SET BASE 10. CONVERSION RADIX
     68	000056	000413 				BR	CBO		;
     69	000060	005701 			$CBOSG::TST	R1		;NEGATIVE NUMBER?
     70	000062	100003 				BPL	$CBOMG		;IF PL NO
     71	000064	112720 	000055 			MOVB	#'-,(R0)+	;INSERT A MINUS SIGN
     72	000070	005401 				NEG	R1		;MAKE VALUE POSITIVE
     73	000072				$CBOMG::SAVRG			;SAVE NONVOLITILE REGISTERS
     74	000076	012703 	000006 			MOV	#6,R3		;SET MAXIMUM DIGITS
     75	000102				CBOM1:				;++030                                          ;**NEW**
     76	000102	012705 	000010 			MOV	#8.,R5		;SET BASE 8. CONVERSION RADIX
     77	000106	010004 			CBO:	MOV	R0,R4		;SAVE NEXT BYTE ADDRESS
     78	000110	010100 				MOV	R1,R0		;DIVIDEND TO R0
     79
     80
     81						.IF	DF	V1145
     82
     83					1$:	MOV	R0,R1		;DIVIDEND TO R1
     84						CLR	R0		;CLEAR HIGH PART
     85						DIV	R5,R0		;DIVIDE EM UP
     86
     87						.ENDC
     88
     89
     90						.IF	NDF	V1145
     91
     92	000112	010501 			1$:	MOV	R5,R1		;SET CONVERSION RADIX
     93	000114					CALL	$DIV		;DIVIDE EM UP
     94
     95						.ENDC
     96
     97
     98	000120	010146 				MOV	R1,-(SP)	;SAVE REMAINDER
     99	000122	005303 				DEC	R3		;ANY DIGITS LEFT?
    100	000124	003406 				BLE	3$		;IF LE NO
    101	000126	005702 				TST	R2		;COMPRESS ZEROS?
    102	000130	001002 				BNE	2$		;IF NE NO
    103	000132	005700 				TST	R0		;ZERO QUOTIENT?
    104	000134	001402 				BEQ	3$		;IF EQ ALL DONE
    105	000136				2$:	CALL	1$		;DIVIDE AGAIN
    106	000142	062716 	000060 		3$:	ADD	#'0,(SP)	;ADD CHARACTER BIAS
    107	000146	112624 				MOVB	(SP)+,(R4)+	;STORE A DIGIT
    108	000150	010400 				MOV	R4,R0		;STORE TERMINAL ADDRESS
    109	000152					RETURN			;
    110
    111		000001 				.END
CBTA	MACRO M1108  05-DEC-77 23:41  PAGE 2-2
SYMBOL TABLE

CBD     000052R  	FF    = 000014   	SPA   = 000040   	$CBDSG  000030RG 	$DIV  = ****** GX
CBO     000106R  	HT    = 000011   	VT    = 000013   	$CBOMG  000072RG 	$SAVRG= ****** GX
CBOM1   000102R  	LF    = 000012   	$CBDAT  000016RG 	$CBOSG  000060RG 	$$    = 000001
CR    = 000015   	R$$11M= 000000   	$CBDMG  000042RG 	$CBTMG  000000RG

. ABS.	000000	   000
      	000154	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  587 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
[46,10]CBTA,[46,20]CBTA/-SP=[46,30]MACFLM.,CBTA.003
C5TA	MACRO M1108  05-DEC-77 23:41  PAGE 2


      1						.TITLE	C5TA
      2						.IDENT	/02/							;**NEW**
      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 02
     20					;
     21					; D.N. CUTLER 11-SEP-72
     22					;+
     23					; **-$C5TA-RADIX 50 TO ASCII CONVERSION
     24					;
     25					; INPUTS:
     26					;
     27					;	R0=ADDRESS TO STORE FIRST BYTE IN OUTPUT STRING.
     28					;	R1=RAD50 WORD TO BE CONVERTED
     29					;
     30					; OUTPUTS:
     31					;
     32					;	NUMBER IS CONVERTED TO DECIMAL AND STORED IN CONSECUTIVE BYTES.
     33					;	R0=ADDRESS OF NEXT BYTE AFTER LAST DIGIT STORED.
     34					;-
     35
     36	000000	010002 			$C5TA::	MOV	R0,R2		;SAVE BYTE ADDRESS
     37	000002					CALL	CVTC		;CONVERT FIRST CHAR
     38	000006	010046 				MOV	R0,-(SP)	;SAVE IT
     39	000010					CALL	CVTC		;CONVERT SECOND CHAR
     40	000014	010046 				MOV	R0,-(SP)	;SAVE IT
     41	000016					CALL	CVTC		;CONVERT THIRD CHAR
     42	000022	110022 				MOVB	R0,(R2)+	;STORE IT
     43	000024	112622 				MOVB	(SP)+,(R2)+	;STORE SECOND CHAR
     44	000026	112622 				MOVB	(SP)+,(R2)+	;STORE FIRST CHARACTER
     45	000030	010200 				MOV	R2,R0		;SAVE TERMINAL ADDRESS
     46	000032					RETURN			;
     47
     48					;
     49					;	CONVERT RAD50 CHARACTER
     50					;
     51
     52
     53						.IF	DF	V1145
     54
     55					CVTC:	CLR	R0		;CLEAR UPPER PART
     56						DIV	#50,R0		;DIVIDE EM UP
     57
C5TA	MACRO M1108  05-DEC-77 23:41  PAGE 2-1


     58						.ENDC
     59
     60
     61						.IF	NDF	V1145
     62
     63	000034	010100 			CVTC:	MOV	R1,R0		;DIVIDEND TO R0
     64	000036	012701 	000050 			MOV	#50,R1		;DIVISOR TO R1
     65	000042					CALL	$DIV		;DIVIDE EM UP
     66
     67						.ENDC
     68
     69
     70	000046	010146 				MOV	R1,-(SP)	;SAVE REMAINDER
     71	000050	010001 				MOV	R0,R1		;QUOTIENT TO R1
     72	000052	012600 				MOV	(SP)+,R0	;RETRIEVE REMAINDER
     73	000054	001412 				BEQ	3$		;IF EQ BLANK
     74	000056	020027 	000033 			CMP	R0,#33		;TEST MIDDLE
     75	000062	002405 				BLT	2$		;IF LT ALPHA
     76	000064	001402 				BEQ	1$		;IF EQ DOLLAR
     77	000066	062700 	000011 			ADD	#22-11,R0	;
     78	000072	062700 	177711 		1$:	ADD	#11-100,R0	;
     79	000076	062700 	000040 		2$:	ADD	#100-40,R0	;
     80	000102	062700 	000040 		3$:	ADD	#40,R0		;
     81	000106					RETURN			;
     82
     83		000001 				.END
C5TA	MACRO M1108  05-DEC-77 23:41  PAGE 2-2
SYMBOL TABLE

CR    = 000015   	HT    = 000011   	R$$11M= 000000   	VT    = 000013   	$DIV  = ****** GX
CVTC    000034R  	LF    = 000012   	SPA   = 000040   	$C5TA   000000RG 	$$    = 000001
FF    = 000014

. ABS.	000000	   000
      	000110	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  557 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
[46,10]C5TA,[46,20]C5TA/-SP=[46,30]MACFLM.,C5TA.002
CVTUC	MACRO M1108  05-DEC-77 23:41  PAGE 2


      1						.TITLE	CVTUC
      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  QUBJECT 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 23-JAN-75
     22					;
     23					; CONVERT ASCII TEXT TO UPPER CASE
     24					;
     25					;+
     26					; **-$CVTUC-CONVERT TEXT TO UPPER CASE
     27					;
     28					; THIS SUBROUTINE IS CALLED TO PERFORM A BYTE BY BYTE TRANSFER
     29					; OF AN ASCII STRING CONVERTING ALL ALPHABETIC CHARACTERS
     30					; TO UPPER CASE.
     31					;
     32					; INPUTS:
     33					;
     34					;	R0=SOURCE ADDRESS
     35					;	R1=DESTINATION ADDRESS
     36					;	R2=BYTE COUNT
     37					;
     38					;	IF R0=R1 THEN THE STRING IS CONVERTED IN PLACE.
     39					;
     40					;
     41					; OUTPUTS:
     42					;
     43					;	R0=ADDRESS OF NEXT BYTE AFTER INPUT STRING
     44					;	R1=ADDRESS OF NEXT BYTE AFTER OUTPUT STRING
     45					;
     46					;	THE STRING IS MOVED FROM THE LOCATIONS POINTED TO BY
     47					; R0 TO THE LOCATIONS SPECIFIED BY R1. ALL CHARACTERS BETWEEN
     48					; LOWER CASE 'A' AND LOWER CASE 'Z' ARE CONVERTED TO UPPER CASE
     49					;
     50					; R2 IS DESTROYED, R3 - R5 ARE PRESERVED
     51					;
     52					;-
     53
     54	000000				$CVTUC::			;
     55	000000	121027 	000141 			CMPB	(R0),#141	; CHARACTER IN LOWER CASE RANGE?
     56	000004	103405 				BLO	10$		; IF LO NO
     57	000006	121027 	000172 			CMPB	(R0),#172	; CHARACTER OUTSIDE LOWER CASE RANGE?
CVTUC	MACRO M1108  05-DEC-77 23:41  PAGE 2-1


     58	000012	101002 				BHI	10$		; IF HI YES
     59	000014	142710 	000040 			BICB	#40,(R0)	; CONVERT TO UPPER CASE
     60	000020				10$:				;
     61	000020	112021 				MOVB	(R0)+,(R1)+	; MOVE CHARACTER
     62	000022					SOB	R2,$CVTUC	; REPEAT
     63	000026					RETURN			;
     64
     65		000001 				.END
CVTUC	MACRO M1108  05-DEC-77 23:41  PAGE 2-2
SYMBOL TABLE

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

. ABS.	000000	   000
      	000030	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  512 WORDS  ( 2 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:05
[46,10]CVTUC,[46,20]CVTUC/-SP=[46,30]MACFLM.,CVTUC
EDDAT	MACRO M1108  05-DEC-77 23:41  PAGE 2


      1						.TITLE	EDDAT
      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					; G.W. BERRY/C. MONIA 06-APR-74                                                 ;**NEW**
     23					;                                                                               ;**-13
     24					; DATE AND TIME FORMAT CONVERSION ROUTINES
     25					;+
     26					; **-$DAT-CONVERT DATE STRING
     27					;
     28					; THIS ROUTINE IS CALLED TO CONVERT THE THREE WORD INTERNAL DATE
     29					; TO THE STANDARD 9-CHARACTER OUTPUT FORMAT, AS FOLLOWS:
     30					;
     31					;			Z9-AAA-99
     32					;
     33					; INPUTS:
     34					;
     35					;	R0 = OUTPUT STRING
     36					;	R1 = ADDRESS OF PARAMETER BLOCK
     37					;	WHERE THE FORMAT FOR THE PARAMETER BLOCK IS:
     38					;		.WORD 	YEAR	;YEAR-1900
     39					;		.WORD	MONTH	;MONTH OF YEAR
     40					;		.WORD	DAY	;DAY OF MONTH
     41					;
     42					; OUTPUTS:
     43					;
     44					;	R0 = OUTPUT STRING (ADVANCED)
     45					;	R1 = (INPUT R1) + 6
     46					;-
     47
     48					;MONTH TABLE
     49	000000	   112 	   101 	   116 	MONTH:	.ASCII /JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC/
	000003	   106 	   105 	   102
	000006	   115 	   101 	   122
	000011	   101 	   120 	   122
	000014	   115 	   101 	   131
	000017	   112 	   125 	   116
	000022	   112 	   125 	   114
	000025	   101 	   125 	   107
	000030	   123 	   105 	   120
EDDAT	MACRO M1108  05-DEC-77 23:41  PAGE 2-1


	000033	   117 	   103 	   124
	000036	   116 	   117 	   126
	000041	   104 	   105 	   103
     50
     51	000044				$DAT::				;                                               ;**NEW**
     52	000044					SAVRG			; SAVE NON-VOLATILE REGISTERS                   ;**NEW**
     53	000050	010104 				MOV	R1,R4		; FREE UP R1, R2                                ;**NEW**
     54	000052	010205 				MOV	R2,R5		;                                               ;**NEW**
     55	000054	012446 				MOV	(R4)+,-(SP)	; SAVE YEAR                                     ;**NEW**
     56	000056	012446 				MOV	(R4)+,-(SP)	; SAVE MONTH                                    ;**NEW**
     57	000060	012401 				MOV	(R4)+,R1	; GET DAY                                       ;**NEW**
     58	000062					CALL	DIGS		; OUTPUT TWO DIGITS ZERO SURPRESSED             ;**NEW**
     59	000066	112720 	000055 			MOVB	#'-,(R0)+	; OUTPUT SEPARATOR                              ;**NEW**
     60	000072	011601 				MOV	(SP),R1		; GET MONTH                                     ;**NEW**
     61	000074	006316 				ASL	(SP)		; MULTIPLY BY THREE                             ;**NEW**
     62	000076	062601 				ADD	(SP)+,R1	;                                               ;**NEW**
     63	000100	062701 	177775'			ADD	#MONTH-3,R1	; COMPUTE TABLE INDEX                           ;**NEW**
     64	000104	112120 				MOVB	(R1)+,(R0)+	; OUTPUT MONTH                                  ;**NEW**
     65	000106	112120 				MOVB	(R1)+,(R0)+	;                                               ;**NEW**
     66	000110	112120 				MOVB	(R1)+,(R0)+	;                                               ;**NEW**
     67	000112	112720 	000055 			MOVB	#'-,(R0)+	; OUTPUT SEPARATOR                              ;**NEW**
     68	000116	012601 				MOV	(SP)+,R1	; GET YEAR                                      ;**NEW**
     69	000120	000444 				BR	DIG		; OUTPUT TWO DIGITS, EXIT                       ;**NEW**
     70					                                                                                ;**-18
     71					;+
     72					; **-$TIM-CONVERT TIME
     73					;
     74					; THIS ROUTINE IS CALLED TO CONVERT THE TIME IN A STANDARD FORMAT
     75					; TO AN ASCII OUTPUT STRING OF THE FORM:
     76					;
     77					;		HH:MM:SS.S
     78					;
     79					; THE STANDARD FORMAT FOR THE INPUT VALUES IS IDENTICAL WITH THE
     80					; ARGUMENTS RETURNED BY THE "GET TIME" SYSTEM CALL.
     81					;
     82					; INPUTS:
     83					;
     84					;	R0 = OUTPUT STRING
     85					;	R1 = ADDRESS OF FIRST PARAMETER
     86					;	R2 = PARAMETER COUNT, WHERE:
     87					;		R2=0 OR 1	OUTPUT: HH
     88					;		R2=2		OUTPUT: HH:MM
     89					;		R2=3		OUTPUT: HH:MM:SS
     90					;		R2>3		OUTPUT: HH:MM:SS.S
     91					;
     92					;	WHERE THE FORMAT FOR THE PARAMETER BLOCK IS:
     93					;		.WORD	HOUR-OF-DAY
     94					;		.WORD	MINUTE-OF-HOUR
     95					;		.WORD	SECOND-OF-MINUTE
     96					;		.WORD	TICK-OF-SECOND
     97					;		.WORD	TICKS-PER-SECOND
     98					;
     99					; OUTPUTS:
    100					;
    101					;	R0 = OUTPUT STRING
    102					;	R1 = NEXT PARAMETER (ADVANCED PAST LAST PARAMETER USED)
    103					;	R2 IS DISTROYED
EDDAT	MACRO M1108  05-DEC-77 23:41  PAGE 2-2


    104					;-
    105
    106	000122				$TIM::				;                                               ;**NEW**
    107	000122					SAVRG			; SAVE NON-VOLATILE REGISTERS                   ;**NEW**
    108	000126	010104 				MOV	R1,R4		; FREE UP R1                                    ;**NEW**
    109	000130	012705 	000003 			MOV	#3,R5		; ASSUME TENTHS WANTED                          ;**NEW**
    110	000134	020205 				CMP	R2,R5		; WANT TENTHS OF SECOND?                        ;**NEW**
    111	000136	101421 				BLOS	10$		; IF LOS NO                                     ;**NEW**
    112	000140					CALL	30$		; OUTPUT HH:MM:SS                               ;**NEW**
    113	000144	112720 	000056 			MOVB	#'.,(R0)+	; OUTPUT SEPARATOR                              ;**NEW**
    114	000150	010003 				MOV	R0,R3		; SAVE STRING POINTER                           ;**NEW**
    115					                                                                                ;**NEW**
    116						.IF	DF	V1145                                                   ;**NEW**
    117					                                                                                ;**NEW**
    118						MOV	(R4)+,R0	; GET TICKS                                     ;**NEW**
    119						MUL	#10.,R0		; COMPUTE TICKS X 10.                           ;**NEW**
    120						DIV	(R4)+,R0	; COMPUTE TENTHS OF SECOND                      ;**NEW**
    121					                                                                                ;**NEW**
    122						.IFF                                                                    ;**NEW**
    123					                                                                                ;**NEW**
    124	000152	011400 				MOV	(R4),R0		; GET TICKS                                     ;**NEW**
    125	000154	006300 				ASL	R0		; MULTIPLY TICKS BY 10.                         ;**NEW**
    126	000156	006300 				ASL	R0		;                                               ;**NEW**
    127	000160	006300 				ASL	R0		; NOW HAVE TICKS*8                              ;**NEW**
    128	000162	061400 				ADD	(R4),R0		; ADD TICKS*2                                   ;**NEW**
    129	000164	062400 				ADD	(R4)+,R0	;                                               ;**NEW**
    130	000166	012401 				MOV	(R4)+,R1	; GET TICKS PER SECOND                          ;**NEW**
    131	000170					CALL	$DIV		; COMPUTE TENTHS                                ;**NEW**
    132					                                                                                ;**NEW**
    133						.ENDC                                                                   ;**NEW**
    134					                                                                                ;**NEW**
    135	000174	010001 				MOV	R0,R1		; SET VALUE TO BE CONVERTED                     ;**NEW**
    136	000176	010300 				MOV	R3,R0		; RESTORE STRING POINTER                        ;**NEW**
    137	000200	000412 				BR	DIGS		; RESTORE UPDATED R1, EXIT                      ;**NEW**
    138	000202				10$:				;                                               ;**NEW**
    139	000202	010205 				MOV	R2,R5		; SET LOOP COUNT                                ;**NEW**
    140	000204	000402 				BR	30$		;                                               ;**NEW**
    141	000206				20$:				;                                               ;**NEW**
    142	000206	112720 	000072 			MOVB	#':,(R0)+	; OUTPUT SEPARATOR                              ;**NEW**
    143	000212				30$:				;                                               ;**NEW**
    144	000212	012401 				MOV	(R4)+,R1	; GET VALUE                                     ;**NEW**
    145	000214					CALL	DIG		; OUTPUT TWO DIGITS                             ;**NEW**
    146	000220	005305 				DEC	R5		; DECREMENT COUNT                               ;**NEW**
    147	000222	003371 				BGT	20$		; IF GT GO AGAIN                                ;**NEW**
    148	000224	000405 				BR	DIGX		;                                               ;**NEW**
    149					                                                                                ;**-22
    150					;+
    151					; OUTPUT TWO DIGIT SUBROUTINE.
    152					;
    153					; INPUTS:
    154					;
    155					;	R0 = OUTPUT STRING
    156					;	R1=VALUE (MUST BE IN RANGE 0-99)                                        ;**NEW**
    157					;                                                                               ;**-1
    158					; OUTPUTS:
    159					;
    160					;	R0 = OUTPUT STRING
EDDAT	MACRO M1108  05-DEC-77 23:41  PAGE 2-3


    161					;                                                                               ;**NEW**
    162					;-                                                                              ;**-1
    163					;                                                                               ;**NEW**
    164					; ZERO SURPRESS FIRST DIGIT                                                     ;**NEW**
    165					;                                                                               ;**NEW**
    166					                                                                                ;**NEW**
    167	000226				DIGS:				;                                               ;**NEW**
    168	000226	005002 				CLR	R2		; SET SURPRESS INDICATOR                        ;**NEW**
    169	000230	000401 				BR	DIG1		;                                               ;**NEW**
    170					                                                                                ;**NEW**
    171					;                                                                               ;**NEW**
    172					; NO ZERO SURPRESS ON FIRST DIGIT                                               ;**NEW**
    173					;                                                                               ;**NEW**
    174					                                                                                ;**NEW**
    175	000232				DIG:				;                                               ;**NEW**
    176	000232	010702 				MOV	PC,R2		;                                               ;**NEW**
    177	000234				DIG1:				;                                               ;**NEW**
    178	000234					CALL	$CBDAT		; CONVERT DIGITS                                ;**NEW**
    179	000240				DIGX:				;                                               ;**NEW**
    180	000240	010401 				MOV	R4,R1		; SET UPDATED PARAMETER VECTOR                  ;**NEW**
    181	000242	010502 				MOV	R5,R2		; RESTORE R2 (POSSIBLY DESTROYED)               ;**NEW**
    182	000244					RETURN			;                                               ;**NEW**
    183					                                                                                ;**-16
    184		000001 				.END
EDDAT	MACRO M1108  05-DEC-77 23:41  PAGE 2-4
SYMBOL TABLE

CR    = 000015   	DIG1    000234R  	MONTH   000000R  	$CBDAT= ****** GX	$SAVRG= ****** GX
DIG     000232R  	FF    = 000014   	R$$11M= 000000   	$DAT    000044RG 	$TIM    000122RG
DIGS    000226R  	HT    = 000011   	SPA   = 000040   	$DIV  = ****** GX	$$    = 000001
DIGX    000240R  	LF    = 000012   	VT    = 000013

. ABS.	000000	   000
      	000246	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  717 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:10
[46,10]EDDAT,[46,20]EDDAT/-SP=[46,30]MACFLM.,EDDAT.002
EDTMG	MACRO M1108  05-DEC-77 23:41  PAGE 2


      1						.TITLE	EDTMG
      2						.IDENT	/08/                                                            ;**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 08                                                                    ;**NEW**
     20					;                                                                               ;**-1
     21					; D. N. CUTLER/C. MONIA 10-MAY-74
     22					;
     23					; MODIFICATIONS:                                                                ;**NEW**
     24					;                                                                               ;**NEW**
     25					; NO.		DATE		PROGRAMMER                                      ;**NEW**
     26					; ---		----		----------                                      ;**NEW**
     27					;                                                                               ;**NEW**
     28					; 030		02-JAN-75	C. MONIA                                        ;**NEW**
     29					;                                                                               ;**NEW**
     30					; GENERALIZED FORMATTING ROUTINE
     31					;
     32					;
     33					; EQUATED SYMBOLS
     34					;
     35
     36		000001 			NP=1				; NO-PARAMETER FLAG
     37
     38					;
     39					; LOCAL DATA
     40					;
     41
     42	000000	   101 			OPRAND:	.BYTE	'A		;%A-ASCII
     43	000001	   102 				.BYTE	'B		;++030 %B-BINARY BYTE TO OCTAL                  ;**NEW**
     44	000002	   104 				.BYTE	'D		;%D-SIGNED BINARY TO DECIMAL CONVERSION
     45	000003	   105 				.BYTE	'E		;++030 %E-EXTENDED ASCII CONVERSION             ;**NEW**
     46	000004	   106 				.BYTE	'F		;%F-FORM FEED
     47	000005	   116 				.BYTE	'N		;%N-NEW LINE (CR-LF)
     48	000006	   117 				.BYTE	'O		;%O-SIGNED BINARY TO OCTAL CONVERSION
     49	000007	   120 				.BYTE	'P		;%P-MAGNITUDE BINARY TO OCTAL CONVERSION
     50	000010	   122 				.BYTE	'R		;%R-BINARY TO RAD50 CONVERSION
     51	000011	   123 				.BYTE	'S		;++030 %S-SPACE GENERATOR                       ;**NEW**
     52	000012	   130 				.BYTE	'X		;%X-FILE NAME CONVERSION
     53	000013	   131 				.BYTE	'Y		;%Y-DATE CONVERSION
     54	000014	   132 				.BYTE	'Z		;%Z-TIME CONVERSION
     55		000015 			OPRNDX=.-OPRAND			;NUMBER OF DIRECTIVES
     56
     57						.EVEN
EDTMG	MACRO M1108  05-DEC-77 23:41  PAGE 2-1


     58
     59					;
     60					; DIRECTIVE DISPATCH TABLE:
     61					;
     62					; THE LOW ORDER BIT IS SET FOR THOSE DIRECTIVES NOT REQUIRING
     63					; AN ARGUMENT BLOCK ENTRY
     64					;
     65
     66
     67	000016	000000C			VECTOR:	.WORD	ILLDIR!NP	; ILLEGAL DIRECTIVE
     68	000020	000250'				.WORD	ASCII		;%A->ASCII STRING
     69	000022	000264'				.WORD	BYTE		;++030 %B->BINARY BYTE TO OCTAL                 ;**NEW**
     70	000024	000316'				.WORD	BINDEC		;%D->SIGNED DECIMAL
     71	000026	000332'				.WORD	EASCI		;++030 %E->EXTENDED ASCII                       ;**NEW**
     72	000030	000000C				.WORD	FORM!NP		; %F->FORM CONTROL
     73	000032	000000C				.WORD	NEWLIN!NP	; %N->NEWLINE
     74	000034	000426'				.WORD	OCTAL		;%0->SIGNED OCTAL
     75	000036	000450'				.WORD	POINT		;%P->ABSOLUTE OCTAL
     76	000040	000466'				.WORD	RAD50		;%R->RAD50 STRING
     77	000042	000000C				.WORD	SPACE!NP	;++030 %S->SPACE GENERATOR                      ;**NEW**
     78	000044	000520'				.WORD	XFNAM		;%X->FILE NAME STRING
     79	000046	000634'				.WORD	EDATE		;%Y->DATE CONVERSION
     80	000050	000650'				.WORD	ETIME		;%Z->TIME CONVERSION
     81
     82					;+
     83					; **-$EDMSG-EDIT MESSAGE
     84					;
     85					; THIS ROUTINE IS CALLED TO PROCESS AN ASCIZ FORMAT STRING TO PRODUCE
     86					; AN EDITED OUTPUT STRING. THE INPUTS TO THE ROUTINE ARE A FORMAT STRING
     87					; AND THE ADDRESS OF AN ARGUMENT BLOCK. THE FORMAT STRING IS SCANNED
     88					; LOOKING FOR FORMAT DIRECTIVES. AS EACH NON-FORMAT CHARACTER IS EN-
     89					; COUNTERED, IT IS SIMPLY COPIED INTO THE OUTPUT STRING. A"%" SIGN IS
     90					; USED TO DELIMIT A FORMAT DIRECTIVE. IF A "%" SIGN IS FOLLOWED BY A "V"
     91					; (VALUE), THEN THE REPEAT COUNT IS TAKEN FROM THE NEXT WORD IN THE ARG-
     92					; UMENT BLOCK. ELSE THE NEXT "N" CHARACTERS (BY CONTEXT) ARE CONVERTED
     93					; TO BINARY AND THIS VALUE IS TAKEN AS THE REPEAT COUNT. A REPEAT COUNT
     94					; OF ZERO IS DEFAULTED TO A REPEAT COUNT OF ONE IN EITHER CASE. THE NEXT
     95					; CHARACTER IN THE FORMAT STRING MUST BE A FORMAT DIRECTIVE. THE FOLLOW-
     96					; ING FORMAT DIRECTIVES ARE IMPLEMENTED.
     97					;
     98					;	%A-ASCII STRING
     99					;++030	%B-BINARY BYTE TO OCTAL                                                 ;**NEW**
    100					;	%D=SIGNED BINARY TO DECIMAL CONVERSION
    101					;++030	%E-EXTENDED ASCII                                                       ;**NEW**
    102					;	%F-FORM CONTROL
    103					;	%N-NEW LINE (CR-LF)
    104					;	%O-SIGNED BINARY TO OCTAL CONVERSION
    105					;	%P-MAGNITUDE BINARY TO OCTAL CONVERSION
    106					;	%R-BINARY TO RAD50 CONVERSION
    107					;++030	%S-SPACE GENERATOR                                                      ;**NEW**
    108					;	%X-FILE NAME CONVERSION
    109					;	%Y-DATE CONVERSION
    110					;	%Z-TIME CONVERSION
    111					;
    112					; INPUTS:
    113					;
    114					;	R0=ADDRESS OF OUTPUT STRING.
EDTMG	MACRO M1108  05-DEC-77 23:41  PAGE 2-2


    115					;	R1=ADDRESS OF INPUT STRING
    116					;	R2=ADDRESS OF ARGUMENT BLOCK.
    117					;
    118					; OUTPUTS:
    119					;
    120					;	R0=ADDRESS OF LAST BYTE IN OUTPUT STRING.
    121					;	R1=LENGTH OF OUTPUT STRING IN BYTES.
    122					;	R2=ADDRESS OF NEXT PARAMETER IN ARGUMENT BLOCK
    123					;-
    124
    125	000052				$EDMSG::SAVRG			;SAVE NONVOLITILE REGISTERS
    126	000056	010046 				MOV	R0,-(SP)	;SAVE STARTING ADDRESS OF OUTPUT BUFFER
    127	000060	010003 				MOV	R0,R3		;MOVE PARAMETERS TO NONVOLITILE REGISTER
    128	000062	010104 				MOV	R1,R4		;
    129	000064	010205 				MOV	R2,R5		;
    130	000066	112402 			10$:	MOVB	(R4)+,R2	;GET NEXT CHARACTER IN INPUT STRING
    131	000070	001405 				BEQ	20$		;IF EQ ALL DONE
    132	000072	122702 	000045 			CMPB	#'%,R2		;FORMATTING CHARACTER?
    133	000076	001410 				BEQ	30$		;IF EQ YES
    134	000100	110223 				MOVB	R2,(R3)+	;STORE CHARACTER IN OUTPUT STRING
    135	000102	000771 				BR	10$		;GO AGAIN
    136	000104	105013 			20$:	CLRB	(R3)		;CLEAR LAST BYTE FOR ASCIZ
    137	000106	010300 				MOV	R3,R0		;SET LAST BYTE ADDRESS
    138	000110	010001 				MOV	R0,R1		;COPY ADDRESS OF NEXT BYTE IN OUTPUT BUF
    139	000112	162601 				SUB	(SP)+,R1	;CALCULATE LENGTH OF LINE IN BYTES
    140	000114	010502 				MOV	R5,R2		; SET ADDRESS OF NEXT PARAMETER
    141	000116					RETURN			;
    142	000120	010446 			30$:	MOV	R4,-(SP)	;SAVE R4 IN CASE OF ILLEGAL DIRECTIVE
    143	000122	010400 				MOV	R4,R0		;SET ADDRESS OF NEXT BYTE
    144	000124	122720 	000126 			CMPB	#'V,(R0)+	;NEXT CHARACTER "V"?
    145	000130	001002 				BNE	35$		; IF NE NO
    146	000132	012501 				MOV	(R5)+,R1	; GET ARGUMENT
    147	000134	000404 				BR	40$		; PROCESS DIRECTIVE
    148	000136				35$:				;
    149	000136	010400 				MOV	R4,R0		;SET ADDRESS OF NEXT BYTE
    150	000140					CALL	$CDTB		;CONVERT LEADING NUMBER
    151	000144	005300 				DEC	R0		;BACKUP TO TERMINAL BYTE
    152	000146	010004 			40$:	MOV	R0,R4		;RESTORE ADDRESS OF NEXT CHARACTER
    153	000150	010300 				MOV	R3,R0		;SET ADDRESS OF NEXT IN OUTPUT STRING
    154	000152	010103 				MOV	R1,R3		;SET REPEAT COUNT
    155	000154	001001 				BNE	45$		;IF NE OKAY
    156	000156	005203 				INC	R3		;MAKE COUNT 1
    157	000160	012702 	000015 		45$:	MOV	#OPRNDX,R2	;GET NUMBER OF DIRECTIVES
    158	000164	121462 	177777'		50$:	CMPB	(R4),OPRAND-1(R2);MATCH?
    159	000170	001402 				BEQ	60$		;IF EQ YES
    160	000172					SOB	R2,50$		;REPEAT
    161	000176	005204 			60$:	INC	R4		;INCREMENT PAST DIRECTIVE
    162	000200	006302 				ASL	R2		;MAKE WORD INDEX
    163	000202	016246 	000016'			MOV	VECTOR(R2),-(SP) ; GET ADDRESS OF DIRECTIVE ROUTINE
    164	000206	006216 				ASR	(SP)		; ISOLATE NO-PARAMETERS FLAG
    165	000210	103401 				BCS	70$		; IF C/S NO PARAMETERS REQUIRED
    166	000212	012501 				MOV	(R5)+,R1	; ELSE FETCH FIRST PARAMETER
    167	000214				70$:				;
    168	000214	006316 				ASL	(SP)		; CONVERT TO ADDRESS
    169	000216					CALL	@(SP)+		; CALL PROCESSING ROUTINE
    170	000220	010003 				MOV	R0,R3		;RESTORE ADDRESS OF NEXT IN OUTPUT STRIN
    171	000222	005726 				TST	(SP)+		;CLEAN STACK
EDTMG	MACRO M1108  05-DEC-77 23:41  PAGE 2-3


    172	000224	000720 				BR	10$		;GO AGAIN
    173
    174					;
    175					; ILLEGAL DIRECTIVE (%"UNKNOWN)
    176					;
    177
    178	000226	112720 	000045 		ILLDIR:	MOVB	#'%,(R0)+	;STORE PERCENT SIGN IN OUTPUT STRING
    179	000232	016604 	000002 			MOV	2(SP),R4	;RESTORE INPUT STRING ADDRESS
    180	000236	122714 	000126 			CMPB	#'V,(R4)	;"V" DIRECTIVE?
    181	000242	001001 				BNE	10$		;IF NE NO
    182	000244	005745 				TST	-(R5)		;BACKUP ARGUMENT POINTER
    183	000246				10$:	RETURN			;
    184
    185					;
    186					; ASCII DIRECTIVE (%NA)
    187					;
    188					; MOVE "N" CHARACTERS FROM STRING POINTER TO BY R1 TO OUTPUT STRING.
    189					;
    190
    191	000250	112120 			ASCII:	MOVB	(R1)+,(R0)+	;MOVE A BYTE
    192	000252					SOB	R3,ASCII	;REPEAT
    193	000256					RETURN			;
    194					                                                                                ;**NEW**
    195					;++030                                                                          ;**NEW**
    196					;++030 BINARY BYTE TO OCTAL CONVERSION (%NB)                                    ;**NEW**
    197					;++030                                                                          ;**NEW**
    198					;++030 CONVERT N CONSECUTIVE BYTES POINTED TO BY R1                             ;**NEW**
    199					;++030                                                                          ;**NEW**
    200					                                                                                ;**NEW**
    201	000260				BYTE1:				;++030                                          ;**NEW**
    202	000260	112720 	000040 			MOVB	#SPA,(R0)+	;++030 INSERT A SPACE                           ;**NEW**
    203	000264				BYTE:				;++030                                          ;**NEW**
    204	000264	112102 				MOVB	(R1)+,R2	;++030 GET NEXT BYTE                            ;**NEW**
    205	000266	010146 				MOV	R1,-(SP)	;++030 SAVE R1                                  ;**NEW**
    206	000270	010201 				MOV	R2,R1		;++030 SET VALUE TO CONVERT                     ;**NEW**
    207	000272	010602 				MOV	SP,R2		;++030 DO NOT SUPPRESS ZEROS                    ;**NEW**
    208	000274					CALL	$CBTMG		;++030 CONVERT BYTE TO MAGNITUDE OCTAL          ;**NEW**
    209	000300	012601 				MOV	(SP)+,R1	;++030 RESTORE R1                               ;**NEW**
    210	000302					SOB	R3,BYTE1	;++030 GO AGAIN                                 ;**NEW**
    211	000306					RETURN			;++030                                          ;**NEW**
    212
    213					;
    214					; SIGNED BINARY TO DECIMAL CONVERSION (%ND)
    215					;
    216					; CONVERT "N" CONSECUTIVE ARGUMENT WORDS. IF MORE THAN ONE WORD IS
    217					; CONVERTED, THEN INSERT A TAB BETWEEN WORDS.
    218					;
    219
    220	000310	112720 	000011 		BINDC1:	MOVB	#HT,(R0)+	;INSERT A TAB
    221	000314	012501 				MOV	(R5)+,R1	;GET NEXT ARGUMENT WORD
    222	000316	005002 			BINDEC:	CLR	R2		;ENABLE ZERO SUPPRESSION
    223	000320					CALL	$CBDSG		;CONVERT TO DECIMAL
    224	000324					SOB	R3,BINDC1	;REPEAT
    225	000330					RETURN			;
    226					                                                                                ;**NEW**
    227					;++030                                                                          ;**NEW**
    228					;++030 EXTENDED ASCII CONVERSION (%NE)                                          ;**NEW**
EDTMG	MACRO M1108  05-DEC-77 23:41  PAGE 2-4


    229					;++030                                                                          ;**NEW**
    230					;++030 CONVERT N BYTES POINTED TO BY R1 TO EXTENDED ASCII REPRESENTATION        ;**NEW**
    231					;++030                                                                          ;**NEW**
    232					                                                                                ;**NEW**
    233	000332				EASCI:				;++030                                          ;**NEW**
    234	000332	112110 				MOVB	(R1)+,(R0)	;++030 MOVE NEXT BYTE                           ;**NEW**
    235	000334	142710 	000200 			BICB	#200,(R0)	;++030 CLEAR PARITY BIT                         ;**NEW**
    236	000340	121027 	000040 			CMPB	(R0),#SPA	;++030 PRINTING CHARACTER?                      ;**NEW**
    237	000344	002403 				BLT	10$		;++030 IF LT NO                                 ;**NEW**
    238	000346	121027 	000177 			CMPB	(R0),#177	;++030 RUBOUT?                                  ;**NEW**
    239	000352	001002 				BNE	20$		;++030 IF NE NO                                 ;**NEW**
    240	000354				10$:				;++030                                          ;**NEW**
    241	000354	112710 	000040 			MOVB	#SPA,(R0)	;++030 REPLACE NON-PRINTING CHAR. WITH SPACE    ;**NEW**
    242	000360				20$:				;++030                                          ;**NEW**
    243	000360	005200 				INC	R0		;++030 STEP TO NEXT OUTPUT BYTE                 ;**NEW**
    244	000362					SOB	R3,EASCI	;++030 GO AGAIN                                 ;**NEW**
    245	000366					RETURN			;++030                                          ;**NEW**
    246
    247					;
    248					; FORM CONTROL DIRECTIVE (%NF)
    249					;
    250					; INSERT "N" FORM FEEDS INTO OUTPUT STRING.
    251					;
    252
    253	000370	112720 	000014 		FORM:	MOVB	#FF,(R0)+	;INSERT A FORM FEED
    254	000374					SOB	R3,FORM		;REPEAT
    255	000400					RETURN			;
    256
    257					;
    258					; NEW LINE DIRECTIVE (%NN)
    259					;
    260					; INSERT "N" CR-LF PAIRS INTO OUTPUT STRING.
    261					;
    262
    263	000402	112720 	000015 		NEWLIN:	MOVB	#CR,(R0)+	;INSERT A CR
    264	000406	112720 	000012 			MOVB	#LF,(R0)+	;INSERT A LF
    265	000412					SOB	R3,NEWLIN	;REPEAT
    266	000416					RETURN			;
    267
    268					;
    269					; SIGNED BINARY TO OCTAL CONVERSION DIRECTIVE (%NO)
    270					;
    271					; CONVERT "N" CONSECUTIVE ARGUMENT WORDS. IF MORE THAN ONE WORD IS
    272					; CONVERTED, THEN INSERT A TAB BETWEEN WORDS.
    273					;
    274
    275	000420	112720 	000011 		OCTAL1:	MOVB	#HT,(R0)+	;INSERT A TAB
    276	000424	012501 				MOV	(R5)+,R1	;GET NEXT ARGUMENT WORD
    277	000426	005002 			OCTAL:	CLR	R2		;ENABLE ZERO SUPPRESSION
    278	000430					CALL	$CBOSG		;CONVERT TO OCTAL
    279	000434					SOB	R3,OCTAL1	;REPEAT
    280	000440					RETURN			;
    281
    282					;
    283					; MAGNITUDE BINARY TO OCTAL CONVERSION DIRECTIVE (%NP)
    284					;
    285					; CONVERT "N" CONSECUTIVE ARGUMENT WORDS. IF MORE THAN ONE WORD IS
EDTMG	MACRO M1108  05-DEC-77 23:41  PAGE 2-5


    286					; CONVERTED, THEN INSERT A TAB BETWEEN WORDS.
    287					;
    288
    289	000442	112720 	000011 		POINT1:	MOVB	#HT,(R0)+	;INSERT A TAB
    290	000446	012501 				MOV	(R5)+,R1	;GET NEXT ARGUMENT WORD
    291	000450	010602 			POINT:	MOV	SP,R2		;DISABLE ZERO SUPPRESSION
    292	000452					CALL	$CBOMG		;CONVERT TO OCTAL
    293	000456					SOB	R3,POINT1	;REPEAT
    294	000462					RETURN			;
    295
    296					;
    297					; BINARY TO RAD50 CONVERSION DIRECTIVE
    298					;
    299					; CONVERT "N" CONSECUTIVE RAD50 WORDS.
    300					;
    301
    302	000464	012501 			RAD501:	MOV	(R5)+,R1	;GET NEXT ARGUMENT WORD
    303	000466				RAD50:	CALL	$C5TA		;CONVERT TO RAD50
    304	000472					SOB	R3,RAD501	;REPEAT
    305	000476					RETURN			;
    306					                                                                                ;**NEW**
    307					;++030                                                                          ;**NEW**
    308					;++030 SPACE GENERATOR (%NS)                                                    ;**NEW**
    309					;++030                                                                          ;**NEW**
    310					;++030 GENERATE N SPACES IN BUFFER                                              ;**NEW**
    311					;++030                                                                          ;**NEW**
    312					                                                                                ;**NEW**
    313	000500				SPACE:				;++030                                          ;**NEW**
    314	000500	112720 	000040 			MOVB	#SPA,(R0)+	;++030 PUT IN A SPACE                           ;**NEW**
    315	000504					SOB	R3,SPACE	;++030 LOOP UNTIL DONE                          ;**NEW**
    316	000510					RETURN			;++030                                          ;**NEW**
    317
    318					;
    319					; FILE NAME STRING CONVERSION
    320					;
    321					; CONVERT "N" FILE NAME STRINGS. IF MORE THAN ONE FILE NAME STRING IS
    322					; CONVERTED, THEN INSERT A TAB BETWEEN STRINGS.
    323					;
    324
    325	000512	112720 	000011 		XFNAM1:	MOVB	#HT,(R0)+	;INSERT A TAB
    326	000516	012501 				MOV	(R5)+,R1	;GET NEXT INPUT PARAMETER
    327	000520	012746 	000003 		XFNAM:	MOV	#3,-(SP)	;SET LOOP COUNT
    328	000524				10$:	CALL	$C5TA		;CONVERT TO RAD50
    329	000530	012501 				MOV	(R5)+,R1	;GET NEXT INPUT PARAMETER
    330	000532	005316 				DEC	(SP)		;DECREMENT LOOP COUNT
    331	000534	003373 				BGT	10$		;IF GT GO AGAIN
    332	000536	005726 				TST	(SP)+		;CLEAN STACK
    333	000540	012702 	000011 			MOV	#9.,R2		;SET SUPRESS COUNT
    334	000544					CALL	30$		;SUPRESS TRAILING BLANKS
    335	000550	112720 	000056 			MOVB	#'.,(R0)+	;INSERT PERIOD SEPARATOR
    336	000554					CALL	$C5TA		;CONVERT FILE TYPE TO RAD50
    337	000560	012702 	000003 			MOV	#3,R2		;SET SUPRESS COUNT
    338	000564					CALL	30$		;SUPRESS TRAILING BLANKS
    339	000570	012501 				MOV	(R5)+,R1	;GET VERSION NUMBER
    340	000572	001405 				BEQ	15$		;IF EQ SKIP VERSION
    341	000574	112720 	000073 			MOVB	#';,(R0)+	;INSERT A SEMICOLON SEPARATOR
    342	000600	005002 				CLR	R2		;ENABLE ZERO SUPRESSION
EDTMG	MACRO M1108  05-DEC-77 23:41  PAGE 2-6


    343	000602					CALL	$CBOMG		; CONVERT VERSION TO OCTAL
    344	000606				15$:	SOB	R3,XFNAM1	;REPEAT
    345	000612				20$:	RETURN			;
    346	000614	005302 			30$:	DEC	R2		;SUPRESS ANY MORE?
    347	000616	002775 				BLT	20$		;IF LT NO
    348	000620	122760 	000040 	177777 		CMPB	#' ,-1(R0)	;TRAILING BLANK?
    349	000626	001371 				BNE	20$		;IF NE NO
    350	000630	005300 				DEC	R0		;BACK UP A BYTE
    351	000632	000770 				BR	30$		;
    352
    353					;
    354					; DATE CONVERSION
    355					;
    356					; NOTE: REPEAT COUNT IS IGNORED.
    357					;
    358
    359	000634	010501 			EDATE:	MOV	R5,R1		;COPY ADDRESS OF NEXT PARAMETER
    360	000636	005741 				TST	-(R1)		;BACK UP TO FIRST PARAMETER
    361	000640					CALL	$DAT		;CONVERT DATE
    362	000644	010105 				MOV	R1,R5		;SET ADDRESS OF NEXT ARGUMENT
    363	000646					RETURN			;
    364
    365					;
    366					; TIME CONVERSION
    367					;
    368					; REPEAT COUNT IS USED TO SPECIFY THE TIME FORMAT.
    369					;
    370
    371	000650	010501 			ETIME:	MOV	R5,R1		;COPY ADDRESS OF NEXT ARGUMENT
    372	000652	005741 				TST	-(R1)		;BACK UP TO FIRST ARGUMENT
    373	000654	010302 				MOV	R3,R2		;SET CONVERSION TYPE
    374	000656					CALL	$TIM		;CONVERT TIME
    375	000662	010105 				MOV	R1,R5		;SET ADDRESS OF NEXT ARGUMENT
    376	000664					RETURN			;
    377
    378		000001 				.END
EDTMG	MACRO M1108  05-DEC-77 23:41  PAGE 2-7
SYMBOL TABLE

ASCII   000250R  	FF    = 000014   	OPRAND  000000R  	SPACE   000500R  	$CBTMG= ****** GX
BINDC1  000310R  	FORM    000370R  	OPRNDX= 000015   	VECTOR  000016R  	$CDTB = ****** GX
BINDEC  000316R  	HT    = 000011   	POINT   000450R  	VT    = 000013   	$C5TA = ****** GX
BYTE    000264R  	ILLDIR  000226R  	POINT1  000442R  	XFNAM   000520R  	$DAT  = ****** GX
BYTE1   000260R  	LF    = 000012   	RAD50   000466R  	XFNAM1  000512R  	$EDMSG  000052RG
CR    = 000015   	NEWLIN  000402R  	RAD501  000464R  	$CBDSG= ****** GX	$SAVRG= ****** GX
EASCI   000332R  	NP    = 000001   	R$$11M= 000000   	$CBOMG= ****** GX	$TIM  = ****** GX
EDATE   000634R  	OCTAL   000426R  	SPA   = 000040   	$CBOSG= ****** GX	$$    = 000001
ETIME   000650R  	OCTAL1  000420R

. ABS.	000000	   000
      	000666	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  803 WORDS  ( 4 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[46,10]EDTMG,[46,20]EDTMG/-SP=[46,30]MACFLM.,EDTMG.008
LOAD	MACRO M1108  05-DEC-77 23:42  PAGE 3


      1						.TITLE	LOAD
      2						.IDENT	/05/
      3					                                                                                ;**-1
      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					;                                                                               ;**-7
     20					; VERSION 05
     21					;                                                                               ;**-1
     22					; D.N. CUTLER/C. MONIA 09-JUN-74                                                ;**NEW**
     23					;                                                                               ;**-1
     24					; MANUAL SEGMENT LOADING
     25					;
     26					;+                                                                              ;**-5
     27					; **-$LOAD-LOAD SEGMENT
     28					;
     29					; THIS ROUTINE IS CALLED TO MANUALLY LOAD A NAMED SEGMENT INTO MEMORY.
     30					; IT IS ONE OF THE RUN TIME OVERLAY ROUTINES AND IS CALLED DIRECTLY BY
     31					; THE USER. THE SEGMENT TABLES ARE SEARCHED FOR THE SPECIFIED SEGMENT
     32					; NAME. IF THE NAME IS NOT FOUND A CARRY SET CONDITION IS RETURNED TO
     33					; THE CALLER. ELSE $MARKS IS CALLED TO MARK THE APPROPRIATE SEGMENTS
     34					; OUT OF MEMORY AND $RDSEG IS CALLED TO LOAD THE SEGMENT. BOTH SYN-
     35					; CHRONOUS AND ASYNCHRONOUS REQUESTS ARE SUPPORTED.
     36					;
     37					; INPUTS:
     38					;
     39					;	R0=ADDRESS OF ARGUMENT PARAMETER BLOCK.
     40					;
     41					;	PARAMETER BLOCK FORMAT:
     42					;
     43					;	.BYTE	LENGTH,EVENT FLAG
     44					;	.RAD50	/SEGNAME/
     45					;	.WORD	I/O STATUS
     46					;	.WORD	AST TRAP ADDRESS
     47					;
     48					;	WHERE:
     49					;
     50					;	LENGTH=LENGTH OF THE PARAMETER BLOCK IN WORDS. THE LENGTH MAY BE
     51					;		ANY NUMBER GREATER THAN 3 BUT ONLY THE FIRST FIVE WORDS
     52					;		OF THE PARAMTER BLOCK ARE CONSIDERED.
     53					;	EVENT FLAG=EVENT FLAG NUMBER TO BE USED FOR AN ASYNCHRONOUS LOAD
     54					;		REQUEST. IF NO EVENT FLAG IS SPECIFIED (I.E. ZERO), THEN
     55					;		THE LOAD REQUEST IS CONSIDIERED TO BE SYNCHRONOUS.
     56					;	SEGNAME=RAD50 NAME OF THE SEGMENT TO BE LOADED.
     57					;	I/O STATUS=ADDRESS OF I/O STATUS DOUBLEWORD. STANDARD Q I/O
LOAD	MACRO M1108  05-DEC-77 23:42  PAGE 3-1


     58					;		STATUS CODES APPLY.
     59					;	AST TRAP ADDRESS=ADDRESS OF AST TRAP ROUTINE TO TRAP TO AT THE
     60					;		COMPLETION OF THE LOAD REQUEST. NOTE THAT AN AST TRAP
     61					;		CAN OCCUR ON SYNCHRONOUS LOAD REQUESTS.
     62					;
     63					;	I/O STATUS AND AST TRAP ADDRESS ARE OPTIONAL PARAMETERS AND NEED
     64					;	BE SPECIFIED.
     65					;
     66					; OUTPUTS:
     67					;
     68					;	C=1 IF ILLEGAL PARAMETERS ARE SUPPLIED OR THE LOAD REQUEST IS
     69					;		UNSUCESSFUL.
     70					;	C=0 IF THE REQUEST IS SUCESSFULLY EXECUTED. FOR SYNCHRONOUS RE-
     71					;		QUESTS THIS MEANS THAT THE DESIRED SEGMENT HAS BEEN
     72					;		LOADED AND IS IN MEMORY. FOR ASYNCHRONOUS REQUESTS THIS
     73					;		MEANS THAT THE LOAD REQUEST HAS BEEN SUCESSFULLY EXECU-
     74					;		TED BUT THE SEGMENT IS NOT NECESSARILY IN MEMORY. THE
     75					;		CALLER MUST INSURE THAT LOADING IS COMPLETE BEFORE CALL-
     76					;		ING ANY ROUTINES OR ACCESSING ANY DATA IN THE LOADED
     77					;		SEGMENT.
     78					;	ALL REGISTERS ARE PRESERVED.
     79					;-
     80
     81	000000					.PSECT	$$LOAD
     82	000000	122710 	000003 		$LOAD::	CMPB	#3,(R0)		;ENOUGH PARAMETERS?
     83	000004	000261 				SEC			; ASSUME NO                                     ;**NEW**
     84	000006	003051 				BGT	60$		; IF EQ NO                                      ;**NEW**
     85	000010					SAVRG			; SAVE R3,R4,R5                                 ;**NEW**
     86	000014	010246 				MOV	R2,-(SP)	; SAVE R2                                       ;**NEW**
     87	000016	013702 	000000G			MOV	@#N.OVPT,R2	; GET POINTER TO IMPURE AREA                    ;**NEW**
     88	000022	016202 	000000G			MOV	N.STBL(R2),R2	; GET SEGMENT DESCRIPTOR TABLE ADDRESS          ;**NEW**
     89	000026				10$:				;                                               ;**NEW**
     90	000026	005712 				TST	(R2)		; END OF SEGMENT DESCRIPTOR LIST?               ;**NEW**
     91	000030	000261 				SEC			; ASSUME SEGMENT NOT FOUND                      ;**NEW**
     92	000032	001436 				BEQ	50$		; IF EQ NOT FOUND                               ;**NEW**
     93	000034	026260 	000014 	000002 		CMP	T$RNME(R2),2(R0) ; CHECK SEGMENT NAME                           ;**NEW**
     94	000042	001004 				BNE	20$		; IF NE NOT DESIRED SEGMENT                     ;**NEW**
     95	000044	026260 	000016 	000004 		CMP	T$RNME+2(R2),4(R0) ; CHECK SECOND HALF OF NAME                  ;**NEW**
     96	000052	001403 				BEQ	30$		; IF EQ HAVE REQUESTED SEGMENT                  ;**NEW**
     97	000054				20$:				;                                               ;**NEW**
     98	000054	062702 	000020 			ADD	#S$ZSEG,R2	; POINT TO NEXT DESCRIPTOR                      ;**NEW**
     99	000060	000762 				BR	10$		; GO AGAIN                                      ;**NEW**
    100	000062				30$:				;                                               ;**NEW**
    101	000062	005005 				CLR	R5		; ASSUME NO AST                                 ;**NEW**
    102	000064	005004 				CLR	R4		; ASSUME NO I/O STATUS                          ;**NEW**
    103	000066	121027 	000004 			CMPB	(R0),#4		; TEST FOR I/O STATUS OR AST                    ;**NEW**
    104	000072	103407 				BLO	40$		; IF LO NONE REQUESTED                          ;**NEW**
    105	000074	016004 	000006 			MOV	6(R0),R4	; SET ADDRESS OF I/O STATUS                     ;**NEW**
    106	000100	121027 	000005 			CMPB	(R0),#5		; CHECK FOR AST                                 ;**NEW**
    107	000104	103402 				BLO	40$		; IF LO NO AST SPECIFIED                        ;**NEW**
    108	000106	016005 	000010 			MOV	10(R0),R5	; SET AST ADDRESS                               ;**NEW**
    109	000112				40$:				;                                               ;**NEW**
    110	000112	005003 				CLR	R3		; SET FOR MOVB WITH NO EXTEND                   ;**NEW**
    111	000114	156003 	000001 			BISB	1(R0),R3	; GET EFN                                       ;**NEW**
    112	000120					CALL	$MARKS		; MARK APPROPRIATE SEGMENTS OUT OF MEMORY       ;**NEW**
    113	000124					CALL	$RDSEG		; READ SEGMENT INTO MEMORY                      ;**NEW**
    114	000130				50$:				;                                               ;**NEW**
LOAD	MACRO M1108  05-DEC-77 23:42  PAGE 3-2


    115	000130	012602 				MOV	(SP)+,R2	; RESTORE R2                                    ;**NEW**
    116	000132				60$:				;                                               ;**NEW**
    117	000132					RETURN			;                                               ;**NEW**
    118					                                                                                ;**-63
    119		000001 				.END
LOAD	MACRO M1108  05-DEC-77 23:42  PAGE 3-3
SYMBOL TABLE

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

. ABS.	000172	   000
      	000000	   001
$$LOAD	000134	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1143 WORDS  ( 5 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:10
[46,10]LOAD,[46,20]LOAD/-SP=[46,30]MACFLM.,SEGDF.005,LOAD.005
OVCTL	MACRO M1108  05-DEC-77 23:42  PAGE 3


      1						.TITLE	OVCTL
      2						.IDENT	/08/                                                            ;**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 08
     21					;                                                                               ;**-1
     22					; D. N. CUTLER/C. MONIA 11-JAN-74
     23					;
     24					; MODIFICATIONS:
     25					;
     26					; NO.		DATE		PROGRAMMER
     27					; ---		----		----------
     28					;
     29					; 021		11-JAN-74	C. MONIA
     30					;
     31					; OVERLAY RUN TIME ROUTINES
     32					;
     33					; EQUATED SYMBOLS
     34					;
     35
     36		000037 			O$VEF==31.			;SYSTEM OVERLAY EVENT FLAG
     37		000001 			Q$IO=1				;QUEUE I/O DIRECTIVE CODE
     38		000051 			W$FR=41.			;WAIT FOR EVENT FLAG DIRECTIVE CODE
     39
     40					;
     41					; MACRO LIBRARY CALLS
     42					;
     43
     44						.MCALL	DIR$,QIOSY$,WTSE$S                                              ;**NEW**
     45	000000					QIOSY$                                                                  ;**-1
     46
     47					;+
     48					; **-$MARKS-MARK SEGMENT
     49					;
     50					; THIS ROUTINE IS CALLED TO MARK ALL SEGMENTS OUT OF MEMORY THAT ARE
     51					; NOT ON THE SAME PATH AS THE ARGUMENT SEGMENT. IT IS ONE OF THE OVER-
     52					; LAY RUN TIME ROUTINES AND IS CALLED BY BOTH THE $LOAD (MANUAL LOAD-
     53					; ING) AND $AUTO (AUTOMATIC LOADING) ROUTINES.
     54					;
     55					; INPUTS:
     56					;
     57					;	R2=ADDRESS OF ARGUMENT SEGMENT DESCRIPTOR.                              ;**NEW**
OVCTL	MACRO M1108  05-DEC-77 23:42  PAGE 3-1


     58					;                                                                               ;**-1
     59					; OUTPUTS:
     60					;
     61					;	THE APPROPRIATE SEGMENTS ARE MARKED OUT OF MEMORY AND ALL REG-
     62					;	ISTERS ARE PRESERVED.
     63					;-
     64
     65	000000					.PSECT	$$OVCT
     66	000000				$MARKS::			;
     67	000000	010246 				MOV	R2,-(SP)	; SAVE ARGUMENT SEGMENT ADDRESS                 ;**NEW**
     68	000002	032762 	010000 	000000 	10$:	BIT	#10000,T$RBLK(R2) ; SEGMENT IN MEMORY?
     69	000010	001005 				BNE	20$		;IF NE NO                                       ;**-2
     70	000012	016202 	000010 		15$:	MOV	T$RDWN(R2),R2	;GET DOWN LINK OF SEGMENT                       ;**NEW**
     71	000016	001371 				BNE	10$		;IF NE GO AGAIN                                 ;**-1
     72	000020				17$:				;++021
     73	000020	012602 				MOV	(SP)+,R2	;RESTORE ARGUMENT SEGMENT                       ;**NEW**
     74	000022					RETURN			;                                               ;**-1
     75	000024				20$:				;++021
     76	000024	005762 	000010 			TST	T$RDWN(R2)	;++021 IS THIS A ROOT SEGMENT                   ;**NEW**
     77	000030	001773 				BEQ	17$		;++021 IF EQ YES                                ;**-1
     78	000032	010246 				MOV	R2,-(SP)	;++021 SAVE SEGMENT DESCRIPTOR ADDRESS          ;**NEW**
     79	000034	010246 			30$:	MOV	R2,-(SP)	;STACK SEGMENT DESCRIPTOR ADDRESS               ;**NEW**
     80	000036	016202 	000012 		40$:	MOV	T$RNXT(R2),R2	;GET NEXT LINK OF SEGMENT                       ;**NEW**
     81	000042	020216 				CMP	R2,(SP)		;SAME AS TOS SEGMENT?                           ;**NEW**
     82	000044	001414 				BEQ	60$		;IF EQ YES                                      ;**-4
     83	000046	032762 	010000 	000000 	50$:	BIT	#10000,T$RBLK(R2) ; SEGMENT IN MEMORY?
     84	000054	001370 				BNE	40$		; IF NE NO                                      ;**NEW**
     85	000056	052762 	010000 	000000 		BIS	#10000,T$RBLK(R2) ; SET SEGMENT OUT OF MEMORY
     86	000064	016216 	000006 			MOV	T$RUP(R2),(SP)	;REPLACE TOS WITH UP LINK OF SEGMENT            ;**NEW**
     87	000070	001402 				BEQ	60$		;IF EQ NO LINK UP                               ;**-4
     88	000072	011602 				MOV	(SP),R2		;GET ADDRESS OF UP LINK                         ;**NEW**
     89	000074	000764 				BR	50$		;                                               ;**-1
     90	000076	005726 			60$:	TST	(SP)+		;CLEAN STACK
     91	000100	012602 				MOV	(SP)+,R2	;RETRIEVE SEGMENT ADDRESS                       ;**NEW**
     92	000102	000743 				BR	15$		;                                               ;**-1
     93
     94					;+
     95					; **-$RDSEG-READ OVERLAY SEGMENT
     96					;
     97					; THIS ROUTINE IS CALLED TO LOAD AN OVERLAY SEGMENT INTO MEMORY. IT
     98					; IS ONE OF THE OVERLAY RUN TIME ROUTINES AND IS CALLED FROM BOTH THE
     99					; $LOAD (MANUAL LOADING) AND $AUTO (AUTOMATIC LOADING) ROUTINES.
    100					;
    101					; INPUTS:
    102					;
    103					;	R2=ADDRESS OF SEGMENT DESCRIPTOR OF SEGMENT TO BE LOADED.               ;**NEW**
    104					;	R3=EVENT FLAG NUMBER.                                                   ;**NEW**
    105					;		IF R3 EQ 0, THEN A SYNCHRONOUS LOAD IS SPECIFIED. THE           ;**NEW**
    106					;			EVENT FLAG THAT IS USED TO SYNCHRONIZE THE              ;**-3
    107					;			LOADING IS THE STANDARD OVERLAY EVENT FLAG.
    108					;		IF R3 NE 0, THEN AN ASYNCHRONOUS LOAD REQUEST IS SPEC-          ;**NEW**
    109					;			IFIED. THE SPECIFIED EVENT FLAG IS USED IN THE          ;**-1
    110					;			LOAD REQUEST THUS PROVIDING SYNCHRONIZATION
    111					;			FOR THE CALLER.
    112					;	R4=ADDRESS OF I/O STATUS DOUBLEWORD. IF NO STATUS DOUBLEWORD IS         ;**NEW**
    113					;		SPECIFIED NO I/O STATUS IS RETURNED TO THE CALLER.              ;**-1
    114					;	R5=AST TRAP ADDRESS. IF NO TRAP ADDRESS IS SPECIFIED NO TRAP OC-        ;**NEW**
OVCTL	MACRO M1108  05-DEC-77 23:42  PAGE 3-2


    115					;		CURS.                                                           ;**-1
    116					;
    117					; OUTPUTS:
    118					;
    119					;	C=1 IF I/O ERROR ON EITHER THE INITIAL REQUEST DIRECTIVE OR AT
    120					;		THE COMPLETION OF A SYNCHRONOUS LOAD REQUEST.
    121					;	C=0 IF REQUEST IS SUCESSFULLY COMPLETED. SEGMENT IS MARKED IN
    122					;		MEMORY.
    123					; 	R3,R4,R5 ARE  DESTROYED                                                 ;**NEW**
    124					;-                                                                              ;**-1
    125
    126	000104				$RDSEG::			;                                               ;**NEW**
    127	000104	005046 				CLR	-(SP)		; CLEAR PARAM. WORD 6                           ;**-2
    128	000106	016246 	000000 			MOV	T$RBLK(R2),-(SP);SET RELATIVE BLOCK NUMBER                      ;**NEW**
    129	000112	042716 	170000 			BIC	#170000,(SP)	; CLEAR STATUS FIELD
    130	000116	005046 				CLR	-(SP)		;SECOND HALF OF RELATIVE BLOCK IS ZERO          ;**-1
    131	000120	005046 				CLR	-(SP)		;ZERO STACK WORD
    132	000122	016246 	000004 			MOV	T$RLNG(R2),-(SP);SET LENGTH OF OVERLAY SEGMENT                  ;**NEW**
    133	000126	016246 	000002 			MOV	T$RLDA(R2),-(SP);SET VIRTUAL LOAD ADDRESS                       ;**NEW**
    134	000132	010546 				MOV	R5,-(SP)	;SET AST TRAP ADDRESS                           ;**NEW**
    135	000134	013705 	000000G			MOV	@#N.OVPT,R5	; POINT TO IMPURE AREA                          ;**NEW**
    136	000140	010446 				MOV	R4,-(SP)	;SET I/O STATUS DOUBLE WORD ADDRESS             ;**NEW**
    137	000142	001006 				BNE	10$		;IF NE ONE SPECIFIED                            ;**-4
    138	000144	105703 				TSTB	R3		;SYNCHRONOUS REQUEST?                           ;**NEW**
    139	000146	001004 				BNE	10$		;IF NE NO                                       ;**-1
    140	000150	010504 				MOV	R5,R4		; CALCULATE ADDRESS OF COMMON I/O STATUS        ;**NEW**
    141	000152	062704 	000000G			ADD	#N.IOST,R4	;                                               ;**NEW**
    142	000156	010416 				MOV	R4,(SP)		;                                               ;**NEW**
    143	000160	005046 			10$:	CLR	-(SP)		;CLEAR STACK WORD                               ;**-2
    144	000162	150316 				BISB	R3,(SP)		;SET EVENT FLAG NUMBER                          ;**NEW**
    145	000164	001002 				BNE	15$		;IF NE ASYNCHRONOUS REQUEST                     ;**-1
    146	000166	012716 	000037 			MOV	#O$VEF,(SP)	;SET SYSTEM EVENT FLAG
    147	000172				15$:				;                                               ;**NEW**
    148	000172	016546 	000000G			MOV	N.OVLY(R5),-(SP);SET LOGICAL UNIT NUMBER                        ;**NEW**
    149	000176	012746 	001010 			MOV	#IO.LOV,-(SP)	;SET FUNCTION CODE                              ;**-1
    150	000202	012746 				MOV	(PC)+,-(SP)	;SET DIRECTIVE CODE AND LENGTH
    151	000204	   001 	   014 			.BYTE	Q$IO,12.	;
    152	000206					DIR$			; MAKE REQUEST TO LOAD OVERLAY SEGMENT          ;**NEW**
    153	000210	103420 				BCS	50$		;IF CS LEAVE NOW                                ;**-1
    154	000212	042762 	010000 	000000 		BIC	#10000,T$RBLK(R2) ; MARK SEGMENT IN MEMORY
    155	000220	105703 				TSTB	R3		;SYNCHRONOUS REQUEST?                           ;**NEW**
    156	000222	001013 				BNE	50$		;IF NE NO                                       ;**-2
    157	000224					WTSE$S	#O$VEF		; WAIT FOR LOAD TO COMPLETE                     ;**NEW**
    158	000236				30$:				;                                               ;**NEW**
    159	000236	105714 				TSTB	(R4)		;TEST FINAL STATUS                              ;**NEW**
    160	000240	100004 				BPL	50$		;IF PL OKAY                                     ;**-10
    161	000242				40$:				;                                               ;**NEW**
    162	000242	052762 	010000 	000000 		BIS	#10000,T$RBLK(R2) ; MARK SEGMENT OUT OF MEMORY
    163	000250	000261 				SEC			;SET CARRY                                      ;**-1
    164	000252				50$:				;                                               ;**NEW**
    165	000252					RETURN			;                                               ;**-1
    166
    167		000001 				.END                                                                    ;**-20
OVCTL	MACRO M1108  05-DEC-77 23:42  PAGE 3-3
SYMBOL TABLE

CR    = 000015   	IE.INS= 177776   	IO.ATT= 001400   	IO.RLB= 001000   	IS.SET= 000002
FF    = 000014   	IE.IPR= 177641   	IO.CCI= 014000   	IO.RLV= 001100   	IS.SUC= 000001
HT    = 000011   	IE.ISQ= 177703   	IO.CCT= 002460   	IO.RNA= 005400   	LF    = 000012
IE.ABO= 177761   	IE.ITI= 177643   	IO.CLN= 003400   	IO.RNC= 001004   	N.IOST= ****** GX
IE.ACT= 177771   	IE.ITS= 177770   	IO.CON= 015400   	IO.RNE= 001020   	N.OVLY= ****** GX
IE.ADP= 177636   	IE.LCK= 177745   	IO.CRC= 001020   	IO.RTC= 003400   	N.OVPT= ****** GX
IE.ALN= 177736   	IE.LNL= 177646   	IO.CRE= 012000   	IO.RTI= 016400   	O$VEF = 000037 G
IE.AST= 177660   	IE.MBK= 177721   	IO.CTI= 015400   	IO.RTK= 000060   	Q$IO  = 000001
IE.BAD= 177777   	IE.MOD= 177753   	IO.CTL= 016400   	IO.RVB= 010400   	R$$11M= 000000
IE.BBE= 177710   	IE.NBF= 177731   	IO.DAC= 010000   	IO.RWD= 002400   	SPA   = 000040
IE.BDI= 177714   	IE.NBK= 177727   	IO.DCI= 014400   	IO.RWU= 002540   	S$GATL  000152
IE.BDR= 177716   	IE.NFI= 177704   	IO.DCT= 002470   	IO.R1C= 002400   	S$GBLK  000002
IE.BDV= 177711   	IE.NLN= 177733   	IO.DEL= 012400   	IO.SAO= 004000   	S$GCST  000024
IE.BHD= 177700   	IE.NNC= 177674   	IO.DET= 002000   	IO.SCS= 013000   	S$GDWN  000012
IE.BLK= 177754   	IE.NOD= 177751   	IO.DIS= 016000   	IO.SDI= 013000   	S$GELT  000146
IE.BNM= 177712   	IE.NSF= 177746   	IO.DTI= 016000   	IO.SDO= 012400   	S$GLDA  000004
IE.BTF= 177675   	IE.OFL= 177677   	IO.ENA= 006000   	IO.SEC= 002520   	S$GLGH  000172
IE.BTP= 177725   	IE.ONP= 177773   	IO.EOF= 003000   	IO.SEM= 002440   	S$GLNG  000006
IE.BVR= 177701   	IE.OVR= 177756   	IO.ESA= 002500   	IO.SHT= 002410   	S$GMEM  000160
IE.BYT= 177755   	IE.PRI= 177760   	IO.EXT= 011400   	IO.SLO= 005400   	S$GNME  000020
IE.CKP= 177766   	IE.RAC= 177724   	IO.FDX= 003020   	IO.SMO= 002560   	S$GNXT  000014
IE.CKS= 177742   	IE.RAT= 177723   	IO.FNA= 004400   	IO.SNM= 002450   	S$GPRV  000016
IE.CLO= 177732   	IE.RBG= 177730   	IO.HDX= 003010   	IO.SPB= 002420   	S$GRO   000030
IE.CON= 177752   	IE.RCN= 177722   	IO.HIS= 015000   	IO.SPF= 002440   	S$GRW   000032
IE.DAA= 177770   	IE.RER= 177740   	IO.INL= 002400   	IO.SSO= 004400   	S$GRWB  000162
IE.DAO= 177763   	IE.RNM= 177715   	IO.ITI= 017000   	IO.SST= 002430   	S$GSEG  000164
IE.DFU= 177750   	IE.RSU= 177757   	IO.KIL= 000012   	IO.STC= 002500   	S$GSEQ  000166
IE.DNA= 177771   	IE.SDP= 177635   	IO.LED= 012000   	IO.STP= 016400   	S$GSTB  000036
IE.DNR= 177775   	IE.SNC= 177735   	IO.LOV= 001010   	IO.SYN= 003040   	S$GSTS  000000
IE.DUN= 177767   	IE.SPC= 177772   	IO.LTK= 000050   	IO.TRM= 002410   	S$GUND  000140
IE.DUP= 177707   	IE.SQC= 177734   	IO.MCS= 013400   	IO.UNL= 000042   	S$GUP   000010
IE.EBX= 177776   	IE.SRE= 177762   	IO.MDA= 016000   	IO.WAT= 013400   	S$GVAD  000142
IE.EOF= 177766   	IE.STK= 177706   	IO.MDI= 014400   	IO.WLB= 000400   	S$ZSEG  000020
IE.EOT= 177702   	IE.ULN= 177773   	IO.MDO= 015400   	IO.WLS= 000410   	T$RBLK  000000
IE.EOV= 177765   	IE.UPN= 177777   	IO.MLO= 006000   	IO.WLV= 000500   	T$RDWN  000010
IE.EXP= 177676   	IE.VER= 177774   	IO.MOD= 003000   	IO.WVB= 011000   	T$RLDA  000002
IE.FEX= 177717   	IE.WAC= 177743   	IO.MSO= 005000   	IO.XMT= 014400   	T$RLNG  000004
IE.FHE= 177705   	IE.WAT= 177741   	IO.RAL= 001010   	IO.XNA= 014410   	T$RNME  000014
IE.FOP= 177713   	IE.WER= 177737   	IO.RAT= 013000   	IQ.Q  = 000002   	T$RNXT  000012
IE.HFU= 177744   	IE.WLK= 177764   	IO.RBC= 003000   	IQ.X  = 000001   	T$RUP   000006
IE.HWR= 177772   	IE.2DV= 177720   	IO.RCI= 015000   	IS.BV = 000005   	VT    = 000013
IE.IDU= 177644   	IO.ACE= 007400   	IO.RCV= 015000   	IS.CLR= 000000   	W$FR  = 000051
IE.IEF= 177637   	IO.ACR= 006400   	IO.RDB= 001200   	IS.CR = 006401   	$MARKS  000000RG    002
IE.IFC= 177776   	IO.ACW= 007000   	IO.RDN= 000022   	IS.ESC= 015401   	$RDSEG  000104RG    002
IE.IFU= 177747   	IO.ADS= 014000   	IO.REL= 013400   	IS.PND= 000000   	$$MSG = 000000
IE.ILL= 177726   	IO.APC= 014000   	IO.RHD= 001010   	IS.RDD= 000002   	...GBL= 000000
IE.ILU= 177640   	IO.APV= 014010

. ABS.	000172	   000
      	000000	   001
$$OVCT	000254	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  4205 WORDS  ( 17 PAGES)
DYNAMIC MEMORY:  5216 WORDS  ( 20 PAGES)
ELAPSED TIME:  00:00:39
[46,10]OVCTL,[46,20]OVCTL/-SP=[46,30]MACFLM.,SEGDF.005,OVCTL.008
OVDAT	MACRO M1108  05-DEC-77 23:43  PAGE 3


      1						.IIF NDF RES , .TITLE OVDAT
      2						.IIF DF  RES , .TITLE OVRES
      3						.IDENT	/05/                                                            ;**NEW**
      4					                                                                                ;**-1
      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 05                                                                    ;**NEW**
     22					;                                                                               ;**-1
     23					; D.N. CUTLER/C. MONIA 05-JAN-74
     24					;
     25					;
     26					; OVERLAY RUN TIME DATA AREA
     27					;
     28					; LOW CORE POINTER TO DATA VECTOR
     29					;
     30
     31	000020					.ASECT
     32
     33						.IF	NDF	R$$11M
     34
     35					.=6
     36
     37						.IFF
     38
     39		000042 			.=42
     40
     41						.ENDC
     42
     43
     44
     45						.IF NDF	RES
     46
     47						.IFT
     48	000042				.NOVPT::			; POINTER TO VECTOR
     49
     50						.IF	NDF	R$$11M
     51
     52						.WORD	OVRDAT                                                          ;**NEW**
     53					                                                                                ;**-1
     54						.IFF
     55
     56						.BLKW	1		;
     57
OVDAT	MACRO M1108  05-DEC-77 23:43  PAGE 3-1


     58						.ENDC
     59
     60
     61					;
     62					; OVERLAY DATA VECTOR
     63					;
     64
     65						.IFT
     66	000000					.PSECT
     67						.IFF
     68						.PSECT	$$OVDT,ABS
     69
     70						.IFT
     71	000000				OVRDAT:				;BASE ADDRESS OF VECTOR
     72
     73						.IFT
     74	000000				.NOVLY::			;OVERLAY LOGICAL UNIT (PLUGGED BY TKB)
     75						.IFF
     76					N.OVLY::			;OFFSET-OVERLAY LOGICAL UNIT
     77
     78						.IFTF
     79						.BLKW	1		;RESERVE SPACE FOR OVERLAY LOGICAL UNIT
     80
     81						.IFT
     82	000002				.NSTBL::			;ADDRESS OF SEGMENT TABLES (PLUGGED BY TKB)
     83						.IFF
     84					N.STBL::			;OFFSET-ADDRESS OF SEGMENT TABLES
     85
     86						.IFTF
     87						.BLKW	1		;RESERVE SPACE FOR SEGMENT TABLES ADDRESS
     88
     89						.IFT
     90	000004				.NIOST::			;COMMON I/O STATUS DOUBLEWORD
     91						.IFF
     92					N.IOST::			;OFFSET-COMMON I/O STATUS DOUBLEWOORD
     93
     94						.IFTF
     95						.BLKW	2		;RESERVE SPACE FOR I/O STATUS DOUBLEWORD
     96						.IFT                                                                    ;**NEW**
     97	000010	000000G			.NALER::.WORD	$ALERR		; ADDRESS OF AUTOLOAD ERROR HANDLER             ;**NEW**
     98						.IFF                                                                    ;**NEW**
     99					N.ALER::.BLKW	1		;                                               ;**NEW**
    100
    101						.ENDC
    102
    103
    104		000001 				.END
OVDAT	MACRO M1108  05-DEC-77 23:43  PAGE 3-2
SYMBOL TABLE

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

. ABS.	000172	   000
      	000012	   001
ERRORS DETECTED:  0

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


      1		000000 			RES=0										;**NEW**
SEGDF	MACRO M1108  05-DEC-77 23:43  PAGE 4


						.IIF NDF RES , .TITLE OVDAT
      2						.IIF DF  RES , .TITLE OVRES
      3						.IDENT	/05/                                                            ;**NEW**
      4					                                                                                ;**-1
      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 05                                                                    ;**NEW**
     22					;                                                                               ;**-1
     23					; D.N. CUTLER/C. MONIA 05-JAN-74
     24					;
     25					;
     26					; OVERLAY RUN TIME DATA AREA
     27					;
     28					; LOW CORE POINTER TO DATA VECTOR
     29					;
     30
     31	000020					.ASECT
     32
     33						.IF	NDF	R$$11M
     34
     35					.=6
     36
     37						.IFF
     38
     39		000042 			.=42
     40
     41						.ENDC
     42
     43
     44
     45						.IF NDF	RES
     46
     47						.IFT
     48					.NOVPT::			; POINTER TO VECTOR
     49
     50						.IF	NDF	R$$11M
     51
     52						.WORD	OVRDAT                                                          ;**NEW**
     53					                                                                                ;**-1
     54						.IFF
     55
     56						.BLKW	1		;
     57
OVRES	MACRO M1108  05-DEC-77 23:43  PAGE 4-1


     58						.ENDC
     59
     60
     61					;
     62					; OVERLAY DATA VECTOR
     63					;
     64
     65						.IFT
     66						.PSECT
     67						.IFF
     68	000000					.PSECT	$$OVDT,ABS
     69
     70						.IFT
     71					OVRDAT:				;BASE ADDRESS OF VECTOR
     72
     73						.IFT
     74					.NOVLY::			;OVERLAY LOGICAL UNIT (PLUGGED BY TKB)
     75						.IFF
     76	000000				N.OVLY::			;OFFSET-OVERLAY LOGICAL UNIT
     77
     78						.IFTF
     79						.BLKW	1		;RESERVE SPACE FOR OVERLAY LOGICAL UNIT
     80
     81						.IFT
     82					.NSTBL::			;ADDRESS OF SEGMENT TABLES (PLUGGED BY TKB)
     83						.IFF
     84	000002				N.STBL::			;OFFSET-ADDRESS OF SEGMENT TABLES
     85
     86						.IFTF
     87						.BLKW	1		;RESERVE SPACE FOR SEGMENT TABLES ADDRESS
     88
     89						.IFT
     90					.NIOST::			;COMMON I/O STATUS DOUBLEWORD
     91						.IFF
     92	000004				N.IOST::			;OFFSET-COMMON I/O STATUS DOUBLEWOORD
     93
     94						.IFTF
     95						.BLKW	2		;RESERVE SPACE FOR I/O STATUS DOUBLEWORD
     96						.IFT                                                                    ;**NEW**
     97					.NALER::.WORD	$ALERR		; ADDRESS OF AUTOLOAD ERROR HANDLER             ;**NEW**
     98						.IFF                                                                    ;**NEW**
     99	000010				N.ALER::.BLKW	1		;                                               ;**NEW**
    100
    101						.ENDC
    102
    103
    104		000001 				.END
OVRES	MACRO M1108  05-DEC-77 23:43  PAGE 4-2
SYMBOL TABLE

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

. ABS.	000172	   000
      	000000	   001
$$OVDT	000012	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1093 WORDS  ( 5 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:09
[46,10]OVRES,[46,20]OVRES/-SP=[46,30]MACFLM.,SEGDF.005,OVRES.,OVDAT.005
RQLCB	MACRO M1108  05-DEC-77 23:43  PAGE 2


      1						.TITLE	RQLCB
      2						.IDENT	/03/								;**NEW**
      3															;**-2
      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 6-OCT-72
     22					;
     23					; BEST/FIRST FIT DYNAMIC CORE ALLOCATION ROUTINES
     24					;
     25					; DATA STRUCTURES
     26					;
     27					; FREE BLOCK LIST HEADER:
     28					;
     29					;	FREEHD:	.WORD	NEXT	;POINTER TO NEXT FREE BLOCK OR 0
     30					;		.WORD	0	;ALWAYS ZERO
     31					;
     32					; FREE BLOCK:
     33					;
     34					;	FREEBK:	.WORD	NEXT	;POINTER TO NEXT OR 0
     35					;		.WORD	SIZE	;SIZE OF BLOCK IN BYTES
     36					;
     37					; NOTE: THE FREE BLOCK LIST IS ORDERED BY THE CORE ADDRESS OF THE BLOCKS
     38					;	THEMSELVES. THIS IS SO GARBAGE COLLECTION AND BLOCK AGGLOMERATIO
     39					;	CAN BE PERFORMED WITH LITTLE OVERHEAD.
     40					;+
     41					; **-$RLCB-RELEASE CORE BLOCK
     42					;
     43					; THIS SUBROUTINE IS CALLED TO RELEASE A CORE BLOCK TO THE FREE LIST.
     44					; THE FREE LIST IS SEARCHED UNTIL THE PROPER SLOT IS FOUND AND THE
     45					; BLOCK IS MERGED INTO THE FREE LIST. IF THE BLOCK BEING RELEASED
     46					; CAN BE AGGLOMERATED WITH A BLOCK ALREADY IN THE FREE LIST, THEN THE
     47					; BLOCKS ARE AGGLOMERATED AND THE NEW BLOCK IS MERGED INTO THE FREE
     48					; LIST.
     49					;
     50					; INPUTS:
     51					;
     52					;	R0=ADDRESS OF FREE BLOCK LIST HEAD.
     53					;	R1=SIZE OF BLOCK TO RELEASE IN BYTES.
     54					;	R2=ADDRESS OF BLOCK TO RELEASE.
     55					;
     56					; OUTPUTS:
     57					;
RQLCB	MACRO M1108  05-DEC-77 23:43  PAGE 2-1


     58					;	NONE.
     59					;-
     60
     61	000000					.PSECT	$$RESL								;**NEW**
     62	000000				$RLCB::	SAVRG			;SAVE NONVOLITILE REGISTERS
     63	000004	062701 	000003 			ADD	#3,R1		;ROUND UP TO NEXT 2 WORD BOUNDRY
     64	000010	042701 	000003 			BIC	#3,R1		;CLEAR EXCESS BITS
     65	000014	001431 				BEQ	5$		;IF EQ VERGESSEN!!!
     66	000016	011003 			1$:	MOV	(R0),R3		;GET ADDRESS OF NEXT IN LIST
     67	000020	001404 				BEQ	2$		;IF EQ END OF CHAIN
     68	000022	020203 				CMP	R2,R3		;COMPARE ADDRESSES
     69	000024	103402 				BLO	2$		;IF LO FOUND SLOT
     70	000026	010300 				MOV	R3,R0		;SET NEW PREVIOUS ADDRESS
     71	000030	000772 				BR	1$		;GO AGAIN
     72	000032	010312 			2$:	MOV	R3,(R2)		;ASSUME NO AGGLOMERATION
     73	000034	010204 				MOV	R2,R4		;CALCULATE ADDRESS OF NEXT BLOCK
     74	000036	060104 				ADD	R1,R4		;ADD IN BLOCK SIZE
     75	000040	020304 				CMP	R3,R4		;COMPARE ADDRESSES
     76	000042	001002 				BNE	3$		;IF NE DO NOT MERGE BLOCKS
     77	000044	012312 				MOV	(R3)+,(R2)	;SET NEW FORWARD LINK
     78	000046	061301 				ADD	(R3),R1		;ADJUST SIZE
     79	000050	010210 			3$:	MOV	R2,(R0)		;ASSUME NO AGGLOMERATION
     80	000052	010004 				MOV	R0,R4		;CALCULATE ADDRESS OF NEXT BLOCK
     81	000054	066004 	000002 			ADD	2(R0),R4	;ADD IN BLOCK SIZE
     82	000060	020204 				CMP	R2,R4		;COMPARE ADDRESSES
     83	000062	001004 				BNE	4$		;IF NE DO NOT MERGE
     84	000064	011210 				MOV	(R2),(R0)	;SET NEW FORWARD LINK
     85	000066	066001 	000002 			ADD	2(R0),R1	;ADJUST SIZE
     86	000072	010002 				MOV	R0,R2		;SET NEW BASE ADDRESS OF BLOCK
     87	000074	010162 	000002 		4$:	MOV	R1,2(R2)	;SET SIZE OF BLOCK
     88	000100				5$:	RETURN			;
     89
     90					;+
     91					; **-$RQCB-REQUEST CORE BLOCK
     92					;
     93					; THIS ROUTINE IS CALLED TO REQUEST A CORE BLOCK FROM THE FREE LIST.
     94					; THE SELECTION IS MADE EITHER FIRST FIT OR BEST FIT ACCORDING TO THE
     95					; THE INPUT PARAMETERS.
     96					;
     97					; INPUTS:
     98					;
     99					;	R0=ADDRESS OF FREE BLOCK LIST HEAD.
    100					;	R1=SIZE OF BLOCK REQUESTED IN BYTES.
    101					;		IF R1 IS GE 0, THEN BEST FIT IS USED.
    102					;		IF R1 IS LT 0, THEN FIRST FIT IS USED.
    103					;
    104					;	IN EITHER CASE THE MAGNITUDE OF R1 IS THE SIZE OF THE BLOCK.
    105					;
    106					; OUTPUTS:
    107					;
    108					;	C=1 IF REQUEST CANNOT BE FULFILLED.
    109					;	C=0 IF REQUEST IS SATISFIED.
    110					;		R0=ADDRESS OF REQUESTED CORE BLOCK.
    111					;-
    112
    113	000102				$RQCB::	SAVRG			;SAVE NONVOLITILE REGISTERS
    114	000106	005004 				CLR	R4		;CLEAR PREVIOUS BLOCK ADDRESS
RQLCB	MACRO M1108  05-DEC-77 23:43  PAGE 2-2


    115	000110	005005 				CLR	R5		;CLEAR FOUND BLOCK ADDRESS
    116	000112	010102 				MOV	R1,R2		;SET TYPE OF FIT FLAG
    117	000114	100001 				BPL	1$		;IF PL BEST FIT
    118	000116	005401 				NEG	R1		;MAKE SIZE POSITIVE
    119	000120	062701 	000003 		1$:	ADD	#3,R1		;ROUND TO NEXT 2 WORD BOUNDRY
    120	000124	042701 	000003 			BIC	#3,R1		;CLEAR EXCESS BITS
    121	000130	001441 				BEQ	9$		;IF EQ VERGESSEN!!!
    122	000132	011003 			2$:	MOV	(R0),R3		;GET ADDR OF NEXT
    123	000134	001417 				BEQ	5$		;IF EQ END OF LIST
    124	000136	020163 	000002 			CMP	R1,2(R3)	;BLOCK BIG ENOUGH?
    125	000142	101012 				BHI	4$		;IF HI NO
    126	000144	005702 				TST	R2		;FIRST/BEST FIT?
    127	000146	100420 				BMI	6$		;IF MI FIRST FIT
    128	000150	005705 				TST	R5		;FIND PREVIOUS BLOCK?
    129	000152	001404 				BEQ	3$		;IF EQ NO
    130	000154	026563 	000002 	000002 		CMP	2(R5),2(R3)	;COMPARE BLOCK SIZES
    131	000162	101402 				BLOS	4$		;IF LOS PREVIOUS WINS
    132	000164	010004 			3$:	MOV	R0,R4		;SET ADDR OF PREV
    133	000166	010305 				MOV	R3,R5		;SET ADDR OF BLOCK
    134	000170	010300 			4$:	MOV	R3,R0		;SET NEW PREV ADDR
    135	000172	000757 				BR	2$		;GO AGAIN
    136	000174	005702 			5$:	TST	R2		;FIRST/BEST FIT?
    137	000176	100416 				BMI	9$		;IF MI FIRST FIT
    138	000200	005705 				TST	R5		;FIND A BLOCK?
    139	000202	001414 				BEQ	9$		;IF EQ NO
    140	000204	010400 				MOV	R4,R0		;RETRIEVE ADDR OF PREV
    141	000206	010503 				MOV	R5,R3		;RETRIEVE ADDR OF BLOCK
    142	000210	160163 	000002 		6$:	SUB	R1,2(R3)	;REDUCE SIZE OF BLOCK
    143	000214	001403 				BEQ	7$		;IF EQ NONE LEFT
    144	000216	066303 	000002 			ADD	2(R3),R3	;CALCULATE ADDRESS OF BLOCK
    145	000222	000401 				BR	8$		;
    146	000224	011310 			7$:	MOV	(R3),(R0)	;LINK PREV TO NEXT
    147	000226	010300 			8$:	MOV	R3,R0		;SET ADDRESS OF BLOCK
    148	000230	000241 				CLC			;CLEAR CARRY
    149	000232	000401 				BR	10$		;
    150	000234	000261 			9$:	SEC			;SET CARRY
    151	000236				10$:	RETURN			;
    152
    153		000001 				.END			;
RQLCB	MACRO M1108  05-DEC-77 23:43  PAGE 2-3
SYMBOL TABLE

CR    = 000015   	HT    = 000011   	R$$11M= 000000   	VT    = 000013   	$RQCB   000102RG    002
FF    = 000014   	LF    = 000012   	SPA   = 000040   	$RLCB   000000RG    002	$SAVRG= ****** GX

. ABS.	000000	   000
      	000000	   001
$$RESL	000240	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  602 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:07
[46,10]RQLCB,[46,20]RQLCB/-SP=[46,30]MACFLM.,RQLCB.003
SAVAL	MACRO M1108  05-DEC-77 23:43  PAGE 2


      1						.TITLE	SAVAL
      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 25-JUN-74
     22					;
     23					; SUBROUTINE TO SAVE AND RESTORE R0 - R5
     24					;
     25					; MACRO LIBRARY CALLS
     26					;
     27
     28						.MCALL	CALL,RETURN
     29
     30					;+
     31					; **-$SAVAL-SAVE AND RESTORE R0-R5
     32					;
     33					; THIS MODULE IS ENTERED VIA A 'JSR	PC,$SAVAL' TO SAVE AND
     34					; SUBSEQUENTLY RESTORE REGISTERS R0 THROUGH R5. AFTER STORING THE
     35					; REGISTER CONTENTS ON THE STACK A CO-ROUTINE CALL IS MADE TO
     36					; THE CALLING ROUTINE. A SUBSEQUENT 'RTS	PC' CAUSES THIS
     37					; SUBROUTINE TO RESTORE ALL REGISTERS AND EXIT VIA AN  'RTS	PC'.
     38					;
     39					; ALL REGISTER CONTENTS ARE PRESERVED.
     40					;-
     41
     42	000000				$SAVAL::				;
     43	000000	010446 				MOV	R4,-(SP)		; SAVE R4
     44	000002	010346 				MOV	R3,-(SP)		; SAVE R3
     45	000004	010246 				MOV	R2,-(SP)		; SAVE R2
     46	000006	010146 				MOV	R1,-(SP)		; SAVE R1
     47	000010	010046 				MOV	R0,-(SP)		; SAVE R0
     48	000012	016646 	000012 			MOV	12(SP),-(SP)		; COPY RETURN
     49	000016	010566 	000014 			MOV	R5,14(SP)		; SAVE R5
     50	000022					CALL	@(SP)+			; CALL THE CALLER
     51	000024	012600 				MOV	(SP)+,R0		; RESTORE R0
     52	000026	012601 				MOV	(SP)+,R1		; RESTORE R1
     53	000030	012602 				MOV	(SP)+,R2		; RESTORE R2
     54	000032	012603 				MOV	(SP)+,R3		; RESTORE R3
     55	000034	012604 				MOV	(SP)+,R4		; RESTORE R4
     56	000036	012605 				MOV	(SP)+,R5		; RESTORE R5
     57	000040					RETURN				;
SAVAL	MACRO M1108  05-DEC-77 23:43  PAGE 2-1


     58
     59		000001 				.END
SAVAL	MACRO M1108  05-DEC-77 23:43  PAGE 2-2
SYMBOL TABLE

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

. ABS.	000000	   000
      	000042	   001
ERRORS DETECTED:  0

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


      1						.TITLE	SAVRG
      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 18-NOV-72
     22					;
     23					;+
     24					; **-$SAVRG-SAVE/RESTORE NONVOLITILE REGISTERS
     25					;
     26					; JSR R5,$SAVRG
     27					;-
     28
     29	000000					.PSECT	$$RESL								;**NEW**
     30	000000	010446 			$SAVRG::MOV	R4,-(SP)	;SAVE R4 AND R3
     31	000002	010346 				MOV	R3,-(SP)	;
     32	000004	010546 				MOV	R5,-(SP)	;PUT RETURN ADDRESS ON STACK
     33	000006	016605 	000006 			MOV	6(SP),R5	;RETRIEVE REAL R5
     34	000012					CALL	@(SP)+		;CALL THE CALLER
     35	000014	012603 				MOV	(SP)+,R3	;RESTORE NONVOLITILE REGISTERS
     36	000016	012604 				MOV	(SP)+,R4	;
     37	000020	012605 				MOV	(SP)+,R5	;
     38	000022					RETURN			;
     39
     40		000001 				.END
SAVRG	MACRO M1108  05-DEC-77 23:43  PAGE 2-1
SYMBOL TABLE

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

. ABS.	000000	   000
      	000000	   001
$$RESL	000024	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  532 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:05
[46,10]SAVRG,[46,20]SAVRG/-SP=[46,30]MACFLM.,SAVRG.003
SAVVR	MACRO M1108  05-DEC-77 23:43  PAGE 2


      1						.TITLE	SAVVR
      2						.IDENT	/02/							;**NEW**
      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 02
     20					;
     21					; D.N. CUTLER 18-NOV-72
     22					;
     23					;+
     24					; **-$SAVVR-SAVE/RESTORE VOLITILE REGISTERS
     25					;
     26					; JSR R2,$SAVVR
     27					;-
     28
     29	000000	010146 			$SAVVR::MOV	R1,-(SP)	;SAVE R1 AND R0
     30	000002	010046 				MOV	R0,-(SP)	;
     31	000004	010246 				MOV	R2,-(SP)	;SET RETURN ADDRESS
     32	000006	016602 	000006 			MOV	6(SP),R2	;RESTORE R2
     33	000012					CALL	@(SP)+		;CALL THE CALLER
     34	000014	012600 				MOV	(SP)+,R0	;RESTORE REGISTERS
     35	000016	012601 				MOV	(SP)+,R1	;
     36	000020	012602 				MOV	(SP)+,R2	;
     37	000022					RETURN			;
     38
     39		000001 				.END
SAVVR	MACRO M1108  05-DEC-77 23:43  PAGE 2-1
SYMBOL TABLE

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

. ABS.	000000	   000
      	000024	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  522 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:05
[46,10]SAVVR,[46,20]SAVVR/-SP=[46,30]MACFLM.,SAVVR.002
SAVR1	MACRO M1108  05-DEC-77 23:43  PAGE 2


      1						.TITLE	SAVR1
      2					; ALTERED 21-MAR-73 13:30
      3						.IDENT	/0101/
      4					; COPYRIGHT 1973, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
      5					;
      6					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
      7					; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
      8					;
      9					; PETER H. LIPMAN 21-MARCH-73
     10					;
     11	000000					.PSECT	$$RESL
     12					;
     13						.MCALL	CALL,RETURN
     14					;+
     15					; SUBROUTINE TO SAVE REGISTERS R1-R5 AND RESTORE THEM ON RETURN
     16					; CALLING SEQUENCE:
     17					;	JSR R5,SAVR1
     18					; INPUTS:
     19					;	NONE
     20					; OUPUTS:
     21					;	NONE
     22					; OPERATION:
     23					;	THE ROUTINE IS A COROUTINE WHICH SAVES R1-R5
     24					; ON THE STACK, AND THEN CALLS THE CALLER.  THE RETURN FROM THE
     25					; CALLER THEN POPS THE SAVED REGISTERS AND DOES A RETURN.
     26					;-
     27
     28	000000	010446 			.SAVR1::MOV R4,-(SP)		;SAVE R4,R3,R2,R1
     29	000002	010346 				MOV R3,-(SP)
     30	000004	010246 				MOV R2,-(SP)
     31	000006	010146 				MOV R1,-(SP)
     32	000010	010546 				MOV R5,-(SP)		;PUT RETURN ADDRESS ON STACK
     33	000012	016605 	000012 			MOV 10.(SP),R5		;RETRIEVE REAL R5
     34	000016					CALL @(SP)+		;CALL THE CALLER
     35	000020	012601 				MOV (SP)+,R1		;RESTORE R1,R2,R3,R4,R5
     36	000022	012602 				MOV (SP)+,R2
     37	000024	012603 				MOV (SP)+,R3
     38	000026	012604 				MOV (SP)+,R4
     39	000030	012605 				MOV (SP)+,R5
     40	000032					RETURN
     41					;
     42					;
     43		000001 				.END
SAVR1	MACRO M1108  05-DEC-77 23:43  PAGE 2-1
SYMBOL TABLE

CR    = 000015   	HT    = 000011   	R$$11M= 000000   	VT    = 000013   	.SAVR1  000000RG    002
FF    = 000014   	LF    = 000012   	SPA   = 000040   	$$    = 000001

. ABS.	000000	   000
      	000000	   001
$$RESL	000034	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  532 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:05
[46,10]SAVR1,[46,20]SAVR1/-SP=[46,30]MACFLM.,SAVR1
ARITH	MACRO M1108  05-DEC-77 23:43  PAGE 1


      1						.TITLE	ARITH
      2						.IDENT	/03/
      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 03
     20					;
     21					; D. N. CUTLER 10-FEB-72
     22
     23
     24						.MCALL	RETURN
     25
     26
     27					;+
     28					; **-$MUL-INTEGER MULTIPLY MAGNITUDE NUMBERS
     29					;
     30					; INPUTS:
     31					;
     32					;	R0=MULTIPLIER.
     33					;	R1=MULTIPLICAND.
     34					;
     35					; OUTPUTS:
     36					;
     37					;	DOUBLE WORD RESULT IS RETURNED WITH THE
     38					;	HIGH PART IN R0 AND THE LOW PART IN R1.
     39					;
     40					;	REGISTERS R2, R3, R4, AND R5 ARE PRESERVED ACROSS CALL.
     41					;-
     42
     43						.ENABL	LSB
     44	000000	010046 			$MUL::	MOV	R0,-(SP)	;SAVE R0 FOR ADDS
     45	000002	012746 	000021 			MOV	#21,-(SP)	;SET REPEAT COUNT
     46	000006	005000 				CLR	R0		;CLEAR HIGH PART
     47	000010	006000 			10$:	ROR	R0		;DOUBLE RIGHT SHIFT
     48	000012	006001 				ROR	R1		;
     49	000014	103003 				BCC	20$		;IF CC DO NOT ADD
     50	000016	066600 	000002 			ADD	2(SP),R0	;
     51	000022	000241 				CLC			;CLEAR CARRY INDICATOR
     52	000024	005316 			20$:	DEC	(SP)		;DECREMENT REPEAT COUNT
     53	000026	003370 				BGT	10$		;IF GT MORE TO GO
     54	000030	000415 				BR	50$		;EXIT TO CALLER
     55
     56					;+
     57					; **-$DIV-INTEGER DIVIDE MAGNITUDE NUMBERS
ARITH	MACRO M1108  05-DEC-77 23:43  PAGE 1-1


     58					;
     59					; INPUTS:
     60					;
     61					;	R0=DIVIDEND.
     62					;	R1=DIVISOR.
     63					;
     64					; OUTPUTS:
     65					;
     66					;	QUOTIENT IS RETURNED IN R0 AND REMAINDER IN R1.
     67					;
     68					;	REGISTERS R2, R3, R4, AND R5 ARE PRESERVED ACROSS CALL.
     69					;-
     70
     71	000032	012746 	000020 		$DIV::	MOV	#20,-(SP)	;SET LOOP COUNT
     72	000036	010146 				MOV	R1,-(SP)	;SAVE DIVISOR FOR SUBTRACTS
     73	000040	005001 				CLR	R1		;CLEAR REMAINDER
     74	000042	006300 			30$:	ASL	R0		;DOUBLE LEFT SHIFT
     75	000044	006101 				ROL	R1		;
     76	000046	020116 				CMP	R1,(SP)		;SUBTRACT OUT DIVISOR?
     77	000050	103402 				BLO	40$		;IF LO NO
     78	000052	161601 				SUB	(SP),R1		;SUBTRACT OUT DIVISOR
     79	000054	005200 				INC	R0		;ADD IN LOW BIT
     80	000056	005366 	000002 		40$:	DEC	2(SP)		;DECREMENT REPEAT COUNT
     81	000062	003367 				BGT	30$		;IF GT MORE TO GO
     82	000064	022626 			50$:	CMP	(SP)+,(SP)+	;CLEAN STACK
     83	000066					RETURN			;
     84						.DSABL	LSB
     85
     86		000001 				.END
ARITH	MACRO M1108  05-DEC-77 23:43  PAGE 1-2
SYMBOL TABLE

$DIV    000032RG 	$MUL    000000RG

. ABS.	000000	   000
      	000070	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  126 WORDS  ( 1 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:04
[46,10]ARITH,[46,20]ARITH/-SP=[46,30]ARITH
CAT2B - CONVERT FROM ASCII TO T	MACRO M1108  05-DEC-77 23:44  PAGE 2


      1						.TITLE	CAT2B - CONVERT FROM ASCII TO TWO BINARY WORDS
      2
      3						.IDENT	"V0102"
      4					;
      5					;
      6					; COPYRIGHT (C)   1975,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					; COPYRIGHT (C)   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
     22					;
     23					; ANDREW C. GOLDSTEIN  28 JUN 1974
     24					;
     25						.MCALL	RETURN
CAT2B - CONVERT FROM ASCII TO T	MACRO M1108  05-DEC-77 23:44  PAGE 3


     27					;+
     28					;
     29					; *** - $CDT2B - CONVERT A DECIMAL NUMBER TO TWO BINARY WORDS.
     30					;		 THIS SUBROUTINE CONVERTS AN ASCII DECIMAL NUMBER STRING
     31					;		 TO A DOUBLE LENGTH BINARY NUMBER.
     32					;
     33					; *** - $COT2B - CONVERT AN OCTAL NUMBER TO TWO BINARY WORDS.
     34					;		 THIS SUBROUTINE CONVERTS AN ASCII OCTAL NUMBER STRING
     35					;		 TO A DOUBLE LENGTH BINARY NUMBER.
     36					;
     37					; INPUT:
     38					;	R0 - ADDRESS OF NEXT CHARACTER IN BUFFER (DIGIT)
     39					;	R1 - ADDRESS OF TWO WORD FIELD TO HOLD CONVERTED NUMBER
     40					;		WORD 1 - HIGH ORDER 16 BITS
     41					;		WORD 2 - LOW ORDER 16 BITS
     42					;
     43					; OUTPUT:
     44					;	R0 - UPDATED BUFFER POINTER (NEXT CHARACTER + 1)
     45					;	R1 - REMAINS UNCHANGED
     46					;	R2 - NEXT CHARACTER IN STRING
     47					;
     48					;	CC-C
     49					;	     CLEAR - 16 BIT NUMBER ONLY
     50					;	     SET   - 32 BIT NUMBER
     51					;
     52					; ALL OTHER REGISTERS ARE PRESERVED
     53					;
     54					;-
     55
     56						.ENABL	LSB
     57
     58	000000	012746 	000007 		$COT2B::MOV	#7.,-(SP)	; SET UP FOR OCTAL CONVERT
     59	000004	000402 				BR	10$
     60
     61	000006	012746 	000011 		$CDT2B::MOV	#9.,-(SP)	; SET UP FOR DECIMAL CONVERT
     62
     63	000012	005021 			10$:	CLR	(R1)+		; ZERO HIGH ORDER 16 BITS
     64	000014	005011 				CLR	(R1)		; ZERO LOW ORDER 16 BITS
     65
     66	000016	112002 			20$:	MOVB	(R0)+,R2	; GET NEXT CHARACTER
     67	000020	162702 	000060 			SUB	#'0,R2		; CONVERT DIGIT TO VALUE
     68	000024	103430 				BLO	50$		; NOT A LEGAL DIGIT CHARACTER
     69
     70	000026	020216 				CMP	R2,(SP)		; LAST CHANCE TO BE IN RANGE
     71	000030	101026 				BHI	50$		; DEFINITELY NOT LEGAL
     72	000032	006311 				ASL	(R1)		; MULTIPLY CURRENT BINARY NUMBER BY 2
     73	000034	006141 				ROL	-(R1)		; USE FULL 32 BIT ACCURACY
     74	000036	012146 				MOV	(R1)+,-(SP)	; SAVE HIGH ORDER BITS
     75	000040	011146 				MOV	(R1),-(SP)	; SAVE LOW ORDER BITS
     76	000042	006311 				ASL	(R1)		; MULTIPLY AGAIN BY 2
     77	000044	006141 				ROL	-(R1)		; KEEP THOSE BITS MOVING
     78	000046	006361 	000002 			ASL	2(R1)		; MAKE TOTAL MULTIPLICATION BY 8
     79	000052	006121 				ROL	(R1)+		; NOW HAVE (NEW NUMBER) = (OLD NUMBER)*8
     80
     81	000054	026627 	000004 	000011 		CMP	4(SP),#9.	; CHECK WHAT RADIX WE'RE IN
     82	000062	001402 				BEQ	30$		; EQUAL IF DECIMAL
     83	000064	022626 				CMP	(SP)+,(SP)+	; OCTAL - THROW AWAY (OLD NUMBER)*2
CAT2B - CONVERT FROM ASCII TO T	MACRO M1108  05-DEC-77 23:44  PAGE 3-1


     84	000066	000403 				BR	40$
     85
     86	000070	062611 			30$:	ADD	(SP)+,(R1)	; ADD BACK (OLD NUMBER)*2
     87	000072	005541 				ADC	-(R1)		; ADD ANY OVERFLOW TO HIGH ORDER
     88	000074	062621 				ADD	(SP)+,(R1)+	; NOW HAVE (NEW NUMBER) = (OLD NUMBER)*10
     89
     90	000076	060211 			40$:	ADD	R2,(R1)		; ADD THIS DIGIT TO MAKE NEW TOTAL
     91	000100	005561 	177776 			ADC	-2(R1)		; MAKE SURE OVERFLOW IS CONSIDERED
     92	000104	000744 				BR	20$		; GO GET NEXT DIGIT
     93
     94	000106	005726 			50$:	TST	(SP)+		; THROW AWAY RADIX VALUE
     95	000110	062702 	000060 			ADD	#'0,R2		; RESTORE CHARACTER IN R2
     96	000114	005741 				TST	-(R1)		; MORE THAN 16 BITS IN CONVERTED NUMBER?
     97	000116	001401 				BEQ	60$		; YES
     98	000120	000261 				SEC			; NO, SO SET THE 32-BIT FLAG
     99	000122				60$:	RETURN			; RETURN TO CALLER
    100
    101						.DSABL	LSB
    102
    103		000001 				.END
CAT2B - CONVERT FROM ASCII TO T	MACRO M1108  05-DEC-77 23:44  PAGE 3-2
SYMBOL TABLE

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

. ABS.	000000	   000
      	000124	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  542 WORDS  ( 3 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:06
[46,10]CAT2B,[46,20]CAT2B/-SP=[46,30]MACFLM.,CAT2B
DARITH - DOUBLE PRECISION MUL, 	MACRO M1108  05-DEC-77 23:44  PAGE 1


      1						.TITLE	DARITH - DOUBLE PRECISION MUL, DIV
      2						.IDENT	/0004/
      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 0004
     19					;
     20					; PETER H. LIPMAN	27-FEB-74
     21					;
     22					; DOUBLE PRECISION MULTIPLY AND DIVIDE
     23					;
     24
     25
     26						.MCALL	RETURN
     27
     28	000000					.PSECT	$$RESL
     29
     30
     31					;+
     32					; **-$DMUL-DOUBLE PRECISION MULTIPLY
     33					;
     34					; INPUTS:
     35					;
     36					;	R0=SINGLE PRECISION MAGNITUDE MULTIPLIER
     37					;	R2,R3=DOUBLE PRECISION MAGNITUDE MULTIPLICAND
     38					;
     39					; OUTPUTS:
     40					;
     41					;	C=0
     42					;	R0,R1=DOUBLE PRECISION MAGNITUDE RESULT
     43					;	R2,R3 ALTERED
     44					;	R4,R5 PRESERVED
     45					;-
     46	000000				$DMUL::
     47	000000	010046 				MOV	R0,-(SP)	;SINGLE PRECISION MULTIPLIER
     48	000002	005000 				CLR	R0		;INIT THE RESULT
     49	000004	005001 				CLR	R1		;
     50	000006	005716 			10$:	TST	(SP)		;IF REMAINING MULTIPLIER IS ZERO
     51	000010	001410 				BEQ	30$		;THEN ALL THROUGH
     52	000012	006016 				ROR	(SP)		;IF NEXT BIT IS A ONE
     53	000014	103003 				BCC	20$		;
     54	000016	060301 				ADD	R3,R1		;THEN ADD MULTIPLICAND TO RESULT
     55	000020	005500 				ADC	R0
     56	000022	060200 				ADD	R2,R0
     57	000024	006303 			20$:	ASL	R3		;IN EITHER CASE, DOUBLE THE MULTIPLICAND
DARITH - DOUBLE PRECISION MUL, 	MACRO M1108  05-DEC-77 23:44  PAGE 1-1


     58	000026	006102 				ROL	R2
     59	000030	000766 				BR	10$		;AND SEE IF ANY MORE MULTIPLIER
     60	000032	005726 			30$:	TST	(SP)+		;CLEAN UP THE STACK, RETURN C=0
     61	000034					RETURN			;AND RETURN
DARITH - DOUBLE PRECISION MUL, 	MACRO M1108  05-DEC-77 23:44  PAGE 2


     63					;+
     64					;
     65					; **-$DDIV-DOUBLE PRECISION DIVIDE ROUTINE
     66					;
     67					; INPUTS:
     68					;
     69					;	R2=LOW ORDER OF DIVIDEND
     70					;	R1=HIGH ORDER OF DIVIDEND
     71					;	R0=DIVISOR, (15 BITS UNSIGNED)
     72					;
     73					; OUTPUTS:
     74					;
     75					;	R2=LOW ORDER OF QUOTIENT
     76					;	R1=HIGH ORDER OF QUOTIENT
     77					;	R0=REMAINDER
     78					;
     79					;-
     80
     81	000036	010346 			$DDIV::	MOV	R3,-(SP)	;SAVE R3
     82	000040	012703 	000040 			MOV	#32.,R3		;SET ITERATION COUNT IN R3
     83	000044	010046 				MOV	R0,-(SP)	;PUT DIVISOR IN STACK
     84	000046	005000 				CLR	R0		;SET REMAINDER TO ZERO
     85	000050	006302 			1$:	ASL	R2		;SHIFT THE ENTIRE DIVIDEND...
     86	000052	006101 				ROL	R1		;... ONE BIT TO THE LEFT AND ...
     87	000054	006100 				ROL	R0		;... INTO THE REMAINDER
     88	000056	020016 				CMP	R0,(SP)		;IS REMAINDER .GE. DIVISOR?
     89	000060	103402 				BLO	2$		;NO, SKIP TO ITERATION CONTROL
     90	000062	161600 				SUB	(SP),R0		;YES, SUBTRACT DIVISOR OUT
     91	000064	005202 				INC	R2		;AND INCREMENT THE QUOTIENT
     92	000066	005303 			2$:	DEC	R3		;REPEAT AS LONG AS NECESSARY
     93	000070	003367 				BGT	1$
     94	000072	005726 				TST	(SP)+		;PURGE DIVISOR FROM STACK
     95	000074	012603 				MOV	(SP)+,R3	;RESTORE R3
     96	000076					RETURN			;
     97					;
     98					;
     99		000001 				.END
DARITH - DOUBLE PRECISION MUL, 	MACRO M1108  05-DEC-77 23:44  PAGE 2-1
SYMBOL TABLE

$DDIV   000036RG    002	$DMUL   000000RG    002

. ABS.	000000	   000
      	000000	   001
$$RESL	000100	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  132 WORDS  ( 1 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:04
[46,10]DARITH,[46,20]DARITH/-SP=[46,30]DARITH
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 1


      1						.MCALL	CSI$
      2	000000					CSI$
      3					;
      4		000002 			C.BFLN=C.CMLD
      5		000004 			C.BFAD=C.CMLD+2
      6		000016 			C.FNLN=C.FILD
      7		000020 			C.FNAD=C.FILD+2
      8		000006 			C.DVLN=C.DEVD
      9		000010 			C.DVAD=C.DEVD+2
     10		000012 			C.DILN=C.DIRD
     11		000014 			C.DIAD=C.DIRD+2
     12					;
     13		000032 			C.IDVA=	32	;INPUT LAST DEVICE NAME FOUND PTR
     14		000030 			C.IDVL=	30	;INPUT LAST DEVICE NAME FOUND LENGTH
     15		000036 			C.ODVA=	36	;OUTPUT LAST DEVICE NAME FOUND PTR
     16		000034 			C.ODVL=	34	;OUTPUT LAST DEVICE FOUND LENGTH
     17		000042 			C.IDIA=	42	;INPUT LAST DIR INFO PTR FOUND
     18		000040 			C.IDIL=	40	;INPUT LAST DIR INFO FOUND LENGTH
     19		000046 			C.ODIA=	46	;OUTPUT LAST DIR INFO FOUND PTR
     20		000044 			C.ODIL=	44	;OUTPUT LAST DIR INFO FOUND LENGTH
     21		000050 			C.ISTR=	50	;INPUT NEXT STRING SECTION ADDR
     22		000052 			C.OSTR=	52	;OUTPUT NEXT STRING SECTION ADDR
     23					;
     24					;	COMMAND STRING DELIMITERS
     25					;
     26		000072 			COLON=	72	;	:
     27		000054 			COMMA=	54	;	,
     28		000057 			SLASH=	57	;	/
     29		000075 			EQUAL=	75	;	=
     30		000073 			SEMIC=	73	;	;
     31		000135 			RBRAC=	135	;	]
     32		000133 			LBRAC=	133	;	[
     33					;
     34					;	CHARS DELETED FROM COMMAND STRINGS
     35					;
     36		000040 			BLANK=	40
     37		000011 			TAB=	11
     38		000000 			NULL=	0
     39		000177 			RUBOUT=	177
     40					;
     41					;	OTHER RELEVANT CHARS
     42					;
     43		000101 			CHARA=	101	;	A
     44		000132 			CHARZ=	132	;	Z
     45		000060 			CHAR0=	60	;	0
     46		000071 			CHAR9=	71	;	9
     47		000056 			DOT=	56	;	.
     48		000052 			STAR=	52	;	*
     49		000055 			MINUS=	55	;	-
     50		000053 			PLUS=	53	;	+
     51		000044 			DOLLAR=	44	;	$
     52					;
     53					;
     54					;
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 2


      1						.TITLE	.CSI1
      2						.IDENT	/05/
      3
      4					; COPYRIGHT 1973, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
      5					; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
      6					;
      7					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
      8					; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
      9					;
     10					; THIS SOFTWARE IS FURNSIHED TO PURCHASER UNDER A LICENSE FOR USE
     11					; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     12					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     13					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     14					;
     15					; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     16					; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     17					; EQUIPMENT CORPORATION.
     18					;
     19					; VERSION 05
     20					;
     21					; WRITTEN BY:
     22					; 	A. MAROTTO  (CCA)
     23					;
     24					; MODIFIED BY:
     25					;	C.A. D'ELIA	19-OCT-73	001
     26					;	C.A. D'ELIA	15-JAN-74	002
     27					; 	C.A. D'ELIA	11-FEB-74	003
     28					;	C.A. D'ELIA	23-MAY-74	004
     29					;	C.A. D'ELIA	07-JUN-74	005
     30					;	C.A. D'ELIA	01-AUG-74	006
     31					;	C.A. D'ELIA	04-OCT-74	007
     32					;
     33					;
     34					;	COMMAND STRING INTERPRETER-SYNTAX ANALYZER
     35					;
     36					;
     37
     38					;++003
     39					;
     40					; DEFINITION OF MACRO TO GENERATE STATE TABLE ENTRIES
     41					;
     42					;--003
     43
     44						.MACRO	GENDSP	LIST
     45						.IRP	X,<LIST>
     46						.BYTE	X'DSP
     47						.ENDM
     48						.ENDM	GENDSP
     49
     50
     51					;
     52					;
     53					;
     54					;
     55					;
     56	000000				.CSI1::				;++004
     57	000000	004567 	000000G			JSR	R5,.SAVR1	;++004 SAVE REGISTERS
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 2-1


     58					;
     59					;	CLEAR CSI CMMD BLOCK
     60					;
     61	000004	010003 				MOV	R0,R3		;COMMAND BLOCK ADDR
     62	000006	016001 	000004 			MOV	C.BFAD(R0),R1	;GET BUFF ADDR
     63	000012	016002 	000002 			MOV	C.BFLN(R0),R2	;AND BUFF LENGTH
     64	000016	012704 	000026 			MOV	#<C.SIZE/2>,R4	;++003 SET SIZE OF CSI BLOCK (WDS)
     65	000022	005023 			CSICLR:	CLR	(R3)+		;CLEAR BLOCK
     66	000024	005304 				DEC	R4
     67	000026	001375 				BNE	CSICLR
     68	000030	010160 	000004 			MOV	R1,C.BFAD(R0)	;RESTORE BUFF ADDR
     69	000034	010160 	000052 			MOV	R1,C.OSTR(R0)	;SET OUTPUT SIDE STRING PTR
     70					;
     71					;	COMPRESS COMMAND STRING(ELIMINATE NULLS, STABS, RUBOUTS AND BLANKS)
     72					;	ALSO ESTABLISH THAT THERE IS AT MOST 1 EQUALS AND SAVE ITS LOCN+1
     73					;
     74	000040	010103 				MOV	R1,R3		;SET PTRS FOR COMPRESS
     75	000042	010004 				MOV	R0,R4		;++003 SET R4 TO THE ...
     76	000044	062704 	000050 			ADD	#C.ISTR,R4	;++003 ... INPUT STRING POINTER
     77	000050	005702 				TST	R2
     78	000052	001002 				BNE	COMPRS		;BRANCH IF NOT NULL LINE
     79	000054	010114 				MOV	R1,(R4)		;++003 ELSE, SET INPUT STRING POINTER
     80	000056	000207 				RTS	PC		;++003 RETURN -- CC-C ALREADY CLEAR
     81	000060	105713 			COMPRS:	TSTB	(R3)		;++003 BRANCH IF NULL, RUBOUT ...
     82	000062	001431 				BEQ	ELIM		;TAB OR BLANK
     83	000064	122713 	000011 			CMPB	#TAB,(R3)
     84	000070	001426 				BEQ	ELIM
     85	000072	122713 	000177 			CMPB	#RUBOUT,(R3)
     86	000076	001423 				BEQ	ELIM
     87	000100	122713 	000040 			CMPB	#BLANK,(R3)
     88	000104	001420 				BEQ	ELIM
     89	000106	111321 				MOVB	(R3),(R1)+	;ELSE MOVE CHAR TO COMPRESSED STRING
     90	000110	122713 	000075 			CMPB	#EQUAL,(R3)	;BRANCH IF NOT EQUALS
     91	000114	001014 				BNE	ELIM
     92	000116	005714 				TST	(R4)		;++003 ERROR IF ALREADY FOUND EQUAL SIGN
     93	000120	001406 				BEQ	SETINP		;ELSE BRANCH
     94	000122	010360 	000020 			MOV	R3,C.FNAD(R0)	;SET LOCN OF BAD SYNTAX
     95	000126	010260 	000016 			MOV	R2,C.FNLN(R0)	;SET LENGTH
     96	000132	000261 				SEC			;SET ERROR
     97	000134	000207 				RTS	PC		;EXIT
     98	000136	010114 			SETINP:	MOV	R1,(R4)		;++003 SET INPUT STRING POINTER
     99	000140	152760 	000040 	000001 		BISB	#CS.EQU,C.STAT(R0)  ;++005 INDICATE EQUAL SIGN SEEN
    100	000146	005203 			ELIM:	INC	R3		;NEXT UNCOMPRESSED CHARS ADDR
    101	000150	005302 				DEC	R2		;BRANCH IF MORE TO CHECK
    102	000152	001342 				BNE	COMPRS
    103					;
    104	000154	005714 				TST	(R4)		;++003 BRANCH IF EQUAL SIGN ALREADY FOUND
    105	000156	001001 				BNE	INPSET
    106	000160	010114 				MOV	R1,(R4)		;++003 ELSE, SET INPUT STRING POINTER
    107	000162	016002 	000004 		INPSET:	MOV	C.BFAD(R0),R2	;++003 GET STRING ADDRESS
    108	000166	160201 				SUB	R2,R1		;++003 SET COMPRESSED STRING LENGTH
    109	000170	010160 	000002 			MOV	R1,C.BFLN(R0)
    110					;
    111					;	COMMAND BLOCK IS SET UP AND STRING IS COMPRESSED
    112					;	PREPARE FOR SYNTAX SCAN OF COMPRESSED STRING
    113					;
    114	000174	010046 				MOV	R0,-(SP)	;SAVE CMMD BLOCK ADDR
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 2-2


    115	000176	005000 				CLR	R0		;SET SCAN STATE
    116	000200	060201 				ADD	R2,R1		;END OF STRING ADDR
    117	000202	010204 				MOV	R2,R4
    118	000204	020401 			SCAN:	CMP	R4,R1		;BRANCH IF DONE
    119	000206	001415 				BEQ	DONE
    120	000210	004767 	000132 			JSR	PC,GETDEL	;SCAN TO A DELIMITER
    121					;
    122					;	GO TO PROPER ROUTINE VIA STATE TABLE
    123					;
    124	000214	010503 				MOV	R5,R3
    125	000216	062703 	000265'			ADD	#STAT0,R3	;BASE OF TABLES
    126	000222	005300 			NXTAB:	DEC	R0		;BRANCH IF IN PROPER TABLE
    127	000224	100403 				BMI	JUMP
    128	000226	062703 	000007 			ADD	#7.,R3		;++003 ADVANCE TO NEXT TABLE
    129	000232	000773 				BR	NXTAB
    130					;
    131	000234	111303 			JUMP:	MOVB	(R3),R3		;++003 LOAD OFFSET INTO DISP TBL
    132	000236	000173 	000250'			JMP	@DSPTBL(R3)	;++003 JUMP TO PROPER ROUTINE
    133					;
    134					;
    135					;
    136	000242	012600 			DONE:	MOV	(SP)+,R0	;RESTORE CSI BLK ADDR
    137	000244	000241 				CLC
    138	000246	000207 				RTS	PC
    139					;++003
    140					;
    141					; GENERATE THE OFFSET SYMBOLS TO USE THE DISPATCH TABLE
    142					;
    143					;--003
    144
    145		000000 			XTMPX=0
    146						.IRP	X,<FN,DV,PP,ER,VR,SW>
    147					X'DSP=XTMPX
    148					XTMPX=XTMPX+2
    149						.ENDM
    150
    151
    152
    153					;++003
    154					;
    155					; TABLE OF ROUTINE ADDRESSES
    156					;
    157					;--003
    158
    159	000250				DSPTBL:				;++003
    160	000250	001116'				.WORD	FNSCAN		;++003 SCAN FILE NAME
    161	000252	000554'				.WORD	DVSCAN		;++003 SCAN DEVICE NAME (AND NUMBER)
    162	000254	000634'				.WORD	PPSCAN		;++003 SCAN UIC SPECIFICATION
    163	000256	000526'				.WORD	ERROR		;++003 DECLARE SYNTAX ERROR
    164	000260	000766'				.WORD	VRSCAN		;++003 SCAN VERSION NUMBER
    165	000262	001024'				.WORD	SWSCAN		;++003 SCAN SWITCHES
    166
    167
    168					;
    169					;	STATE TABLES FOR SYNTAX SCAN
    170					;
    171	000264	   000 				.BYTE	FNDSP		;++003
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 2-3


    172
    173	000265				STAT0:	GENDSP	<FN,DV,PP,FN,FN,ER,FN> ;++003
    174
    175	000274				STAT1:	GENDSP	<FN,ER,PP,FN,FN,ER,FN> ;++003
    176
    177	000303				STAT2:	GENDSP	<FN,ER,ER,FN,FN,ER,VR> ;++003
    178
    179	000312				STAT3:	GENDSP	<VR,ER,ER,ER,VR,ER,SW> ;++003
    180
    181	000321				STAT4:	GENDSP	<SW,SW,ER,ER,SW,ER> ;++003
    182
    183						.EVEN			;++003
    184					;
    185					;
    186					;
    187					;	SCAN TO A DELIMITER
    188					;
    189					;	DELIMITERS ARE-
    190					;	COLON, COMMA, SLASH, EQUALS(OR END OF STRING), SEMICOLON, RIGHT BRACKET,
    191					;	LEFT BRACKET
    192					;	CALL SEQUENCE-
    193					;
    194					;	R1=END OF STRING ADDR
    195					;	R2=CURRENT STRING PTR
    196					;	JSR PC,GETDEL
    197					;
    198					;	RETURNS-
    199					;
    200					;	R4=ADDR OF DELIMITER FOUND
    201					;	R5=VALUE OF DELIMITER
    202					;
    203					;	VALUE OF DELIMITERS-
    204					;	1, 0, 4, -1, 3, 5, 2 RESPECTIVELY(SEE DELIMITERS ABOVE)
    205					;
    206	000330				DELTAB:
    207	000330	   075 	   377 			.BYTE	EQUAL,-1	;++003
    208	000332	   135 	   005 			.BYTE	RBRAC,5		;++003
    209	000334	   057 	   004 			.BYTE	SLASH,4		;++003
    210	000336	   073 	   003 			.BYTE	SEMIC,3		;++003
    211	000340	   133 	   002 			.BYTE	LBRAC,2		;++003
    212	000342	   072 	   001 			.BYTE	COLON,1		;++003
    213	000344	   054 	   000 			.BYTE	COMMA,0		;++003
    214					;
    215	000346	010204 			GETDEL:	MOV	R2,R4		;ADDR DELIM
    216	000350	012705 	000330'		GD:	MOV	#DELTAB,R5	;ADDR DELIMITER TABLE
    217	000354	020401 				CMP	R4,R1		;BRANCH IF NOT AT END OF STRING
    218	000356	001002 				BNE	GD1
    219	000360	005205 				INC	R5		;++003 SET END-OF-STR VALUE POINTER
    220	000362	000402 				BR	GDX		;++003 BRANCH TO GET THE VALUE
    221					;
    222	000364	121425 			GD1:	CMPB	(R4),(R5)+	;IS THIS CHAR THIS DELIM
    223	000366	001002 				BNE	GD2		;BRANCH IF NOT
    224	000370	111505 			GDX:	MOVB	(R5),R5		;++003 GET DELIMITER VALUE
    225	000372	000207 				RTS	PC		;EXIT
    226					;
    227	000374	105725 			GD2:	TSTB	(R5)+		;++003 BRANCH IF NOT AT END OF
    228	000376	001372 				BNE	GD1		;DELIMITER TABLE
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 2-4


    229					;
    230	000400	005204 				INC	R4		;ADVANCE TO NEXT CHAR
    231	000402	000762 				BR	GD		;GO CHECK
    232					;
    233					;
    234					;
    235					;
    236					;	GIVEN CHAR(ADDR IN R0) DETERMINE ITS CLASS(RETURN IN R3)
    237					;
    238					;	CLASSES ARE:
    239					;	NUMER, ALPHA, DOLSGN, PERIOD, ASTER,  OTHER
    240					;
    241	000404	012703 	000005 		CHRTYP:	MOV	#OTHER,R3
    242	000410	020004 				CMP	R0,R4
    243	000412	103043 				BHIS	TYPEX
    244	000414	121027 	000132 			CMPB	(R0),#CHARZ
    245	000420	101040 				BHI	TYPEX
    246	000422	121027 	000101 			CMPB	(R0),#CHARA
    247	000426	103403 				BLO	CT1
    248	000430	012703 	000001 			MOV	#ALPHA,R3
    249	000434	000432 				BR	TYPEX
    250	000436	121027 	000071 		CT1:	CMPB	(R0),#CHAR9
    251	000442	101027 				BHI	TYPEX
    252	000444	121027 	000060 			CMPB	(R0),#CHAR0
    253	000450	103403 				BLO	CT2
    254	000452	012703 	000000 			MOV	#NUMER,R3
    255	000456	000421 				BR	TYPEX
    256	000460	121027 	000052 		CT2:	CMPB	(R0),#STAR
    257	000464	001003 				BNE	CT3
    258	000466	012703 	000004 			MOV	#ASTER,R3
    259	000472	000413 				BR	TYPEX
    260	000474	121027 	000056 		CT3:	CMPB	(R0),#DOT
    261	000500	001003 				BNE	CT4
    262	000502	012703 	000003 			MOV	#PERIOD,R3
    263	000506	000405 				BR	TYPEX
    264	000510	121027 	000044 		CT4:	CMPB	(R0),#DOLLAR
    265	000514	001002 				BNE	TYPEX
    266	000516	012703 	000002 			MOV	#DOLSGN,R3
    267	000522	005200 			TYPEX:	INC	R0
    268	000524	000207 				RTS	PC
    269					;
    270		000000 			NUMER=0
    271		000001 			ALPHA=1
    272		000002 			DOLSGN=2
    273		000003 			PERIOD=3
    274		000004 			ASTER=4
    275		000005 			OTHER=5
    276					;
    277					;
    278					;
    279					;
    280					;	SYNTAX ERROR COMES HERE
    281					;
    282	000526	012600 			ERROR:	MOV	(SP)+,R0	;GET CMMD BLOCK
    283	000530	010260 	000020 			MOV	R2,C.FNAD(R0)	;SET ERROR STRING ADDR
    284	000534	020401 				CMP	R4,R1		;IF AT END OF STRING,
    285	000536	103001 				BHIS	ERR1		;DONT RETURN DELIM
.CSI1	MACRO M1108  05-DEB-77 23:44  PAGE 2-5


    "86	000540	005204 				INC	R4
    287	000542	160204 			ERR1:	SUB	R2,R4		;SET ERROR STRING LENGTH
    288	000544	010460 	000016 			MOV	R4,C.FNLN(R0)
    289	000550	000261 				SEC			;SET ERROR
    290	000552	000207 				RTS	PC		;EXIT
    291					;
    292					;
    293					;
    294					;	VALIDATE DEVICE NAME SYNTAX
    295					;
    296	000554	010200 			DVSCAN:	MOV	R2,R0		;SET START CHAR
    297	000556	004767 	177622 			JSR	PC,CHRTYP	;GET CHAR TYPE
    298	000562	022703 	000001 			CMP	#ALPHA,R3	;IF FIRST 2 CHARS NOT ALPHA
    299	000566	001357 				BNE	ERROR		;OR LESS THAN 2 CHARS - ERROR
    300	000570	004767 	177610 			JSR	PC,CHRTYP
    301	000574	022703 	000001 			CMP	#ALPHA,R3
    302	000600	001352 				BNE	ERROR
    303	000602	020004 			DVS:	CMP	R0,R4		;EXIT IF AT END OF STRING
    304	000604	001406 				BEQ	DVSX
    305	000606	004767 	177572 			JSR	PC,CHRTYP
    306	000612	022703 	000000 			CMP	#NUMER,R3	;IF ALL SUBSEQUENT CHARS ARE
    307	000616	001771 				BEQ	DVS		;NOT NUMERIC
    308	000620	000742 				BR	ERROR		;ERROR
    309	000622	010500 			DVSX:	MOV	R5,R0		;++003 SET NEXT STATE
    310	000624				DVSX1:				;++003
    311	000624	010402 				MOV	R4,R2		;SET NEW SCAN PTR
    312	000626	005202 				INC	R2
    313	000630				DVSX2:				;++003
    314	000630	000167 	177350 			JMP	SCAN		;GO SCAN NEXT SECTION
    315					;
    316					;
    317					;	VALIDATE PROJECT/PROGRAMMER NUMBER SYNTAX
    318					;
    319	000634	020204 			PPSCAN:	CMP	R2,R4		;IF CHARS PRECEED [
    320	000636	001333 				BNE	ERROR		;ERROR
    321	000640	005202 				INC	R2		;STEP OVER DELIM
    322	000642	004767 	177500 			JSR	PC,GETDEL	;GET NEXT DELIM
    323	000646	005705 				TST	R5
    324	000650	001326 				BNE	ERROR		;ERROR IF NOT COMMA
    325	000652	010205 			PP1:	MOV	R2,R5		;SET UP FOR CALL TO CONVERT RTN
    326	000654	010446 				MOV	R4,-(SP)	;++003 SAVE POINTER
    327	000656	160204 				SUB	R2,R4
    328	000660	005046 				CLR	-(SP)
    329	000662	010603 				MOV	SP,R3
    330	000664	004767 	000000G			JSR	PC,.ODCVT	;CONVERT NUM
    331	000670	012603 				MOV	(SP)+,R3
    332	000672	100432 				BMI	PVER2		;++003 ERROR IF NEGATIVE NUMBER
    333	000674	103002 				BCC	PPOK		;++003 ELSE, BRANCH IF NO BAD CHARS
    334	000676	004767 	000042 			JSR	PC,PVER		;++003 ELSE, CHECK FOR WILD FIELD SPEC
    335	000702	020327 	000377 		PPOK:	CMP	R3,#377		;++006 COMPARE RESULT W/ MAX UIC
    336	000706	003024 				BGT	PVER2		;++006 ERROR IF IT'S GREATER
    337	000710	012602 				MOV	(SP)+,R2	;++003 ELSE, SET NEXT SCAN POINTER
    338	000712	010204 				MOV	R2,R4
    339	000714	122227 	000135 			CMPB	(R2)+,#RBRAC	;DID LAST SECTION END WITH ]
    340	000720	001406 				BEQ	PPX		;DONE IF SO
    341	000722	004767 	177420 			JSR	PC,GETDEL	;GET DELIM
    342	000726	020527 	000005 			CMP	R5,#5		;ERROR IF NOT ]
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 2-6


    343	000732	001747 				BEQ	PP1		;ELSE GO CVT NUM
    344	000734	000674 				BR	ERROR
    345	000736	012700 	000002 		PPX:	MOV	#2,R0		;++003 SET NEXT STATE
    346	000742	000732 				BR	DVSX2		;++003 BRANCH TO SCAN NEXT FIELD
    347					;++003
    348					;
    349					;  BAD CHAR FOUND IN PPN OR VERSION -- CHECK FOR WILD (*)
    350					;
    351					;--003
    352	000744	005304 			PVER:	DEC	R4		;++003 NO ERROR IF FIELD IS ...
    353	000746	001003 				BNE	PVER1		;++003 ... ONE CHAR LONG ...
    354	000750	122712 	000052 			CMPB	#STAR,(R2)	;AND IS *
    355	000754	001403 				BEQ	PVOK		;++003
    356	000756	005726 			PVER1:	TST	(SP)+		;++003 ERROR -- PURGE RETURN ADDRESS
    357	000760	012604 			PVER2:	MOV	(SP)+,R4	;++003 SET POINTER
    358	000762	000661 				BR	ERROR
    359	000764	000207 			PVOK:	RTS	PC		;++003 NO ERROR -- RETURN
    360					;
    361					;
    362					;	VALIDATE VERSION NUMBER SYNTAX
    363					;
    364	000766	010500 			VRSCAN:	MOV	R5,R0		;SET NEXT STATE
    365	000770	010446 				MOV	R4,-(SP)	;SAVE NEXT PTR
    366	000772	010205 				MOV	R2,R5		;SET ADDR
    367	000774	005046 				CLR	-(SP)
    368	000776	160204 				SUB	R2,R4		;++001 CALC LENGTH OF STRING
    369	001000	001403 				BEQ	1$		;++001 BRANCH IF NULL
    370	001002	010603 				MOV	SP,R3		;SET RESULT ADDR
    371	001004	004767 	000000G			JSR	PC,.DCCVT	;++003 GO CONVERT NUMBER (DECIMAL DEFAULT)
    372	001010				1$:				;++001
    373	001010	012603 				MOV	(SP)+,R3
    374	001012	103002 				BCC	VRCK		;++003 NO ERRORS DETECTED
    375	001014	004767 	177724 			JSR	PC,PVER		;++003 CHECK FOR WILD FIELD SPEC
    376	001020	012604 			VRCK:	MOV	(SP)+,R4	;++007 SET NEXT FIELD POINTER
    377	001022	000700 				BR	DVSX1		;++003 BRANCH TO SCAN NEXT SECTION
    378					;
    379					;
    380					;
    381					;	VALIDATE SWITCH SYNTAX
    382					;
    383	001024	010200 			SWSCAN:	MOV	R2,R0
    384	001026	121027 	000055 			CMPB	(R0),#MINUS	;STEP OVER LEADING MINUS
    385	001032	001001 				BNE	SW1
    386	001034	005200 				INC	R0
    387	001036	020004 			SW1:	CMP	R0,R4		;BRANCH IF AT END OF NAME
    388	001040	001406 				BEQ	SW2
    389	001042	004767 	177336 			JSR	PC,CHRTYP	;GET NEXT CHARS TYPE
    390	001046	020327 	000003 			CMP	R3,#PERIOD	;IF NOT RAD50 CHAR
    391	001052	101771 				BLOS	SW1
    392	001054	000624 			SWER:	BR	ERROR		;++003 ELSE, REPORT ERROR DETECTED
    393	001056	022705 	000001 		SW2:	CMP	#1,R5		;++003 IS COLON THE DELIMITER?
    394	001062	001257 				BNE	DVSX		;++003 NO, BRANCH TO SCAN NEXT
    395	001064	010402 				MOV	R4,R2		;++003 SET POINTER
    396	001066	005202 				INC	R2		;++003
    397	001070	004767 	177252 			JSR	PC,GETDEL	;++003 SKIP THE SWITCH VALUE
    398	001074	010503 				MOV	R5,R3		;++004 COPY DELIMITER VALUE INTO R3
    399	001076	162703 	000002 			SUB	#2,R3		;++004 IF DELIMITER IS '[' THEN ...
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 2-7


    400	001102	001611 				BEQ	ERROR		;++004 ... DECLARE SYNTAX ERROR
    401	001104	005303 				DEC	R3		;++004 IF DELIMITER IS ';' THEN ...
    402	001106	001607 				BEQ	ERROR		;++004 ... DECLARE SYNTAX ERROR
    403	001110	005303 				DEC	R3		;++004 IF DELIMITER IS ']' THEN ...
    404	001112	003205 				BGT	ERROR		;++004 ... DECLARE SYNTAX ERROR
    405	001114	000760 				BR	SW2		;++003 TRY TO LEAVE AGAIN
    406					;
    407					;	VALIDATE FILE NAME SYNTAX
    408					;	NOTE: 0 CHARS AND WILD CARD SWITCHES ALLOWED
    409					;
    410	001116	020204 			FNSCAN:	CMP	R2,R4		;++003 IF FILE NAME STRING IS NULL, ...
    411	001120	001640 				BEQ	DVSX		;++003 ... BRANCH TO SCAN NEXT SECTION
    412	001122	005046 				CLR	-(SP)		;++003 RESERVE LENGTH WORD ON STACK
    413	001124	010200 				MOV	R2,R0		;++003 SET POINTER
    414	001126	004767 	177252 		FN1:	JSR	PC,CHRTYP	;GET CHAR TYPE
    415	001132	005216 				INC	(SP)		;++003 INCREMENT FILE NAME LENGTH
    416	001134	162703 	000003 			SUB	#PERIOD,R3
    417	001140	100772 				BMI	FN1		;GET NEXT IF RAD50 CHAR
    418	001142	001417 				BEQ	FNP		;BRANCH IF PERIOD
    419	001144	005303 				DEC	R3
    420	001146	001407 				BEQ	FNS		;BRANCH IF STAR
    421	001150	022726 	000012 			CMP	#10.,(SP)+	;++003 IF MORE THAN 10 CHARS ...
    422	001154	002737 				BLT	SWER		;++003 ... FILE NAME IS IN ERROR
    423	001156	005300 				DEC	R0		;++003 IF CHAR IS NOT THE DELIMITER ...
    424	001160	020004 				CMP	R0,R4		;++003 ... THEN THE FILE NAME ...
    425	001162	001334 				BNE	SWER		;++003 ... IS IN ERROR
    426	001164	000616 			FDONE:	BR	DVSX		;++003 ELSE, FILE SCAN IS DONE
    427					;++003   STAR WAS DETECTED
    428	001166	005326 			FNS:	DEC	(SP)+		;++003 IF MORE THAN ONE CHAR ...
    429	001170	001331 				BNE	SWER		;++003 ... THEN * IS IN ERROR
    430	001172	122720 	000056 			CMPB	#DOT,(R0)+	;++003 IF NEXT CHAR IS NOT A DOT ...
    431	001176	001326 				BNE	SWER		;++003 ... THEN * IS IN ERROR
    432	001200	000403 				BR	FNP1		;++003 ELSE, LOOK AT FILE TYPE
    433					;++003   DOT WAS DETECTED
    434	001202	022726 	000012 		FNP:	CMP	#10.,(SP)+	;++003 IF MORE THAN 10 CHARS ...
    435	001206	002722 				BLT	SWER		;++003 ... FILE NAME IS IN ERROR
    436	001210	010403 			FNP1:	MOV	R4,R3		;++003 SET POINTER
    437	001212	160003 				SUB	R0,R3		;IF NO FILE TYPE
    438	001214	001763 				BEQ	FDONE		;++006 ... THEN JUST RETURN
    439	001216	022703 	000003 			CMP	#3,R3		;OR IF LONGER THAN 3 CHARS
    440	001222	103714 				BLO	SWER		;++003 ... FILE TYPE IS IN ERROR
    441	001224	005303 				DEC	R3		;IF 1 CHAR
    442	001226	001003 				BNE	FN2
    443	001230	122710 	000052 			CMPB	#STAR,(R0)	;CHECK IF STAR
    444	001234	001753 				BEQ	FDONE		;++004 IF SO, DONE
    445	001236	004767 	177142 		FN2:	JSR	PC,CHRTYP	;GET CHAR TYPE
    446	001242	162703 	000003 			SUB	#PERIOD,R3	;IF RAD50 CHAR BRANCH
    447	001246	100773 				BMI	FN2
    448	001250	020004 				CMP	R0,R4		;ELSE IF DELIM,
    449	001252	101344 				BHI	FDONE		;++003 DONE
    450	001254	000677 				BR	SWER		;++003 ELSE, ERROR
    451					;
    452					;
    453					;
    454		000001 				.END
.CSI1	MACRO M1108  05-DEC-77 23:44  PAGE 2-8
SYMBOL TABLE

ALPHA = 000001   	C.CMLD= 000002   	C.TYPR= 000000   	GD      000350R  	SCAN    000204R
ASTER = 000004   	C.DEVD= 000006   	DELTAB  000330R  	GDX     000370R  	SEMIC = 000073
BLANK = 000040   	C.DIAD= 000014   	DOLLAR= 000044   	GD1     000364R  	SETINP  000136R
CHARA = 000101   	C.DILN= 000012   	DOLSGN= 000002   	GD2     000374R  	SLASH = 000057
CHARZ = 000132   	C.DIRD= 000012   	DONE    000242R  	GETDEL  000346R  	STAR  = 000052
CHAR0 = 000060   	C.DSDS= 000006   	DOT   = 000056   	INPSET  000162R  	STAT0   000265R
CHAR9 = 000071   	C.DVAD= 000010   	DSPTBL  000250R  	JUMP    000234R  	STAT1   000274R
CHRTYP  000404R  	C.DVLN= 000006   	DVDSP = 000002   	LBRAC = 000133   	STAT2   000303R
COLON = 000072   	C.FILD= 000016   	DVS     000602R  	MINUS = 000055   	STAT3   000312R
COMMA = 000054   	C.FNAD= 000020   	DVSCAN  000554R  	NULL  = 000000   	STAT4   000321R
COMPRS  000060R  	C.FNLN= 000016   	DVSX    000622R  	NUMER = 000000   	SWDSP = 000012
CSICLR  000022R  	C.IDIA= 000042   	DVSX1   000624R  	NXTAB   000222R  	SWER    001054R
CS.DIF= 000002   	C.IDIL= 000040   	DVSX2   000630R  	OTHER = 000005   	SWSCAN  001024R
CS.DVF= 000004   	C.IDVA= 000032   	ELIM    000146R  	PERIOD= 000003   	SW1     001036R
CS.EQU= 000040   	C.IDVL= 000030   	EQUAL = 000075   	PLUS  = 000053   	SW2     001056R
CS.INP= 000001   	C.ISTR= 000050   	ERDSP = 000006   	PPDSP = 000004   	TAB   = 000011
CS.MOR= 000020   	C.MKW1= 000024   	ERROR   000526R  	PPOK    000702R  	TYPEX   000522R
CS.NMF= 000001   	C.MKW2= 000026   	ERR1    000542R  	PPSCAN  000634R  	VRCK    001020R
CS.OUT= 000002   	C.ODIA= 000046   	FDONE   001164R  	PPX     000736R  	VRDSP = 000010
CS.WLD= 000010   	C.ODIL= 000044   	FNDSP = 000000   	PP1     000652R  	VRSCAN  000766R
CT1     000436R  	C.ODVA= 000036   	FNP     001202R  	PVER    000744R  	XTMPX = 000014
CT2     000460R  	C.ODVL= 000034   	FNP1    001210R  	PVER1   000756R  	.CSI1   000000RG
CT3     000474R  	C.OSTR= 000052   	FNS     001166R  	PVER2   000760R  	.DCCVT= ****** GX
CT4     000510R  	C.SIZE= 000054   	FNSCAN  001116R  	PVOK    000764R  	.ODCVT= ****** GX
C.BFAD= 000004   	C.STAT= 000001   	FN1     001126R  	RBRAC = 000135   	.SAVR1= ****** GX
C.BFLN= 000002   	C.SWAD= 000022   	FN2     001236R  	RUBOUT= 000177

. ABS.	000000	   000
      	001256	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1008 WORDS  ( 4 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:16
[46,10]CSI1,[46,20]CSI1/-SP=[46,30]CSIDEF,CSI1
.CSI2	MACRO M1108  05-DEC-77 23:44  PAGE 1


      1						.MCALL	CSI$
      2	000000					CSI$
      3					;
      4		000002 			C.BFLN=C.CMLD
      5		000004 			C.BFAD=C.CMLD+2
      6		000016 			C.FNLN=C.FILD
      7		000020 			C.FNAD=C.FILD+2
      8		000006 			C.DVLN=C.DEVD
      9		000010 			C.DVAD=C.DEVD+2
     10		000012 			C.DILN=C.DIRD
     11		000014 			C.DIAD=C.DIRD+2
     12					;
     13		000032 			C.IDVA=	32	;INPUT LAST DEVICE NAME FOUND PTR
     14		000030 			C.IDVL=	30	;INPUT LAST DEVICE NAME FOUND LENGTH
     15		000036 			C.ODVA=	36	;OUTPUT LAST DEVICE NAME FOUND PTR
     16		000034 			C.ODVL=	34	;OUTPUT LAST DEVICE FOUND LENGTH
     17		000042 			C.IDIA=	42	;INPUT LAST DIR INFO PTR FOUND
     18		000040 			C.IDIL=	40	;INPUT LAST DIR INFO FOUND LENGTH
     19		000046 			C.ODIA=	46	;OUTPUT LAST DIR INFO FOUND PTR
     20		000044 			C.ODIL=	44	;OUTPUT LAST DIR INFO FOUND LENGTH
     21		000050 			C.ISTR=	50	;INPUT NEXT STRING SECTION ADDR
     22		000052 			C.OSTR=	52	;OUTPUT NEXT STRING SECTION ADDR
     23					;
     24					;	COMMAND STRING DELIMITERS
     25					;
     26		000072 			COLON=	72	;	:
     27		000054 			COMMA=	54	;	,
     28		000057 			SLASH=	57	;	/
     29		000075 			EQUAL=	75	;	=
     30		000073 			SEMIC=	73	;	;
     31		000135 			RBRAC=	135	;	]
     32		000133 			LBRAC=	133	;	[
     33					;
     34					;	CHARS DELETED FROM COMMAND STRINGS
     35					;
     36		000040 			BLANK=	40
     37		000011 			TAB=	11
     38		000000 			NULL=	0
     39		000177 			RUBOUT=	177
     40					;
     41					;	OTHER RELEVANT CHARS
     42					;
     43		000101 			CHARA=	101	;	A
     44		000132 			CHARZ=	132	;	Z
     45		000060 			CHAR0=	60	;	0
     46		000071 			CHAR9=	71	;	9
     47		000056 			DOT=	56	;	.
     48		000052 			STAR=	52	;	*
     49		000055 			MINUS=	55	;	-
     50		000053 			PLUS=	53	;	+
     51		000044 			DOLLAR=	44	;	$
     52					;
     53					;
     54					;
.CSI2	MACRO M1108  05-DEC-77 23:44  PAGE 2


      1						.TITLE	.CSI2
      2						.IDENT	/04/
      3
      4					; COPYRIGHT 1973, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
      5					; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
      6					;
      7					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
      8					; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
      9					;
     10					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
     11					; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     12					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     13					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     14					;
     15					; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     16					; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     17					; EQUIPMENT CORPORATION.
     18					;
     19					; VERSION X04
     20					;
     21					;
     22					; WRITTEN BY:
     23					;	A. MAROTTO  (CCA)
     24					;
     25					; MODIFIED BY:
     26					;	C.A. D'ELIA	31-JAN-74	001
     27					;	C.A. D'ELIA	15-MAR-74	002
     28					;	C.A. D'ELIA	04-JUN-74	003
     29					;
     30					;
     31					;
     32					;	COMMAND STRING INTERPRETER - SEMANTIC PARSER
     33					;
     34					;
     35					;
     36					;
     37		000001 			ASVAL=1		;SWITCH VALUE TABLE ASCII CVT CODE
     38		000003 			DECVAL=3		;++003 SWITCH TABLE VALUE FOR DECIMAL CONVERT
     39					;
     40					;
     41					;
     42	000000				.CSI2::				;++002
     43	000000	004567 	000000G			JSR	R5,.SAVR1	;++002 SAVE REGISTERS
     44	000004	105060 	000001 			CLRB	C.STAT(R0)		;CLEAR STATUS
     45	000010	005060 	000024 			CLR	C.MKW1(R0)		;CLEAR SWITCHES MASK
     46	000014	005060 	000026 			CLR	C.MKW2(R0)
     47	000020	005001 				CLR	R1			;SET INPUT SWITCHES
     48	000022	016002 	000050 			MOV	C.ISTR(R0),R2		;GET INPUT STRING ADDR
     49	000026	122710 	000001 			CMPB	#CS.INP,(R0)		;BRANCH IF INPUT REQUEST
     50	000032	001410 				BEQ	CSI21
     51	000034	122710 	000002 			CMPB	#CS.OUT,(R0)		;BRANCH IF OUTPUT REQUEST
     52	000040	001402 				BEQ	CSI20
     53	000042	000261 				SEC				;SET ERROR
     54	000044	000207 				RTS	PC			;EXIT
     55	000046	005201 			CSI20:	INC	R1			;SET OUTPUT SWITCH
     56	000050	016002 	000052 			MOV	C.OSTR(R0),R2		;GET OUTPUT STRING ADDR
     57	000054	004767 	000760 		CSI21:	JSR	PC,DELSCN		;SCAN TO A DELIM
.CSI2	MACRO M1108  05-DEC-77 23:44  PAGE 2-1


     58	000060	012703 	000102'			MOV	#DVVECT,R3		;ADDR DEV INFO CTL VECT
     59	000064	004767 	000032 			JSR	PC,DIDVSN		;DO DEV PROCESSING
     60	000070	012703 	000112'			MOV	#DIVECT,R3		;ADDR DIR INFO CTL VECT
     61	000074	004767 	000022 			JSR	PC,DIDVSN		;DO DIR PROCESSING
     62	000100	000463 				BR	CSI26			;DO FILENAME PROCESSING
     63					;
     64	000102	   030 	   072 	   000 	DVVECT:	.BYTE	C.IDVL,COLON,0,0,CS.DVF,C.DVLN,0,COLON
	000105	   000 	   004 	   006
	000110	   000 	   072
     65					;
     66	000112	   040 	   135 	   001 	DIVECT:	.BYTE	C.IDIL,RBRAC,1,0,CS.DIF,C.DILN,1,RBRAC
	000115	   000 	   002 	   012
	000120	   001 	   135
     67					;
     68	000122	010446 			DIDVSN:	MOV	R4,-(SP)		;SAVE STRING SEG END
     69	000124	010246 				MOV	R2,-(SP)		;AND START PTRS
     70	000126	010546 				MOV	R5,-(SP)		;SAVE DELIM
     71	000130	112305 				MOVB	(R3)+,R5		;DISP TO 4WD I/O SAVE PTRS
     72	000132	060005 				ADD	R0,R5			;ADDR OF INPUT SAVE PTRS
     73	000134	005701 				TST	R1			;BRANCH IF INPUT
     74	000136	001401 				BEQ	CSI22
     75	000140	022525 				CMP	(R5)+,(R5)+	;++001 INCR R5 TO PNT TO OUTPUT
     76	000142	122316 			CSI22:	CMPB	(R3)+,(SP)		;BRANCH IF NOT DEV/DIR INFO
     77	000144	001005 				BNE	CSI23
     78	000146	062304 				ADD	(R3)+,R4		;ADJUSTMENT FOR DIR INFO
     79	000150	160204 				SUB	R2,R4			;CALC LEN OF SEG
     80	000152	152360 	000001 			BISB	(R3)+,C.STAT(R0)	;SET FOUND THIS SEG
     81	000156	000405 				BR	CSI24
     82	000160	062703 	000003 		CSI23:	ADD	#3,R3			;STEP OVER CTL VECT BYTES
     83	000164	011504 				MOV	(R5),R4		;GET PREVIOUS LEN
     84	000166	016502 	000002 			MOV	2(R5),R2		;AND ADDR
     85	000172	010425 			CSI24:	MOV	R4,(R5)+	;++001 SAVE LENGTH/ADDR INFO IN ...
     86	000174	010215 				MOV	R2,(R5)		;++001 ... LAST FOUND WORDS
     87	000176	112305 				MOVB	(R3)+,R5		;CALC ADDR OF
     88	000200	060005 				ADD	R0,R5			;RETURN LEN AND ADDR
     89	000202	010425 				MOV	R4,(R5)+		;RETURN LENGTH AND ADDR
     90	000204	010215 				MOV	R2,(R5)
     91	000206	105723 				TSTB	(R3)+			;FALL THRU FOR DIR INFO
     92	000210	001405 				BEQ	CSI25			;ONLY
     93	000212	005704 				TST	R4
     94	000214	001403 				BEQ	CSI25			;BRANCH IF NO DIR INFO
     95	000216	060204 				ADD	R2,R4
     96	000220	004767 	000706 			JSR	PC,WILDCK		;WILD CARD SCAN
     97	000224	012605 			CSI25:	MOV	(SP)+,R5		;RESTORE DELIM
     98	000226	012602 				MOV	(SP)+,R2		;SEG LEN AND ADDR
     99	000230	012604 				MOV	(SP)+,R4
    100	000232	121305 				CMPB	(R3),R5		;BRANCH IF WAS NOT
    101	000234	001004 				BNE	CSI25X			;DEV(OR DIR) INFO
    102	000236	010402 				MOV	R4,R2			;ELSE SET NEW PTRS
    103	000240	005202 				INC	R2
    104	000242	004767 	000572 			JSR	PC,DELSCN		;SCAN TO DELIM
    105	000246	000207 			CSI25X:	RTS	PC
    106					;
    107					;
    108	000250	010260 	000020 		CSI26:	MOV	R2,C.FNAD(R0)		;SET FILE NAME ADDR
    109	000254	010403 				MOV	R4,R3
    110	000256	160203 				SUB	R2,R3			;CALC FILE NAME LEN
.CSI2	MACRO M1108  05-DEC-77 23:44  PAGE 2-2


    111	000260	010360 	000016 			MOV	R3,C.FNLN(R0)		;SET FILE NAME LENGTH
    112	000264	001405 				BEQ	CSI27			;BRANCH IF NONE
    113	000266	152760 	000001 	000001 		BISB	#CS.NMF,C.STAT(R0)	;SET FILE NAME FOUND STATUS
    114	000274	004767 	000632 			JSR	PC,WILDCK
    115	000300	010402 			CSI27:	MOV	R4,R2			;POINT TO LAST FOUND DELIM
    116	000302	005004 				CLR	R4			;CLEAR ERROR SWITCH
    117	000304	122705 	000057 			CMPB	#SLASH,R5
    118	000310	001002 				BNE	CSI28			;BRANCH IF NO SWITCHES
    119	000312	004767 	000040 			JSR	PC,SWITCH		;GO PROCESS SWITCHES
    120	000316	122705 	000075 		CSI28:	CMPB	#EQUAL,R5		;BRANCH IF AT END OF STRING
    121	000322	001404 				BEQ	CSI29
    122	000324	152760 	000020 	000001 		BISB	#CS.MOR,C.STAT(R0)	;ELSE SET MORE STRINGS FOLLOW
    123	000332	005202 				INC	R2			;STEP OVER LAST DELIMITER
    124	000334	005701 			CSI29:	TST	R1
    125	000336	001003 				BNE	CSI30			;BRANCH IF OUTPUT
    126	000340	010260 	000050 			MOV	R2,C.ISTR(R0)		;SAVE INPUT STRING PTR
    127	000344	000402 				BR	CSIXIT
    128	000346	010260 	000052 		CSI30:	MOV	R2,C.OSTR(R0)		;SAVE OUTPUT STRING PTR
    129	000352	006004 			CSIXIT:	ROR	R4			;SET ERROR VALUE(C-BIT ON IF ERROR)
    130	000354	000207 				RTS	PC			;EXIT
    131					;
    132					;
    133					;	PROCESS SWITCHES HERE
    134					;
    135					;	R2 = STRING PTR(POINTS TO /)(RETURNED AT END OF STRING)
    136					;	R4 = RETURNED 0=NO ERROR, 1=ERROR
    137					;	R5 = DELIMTER AT END OF THIS STRING
    138					;
    139	000356	016003 	000022 		SWITCH:	MOV	C.SWAD(R0),R3		;GET SWITCH TABLE ADDR
    140	000362	001523 				BEQ	SWER			;ERROR IF NONE SPECIFIED
    141	000364	005202 				INC	R2			;STEP OVER CURRENT DELIM
    142	000366	004767 	000446 			JSR	PC,DELSCN		;GET NEXT DELIM
    143	000372	010446 				MOV	R4,-(SP)		;SAVE DELIM PTR
    144	000374	010546 				MOV	R5,-(SP)		;AND DELIM CHAR
    145	000376	005046 				CLR	-(SP)			;SETUP SWITCH NEG FLAG
    146	000400	122712 	000055 			CMPB	#MINUS,(R2)	;++001 IS SWITCH NEGATED BY MINUS?
    147	000404	001410 				BEQ	10$		;++001 IF SO, SKIP TO INDICATE NEGATE
    148	000406	122712 	000116 			CMPB	#'N,(R2)	;++001 ELSE, TEST FOR THE ALTERNATE ...
    149	000412	001007 				BNE	SW		;++001 ... FORM OF NEGATE -- ...
    150	000414	122762 	000117 	000001 		CMPB	#'O,1(R2)	;++001 ... /NOSW
    151	000422	001003 				BNE	SW		;++001 SKIP IF NOT TRUE
    152	000424	005202 				INC	R2		;++001 INCREMENT POINTER (R2) PAST NEGATE
    153	000426				10$:				;++001
    154	000426	005202 				INC	R2
    155	000430	005216 				INC	(SP)
    156	000432	160204 			SW:	SUB	R2,R4
    157	000434	001473 				BEQ	SWER1			;IF SWITCH LEN 0, ERROR
    158	000436	005005 				CLR	R5
    159	000440	152205 				BISB	(R2)+,R5		;SET FIRST SWITCH CHAR
    160	000442	005304 				DEC	R4
    161	000444	001403 				BEQ	SW1			;BRANCH IF ONLY 1 CHAR
    162	000446	000305 				SWAB	R5
    163	000450	151205 				BISB	(R2),R5			;SET SECOND SWITCH CHAR
    164	000452	000305 				SWAB	R5
    165	000454	010304 			SW1:	MOV	R3,R4			;ADDR SWITCH TABLE
    166	000456	005714 			SW2:	TST	(R4)			;ERROR IF END OF TABLE
    167	000460	001461 				BEQ	SWER1
.CSI2	MACRO M1108  05-DEC-77 23:44  PAGE 2-3


    168	000462	020524 				CMP	R5,(R4)+	;++001 BR IF SWITCH FND IN TABLE
    169	000464	001403 				BEQ	SW3
    170	000466	062704 	000006 			ADD	#6.,R4		;++001 SET ADDR OF NEXT ENTRY
    171	000472	000771 				BR	SW2
    172	000474	051460 	000024 		SW3:	BIS	(R4),C.MKW1(R0)	;++001 SET 'OR' OF MASK WORDS
    173	000500	005716 				TST	(SP)			;BRANCH IF NEG SWITCH
    174	000502	001003 				BNE	SW3A
    175	000504	051460 	000026 			BIS	(R4),C.MKW2(R0)	;++001 SET SWITCH ON
    176	000510	000406 				BR	SW3B
    177	000512	032764 	000001 	000004 	SW3A:	BIT	#1,4(R4)	;++001 IS NEGATIVE SWITCH ALLOWED?
    178	000520	001441 				BEQ	SWER1			;ERROR IF NOT
    179	000522	041460 	000026 			BIC	(R4),C.MKW2(R0)	;++001 SET SWITCH OFF
    180	000526	016405 	000002 		SW3B:	MOV	2(R4),R5	;++001 ADDR OF LOCN TO BE MASKED
    181	000532	000241 				CLC
    182	000534	006005 				ROR	R5
    183	000536	001413 				BEQ	SW5			;BRANCH IF NO MASK ADDR
    184	000540	103405 				BCS	SW4			;BRANCH IF TO CLEAR LOCN WITH MASK
    185	000542	006105 				ROL	R5
    186	000544	005716 				TST	(SP)			;BRANCH IF NEG SW TO CLEAR
    187	000546	001006 				BNE	SW4A
    188	000550	051415 			SW3C:	BIS	(R4),(R5)	;++001 CLEAR MASK IN LOCN
    189	000552	000405 				BR	SW5
    190	000554	000241 			SW4:	CLC
    191	000556	006105 				ROL	R5
    192	000560	005716 				TST	(SP)			;BRANCH IF NEG SW TO SET
    193	000562	001372 				BNE	SW3C
    194	000564	041415 			SW4A:	BIC	(R4),(R5)	;++001 CLEAR MASK IN LOCN
    195	000566	005726 			SW5:	TST	(SP)+
    196	000570	012605 				MOV	(SP)+,R5		;LAST DELIMITER SCANNED
    197	000572	012602 				MOV	(SP)+,R2		;ADDR OF IT
    198	000574	016404 	000004 			MOV	4(R4),R4	;++001 ADDR OF VALUE TABLE (IF ANY)
    199	000600	042704 	000001 			BIC	#1,R4			;DEL NEG SW ALLOWED BIT
    200	000604	120527 	000057 		SW6:	CMPB	R5,#SLASH		;DOES ANOTHER SWITCH FOLLOW
    201	000610	001662 				BEQ	SWITCH			;BRANCH IF SO
    202	000612	120527 	000072 			CMPB	R5,#COLON		;DOES A SWITCH VALUE FOLLOW
    203	000616	001422 				BEQ	SWVAL			;GO PROCESS
    204	000620	005004 				CLR	R4			;SET NO ERROR
    205	000622	000207 				RTS	PC			;EXIT
    206					;
    207	000624	005726 			SWER1:	TST	(SP)+
    208	000626	012605 				MOV	(SP)+,R5		;GET LAST DELIM FOUND
    209	000630	012602 				MOV	(SP)+,R2		;GET ITS ADDR
    210	000632	120527 	000075 		SWER:	CMPB	R5,#EQUAL		;IS IT END OF CURRENT SECTION
    211	000636	001407 				BEQ	SWERX
    212	000640	120527 	000054 			CMPB	R5,#COMMA
    213	000644	001404 				BEQ	SWERX			;BRANCH IF SO
    214	000646	005202 				INC	R2			;ELSE STEP OVER IT
    215	000650	004767 	000164 			JSR	PC,DELSCN		;GET NEXT DELIM
    216	000654	000766 				BR	SWER			;LOOP UNTIL END OF CURRENT SECTION
    217	000656	012704 	000001 		SWERX:	MOV	#1,R4			;SET ERROR
    218	000662	000207 				RTS	PC			;EXIT
    219					;
    220					;
    221	000664	010403 			SWVAL:	MOV	R4,R3
    222	000666	001761 				BEQ	SWER			;ERROR IF NO VALUE TABLE
    223	000670	005713 				TST	(R3)
    224	000672	001757 				BEQ	SWER			;ERROR IF NO MORE ENTRIES
.CSI2	MACRO M1108  05-DEC-77 23:44  PAGE 2-4


    225	000674	005202 				INC	R2			;STEP OVER LAST DELIM
    226	000676	004767 	000136 			JSR	PC,DELSCN		;SCAN TO NEXT
    227	000702	010446 				MOV	R4,-(SP)		;SAVE PTR TO DELIM
    228	000704	010546 				MOV	R5,-(SP)		;AND DELIM CHAR
    229	000706	016305 	000002 			MOV	2(R3),R5	;++001 GET RESULT ADDR
    230	000712	122327 	000001 			CMPB	(R3)+,#ASVAL	;++001 SHOULD SW-VALUE BE ASCII?
    231	000716	001025 				BNE	SVNUM			;BRANCH IF NUMBERIC CVT REQUIRED
    232	000720	160204 				SUB	R2,R4			;GET VALUE LEN
    233	000722	121304 				CMPB	(R3),R4		;++001 CMPR WITH ALLOWED LENGTH
    234	000724	103001 				BHIS	SWVL1			;BRANCH IF SAME OR SMALLER THAN ALLOWED
    235	000726	111304 				MOVB	(R3),R4		;++001 SET LENGTH ALLOWED
    236	000730	010446 			SWVL1:	MOV	R4,-(SP)		;SAVE LEN
    237	000732	001403 				BEQ	SWVL3			;BRANCH IF NONE TO MOVE
    238	000734	112225 			SWVL2:	MOVB	(R2)+,(R5)+		;MOVE CHARS
    239	000736	005304 				DEC	R4			;UNTIL COUNT EXHAUSTED
    240	000740	001375 				BNE	SWVL2
    241	000742	111304 			SWVL3:	MOVB	(R3),R4		;++001 GET ALLOWED LENGTH
    242	000744	162604 				SUB	(SP)+,R4		;CALC SPACE LEFT TO PAD
    243	000746	001403 				BEQ	SWVL5			;BRANCH IF NONE
    244	000750	105025 			SWVL4:	CLRB	(R5)+			;PAD WITH NULLS
    245	000752	005304 				DEC 	R4
    246	000754	001375 				BNE	SWVL4
    247	000756	062703 	000003 		SWVL5:	ADD	#3,R3		;++001 ADDR OF NEXT VAL TABLE ENTRY
    248	000762	012605 				MOV	(SP)+,R5		;GET LAST DELIM CHAR
    249	000764	012602 				MOV	(SP)+,R2		;GET ADDR OF DELIM CHAR
    250	000766	010304 				MOV	R3,R4
    251	000770	000705 				BR	SW6			;GO DECIDE WHAT TO DO
    252					;
    253	000772	010346 			SVNUM:	MOV	R3,-(SP)
    254	000774	012746 	000000G			MOV	#.ODCVT,-(SP)	;++003 ASSUME NUMERIC CONVERT (OCTAL DFLT)
    255	001000	122743 	000003 			CMPB	#DECVAL,-(R3)	;++003 IS DECIMAL DEFAULT DESIRED?
    256	001004	001002 				BNE	10$		;++003 BRANCH IF NOT
    257	001006	012716 	000000G			MOV	#.DCCVT,(SP)	;++003 ELSE, SPECIFY DECIMAL DEFAULT
    258	001012				10$:				;++003
    259	001012	010503 				MOV	R5,R3		;++001 SET RESULT ADDR
    260	001014	005013 				CLR	(R3)
    261	001016	160204 				SUB	R2,R4			;LENGTH OF DIGIT STRING
    262	001020	001404 				BEQ	SVNMX			;SKIP NULL STRING
    263	001022	010205 				MOV	R2,R5			;SET STRING ADDR
    264	001024	004736 				JSR	PC,@(SP)+	;++003 CALL NUMERIC CONVERT
    265	001026	103676 				BCS	SWER1			;BRANCH IF ERROR
    266	001030	000401 				BR	SVNMX2		;++003 BRANCH TO LEAVE
    267	001032	005726 			SVNMX:	TST	(SP)+		;++003 PURGE CONVERT ADDR FROM STACK
    268	001034	012603 			SVNMX2:	MOV	(SP)+,R3	;++003 RESTORE R3
    269	001036	000747 				BR	SWVL5
    270					;
    271					;
    272					;	SCAN COMMAND STRING FOR : / = , ] OR END OF STRING
    273					;	RETURN ADDR IN R4, DELIMETER IN R5(END OF STRING BECOMES=)
    274					;
    275					;	NOTE: CHARS INSIDE [] IGNORED.
    276					;
    277	001040	016046 	000004 		DELSCN:	MOV	C.BFAD(R0),-(SP)	;ADDRESS END OF STRING
    278	001044	066016 	000002 			ADD	C.BFLN(R0),(SP)
    279	001050	010204 				MOV	R2,R4			;ADDR FOR SCAN START
    280	001052	012705 	001122'		DEL:	MOV	#DELTAB,R5		;ADDR DELIMITER TABLE
    281	001056	020416 				CMP	R4,(SP)		;++001 CMPR WITH END OF STRING
.CSI2	MACRO M1108  05-DEC-77 23:44  PAGE 2-5


    282	001060	001414 				BEQ	DEL3			;BRANCH IF AT END OF STRING
    283	001062	121425 				CMPB	(R4),(R5)+	;++001 IGNORE CHARS INSIDE []
    284	001064	001004 				BNE	DEL2
    285	001066	005204 			DEL1:	INC	R4		;++001 INCR TO NEXT CHAR
    286	001070	121415 				CMPB	(R4),(R5)	;++001 IS IT R-BRACKET?
    287	001072	001375 				BNE	DEL1		;++001 NO, TRY NEXT CHAR
    288	001074	000407 				BR	DELX
    289	001076	121415 			DEL2:	CMPB	(R4),(R5)	;++001 CMPR CHAR WITH DELIMITER
    290	001100	001405 				BEQ	DELX		;++001 BRANCH IF DELIMITER FOUND
    291	001102	105725 				TSTB	(R5)+		;++001 LAST DELIMITER IS NULL
    292	001104	001374 				BNE	DEL2			;BRANCH IF NOT AT END OF TABLE
    293	001106	005204 				INC	R4			;ADVANCE STRING PTR
    294	001110	000760 				BR	DEL			;GO CHECK NEXT CHAR
    295	001112	122525 			DEL3:	CMPB	(R5)+,(R5)+	;++001 POINT R5 TO EQUAL SIGN
    296	001114	111505 			DELX:	MOVB	(R5),R5		;++001 SET THE DELIMITER FOUND
    297	001116	005726 				TST	(SP)+		;++001 CLEAN STACK
    298	001120	000207 				RTS	PC			;EXIT
    299	001122	   133 	   135 	   075 	DELTAB:	.BYTE	LBRAC,RBRAC,EQUAL,COLON,SLASH,COMMA,NULL ;++001
	001125	   072 	   057 	   054
	001130	   000
    300						.EVEN
    301					;
    302					;	CHECK IF WILD CARD VALUE IN FILE NAME JUST FOUND
    303					;
    304	001132	122722 	000052 		WILDCK:	CMPB	#STAR,(R2)+
    305	001136	001403 				BEQ	WILDEX			;BRANCH IF WILD CARD FOUND
    306	001140	020204 				CMP	R2,R4
    307	001142	001373 				BNE	WILDCK			;BRANCH IF NOT AT END OF NAME
    308	001144	000207 				RTS	PC			;EXIT
    309	001146	152760 	000010 	000001 	WILDEX:	BISB	#CS.WLD,C.STAT(R0)	;SET WILD CARD STATUS
    310	001154	000207 				RTS	PC			;EXIT
    311					;
    312		000001 				.END
.CSI2	MACRO M1108  05-DEC-77 23:44  PAGE 2-6
SYMBOL TABLE

ASVAL = 000001   	CS.EQU= 000040   	C.ISTR= 000050   	DOLLAR= 000044   	SWVL1   000730R
BLANK = 000040   	CS.INP= 000001   	C.MKW1= 000024   	DOT   = 000056   	SWVL2   000734R
CHARA = 000101   	CS.MOR= 000020   	C.MKW2= 000026   	DVVECT  000102R  	SWVL3   000742R
CHARZ = 000132   	CS.NMF= 000001   	C.ODIA= 000046   	EQUAL = 000075   	SWVL4   000750R
CHAR0 = 000060   	CS.OUT= 000002   	C.ODIL= 000044   	LBRAC = 000133   	SWVL5   000756R
CHAR9 = 000071   	CS.WLD= 000010   	C.ODVA= 000036   	MINUS = 000055   	SW1     000454R
COLON = 000072   	C.BFAD= 000004   	C.ODVL= 000034   	NULL  = 000000   	SW2     000456R
COMMA = 000054   	C.BFLN= 000002   	C.OSTR= 000052   	PLUS  = 000053   	SW3     000474R
CSIXIT  000352R  	C.CMLD= 000002   	C.SIZE= 000054   	RBRAC = 000135   	SW3A    000512R
CSI20   000046R  	C.DEVD= 000006   	C.STAT= 000001   	RUBOUT= 000177   	SW3B    000526R
CSI21   000054R  	C.DIAD= 000014   	C.SWAD= 000022   	SEMIC = 000073   	SW3C    000550R
CSI22   000142R  	C.DILN= 000012   	C.TYPR= 000000   	SLASH = 000057   	SW4     000554R
CSI23   000160R  	C.DIRD= 000012   	DECVAL= 000003   	STAR  = 000052   	SW4A    000564R
CSI24   000172R  	C.DSDS= 000006   	DEL     001052R  	SVNMX   001032R  	SW5     000566R
CSI25   000224R  	C.DVAD= 000010   	DELSCN  001040R  	SVNMX2  001034R  	SW6     000604R
CSI25X  000246R  	C.DVLN= 000006   	DELTAB  001122R  	SVNUM   000772R  	TAB   = 000011
CSI26   000250R  	C.FILD= 000016   	DELX    001114R  	SW      000432R  	WILDCK  001132R
CSI27   000300R  	C.FNAD= 000020   	DEL1    001066R  	SWER    000632R  	WILDEX  001146R
CSI28   000316R  	C.FNLN= 000016   	DEL2    001076R  	SWERX   000656R  	.CSI2   000000RG
CSI29   000334R  	C.IDIA= 000042   	DEL3    001112R  	SWER1   000624R  	.DCCVT= ****** GX
CSI30   000346R  	C.IDIL= 000040   	DIDVSN  000122R  	SWITCH  000356R  	.ODCVT= ****** GX
CS.DIF= 000002   	C.IDVA= 000032   	DIVECT  000112R  	SWVAL   000664R  	.SAVR1= ****** GX
CS.DVF= 000004   	C.IDVL= 000030

. ABS.	000000	   000
      	001156	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  923 WORDS  ( 4 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:13
[46,10]CSI2,[46,20]CSI2/-SP=[46,30]CSIDEF,CSI2
.ODCVT	MACRO M1108  05-DEC-77 23:44  PAGE 1


      1						.TITLE	.ODCVT
      2						.IDENT	/X03.01/
      3
      4					;
      5					; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
      6					; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
      7					; COPYRIGHT 1973, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
      8					;
      9					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
     10					; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
     11					;
     12					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
     13					; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     14					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     15					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     16					;
     17					; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     18					; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     19					; EQUIPMENT CORPORATION.
     20					;
     21					;
     22					; VERSION X03-01
     23					;
     24					; WRITTEN BY:
     25					;	A. MAROTTO (CCA)
     26					;
     27					; MODIFIED BY:
     28					;	C.A. D'ELIA	11-FEB-74	001
     29					;	C.A. D'ELIA	02-JUL-75	002
     30					;
     31					;
     32					;	ASCII TO OCTAL/DECIMAL CONVERSION ROUTINE
     33					;
     34	000000					.PSECT	$$RESL
     35
     36					;+
     37					;
     38					; *-* .ODCVT -- CONVERT WITH OCTAL DEFAULT
     39					; *-* .DCCVT -- CONVERT WITH DECIMAL DEFAULT
     40					;
     41					;
     42					;	STRING FORMAT-
     43					;
     44					;	OPTIONAL LEADING + OR -
     45					;	OPTIONAL # (FORCE OCTAL CONVERSION)
     46					;	ASCII DIGITS EITHER OCTAL OR DECIMAL
     47					;	OPTIONAL TRAILING . (FOR DECIMAL CONVERSION)
     48					;
     49					;	CALLING SEQUENCE -
     50					;	R3=ADDR OF RESULT WORD
     51					;	R4=LENGTH OF ASCII STRING
     52					;	R5=ADDR OF ASCII STRING
     53					;
     54					;	ERRORS - C-BIT SET IF ILLEGAL CHARS,NO DIGITS
     55					;		OR RESULT OVERFLOW
     56					;
     57					;-
.ODCVT	MACRO M1108  05-DEC-77 23:44  PAGE 1-1


     58
     59	000000	005013 			.ODCVT::CLR	(R3)		;++001 OCTAL DEFAULT (USE RESULT LOCN)
     60	000002	000402 				BR	CVT0		;++001 SKIP TO COMMON CODE
     61	000004	012713 	000001 		.DCCVT::MOV	#1,(R3)		;++001 DECIMAL DEFAULT
     62	000010	004567 	000000G		CVT0:	JSR	R5,.SAVR1	;++001 SAVE REGISTERS
     63	000014	010046 				MOV	R0,-(SP)	;SAVE R0
     64	000016	010502 				MOV	R5,R2		;SET STRING PTR
     65	000020	060405 				ADD	R4,R5		;ADDR END OF STRING
     66	000022	005001 			CVT2:	CLR	R1		;SET POS NUM SWITCH
     67	000024	121227 	000053 			CMPB	(R2),#'+	;BRANCH IF LEADING +
     68	000030	001404 				BEQ	CVT3
     69	000032	121227 	000055 			CMPB	(R2),#'-	;BRANCH IF NOT LEADING -
     70	000036	001003 				BNE	CVT4
     71	000040	005201 				INC	R1		;SET NEG RESULT SWITCH
     72	000042	005202 			CVT3:	INC	R2		;STEP OVER SIGN
     73	000044	005304 				DEC	R4		;AND DECREASE SCAN COUNT
     74	000046	122712 	000043 		CVT4:	CMPB	#'#,(R2)	;++001 LEADING HASH MARK?
     75	000052	001003 				BNE	10$		;++001 NO, MAKE DECIMAL TEST
     76	000054	005202 				INC	R2		;++001 YES, BYPASS THAT CHARACTER
     77	000056	005313 				DEC	(R3)		;++001 FORCE OCTAL CONVERSION
     78	000060	000404 				BR	15$		;++001 DECR STR LENGTH VIA COMMON CODE
     79	000062	122745 	000056 		10$:	CMPB	#'.,-(R5)	;++001 TRAILING PERIOD?
     80	000066	001002 				BNE	20$		;++001 NO, USE ENTRY POINT DEFAULTS
     81	000070	005213 				INC	(R3)		;++001 YES, FORCE DECIMAL CONVERSION
     82	000072	005304 			15$:	DEC	R4		;++001 DECREMENT STRING LENGTH
     83	000074	012705 	000007 		20$:	MOV	#7,R5		;++001 ASSUME OCTAL CONVERSION
     84	000100	011346 				MOV	(R3),-(SP)	;++001 PUT CONVERSION FLAG ON STACK
     85	000102	003401 				BLE	30$		;++001 SKIP IF OCTAL DESIRED
     86	000104	122525 				CMPB	(R5)+,(R5)+	;++001 UPGRADE CONVERSION TO DECIMAL
     87	000106	005013 			30$:	CLR	(R3)		;++001 CLEAR RESULT LOCATION
     88	000110	005704 				TST	R4		;++001 ERROR IF NULL STRING
     89	000112	003436 				BLE	CVTERR		;++001
     90	000114	112200 			CVT5:	MOVB	(R2)+,R0	;GET DIGIT
     91	000116	162700 	000060 			SUB	#60,R0
     92	000122	100432 				BMI	CVTERR		;ERROR IF LOWER THAN 0
     93	000124	020005 				CMP	R0,R5		;OR HIGHER THAN 7(OR 9)
     94	000126	101030 				BHI	CVTERR
     95	000130	006313 				ASL	(R3)		;MULTIPLY PREVIOUS RESULT
     96	000132	103426 				BCS	CVTERR		;++002 BY 8(OR 10)
     97	000134	005716 				TST	(SP)		;AND ADD IN NEW DIGIT
     98	000136	003402 				BLE	CVT6		;++001 SKIP IF OCTAL CONVERSION
     99	000140	061300 				ADD	(R3),R0
    100	000142	103422 				BCS	CVTERR		;++002
    101	000144	006313 			CVT6:	ASL	(R3)
    102	000146	103420 				BCS	CVTERR		;++002
    103	000150	006313 				ASL	(R3)
    104	000152	103416 				BCS	CVTERR		;++002
    105	000154	060013 				ADD	R0,(R3)
    106	000156	103414 				BCS	CVTERR		;++002
    107	000160	100002 				BPL	10$		;++002 BRANCH IF NO SIGN CHANGE
    108	000162	005716 				TST	(SP)		;++002 ELSE, CHECK CONVERSION MODE
    109	000164	003011 				BGT	CVTERR		;++002 ERROR IF DECIMAL OVERFLOW
    110	000166	005304 			10$:	DEC	R4		;++002 BRANCH IF MORE DIGITS
    111	000170	001351 				BNE	CVT5
    112	000172	005701 				TST	R1		;BRANCH IF POS NUM
    113	000174	001401 				BEQ	CVTXIT
    114	000176	005413 				NEG	(R3)		;NEGATE NUM
.ODCVT	MACRO M1108  05-DEC-77 23:44  PAGE 1-2


    115	000200	000241 			CVTXIT:	CLC			;SET NO ERROR
    116	000202	012600 			CXT:	MOV	(SP)+,R0	;++001 POP CONVERSION FLAG (C-BIT SAFE)
    117	000204	012600 				MOV	(SP)+,R0	;++001 RESTORE R0
    118	000206	000207 				RTS	PC		;EXIT
    119					;
    120	000210				CVTERR:				;++001
    121	000210	000261 				SEC			;SET ERROR
    122	000212	000773 				BR	CXT
    123					;
    124		000001 				.END
.ODCVT	MACRO M1108  05-DEC-77 23:44  PAGE 1-3
SYMBOL TABLE

CVTERR  000210R     002	CVT2    000022R     002	CVT5    000114R     002	CXT     000202R     002	.ODCVT  000000RG    002
CVTXIT  000200R     002	CVT3    000042R     002	CVT6    000144R     002	.DCCVT  000004RG    002	.SAVR1= ****** GX
CVT0    000010R     002	CVT4    000046R     002

. ABS.	000000	   000
      	000000	   001
$$RESL	000214	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  125 WORDS  ( 1 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:04
[46,10]ODCVT,[46,20]ODCVT/-SP=[46,30]ODCVT
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 1


      1		000001 			R$$11M=1
      2						.IF NDF	R$$11M
      3
      4
      5						.TITLE	.GCML  RSX-11D GET COMMAND LINE
      6						.IDENT	/13/
      7
      8						.IFF
      9
     10						.TITLE	.GCML  RSX-11M GET COMMAND LINE
     11						.IDENT	/M13/
     12
     13
     14						.ENDC
     15
     16
     17
     18					;
     19					; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
     20					; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
     21					; COPYRIGHT 1973, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
     22					;
     23					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
     24					; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
     25					;
     26					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE
     27					; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION
     28					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT
     29					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.
     30					;
     31					; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT
     32					; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
     33					; EQUIPMENT CORPORATION.
     34					;
     35					; VERSION 13
     36					;
     37					; WRITTEN BY:
     38					;	R. GROVE
     39					;	P. KNEUVEN
     40					;
     41					; MODIFIED BY:
     42					;	C.A. D'ELIA	26-NOV-73	001
     43					;	C.A. D'ELIA	12-JAN-74	002
     44					;	C.A. D'ELIA	12-MAR-74	003
     45					;	C.A. D'ELIA	19-MAR-74	004
     46					;	C.A. D'ELIA	31-MAR-74	005
     47					;	C.A. D'ELIA	05-APR-74	006
     48					;	C.A. D'ELIA	04-JUN-74	007
     49					;	C.A. D'ELIA	01-JUL-74	008
     50					;	C.A. D'ELIA	01-AUG-74	009
     51					;	C.A. D'ELIA	20-JAN-75	010
     52					;	C.A. D'ELIA	21-MAR-75	011
     53					;	C.A. D'ELIA	30-JUL-75	012
     54					;
     55					;
     56					; LOCAL OFFSET AND SYMBOL DEFINITIONS
     57
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 1-1


     58						.MCALL	CSI$		;++009
     59	000000					CSI$	DEF$L
     60						.MCALL	GCMLD$		;++009
     61	000000					GCMLD$	DEF$L
     62						.MCALL	NBOFF$		;++009
     63	000000					NBOFF$	DEF$L		;++009 DEFINE NAME BLOCK OFFSETS
     64
     65
     66						.MCALL	CALL,RETURN,DIR$,CSI$1,CSI$2,CLOSE$  ;++003
     67
     68
     69						.IF NDF	R$$11M		;++003
     70
     71						.MCALL	OPEN$R,GET$	;++003
     72
     73						.IFF			;++003
     74
U    75						.MCALL	OFNB$R,GET$S,FINIT$,ENCP$S,DSCP$S  ;++010
     76
     77						.ENDC			;++003
     78
     79
     80					; INTERNAL GCML$ BLOCK OFFSET DEFINITIONS
     81		000152 			G.CDEP	=G.ERR+10.	;CURRENT PUSH DOWN DEPTH
     82		000153 			G.MDEP	=G.CDEP+1	;MAXIMUM PUSH DOWN DEPTH
     83		000154 			G.PPTR	=G.MDEP+1	;PUSH DOWN STORAGE POINTER
     84		000156 			G.RBUF	=G.PPTR+2	;RECORD BUFFER POINTER
     85		000160 			G.DPRM	=G.RBUF+2	;DEFAULT PROMPT STRING TEXT
     86		000166 			G.DFNB	=G.DPRM+6	;DEFAULT FILE NAME BLOCK
     87		000020 			G.PDSL = <3*2>+<5*2>		;++001 PUSH DOWN FRAME SIZE (8 WORDS)
     88
     89					; G.MODE BIT DEFINITIONS
     90		000200 			GE.MCR	=200		;G.MODE BIT, SET IF TOP LEVEL IS MCR LINE
     91
     92					; ASCII CHARACTER DEFINITIONS
     93		000015 			CR	=15
     94		000011 			TAB	=11
     95		000040 			BLANK	=40
     96		000033 			ALTMOD	=33
     97
     98						.MACRO	.SAVR1
     99						JSR	R5,.SAVR1
    100						.ENDM	.SAVR1
    101
    102
    103						.IF DF	R$$11M
    104
    105						.MACRO	SOB	REG,ADDR
    106						DEC	REG
    107						BNE	ADDR
    108						.ENDM	SOB
    109
    110						.ENDC
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 2


    112					; GCML$ - ENTRY TO GET NEXT COMMAND LINE
    113
    114	000000				.GCML1::.SAVR1
    115	000004	010005 				MOV	R0,R5		;BLOCK POINTER ALWAYS IN R5
    116	000006	105765 	000152 		LVLTST:	TSTB	G.CDEP(R5)	;++012 TEST CURRENT DEPTH
    117	000012	001413 				BEQ	LVL0		;++001 SPECIAL TEST IF AT LEVEL ZERO
    118	000014	003016 				BGT	PROMPT		;++001 IF .GT. ZERO, THEN PROMPT FOR CMD
    119	000016					CALL	GETMCR		;TRY TO GET AN MCR LINE
    120	000022	103123 				BCC	CMLSCN		;GOT ONE - DON'T DO TOP-LEVEL OPEN
    121
    122
    123						.IF NDF	R$$11M		;++002
    124
    125
    126						OPEN$R	R5		;TOP-LEVEL OPEN
    127
    128						.IFF			;++002
    129
    130	000024	016502 	000000G			MOV	F.DSPT(R5),R2	;++002 GET DESCRIPTOR IN R2
    131	000030					CALL	GOPEN		;++002 OPEN THE FILE
    132
    133						.IFTF			;++010
    134
    135	000034	103002 				BCC	LVL0		;++008 SKIP ON SUCCESS
    136	000036	000167 	000440 			JMP	IOERR		;++008 ELSE, INITIAL OPEN FAILED
    137	000042	132765 	000200 	000141 	LVL0:	BITB	#GE.MCR,G.MODE(R5) ;++001 DID WE HAVE MCR INPUT?
    138	000050	001165 				BNE	TOPEOF		;++001 IF SO, LEVEL 0 IS THE END
    139
    140	000052	005765 	000000G		PROMPT:	TST	F.BDB(R5)	;++001 IS FILE ALREADY OPEN?
    141	000056	001002 				BNE	1$		;++001 YES, SKIP THE OPEN
    142	000060					CALL	POPOP1		;++001 NO, POP IT UP AND OPEN IT
    143	000064	122775 	000000G	000000G	1$:	CMPB	#IE.EOF,@F.BDB(R5)  ;++011 DELAYED FCS EOF PENDING?
    144	000072	001540 				BEQ	IOEOF		;++011 IF EQ YES
    145	000074	132765 	000000G	000000G		BITB	#FD.TTY,F.RCTL(R5) ;++011 NO, IS FILE A TTY?
    146	000102	001434 				BEQ	4$		;NO - DON'T PROMPT
    147	000104	012701 	000000G			MOV	#IO.ATT,R1	;++001 SPECIFY ATTACH
    148	000110	005002 				CLR	R2		;++001 NO EXTRA QIO PARMS NEEDED
    149	000112					CALL	.XQIO		;++001 USE FCS TO ATTACH THE TTY
    150	000116	016501 	000144 			MOV	G.PSDS+2(R5),R1	;USER PROMPT STRING ADDRESS
    151	000122	016502 	000142 			MOV	G.PSDS(R5),R2	;USER PROMPT STRING LENGTH
    152	000126	001005 				BNE	2$		;USE USER'S STRING
    153	000130	010501 				MOV	R5,R1		;USE DEFAULT PROMPT FROM BLOCK
    154	000132	062701 	000160 			ADD	#G.DPRM,R1	;
    155	000136	012702 	000006 			MOV	#6,R2		;EXACTLY 6 BYTE'S WORTH
    156	000142				2$:				;++001
    157	000142	016503 	000156 			MOV	G.RBUF(R5),R3	;++002 PUT ADDR OF BUFFER IN R3
    158	000146	010123 				MOV	R1,(R3)+	;++002 SPECIFY PROMPT STRING ADDR
    159	000150	010223 				MOV	R2,(R3)+	;++002 SPECIFY BYTE COUNT
    160	000152	005013 				CLR	(R3)		;++002 CLEAR CARRIAGE CONTROL
    161	000154	024343 				CMP	-(R3),-(R3)	;++002 POINT R3 TO PARM LIST
    162	000156	012702 	000003 			MOV	#3,R2		;++002 SET PARAMETER COUNT
    163	000162	012701 	000000G			MOV	#IO.WVB,R1	;++002 SPECIFY WRITE VIRTUAL BLOCK
    164	000166					CALL	.XQIO		;++002 SEND PROMPT STRING
    165	000172	103411 				BCS	6$		;DETACH AND I/O ERROR HANDLING
    166	000174				4$:				;++002
    167
    168						.IFT			;++010
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 2-1


    169
    170						GET$	R5,G.RBUF(R5),#80.  ;++002 READ A COMMAND LINE
    171
    172						.IFF			;++002
    173
    174	000174					GET$S	R5,G.RBUF(R5),#80.  ;++002 READ A COMMAND LINE
    175
    176						.ENDC			;++011 (R$$11M)
    177
    178
    179	000216	006046 			6$:	ROR	-(SP)		;++011 SAVE THE C-BIT
    180	000220	116503 	000000G			MOVB	F.ERR(R5),R3	;++001 SAVE FCS RETURN STATUS
    181	000224	017004 	000000G			MOV	@F.BDB(R0),R4	;++011 AND THE FCS I/O STATUS WORD
    182	000230	132765 	000000G	000000G		BITB	#FD.TTY,F.RCTL(R5)	;DETACH ONLY IF TTY
    183	000236	001405 				BEQ	8$		;
    184	000240	012701 	000000G			MOV	#IO.DET,R1	;++001 SPECIFY DETACH
    185	000244	005002 				CLR	R2		;++001 NO EXTRA QIO PARMS NEEDED
    186	000246					CALL	.XQIO		;++001 USE FCS TO DETACH THE TTY
    187	000252	010470 	000000G		8$:	MOV	R4,@F.BDB(R0)	;++011 RESTORE FCS I/O STATUS WORD
    188	000256	006126 				ROL	(SP)+		;++011 AND THE C-BIT (FROM GET$)
    189	000260	103442 				BCS	IOERR0		;
    190	000262	016501 	000002G			MOV	F.NRBD+2(R5),R1	;GET COMMAND LINE ADDRESS
    191	000266	016502 	000000G			MOV	F.NRBD(R5),R2	;GET COMMAND LINE LENGTH
    192
    193					; PROCESS COMMAND LINE OBTAINED
    194					;    R1 IS COMMAND LINE ADDRESS
    195					;    R2 IS COMMAND LINE LENGTH
    196	000272	010165 	000150 		CMLSCN:	MOV	R1,G.CMLD+2(R5)	;SET COMMAND LINE ADDRESS
    197	000276	010265 	000146 			MOV	R2,G.CMLD(R5)	;AND LENGTH
    198	000302	001463 				BEQ	OKOUT		;RETURN NULL LINE TO USER
    199	000304	132765 	000010 	000141 		BITB	#GE.LC,G.MODE(R5)  ;++010 DOES CALLER WANT LOWER CASE?
    200	000312	001015 				BNE	30$		;++010 IF NE YES
    201	000314	010246 				MOV	R2,-(SP)	;++010 SAVE CHARACTER COUNT
    202	000316	060201 				ADD	R2,R1		;++010 POINT TO END OF COMMAND LINE
    203	000320	124127 	000141 		10$:	CMPB	-(R1),#141	;++010 LESS THAN LOWER CASE "A"?
    204	000324	002405 				BLT	20$		;++010 SKIP IF TRUE
    205	000326	121127 	000172 			CMPB	(R1),#172	;++010 GREATER THAN LOWER CASE "Z"?
    206	000332	003002 				BGT	20$		;++010 SKIP IF TRUE
    207	000334	142711 	000040 			BICB	#40,(R1)	;++010 CONVERT TO UPPER CASE
    208	000340				20$:	SOB	R2,10$		;++010 REPEAT FOR ENTIRE COMMAND LINE
    209	000344	012602 				MOV	(SP)+,R2	;++010 RESTORE CHARACTER COUNT
    210	000346	122711 	000073 		30$:	CMPB	#';,(R1)	;++010 CHECK FOR ; IN COLUMN 1
    211	000352	001113 				BNE	INDIR		;NO - CHECK FOR INDIRECT FILE
    212	000354	132765 	000001 	000141 		BITB	#GE.COM,G.MODE(R5); COMMENTS PERMITTED ?
    213	000362	001211 				BNE	LVLTST		;++012 YES - GET ANOTHER LINE
    214	000364	000432 				BR	OKOUT		;NO  - RETURN IT TO USER
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 3


    216					; I/O ERROR AND END-OF-FILE PROCESSING
    217	000366	122703 	000000G		IOERR0:	CMPB	#IE.EOF,R3	;++001 END OF FILE ERROR?
    218	000372	001043 				BNE	IOERR		;NO - I/O ERROR
    219	000374	116500 	000152 		IOEOF:	MOVB	G.CDEP(R5),R0	;++011 ARE WE AT TOP LEVEL ALREADY ?
    220	000400	001411 				BEQ	TOPEOF		;YES - RETURN EOF TO CALLER
    221	000402	005300 				DEC	R0		;IF NOT AT LEVEL 1
    222	000404	001004 				BNE	2$		;POP UP AND CARRY ON
    223	000406	132765 	000200 	000141 		BITB	#GE.MCR,G.MODE(R5);IF RETURNING TO LEVEL 0
    224	000414	001003 				BNE	TOPEOF		;++001 AND TOP WAS MCR, RETURN EOF TO CALLER
    225	000416				2$:	CALL	POPOPN		;POP UP A LEVEL
    226	000422	000613 				BR	PROMPT		;TRY FOR ANOTHER COMMAND
    227
    228					; EXITS FROM .GCML1 AND .GCML2
    229
    230	000424				TOPEOF:	CLOSE$	R5		;CLOSE TOP LEVEL CMI
    231	000432	142765 	000200 	000141 		BICB	#GE.MCR,G.MODE(R5) ;++001 ALL DONE, CLEAR MCR BIT, ...
    232	000440	105365 	000152 			DECB	G.CDEP(R5)	;++001 ... AND SET DEPTH TO -1
    233	000444	012746 	177766 			MOV	#GE.EOF,-(SP)	;++005 INDICATE END-OF-FILE
    234	000450	000401 				BR	OUT		;++005
    235
    236	000452	005046 			OKOUT:	CLR	-(SP)		;++005 INDICATE GCML SUCCESS
    237
    238	000454	132765 	000004 	000141 	OUT:	BITB	#GE.CLO,G.MODE(R5) ;++005 CLOSE FILE AFTER THIS GET?
    239	000462	001402 				BEQ	1$		;++001 NO, SET RETURN INFORMATION
    240	000464					CALL	CLOCRT		;++001 YES, CLOSE CURRENT LEVEL
    241	000470	111665 	000140 		1$:	MOVB	(SP),G.ERR(R5)	;++005 PUT RETURN CODE IN G.ERR
    242	000474	006126 				ROL	(SP)+		;++005 SET C-BIT RETURN STATUS
    243	000476	010500 				MOV	R5,R0		;RESTORE R0
    244	000500					RETURN
    245
    246	000502	012746 	177777 		IOERR:	MOV	#GE.IOR,-(SP)	;++005 INDICATE I/O ERROR
    247	000506	000762 				BR	OUT		;++005
    248	000510	012746 	177776 		OPRERR:	MOV	#GE.OPR,-(SP)	;++005 INDICATE INDIRECT OPEN ERROR
    249	000514	000757 				BR	OUT		;++005
    250	000516	062706 	000054 		BIFERR:	ADD	#C.SIZE,SP	;POP LINGERING CSI BLOCK FROM STACK
    251	000522	012746 	177775 			MOV	#GE.BIF,-(SP)	;++005 INDICATE BAD INDIRECT FILE NAME
    252	000526	000752 				BR	OUT		;++005
    253	000530	012746 	177774 		MDEERR:	MOV	#GE.MDE,-(SP)	;++005 INDICATE MAX INDIRECT DEPTH EXCEEDED
    254	000534	000747 				BR	OUT
    255
    256					; RCML$ - ENTRY TO POP WORLD TO TOP LEVEL
    257
    258	000536				.GCML2::.SAVR1
    259	000542	010005 				MOV	R0,R5		;SET UP BLOCK POINTER
    260	000544	105765 	000152 			TSTB	G.CDEP(R5)	;AT TOP ALREADY ?
    261	000550	003740 				BLE	OKOUT		;++007 YES -- EXIT
    262	000552	105365 	000152 		10$:	DECB	G.CDEP(R5)	;++004 DECREMENT CURRENT DEPTH COUNT
    263	000556	001404 				BEQ	20$		;++004 SKIP BEFORE TOP LEVEL (0) PROCESSED
    264	000560	162765 	000020 	000154 		SUB	#G.PDSL,G.PPTR(R5)  ;++004 BACK UP THE PUSH-DOWN LIST PTR
    265	000566	000771 				BR	10$		;++004 ITERATE
    266	000570	105265 	000152 		20$:	INCB	G.CDEP(R5)	;++004 INDICATE LEVEL ONE
    267	000574					CALL	POPOPN		;POP THINGS UP TO LEVEL 0
    268	000600	000724 				BR	OKOUT		;RETURN BLISSFULLY
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 4


    270					; SET UP TO PROCESS AN INDIRECT FILE
    271					; LOOK FOR @ IN COLUMN 1
    272					;    R1 IS COMMAND LINE ADDRESS
    273					;    R2 IS COMMAND LINE LENGTH
    274					;
    275	000602	122711 	000100 		INDIR:	CMPB	#'@,(R1)	;CHECK FOR @
    276	000606	001321 				BNE	OKOUT		;NO  - RETURN LINE TO USER
    277	000610	132765 	000002 	000141 		BITB	#GE.IND,G.MODE(R5); INDIRECT PERMITTED ?
    278	000616	001715 				BEQ	OKOUT		;NO  - RETURN IT TO USER
    279					; PROCESS INDIRECT FILE
    280	000620	126565 	000152 	000153 		CMPB	G.CDEP(R5),G.MDEP(R5)	;CHECK DEPTH
    281	000626	002340 				BGE	MDEERR		;TOO DEEP
    282	000630	162706 	000054 			SUB	#C.SIZE,SP	;ALLOCATE A CSI BLOCK ON STACK
    283	000634	005201 				INC	R1		;SKIP OVER @
    284	000636	005302 				DEC	R2		;1 LESS CHARACTER IN LINE
    285					; CALL CSI1 AND CSI2
    286	000640					CSI$1	SP,R1,R2	;CHECK SYNTAX ON FILE SPEC
    287	000656	016065 	000002 	000146 		MOV	C.CMLD(R0),G.CMLD(R5)	;SET COMPRESSED LENGTH
    288	000664	005265 	000146 			INC	G.CMLD(R5)	;ADJUST LENGTH FOR @ IN COLUMN 1
    289	000670	103712 				BCS	BIFERR		;BAD SYNTAX
    290	000672	132760 	000040 	000001 		BITB	#CS.EQU,C.STAT(R0)  ;++009 WAS EQUAL SIGN (=) FOUND?
    291	000700	001306 				BNE	BIFERR		;++009 ANY INDICATION OF INPUT SPEC IS ERROR
    292	000702					CSI$2	R0,OUTPUT	;GET THE OUTPUT FILE
    293	000712	103701 				BCS	BIFERR		;
    294	000714	132760 	000030 	000001 		BITB	#CS.WLD!CS.MOR,C.STAT(R0); NO * WILD CARDS, AND ONLY ONE FILE
    295	000722	001275 				BNE	BIFERR;
    296	000724	132760 	000005 	000001 		BITB	#CS.DVF!CS.NMF,C.STAT(R0);
    297	000732	001671 				BEQ	BIFERR		;ERROR - NO DEVICE OR FILE NAME
    298					; SAVE FILE ID AND POINTERS
    299	000734					CALL	PSHCLS		;PUSH AND CLOSE FILE
    300	000740	010602 				MOV	SP,R2		;++002 POINT R2 TO THE CSI DATA ...
    301	000742	062702 	000006 			ADD	#C.DSDS,R2	;++002 ... SET DESCRIPTOR
    302	000746	012765 	054523 	000220 		MOV	#"SY,N.DVNM+G.DFNB(R5);DEFAULT DEVICE IS SY FOR LOWER OPEN'S
    303
    304
    305						.IF NDF	R$$11M		;++002
    306
    307
    308						OPEN$R	R5,,R2		;++002 OPEN THE FILE
    309
    310						.IFF			;++002
    311
    312	000754					CALL	GOPEN		;++002 OPEN THE FILE
    313
    314
    315						.ENDC			;++002
    316
    317
    318	000760	103404 				BCS	4$		;ERROR - CLEANUP AND REPORT ERROR
    319	000762	062706 	000054 			ADD	#C.SIZE,SP	;POP CSI BLOCK FROM STACK
    320	000766	000167 	177060 			JMP	PROMPT		;ALL OK - GET A COMMAND LINE
    321	000772	062706 	000054 		4$:	ADD	#C.SIZE,SP	;POP CSI BLOCK FROM STACK
    322	000776					CALL	POPOPN		;RE-OPEN THE LEVEL ABOVE
    323	001002	000642 			OPRBR:	BR	OPRERR		;REPORT ERROR ON @ FILE OPEN
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 5


    325					;
    326					; POPOPN - SUBROUTINE TO CLOSE, POP UP, AND RE-OPEN
    327					;
    328	001004				POPOPN:	CLOSE$	R5		;CLOSE CURRENT FILE
    329	001012				POPOP1:				;++001
    330	001012	016504 	000154 			MOV	G.PPTR(R5),R4	;UPDATE PUSHDOWN POINTER
    331	001016	162765 	000020 	000154 		SUB	#G.PDSL,G.PPTR(R5) ;++001 RESET PUSHDOWN PTR IN GCML BLK
    332	001024	105365 	000152 			DECB	G.CDEP(R5)	;DECREASE PUSHDOWN LEVEL
    333	001030	001004 				BNE	1$		;IF POPPING TO LEVEL 0
    334	001032	132765 	000200 	000141 		BITB	#GE.MCR,G.MODE(R5) ;++001 AND TOP WAS AN MCR LINE,
    335	001040	001036 				BNE	3$		;DON'T RE-OPEN LEVEL 0
    336	001042	010503 			1$:	MOV	R5,R3		;++001 POINT R3 JUST PAST THE FILE ID ...
    337	001044	062703 	000006G			ADD	#F.FNB+N.FID+6,R3  ;++001 ...IN THE FDB
    338	001050	014443 				MOV	-(R4),-(R3)	;++001 TRANSFER ...
    339	001052	014443 				MOV	-(R4),-(R3)	;++001 ... THE ...
    340	001054	014443 				MOV	-(R4),-(R3)	;++001 ... FILE ID, ...
    341	001056	014463 	000032 			MOV	-(R4),N.DVNM-N.FID(R3)  ;++001 ... THE DEVICE NAME, AND ...
    342	001062	114463 	000034 			MOVB	-(R4),N.UNIT-N.FID(R3)  ;++011 ... UNIT NUMBER INTO THE FDB
    343
    344
    345						.IF NDF	R$$11M		;++002
    346
    347
    348						OPEN$R	R5		;RE-OPEN THE LEVEL ABOVE
    349
    350						.IFF			;++002
    351
    352	001066					OFNB$R	R5		;++003 OPEN FILE BY FILENAME BLOCK
    353
    354
    355						.ENDC			;++002
    356
    357
    358	001102	103416 				BCS	4$		;ERROR ON RE-OPEN, VERY BAD
    359					; RESTORE POINTERS INTO THE FILE
    360	001104	114446 				MOVB	-(R4),-(SP)	;++011 SAVE THE OLD FCS I/O STATUS BYTE
    361	001106	014403 				MOV	-(R4),R3	;BYTE-IN-BLOCK
    362	001110	014402 				MOV	-(R4),R2	;
    363	001112	014401 				MOV	-(R4),R1	;VIRTUAL BLOCK NUMBER
    364	001114					CALL	.POINT		;FDB IS IN R0, NOW .POINT
    365	001120	112675 	000000G			MOVB	(SP)+,@F.BDB(R5)  ;++011 RESTORE OLD FCS I/O STATUS
    366	001124	103004 				BCC	3$		;NO ERRORS
    367	001126	122765 	000000G	000000G		CMPB	#IE.EOF,F.ERR(R5);
    368	001134	001001 				BNE	4$		;ANYTHING EXCEPT EOF IS AN I/O ERROR
    369	001136				3$:	RETURN			;ALL IS NOW READY FOR NEXT GET$
    370	001140	005726 			4$:	TST	(SP)+		;THROW AWAY CALLER'S RETURN ADDRESS
    371	001142	000717 				BR	OPRBR		;++010 DECLARE INDIRECT FILE OPEN ERROR
    372
    373					;++001
    374					;
    375					; CLOSE CURRENT COMMAND LEVEL
    376					;
    377					;--001
    378	001144				.GCML3::.SAVR1			;++001 SAVE REGISTERS
    379	001150	010005 				MOV	R0,R5		;++001 SET FDB POINTER
    380	001152	005765 	000000G		CLOCRT:	TST	F.BDB(R5)	;++001 IS FILE OPEN?
    381	001156	001432 				BEQ	PSHRTN		;++001 NO, JUST RETURN
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 5-1


    382
    383					;
    384					; PSHCLS - SUBROUTINE TO PUSH DOWN AND CLOSE
    385					;
    386	001160	105265 	000152 		PSHCLS:	INCB	G.CDEP(R5)	;++001 INCREASE PUSHDOWN LEVEL
    387	001164	016504 	000154 			MOV	G.PPTR(R5),R4	;NEXT PUSHDOWN FRAME
    388	001170	010500 				MOV	R5,R0		;GET FDB FOR .MARK
    389	001172					CALL	.MARK		;MARK CURRENT PLACE IN FILE FOR .POINT
    390	001176	010124 				MOV	R1,(R4)+	;VIRTUAL BLOCK NUMBER
    391	001200	010224 				MOV	R2,(R4)+	;
    392	001202	010324 				MOV	R3,(R4)+	;BYTE-IN-BLOCK
    393	001204	062700 	000000G			ADD	#F.FNB+N.FID,R0	;++001 POINT R0 TO FILE ID IN FDB
    394	001210	117524 	000000G			MOVB	@F.BDB(R5),(R4)+  ;++011 SAVE FCS I/O STATUS BYTE
    395	001214	116024 	000034 			MOVB	N.UNIT-N.FID(R0),(R4)+  ;++011 SAVE THE UNIT NUMBER, ...
    396	001220	016024 	000032 			MOV	N.DVNM-N.FID(R0),(R4)+  ;++001 ...THE DEVICE NAME, AND ...
    397	001224	012024 				MOV	(R0)+,(R4)+	;++001 ... THE ...
    398	001226	012024 				MOV	(R0)+,(R4)+	;++001 ... FILE ID ...
    399	001230	012024 				MOV	(R0)+,(R4)+	;++001 ... FROM FDB IN THE PUSH DOWN LIST
    400	001232	010465 	000154 			MOV	R4,G.PPTR(R5)	;RESET PUSHDOWN FRAME
    401	001236					CLOSE$	R5		;++001 CLOSE CURRENT LEVEL
    402	001244				PSHRTN:				;++001
    403	001244					RETURN
    404
    405
    406						.IF DF	R$$11M		;++002
    407
    408					;++002
    409					;
    410					; *-GOPEN-* OPEN FILE BY PERFORMING A PARSE, AND AN OPEN BY
    411					; 	    FILE NAME BLOCK.
    412					;
    413					; INPUTS:
    414					;	R2=DATA SET DESCRIPTOR ADDRESS
    415					;	R5=FDB/GCMLB ADDRESS
    416					;
    417					; OUTPUTS:
    418					;	R0,R1, AND R3 ARE LOST
    419					;	C-BIT CLEAR INDICATES SUCCESS OF ALL THREE STEPS
    420					;	C-BIT SET INDICATES FAILURE
    421					;
    422					;--002
    423	001246	010500 			GOPEN:	MOV	R5,R0		;++002 PUT FDB ADDR IN R0
    424	001250	013701 	000000G			MOV	@#.FSRPT,R1	;++002 MUST DETERMINE IF A '.FINIT' ...
    425	001254	005761 	000000G			TST	A.OWUI(R1)	;++002 ...HAS BEEN PERFORMED
    426	001260	001002 				BNE	1$		;++002 IF SO, THEN SKIP
    427	001262					FINIT$			;++002 INITIALIZE
    428	001266	010001 			1$:	MOV	R0,R1		;++002 POINT R1 TO THE ...
    429	001270	062701 	000000G			ADD	#F.FNB,R1	;++002 ... FILE NAME BLOCK
    430	001274	016003 	000000G			MOV	F.DFNB(R0),R3	;++002 PNT R3 TO DEFAULT FILE NAME BLOCK
    431	001300					CALL	.PARSE		;++002 PARSE THE FILE NAME
    432	001304	103405 				BCS	10$		;++002 SKIP ON ERROR
    433	001306					OFNB$R			;++003 OPEN FILE FOR READ (VIA FNB)
    434	001320				10$:	RETURN			;++002
    435
    436
    437						.ENDC			;++002
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 6


    439					; GETMCR - SUBROUTINE CONDITIONALLY GETS AN MCR LINE
    440					;    RETURNS
    441					;    C=1 IF NO MCR LINE, C=0 OTHERWISE
    442					;    R1=STRING ADDRESS
    443					;    R2=STRING LENGTH
    444					;    REGISTERS CHANGED R0-R4
    445	001322	016501 	000156 		GETMCR:	MOV	G.RBUF(R5),R1	;GET RECORD BUFFER ADDRESS
    446	001326	105065 	000152 			CLRB	G.CDEP(R5)	;++001 SET CMD LEVEL TO ZERO
    447	001332	012711 				MOV	(PC)+,(R1)	;SET UP "GET MCR LINE" DPB
    448	001334	   177 	   051 			.BYTE	127.,41.
    449	001336					DIR$	R1		;TRY TO GET AN MCR LINE
    450	001342	103432 				BCS	10$		;TASK NOT INVOKED AS MCR FUNCTION
    451	001344	005721 				TST	(R1)+		;POINT TO MCR LINE IN BUFFER
    452	001346	013702 	000000G			MOV	@#$DSW,R2	;++006 GET MCR LINE BYTE COUNT
    453
    454	001352				2$:	CALL	NXTBYT		;SCAN TO A TAB OR BLANK
    455	001356	103424 				BCS	10$		;NO COMMAND LINE FOLLOWING MCR FUNCTION
    456	001360	120027 	000011 			CMPB	R0,#TAB
    457	001364	001403 				BEQ	4$
    458	001366	120027 	000040 			CMPB	R0,#BLANK
    459	001372	001367 				BNE	2$
    460	001374				4$:	CALL	NXTBYT		;SKIP TABS AND BLANKS
    461	001400	103413 				BCS	10$
    462	001402	120027 	000011 			CMPB	R0,#TAB
    463	001406	001772 				BEQ	4$
    464	001410	120027 	000040 			CMPB	R0,#BLANK
    465	001414	001767 				BEQ	4$
    466
    467	001416	124122 				CMPB	-(R1),(R2)+	;++001 DECR POINTER AND INCR COUNT
    468	001420	152765 	000200 	000141 		BISB	#GE.MCR,G.MODE(R5);SET TOP-LEVEL MCR FLAG
    469	001426	000241 				CLC			;AND INDICATE MCR LINE GOTTEN
    470	001430				10$:	RETURN
    471
    472					; NXTBYT - GET NEXT BYTE FROM MCR LINE
    473					;    INPUT - R1 IS STRING POINTER, R2 IS REMAINING BYTE COUNT
    474					;    OUTPUT- R1,R2 UPDATED, R0 IS THE BYTE
    475					;    SETS C=1 ON END OF LINE
    476	001432	162702 	000001 		NXTBYT:	SUB	#1,R2		;++001 DECR R2 AND SET CC-C WHEN REACH -1
    477	001436	112100 				MOVB	(R1)+,R0	;GET NEXT BYTE
    478	001440					RETURN
    479
    480
    481
    482		000001 				.END
.GCML  RSX-11M GET COMMAND LINE	MACRO M1108  05-DEC-77 23:44  PAGE 6-1
SYMBOL TABLE

ALTMOD= 000033   	C.SWAD= 000022   	GOPEN   001246R  	NXTBYT  001432R  	S.FNBW= 000017
A.OWUI= ****** GX	C.TYPR= 000000   	G.CDEP= 000152   	N.DID = 000024   	S.FNTY= 000004
BIFERR  000516R  	FD.TTY= ****** GX	G.CMLD= 000146   	N.DVNM= 000032   	S.FTYP= 000002
BLANK = 000040   	FO.RD = ****** GX	G.DFNB= 000166   	N.FID = 000000   	S.NFEN= 000020
CLOCRT  001152R  	F.BDB = ****** GX	G.DPRM= 000160   	N.FNAM= 000006   	TAB   = 000011
CMLSCN  000272R  	F.DFNB= ****** GX	G.ERR = 000140   	N.FTYP= 000014   	TOPEOF  000424R
CR    = 000015   	F.DSPT= ****** GX	G.ISIZ= 000020   	N.FVER= 000016   	$DSW  = ****** GX
CS.DIF= 000002   	F.ERR = ****** GX	G.MDEP= 000153   	N.NEXT= 000022   	$$    = 000067
CS.DVF= 000004   	F.FACC= ****** GX	G.MODE= 000141   	N.STAT= 000020   	.CLOSE= ****** G
CS.EQU= 000040   	F.FNB = ****** GX	G.PDSL= 000020   	N.UNIT= 000034   	.CSI1 = ****** G
CS.INP= 000001   	F.NRBD= ****** GX	G.PPTR= 000154   	OKOUT   000452R  	.CSI2 = ****** G
CS.MOR= 000020   	F.RCTL= ****** GX	G.PSDS= 000142   	OPRBR   001002R  	.FINIT= ****** G
CS.NMF= 000001   	F.URBD= ****** GX	G.RBUF= 000156   	OPRERR  000510R  	.FSRPT= ****** GX
CS.OUT= 000002   	GETMCR  001322R  	IE.EOF= ****** GX	OUT     000454R  	.GCML1  000000RG
CS.WLD= 000010   	GE.BIF= 177775   	INDIR   000602R  	PAR$$$= 000005   	.GCML2  000536RG
C.CMLD= 000002   	GE.CLO= 000004   	IOEOF   000374R  	POPOPN  001004R  	.GCML3  001144RG
C.DEVD= 000006   	GE.COM= 000001   	IOERR   000502R  	POPOP1  001012R  	.GETSQ= ****** G
C.DIRD= 000012   	GE.EOF= 177766   	IOERR0  000366R  	PROMPT  000052R  	.MARK = ****** GX
C.DSDS= 000006   	GE.IND= 000002   	IO.ATT= ****** GX	PSHCLS  001160R  	.OPFNB= ****** G
C.FILD= 000016   	GE.IOR= 177777   	IO.DET= ****** GX	PSHRTN  001244R  	.PARSE= ****** GX
C.MKW1= 000024   	GE.LC = 000010   	IO.WVB= ****** GX	R$$11M= 000001   	.POINT= ****** GX
C.MKW2= 000026   	GE.MCR= 000200   	LVLTST  000006R  	S.FDB = 000140   	.SAVR1= ****** GX
C.SIZE= 000054   	GE.MDE= 177774   	LVL0    000042R  	S.FNAM= 000006   	.XQIO = ****** GX
C.STAT= 000001   	GE.OPR= 177776   	MDEERR  000530R  	S.FNB = 000036   	...TPC= 000036

. ABS.	000000	   000
      	001442	   001
ERRORS DETECTED:  1

VIRTUAL MEMORY USED:  2916 WORDS  ( 12 PAGES)
DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:00:37
[46,10]GCML,[46,20]GCML/-SP=[46,30]GCML
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 1


      1						.TITLE	QIOMAC - QIOSYM MACRO DEFINITION
      2					; ALTERED SUNDAY 24-NOV-74 13:00
      3					; ALTERED TUESDAY 28-JAN-75 13:50:00
      4					;
      5					; ***** ALWAYS UPDATE THE FOLLOWING TWO LINES TOGETHER
      6						.IDENT	/0300/
      7		000300 				QI.VER=0300
      8					;
      9					;                             COPYRIGHT (C) 1973, 1978 BY
     10					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
     11					;
     12					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
     13					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     14					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     15					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     16					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     17					;
     18					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     19					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     20					;       CORPORATION.
     21					;
     22					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     23					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     24
     25					;
     26					; PETER H. LIPMAN 1-OCT-73
     27					;
     28					;+
     29					; MACRO TO DEFINE STANDARD QUEUE I/O DIRECTIVE FUNCTION VALUES
     30					; AND IOSB RETURN VALUES.  TO INVOKE AT ASSEMBLY TIME (WITH LOCAL
     31					; DEFINITION) USE:
     32					;
     33					;	QIOSY$		;DEFINE SYMBOLS
     34					;
     35					; TO OBTAIN GLOBAL DEFINITION OF THESE SYMBOLS USE:
     36					;
     37					;	QIOSY$ DEF$G	;SYMBOLS DEFINED GLOBALLY
     38					;
     39					; THE MACRO CAN BE CALLED ONCE ONLY AND THEN
     40					; REDEFINES ITSELF AS NULL.
     41					;-
     42
     43						.MACRO	QIOSY$	$$$GBL,$$$MSG
     44						.IIF	IDN,<$$$GBL>,<DEF$G>,	.GLOBL	QI.VER
     45						.IF	IDN,<$$$MSG>,<DEF$S>
     46						$$$MAX=0
     47						$$MSG=1
     48						.IFF
     49						$$MSG=0
     50						.ENDC
     51						.MCALL	IOERR$
     52						IOERR$	$$$GBL	 	;I/O ERROR CODES FROM HANDLERS, FCP, FCS
     53						.MCALL	DRERR$
     54						DRERR$	$$$GBL	 	;DIRECTIVE STATUS WORD ERROR CODES
     55						.IF	DIF,<$$$MSG>,<DEF$S>
     56						.MCALL	FILIO$
     57						FILIO$	$$$GBL		;DEFINE GENERAL QI/O FUNCTION CODES
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 1-1


     58						.MCALL	SPCIO$
     59						SPCIO$	$$$GBL		;DEVICE DEPENDENT I/O FUNCTION CODES
     60						.MACRO	QIOSY$	ARG,ARG1,ARG2	;RECLAIM MACRO STORAGE
     61						.ENDM	QIOSY$
     62						.ENDC
     63						.ENDM	QIOSY$
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 2


     65
     66					;
     67					; DEFINE THE ERROR CODES RETURNED BY DEVICE HANDLER AND FILE PRIMITIVES
     68					; IN THE FIRST WORD OF THE I/O STATUS BLOCK
     69					; THESE CODES ARE ALSO RETURNED BY FILE CONTROL SERVICES (FCS) IN THE
     70					; BYTE F.ERR IN THE FILE DESCRIPTOR BLOCK (FDB)
     71					;	THE BYTE F.ERR+1 IS 0 IF F.ERR CONTAINS A HANDLER OR FCP ERROR CODE.
     72					;
     73						.MACRO	IOERR$	$$$GBL
     74						.MCALL	.IOER.,DEFIN$
     75						.IF	IDN,<$$$GBL>,<DEF$G>
     76						...GBL=1
     77						.IFF
     78						...GBL=0
     79						.ENDC
     80						.IIF	NDF,$$MSG,$$MSG=0
     81					;
     82					; SYSTEM STANDARD CODES, USED BY ALL FUNCTIONS
     83					;
     84						.IOER.	IE.BAD,-01.,<BAD PARAMETERS>
     85						.IOER.	IE.EBX,-02.,<E BOX STOPPED>
     86						.IOER.	IE.IFC,-02.,<INVALID FUNCTION CODE>
     87						.IOER.	IE.DNR,-03.,<DEVICE NOT READY>
     88						.IOER.	IE.VER,-04.,<PARITY ERROR ON DEVICE>
     89						.IOER.	IE.ONP,-05.,<HARDWARE OPTION NOT PRESENT>
     90						.IOER.	IE.SPC,-06.,<ILLEGAL USER BUFFER>
     91						.IOER.	IE.DNA,-07.,<DEVICE NOT ATTACHED>
     92						.IOER.	IE.DAA,-08.,<DEVICE ALREADY ATTACHED>
     93						.IOER.	IE.DUN,-09.,<DEVICE NOT ATTACHABLE>
     94						.IOER.	IE.EOF,-10.,<END OF FILE DETECTED>
     95						.IOER.	IE.EOV,-11.,<END OF VOLUME DETECTED>
     96						.IOER.	IE.WLK,-12.,<WRITE ATTEMPTED TO LOCKED UNIT>
     97						.IOER.	IE.DAO,-13.,<DATA OVERRUN>
     98						.IOER.	IE.SRE,-14.,<SEND/RECEIVE FAILURE>
     99						.IOER.	IE.ABO,-15.,<REQUEST TERMINATED>
    100						.IOER.	IE.PRI,-16.,<PRIVILEGE VIOLATION>
    101						.IOER.	IE.RSU,-17.,<SHARABLE RESOURCE IN USE>
    102						.IOER.	IE.OVR,-18.,<ILLEGAL OVERLAY REQUEST>
    103						.IOER.	IE.BYT,-19.,<ODD BYTE COUNT (OR VIRTUAL ADDRESS)>
    104						.IOER.	IE.BLK,-20.,<LOGICAL BLOCK NUMBER TOO LARGE>
    105						.IOER.	IE.MOD,-21.,<INVALID UDC MODULE #>
    106						.IOER.	IE.CON,-22.,<UDC CONNECT ERROR>
    107						.IOER.	IE.BBE,-56.,<BAD BLOCK ON DEVICE>
    108						.IOER.	IE.STK,-58.,<NOT ENOUGH STACK SPACE (FCS OR FCP)>
    109						.IOER.	IE.FHE,-59.,<FATAL HARDWARE ERROR ON DEVICE>
    110						.IOER.	IE.EOT,-62.,<END OF TAPE DETECTED>
    111						.IOER.	IE.OFL,-65.,<DEVICE OFF LINE>
    112
    113
    114					;
    115					; FILE PRIMITIVE CODES
    116					;
    117
    118						.IOER.	IE.NOD,-23.,<CALLER'S NODES EXHAUSTED>
    119						.IOER.	IE.DFU,-24.,<DEVICE FULL>
    120						.IOER.	IE.IFU,-25.,<INDEX FILE FULL>
    121						.IOER.	IE.NSF,-26.,<NO SUCH FILE>
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 2-1


    122						.IOER.	IE.LCK,-27.,<LOCKED FROM WRITE ACCESS>
    123						.IOER.	IE.HFU,-28.,<FILE HEADER FULL>
    124						.IOER.	IE.WAC,-29.,<ACCESSED FOR WRITE>
    125						.IOER.	IE.CKS,-30.,<FILE HEADER CHECKSUM FAILURE>
    126						.IOER.	IE.WAT,-31.,<ATTRIBUTE CONTROL LIST FORMAT ERROR>
    127						.IOER.	IE.RER,-32.,<FILE PROCESSOR DEVICE READ ERROR>
    128						.IOER.	IE.WER,-33.,<FILE PROCESSOR DEVICE WRITE ERROR>
    129						.IOER.	IE.ALN,-34.,<FILE ALREADY ACCESSED ON LUN>
    130						.IOER.	IE.SNC,-35.,<FILE ID, FILE NUMBER CHECK>
    131						.IOER.	IE.SQC,-36.,<FILE ID, SEQUENCE NUMBER CHECK>
    132						.IOER.	IE.NLN,-37.,<NO FILE ACCESSED ON LUN>
    133						.IOER.	IE.CLO,-38.,<FILE WAS NOT PROPERLY CLOSED>
    134						.IOER.	IE.DUP,-57.,<ENTER - DUPLICATE ENTRY IN DIRECTORY>
    135						.IOER.	IE.BVR,-63.,<BAD VERSION NUMBER>
    136						.IOER.	IE.BHD,-64.,<BAD FILE HEADER>
    137						.IOER.	IE.EXP,-66.,<FILE EXPIRATION DATE NOT REACHED>
    138						.IOER.	IE.BTF,-67.,<BAD TAPE FORMAT>
    139
    140					;
    141					; FILE CONTROL SERVICES CODES
    142					;
    143
    144						.IOER.	IE.NBF,-39.,<OPEN - NO BUFFER SPACE AVAILABLE FOR FILE>
    145						.IOER.	IE.RBG,-40.,<ILLEGAL RECORD SIZE>
    146						.IOER.	IE.NBK,-41.,<FILE EXCEEDS SPACE ALLOCATED, NO BLOCKS>
    147						.IOER.	IE.ILL,-42.,<ILLEGAL OPERATION ON FILE DESCRIPTOR BLOCK>
    148						.IOER.	IE.BTP,-43.,<BAD RECORD TYPE>
    149						.IOER.	IE.RAC,-44.,<ILLEGAL RECORD ACCESS BITS SET>
    150						.IOER.	IE.RAT,-45.,<ILLEGAL RECORD ATTRIBUTES BITS SET>
    151						.IOER.	IE.RCN,-46.,<ILLEGAL RECORD NUMBER - TOO LARGE>
    152						.IOER.	IE.MBK,-47.,<MULTIPLE BLOCK READ/WRITE - NOT IMPLEMENTED YET>
    153						.IOER.	IE.2DV,-48.,<RENAME - 2 DIFFERENT DEVICES>
    154						.IOER.	IE.FEX,-49.,<RENAME - NEW FILE NAME ALREADY IN USE>
    155						.IOER.	IE.BDR,-50.,<BAD DIRECTORY FILE>
    156						.IOER.	IE.RNM,-51.,<CAN'T RENAME OLD FILE SYSTEM>
    157						.IOER.	IE.BDI,-52.,<BAD DIRECTORY SYNTAX>
    158						.IOER.	IE.FOP,-53.,<FILE ALREADY OPEN>
    159						.IOER.	IE.BNM,-54.,<BAD FILE NAME>
    160						.IOER.	IE.BDV,-55.,<BAD DEVICE NAME>
    161						.IOER.	IE.NFI,-60.,<FILE ID WAS NOT SPECIFIED>
    162						.IOER.	IE.ISQ,-61.,<ILLEGAL SEQUENTIAL OPERATION>
    163						.IOER.	IE.NNC,-68.,<NOT ANSI 'D' FORMAT BYTE COUNT>
    164
    165					;
    166					; SUCCESSFUL RETURN CODES---
    167					;
    168
    169						DEFIN$	IS.PND,+00.	;OPERATION PENDING
    170						DEFIN$	IS.SUC,+01.	;OPERATION COMPLETE, SUCCESS
    171						DEFIN$	IS.RDD,+02.	;READ DELETED DATA (FLOPPY)
    172						DEFIN$	IS.BV,+05.	;ON A/D READ, AT LEAST ONE BAD VALUE
    173									;WAS READ (REMAINDER MAY BE GOOD).
    174									;BAD CHANNEL IS INDICATED BY A
    175									;NEGATIVE VALUE IN THE BUFFER.
    176
    177
    178					;
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 2-2


    179					; TTY SUCCESS CODES:
    180					;
    181
    182						DEFIN$	IS.CR,<15*400+1> ;CARRIAGE RETURN WAS TERMINATOR
    183						DEFIN$	IS.ESC,<33*400+1> ;ESCAPE (ALTMODE) WAS TERMINATOR
    184
    185
    186					; ******
    187					;
    188					; THE NEXT AVAILABLE ERROR NUMBER IS: -69.
    189					; ALL LOWER NUMBERS ARE IN USE!!
    190					;
    191					; *****
    192						.IF	EQ,$$MSG
    193						.MACRO	IOERR$	A
    194						.ENDM	IOERR$
    195						.ENDC
    196						.ENDM	IOERR$
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 3


    198					;
    199					; DEFINE THE DIRECTIVE ERROR CODES RETURNED IN THE DIRECTIVE STATUS WORD
    200					;
    201					;	FILE CONTROL SERVICES (FCS) RETURNS THESE CODES IN THE BYTE F.ERR
    202					; OF THE FILE DESCRIPTOR BLOCK (FDB).  TO DISTINGUISH THEM FROM THE
    203					; OVERLAPPING CODES FROM HANDLER AND FILE PRIMITIVES, THE BYTE
    204					; F.ERR+1 IN THE FDB WILL BE NEGATIVE FOR A DIRECTIVE ERROR CODE.
    205					;
    206						.MACRO	DRERR$	$$$GBL
    207						.MCALL	.QIOE.,DEFIN$
    208						.IF	IDN,<$$$GBL>,<DEF$G>
    209						...GBL=1
    210						.IFF
    211						...GBL=0
    212						.ENDC
    213						.IIF	NDF,$$MSG,$$MSG=0
    214					;
    215					; STANDARD ERROR CODES RETURNED BY DIRECTIVES IN THE DIRECTIVE STATUS WORD
    216					;
    217						.QIOE.	IE.UPN,-01.,<INSUFFICIENT DYNAMIC STORAGE>
    218						.QIOE.	IE.INS,-02.,<SPECIFIED TASK NOT INSTALLED>
    219						.QIOE.	IE.ULN,-05.,<UN-ASSIGNED LUN>
    220						.QIOE.	IE.HWR,-06.,<HANDLER TASK NOT RESIDENT>
    221						.QIOE.	IE.ACT,-07.,<TASK NOT ACTIVE>
    222						.QIOE.	IE.ITS,-08.,<DIRECTIVE INCONSISTENT WITH TASK STATE>
    223						.QIOE.	IE.CKP,-10.,<ISSUING TASK NOT CHECKPOINTABLE>
    224					;
    225					;
    226					;
    227						.QIOE.	IE.AST,-80.,<DIRECTIVE ISSUED/NOT ISSUED FROM AST>
    228						.QIOE.	IE.LNL,-90.,<LUN LOCKED IN USE>
    229						.QIOE.	IE.IDU,-92.,<INVALID DEVICE OR UNIT>
    230						.QIOE.	IE.ITI,-93.,<INVALID TIME PARAMETERS>
    231						.QIOE.	IE.IPR,-95.,<INVALID PRIORITY ( .GT. 250.)>
    232						.QIOE.	IE.ILU,-96.,<INVALID LUN>
    233						.QIOE.	IE.IEF,-97.,<INVALID EVENT ( .GT. 64.)>
    234						.QIOE.	IE.ADP,-98.,<PART OF DPB OUT OF USER'S SPACE>
    235						.QIOE.	IE.SDP,-99.,<DIC OR DPB SIZE INVALID>
    236					;
    237					; SUCCESS CODES FROM DIRECTIVES - PLACED IN THE DIRECTIVE STATUS WORD
    238					;
    239						DEFIN$	IS.CLR,0	;EVENT FLAG WAS CLEAR
    240									;FROM CLEAR EVENT FLAG DIRECTIVE
    241						DEFIN$	IS.SET,2	;EVENT FLAG WAS SET
    242									;FROM SET EVENT FLAG DIRECTIVE
    243					;
    244					;
    245						.IF	EQ,$$MSG
    246						.MACRO	DRERR$	A
    247						.ENDM	DRERR$
    248						.ENDC
    249						.ENDM	DRERR$
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 4


    251					;
    252					; DEFINE THE GENERAL QI/O FUNCTION CODES - DEVICE INDEPENDENT
    253					;
    254						.MACRO	FILIO$	$$$GBL
    255						.MCALL	.WORD.,DEFIN$
    256						.IF	IDN,<$$$GBL>,<DEF$G>
    257						...GBL=1
    258						.IFF
    259						...GBL=0
    260						.ENDC
    261					;
    262					; GENERAL QI/O QUALIFIER BYTE DEFINITIONS
    263					;
    264						.WORD.	IQ.X,001,000	;NO ERROR RECOVERY
    265						.WORD.	IQ.Q,002,000	;QUEUE REQUEST IN EXPRESS QUEUE
    266					;;;	.WORD.	IQ.,004,000	;RESERVED
    267					;
    268					; EXPRESS QUEUE COMMANDS
    269					;
    270
    271						.WORD.	IO.KIL,012,000	;KILL CURRENT REQUEST
    272						.WORD.	IO.RDN,022,000	;I/O RUNDOWN
    273						.WORD.	IO.UNL,042,000	;UNLOAD I/O HANDLER TASK
    274						.WORD.	IO.LTK,050,000	;LOAD A TASK IMAGE FILE
    275						.WORD.	IO.RTK,060,000	;RECORD A TASK IMAGE FILE
    276					;
    277					; GENERAL DEVICE HANDLER CODES
    278					;
    279						.WORD.	IO.WLB,000,001	;WRITE LOGICAL BLOCK
    280						.WORD.	IO.RLB,000,002	;READ LOGICAL BLOCK
    281						.WORD.	IO.LOV,010,002	;LOAD OVERLAY (DISK DRIVER)
    282						.WORD.	IO.ATT,000,003	;ATTACH A DEVICE TO A TASK
    283						.WORD.	IO.DET,000,004	;DETACH A DEVICE FROM A TASK
    284					;
    285					; DIRECTORY PRIMITIVE CODES
    286					;
    287						.WORD.	IO.FNA,000,011	;FIND FILE NAME IN DIRECTORY
    288						.WORD.	IO.RNA,000,013	;REMOVE FILE NAME FROM DIRECTORY
    289						.WORD.	IO.ENA,000,014	;ENTER FILE NAME IN DIRECTORY
    290					;
    291					; FILE PRIMITIVE CODES
    292					;
    293						.WORD.	IO.CLN,000,007	;CLOSE OUT LUN
    294						.WORD.	IO.ACR,000,015	;ACCESS FOR READ
    295						.WORD.	IO.ACW,000,016	;ACCESS FOR WRITE
    296						.WORD.	IO.ACE,000,017	;ACCESS FOR EXTEND
    297						.WORD.	IO.DAC,000,020	;DE-ACCESS FILE
    298						.WORD.	IO.RVB,000,021	;READ VIRITUAL BLOCK
    299						.WORD.	IO.WVB,000,022	;WRITE VIRITUAL BLOCK
    300						.WORD.	IO.EXT,000,023	;EXTEND FILE
    301						.WORD.	IO.CRE,000,024	;CREATE FILE
    302						.WORD.	IO.DEL,000,025	;DELETE FILE
    303						.WORD.	IO.RAT,000,026	;READ FILE ATTRIBUTES
    304						.WORD.	IO.WAT,000,027	;WRITE FILE ATTRIBUTES
    305						.WORD.	IO.APV,010,030	;PRIVILEGED ACP CONTROL
    306						.WORD.	IO.APC,000,030	;ACP CONTROL
    307					;
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 4-1


    308					;
    309						.MACRO	FILIO$	A
    310						.ENDM	FILIO$
    311						.ENDM	FILIO$
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 5


    313					;
    314					; DEFINE THE QI/O FUNCTION CODES THAT ARE SPECIFIC TO INDIVIDUAL DEVICES
    315					;
    316						.MACRO	SPCIO$	$$$GBL
    317						.MCALL	.WORD.,DEFIN$
    318						.IF	IDN,<$$$GBL>,<DEF$G>
    319						...GBL=1
    320						.IFF
    321						...GBL=0
    322						.ENDC
    323					;
    324					; QI/O FUNCTION CODES FOR SPECIFIC DEVICE DEPENDENT FUNCTIONS
    325					;
    326						.WORD.	IO.WLV,100,001	;WRITE LOGICAL REVERSE (DECTAPE)
    327						.WORD.	IO.WLS,010,001	;(COMMUNICATIONS) WRITE PRECEDED BY SYNC TRAIN
    328						.WORD.	IO.RLV,100,002	;READ REVERSE (DECTAPE)
    329						.WORD.	IO.RNC,004,002	;READ - NO LOWER CASE CONVERT (TTY)
    330						.WORD.	IO.RAL,010,002	;READ PASSING ALL CHARACTERS (TTY)
    331						.WORD.	IO.RNE,020,002	;READ WITHOUT ECHO (TTY)
    332						.WORD.	IO.RDB,200,002	;READ BINARY MODE (CARD READER)
    333						.WORD.	IO.RHD,010,002	;(COMMUNICATIONS) READ, STRIP SYNC
    334						.WORD.	IO.CRC,020,002	;(COMMUNICATIONS) READ, DON'T CLEAR CRC
    335						.WORD.	IO.R1C,000,005	;READ SINGLE CHANNEL (AFC, AD01, UDC)
    336						.WORD.	IO.INL,000,005	;(COMMUNICATIONS) INITIALIZATION FUNCTION
    337						.WORD.	IO.TRM,010,005	;(COMMUNICATIONS) TERMINATION FUNCTION
    338						.WORD.	IO.RBC,000,006	;READ MULTICHANNELS (BUFFER DEFINES CHANNELS)
    339						.WORD.	IO.MOD,000,006	;(COMMUNICATIONS) SETMODE FUNCTION FAMILY
    340						.WORD.	IO.HDX,010,006	;(COMMUNICATIONS) SET UNIT HALF DUPLEX
    341						.WORD.	IO.FDX,020,006	;(COMMUNICATIONS) SET UNIT FULL DUPLEX
    342						.WORD.	IO.SYN,040,006	;(COMMUNICATIONS) SPECIFY SYNC CHARACTER
    343						.WORD.	IO.RTC,000,007	;READ CHANNEL - TIME BASED
    344						.WORD.	IO.RWD,000,005	;REWIND (MAGTAPE, DECTAPE)
    345						.WORD.	IO.SPB,020,005	;MAGTAPE, SPACE "N" BLOCKS
    346						.WORD.	IO.SPF,040,005	;MAGTAPE, SPACE "N" EOF MARKS
    347						.WORD.	IO.EOF,000,006	;MAGTAPE, WRITE EOF
    348						.WORD.	IO.STC,100,005	;MAGTAPE, SET CHARACTERISTIC
    349						.WORD.	IO.SEC,120,005	;MAGTAPE, SENSE CHARACTERISTIC
    350						.WORD.	IO.RWU,140,005	;REWIND AND UNLOAD (MAGTAPE, DECTAPE)
    351						.WORD.	IO.SMO,160,005	;MAGTAPE, MOUNT & SET CHARACTERISTICS
    352						.WORD.	IO.SAO,000,010	;UDC SINGLE CHANNEL ANALOG OUTPUT
    353						.WORD.	IO.SSO,000,011	;UDC SINGLE SHOT, SINGLE POINT
    354						.WORD.	IO.MSO,000,012	;UDC SINGLE SHOT, MULTI-POINT
    355						.WORD.	IO.SLO,000,013	;UDC LATCHING, SINGLE POINT
    356						.WORD.	IO.MLO,000,014	;UDC LATCHING, MULTI-POINT
    357						.WORD.	IO.LED,000,024	;LPS11 WRITE LED DISPLAY LIGHTS
    358						.WORD.	IO.SDO,000,025	;LPS11 WRITE DIGITAL OUTPUT REGISTER
    359						.WORD.	IO.SDI,000,026	;LPS11 READ DIGITAL INPUT REGISTER
    360						.WORD.	IO.SCS,000,026	;UDC CONTACT SENSE, SINGLE POINT
    361						.WORD.	IO.REL,000,027	;LPS11 WRITE RELAY
    362						.WORD.	IO.MCS,000,027	;UDC CONTACT SENSE, MULTI-POINT
    363						.WORD.	IO.ADS,000,030	;LPS11 SYNCHRONOUS A/D SAMPLING
    364						.WORD.	IO.CCI,000,030	;UDC CONTACT INT - CONNECT
    365						.WORD.	IO.MDI,000,031	;LPS11 SYNCHRONOUS DIGITAL INPUT
    366						.WORD.	IO.DCI,000,031	;UDC CONTACT INT - DISCONNECT
    367						.WORD.	IO.XMT,000,031	;(COMMUNICATIONS) TRANSMIT SPECIFIED BLOCK WITH ACK
    368						.WORD.	IO.XNA,010,031	;(COMMUNICATIONS) TRANSMIT WITHOUT ACK
    369						.WORD.	IO.HIS,000,032	;LPS11 SYNCHRONOUS HISTOGRAM SAMPLING
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 5-1


    370						.WORD.	IO.RCI,000,032	;UDC CONTACT INT - READ
    371						.WORD.	IO.RCV,000,032	;(COMMUNICATIONS) RECEIVE DATA IN BUFFER SPECIFIED
    372						.WORD.	IO.MDO,000,033	;LPS11 SYNCHRONOUS DIGITAL OUTPUT
    373						.WORD.	IO.CTI,000,033	;UDC TIMER - CONNECT
    374						.WORD.	IO.CON,000,033	;(COMMUNICATIONS) COMMUNICATIONS CONNECT FUNCTION
    375						.WORD.	IO.DTI,000,034	;UDC TIMER - DISCONNECT
    376						.WORD.	IO.DIS,000,034	;(COMMUNICATIONS) COMMUNICATIONS DISCONNECT FUNCTION
    377						.WORD.	IO.MDA,000,034	;LPS11 SYNCHRONOUS D/A OUTPUT
    378						.WORD.	IO.RTI,000,035	;UDC TIMER - READ
    379						.WORD.	IO.CTL,000,035	;(COMMUNICATIONS) NETWORK CONTROL FUNCTION
    380						.WORD.	IO.STP,000,035	;LPS11 STOP IN PROGRESS FUNCTION
    381						.WORD.	IO.ITI,000,036	;UDC TIMER - INITIALIZE
    382						.WORD.	IO.SHT,010,005	;SET HORIZONTAL TAB POSITIONS
    383						.WORD.	IO.SST,030,005	;SET SPECIAL TERMINATOR CHARACTERS
    384						.WORD.	IO.SEM,040,005	;SET TERMINAL MODE (CHARACTERISTICS)
    385						.WORD.	IO.SNM,050,005	;SENSE TERMINAL MODE
    386						.WORD.	IO.CCT,060,005	;CONNECT TO REMOTE TERMINAL (AUTO DIALOUT)
    387						.WORD.	IO.DCT,070,005	;DISCONNECT FROM REMOTE TERMINAL (HANGUP)
    388						.WORD.	IO.ESA,100,005	;ENABLE STATUS AST
    389					;
    390					;
    391						.MACRO	SPCIO$	A
    392						.ENDM	SPCIO$
    393						.ENDM	SPCIO$
QIOMAC - QIOSYM MACRO DEFINITIO	MACRO M1108  05-DEC-77 23:45  PAGE 6


    395					;
    396					; HANDLER ERROR CODES RETURNED IN I/O STATUS BLOCK ARE DEFINED THROUGH THIS
    397					; MACRO WHICH THEN CONDITIONALLY INVOKES THE MESSAGE GENERATING MACRO
    398					; FOR THE QIOSYM.MSG FILE
    399					;
    400						.MACRO	.IOER.	SYM,LO,MSG
    401						DEFIN$	SYM,LO
    402						.IF	GT,$$MSG
    403						.MCALL	.IOMG.
    404						.IOMG.	SYM,LO,<MSG>
    405						.ENDC
    406						.ENDM	.IOER.
    407					;
    408					; QI/O ERROR CODES ARE DEFINED THOUGH THIS MACRO WHICH THEN INVOKES THE
    409					; ERROR MESSAGE GENERATING MACRO, ERROR CODES -129 THROUGH -256
    410					; ARE USED IN THE QIOSYM.MSG FILE
    411					;
    412						.MACRO	.QIOE.	SYM,LO,MSG
    413						DEFIN$	SYM,LO
    414						.IF	GT,$$MSG
    415						.MCALL	.IOMG.
    416						.IOMG.	SYM,<LO-128.>,<MSG>
    417						.ENDC
    418						.ENDM	.QIOE.
    419					;
    420					; CONDITIONALLY GENERATE DATA FOR WRITING A MESSAGE FILE FOR MO
    421					;
    422						.MACRO	.IOMG.	SYM,LO,MSG
    423						.WORD	-<LO>
    424						.ASCIZ	^MSG^
    425						.EVEN
    426						.IIF	LT,<$$$MAX+<LO>>,$$$MAX=-<LO>
    427						.ENDM	.IOMG.
    428					;
    429					; DEFINE THE SYMBOL SYM WHERE LO IS IS THE LOW ORDER BYTE, HI IS THE HIGH BYTE
    430					;
    431						.MACRO	.WORD.	SYM,LO,HI
    432						DEFIN$	SYM,<HI*400+LO>
    433						.ENDM	.WORD.
QIOSYM	MACRO M1108  05-DEC-77 23:45  PAGE 7


      1						.TITLE	QIOSYM
      2					; ALTERED THURSDAY 6-DEC-73 11:00
      3					;
      4					; COPYRIGHT (C) 1975, DIGITAL EQUIPMENT CORP., MAYNARD MASS.
      5					; COPYRIGHT (C) 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					; PETER H. LIPMAN 1-OCT-73
     20					;
     21						.MCALL	QIOSY$
     22	000000					QIOSY$	DEF$G		;DEFINE QIO SYMBOLS GLOBALLY
     23		000001 				.END
QIOSYM	MACRO M1108  05-DEC-77 23:45  PAGE 7-1
SYMBOL TABLE

IE.ABO= 177761 G 	IE.IDU= 177644 G 	IE.STK= 177706 G 	IO.HIS= 015000 G 	IO.SDI= 013000 G
IE.ACT= 177771 G 	IE.IEF= 177637 G 	IE.ULN= 177773 G 	IO.INL= 002400 G 	IO.SDO= 012400 G
IE.ADP= 177636 G 	IE.IFC= 177776 G 	IE.UPN= 177777 G 	IO.ITI= 017000 G 	IO.SEC= 002520 G
IE.ALN= 177736 G 	IE.IFU= 177747 G 	IE.VER= 177774 G 	IO.KIL= 000012 G 	IO.SEM= 002440 G
IE.AST= 177660 G 	IE.ILL= 177726 G 	IE.WAC= 177743 G 	IO.LED= 012000 G 	IO.SHT= 002410 G
IE.BAD= 177777 G 	IE.ILU= 177640 G 	IE.WAT= 177741 G 	IO.LOV= 001010 G 	IO.SLO= 005400 G
IE.BBE= 177710 G 	IE.INS= 177776 G 	IE.WER= 177737 G 	IO.LTK= 000050 G 	IO.SMO= 002560 G
IE.BDI= 177714 G 	IE.IPR= 177641 G 	IE.WLK= 177764 G 	IO.MCS= 013400 G 	IO.SNM= 002450 G
IE.BDR= 177716 G 	IE.ISQ= 177703 G 	IE.2DV= 177720 G 	IO.MDA= 016000 G 	IO.SPB= 002420 G
IE.BDV= 177711 G 	IE.ITI= 177643 G 	IO.ACE= 007400 G 	IO.MDI= 014400 G 	IO.SPF= 002440 G
IE.BHD= 177700 G 	IE.ITS= 177770 G 	IO.ACR= 006400 G 	IO.MDO= 015400 G 	IO.SSO= 004400 G
IE.BLK= 177754 G 	IE.LCK= 177745 G 	IO.ACW= 007000 G 	IO.MLO= 006000 G 	IO.SST= 002430 G
IE.BNM= 177712 G 	IE.LNL= 177646 G 	IO.ADS= 014000 G 	IO.MOD= 003000 G 	IO.STC= 002500 G
IE.BTF= 177675 G 	IE.MBK= 177721 G 	IO.APC= 014000 G 	IO.MSO= 005000 G 	IO.STP= 016400 G
IE.BTP= 177725 G 	IE.MOD= 177753 G 	IO.APV= 014010 G 	IO.RAL= 001010 G 	IO.SYN= 003040 G
IE.BVR= 177701 G 	IE.NBF= 177731 G 	IO.ATT= 001400 G 	IO.RAT= 013000 G 	IO.TRM= 002410 G
IE.BYT= 177755 G 	IE.NBK= 177727 G 	IO.CCI= 014000 G 	IO.RBC= 003000 G 	IO.UNL= 000042 G
IE.CKP= 177766 G 	IE.NFI= 177704 G 	IO.CCT= 002460 G 	IO.RCI= 015000 G 	IO.WAT= 013400 G
IE.CKS= 177742 G 	IE.NLN= 177733 G 	IO.CLN= 003400 G 	IO.RCV= 015000 G 	IO.WLB= 000400 G
IE.CLO= 177732 G 	IE.NNC= 177674 G 	IO.CON= 015400 G 	IO.RDB= 001200 G 	IO.WLS= 000410 G
IE.CON= 177752 G 	IE.NOD= 177751 G 	IO.CRC= 001020 G 	IO.RDN= 000022 G 	IO.WLV= 000500 G
IE.DAA= 177770 G 	IE.NSF= 177746 G 	IO.CRE= 012000 G 	IO.REL= 013400 G 	IO.WVB= 011000 G
IE.DAO= 177763 G 	IE.OFL= 177677 G 	IO.CTI= 015400 G 	IO.RHD= 001010 G 	IO.XMT= 014400 G
IE.DFU= 177750 G 	IE.ONP= 177773 G 	IO.CTL= 016400 G 	IO.RLB= 001000 G 	IO.XNA= 014410 G
IE.DNA= 177771 G 	IE.OVR= 177756 G 	IO.DAC= 010000 G 	IO.RLV= 001100 G 	IQ.Q  = 000002 G
IE.DNR= 177775 G 	IE.PRI= 177760 G 	IO.DCI= 014400 G 	IO.RNA= 005400 G 	IQ.X  = 000001 G
IE.DUN= 177767 G 	IE.RAC= 177724 G 	IO.DCT= 002470 G 	IO.RNC= 001004 G 	IS.BV = 000005 G
IE.DUP= 177707 G 	IE.RAT= 177723 G 	IO.DEL= 012400 G 	IO.RNE= 001020 G 	IS.CLR= 000000 G
IE.EBX= 177776 G 	IE.RBG= 177730 G 	IO.DET= 002000 G 	IO.RTC= 003400 G 	IS.CR = 006401 G
IE.EOF= 177766 G 	IE.RCN= 177722 G 	IO.DIS= 016000 G 	IO.RTI= 016400 G 	IS.ESC= 015401 G
IE.EOT= 177702 G 	IE.RER= 177740 G 	IO.DTI= 016000 G 	IO.RTK= 000060 G 	IS.PND= 000000 G
IE.EOV= 177765 G 	IE.RNM= 177715 G 	IO.ENA= 006000 G 	IO.RVB= 010400 G 	IS.RDD= 000002 G
IE.EXP= 177676 G 	IE.RSU= 177757 G 	IO.EOF= 003000 G 	IO.RWD= 002400 G 	IS.SET= 000002 G
IE.FEX= 177717 G 	IE.SDP= 177635 G 	IO.ESA= 002500 G 	IO.RWU= 002540 G 	IS.SUC= 000001 G
IE.FHE= 177705 G 	IE.SNC= 177735 G 	IO.EXT= 011400 G 	IO.R1C= 002400 G 	QI.VER= 000300 G
IE.FOP= 177713 G 	IE.SPC= 177772 G 	IO.FDX= 003020 G 	IO.SAO= 004000 G 	$$MSG = 000000
IE.HFU= 177744 G 	IE.SQC= 177734 G 	IO.FNA= 004400 G 	IO.SCS= 013000 G 	...GBL= 000001
IE.HWR= 177772 G 	IE.SRE= 177762 G 	IO.HDX= 003010 G

. ABS.	000000	   000
      	000000	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  7810 WORDS  ( 31 PAGES)
DYNAMIC MEMORY:  8384 WORDS  ( 32 PAGES)
ELAPSED TIME:  00:01:11
[46,10]QIOSYM,[46,20]QIOSYM/-SP=[30,30]QIOMAC,[46,30]QIOSYM
OD2CT - CONVERT FROM ASCII TO T	MACRO M1108  05-DEC-77 23:46  PAGE 1


      1						.TITLE	OD2CT - CONVERT FROM ASCII TO TWO BINARY WORDS
      2
      3						.IDENT	"V0002"
      4					;
      5					;
      6					; COPYRIGHT (C)   1975,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.
      7					; COPYRIGHT (C)   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
     22					;
     23					; ANDREW C. GOLDSTEIN  10 JUL 1974
     24					;
     25						.MCALL	RETURN
     26
     27					.MACRO	SAVR1
     28						JSR	R5,.SAVR1
     29					.ENDM	SAVR1
OD2CT - CONVERT FROM ASCII TO T	MACRO M1108  05-DEC-77 23:46  PAGE 2


     31					;+
     32					;
     33					; *** - .DD2CT	CONVERT A DECIMAL NUMBER TO TWO BINARY WORDS.
     34					;		THIS SUBROUTINE CONVERTS AN ASCII DECIMAL NUMBER STRING
     35					;		TO A DOUBLE LENGTH BINARY NUMBER. A TRAILING DECIMAL
     36					;		POINT IS PERMITTED.
     37					;
     38					; *** - .OD2CT	CONVERT AN OCTAL OR DECIMAL NUMBER TO TWO BINARY WORDS.
     39					;		THIS SUBROUTINE CONVERTS AN ASCII OCTAL OR DECIMAL
     40					;		NUMBER STRING TO A DOUBLE LENGTH BINARY NUMBER. RADIX
     41					;		IS CONTROLLED BY THE PRESENCE OR ABSENCE OF A TRAILING
     42					;		DECIMAL POINT.
     43					;
     44					;	BOTH ENTRIES ACCEPT A LEADING "+" OR "-" AND PRODUCE A TWO'S
     45					;	COMPLEMENT NEGATIVE FOR THE LATTER.
     46					;
     47					; INPUT:
     48					;	R3 - ADDRESS OF TWO WORD FIELD TO HOLD CONVERTED NUMBER
     49					;		WORD 1 - HIGH ORDER 16 BITS
     50					;		WORD 2 - LOW ORDER 16 BITS
     51					;	R4 - CHARACTER COUNT OF STRING
     52					;	R5 - ADDRESS OF STRING
     53					;
     54					; OUTPUT:
     55					;
     56					;	CC-C
     57					;	     CLEAR - SUCCESSFUL CONVERSION
     58					;	     SET   - ILLEGAL CHARACTERS IN STRING
     59					;
     60					; ALL REGISTERS ARE PRESERVED
     61					;
     62					;-
     63
     64						.ENABL	LSB
     65
     66	000000				.DD2CT::SAVR1			; SAVE REGISTERS
     67	000004	012701 	000012 			MOV	#10.,R1		; SET UP FOR DECIMAL RADIX ONLY
     68	000010	000404 				BR	10$
     69
     70	000012				.OD2CT::SAVR1			; SAVE REGISTERS
     71	000016	012701 	000010 			MOV	#8.,R1		; SET UP FOR OCTAL RADIX
     72
     73	000022	010502 			10$:	MOV	R5,R2		; COPY THE STRING POINTER
     74	000024	060402 				ADD	R4,R2		; POINT TO END OF STRING
     75	000026	124227 	000056 			CMPB	-(R2),#'.	; LOOK FOR TRAILING DECIMAL POINT
     76	000032	001003 				BNE	20$		; NO
     77	000034	012701 	000012 			MOV	#10.,R1		; YES - SET DECIMAL
     78	000040	005304 				DEC	R4		; REMOVE "." FROM STRING
     79
     80	000042	005046 			20$:	CLR	-(SP)		; CLEAR NEGATIVE FLAG
     81	000044	121527 	000053 			CMPB	(R5),#'+	; LOOK FOR LEADING "+"
     82	000050	001404 				BEQ	30$		; YES
     83	000052	121527 	000055 			CMPB	(R5),#'-	; LOOK FOR LEADING "-"
     84	000056	001003 				BNE	40$		; NO
     85	000060	005216 				INC	(SP)		; YES - SET NEGATIVE
     86	000062	005205 			30$:	INC	R5		; EITHER - DISPOSE OF CHARACTER
     87	000064	005304 				DEC	R4
OD2CT - CONVERT FROM ASCII TO T	MACRO M1108  05-DEC-77 23:46  PAGE 2-1


     88
     89	000066	005023 			40$:	CLR	(R3)+		; ZERO HIGH ORDER 16 BITS
     90	000070	005013 				CLR	(R3)		; ZERO LOW ORDER 16 BITS
     91
     92	000072	112502 			50$:	MOVB	(R5)+,R2	; GET NEXT CHARACTER
     93	000074	162702 	000060 			SUB	#'0,R2		; CONVERT DIGIT TO VALUE
     94	000100	103440 				BLO	90$		; NOT A LEGAL DIGIT CHARACTER
     95
     96	000102	020201 				CMP	R2,R1		; LAST CHANCE TO BE IN RANGE
     97	000104	103036 				BHIS	90$		; DEFINITELY NOT LEGAL
     98	000106	006313 				ASL	(R3)		; MULTIPLY CURRENT BINARY NUMBER BY 2
     99	000110	006143 				ROL	-(R3)		; USE FULL 32 BIT ACCURACY
    100	000112	012346 				MOV	(R3)+,-(SP)	; SAVE HIGH ORDER BITS
    101	000114	011346 				MOV	(R3),-(SP)	; SAVE LOW ORDER BITS
    102	000116	006313 				ASL	(R3)		; MULTIPLY AGAIN BY 2
    103	000120	006143 				ROL	-(R3)		; KEEP THOSE BITS MOVING
    104	000122	006363 	000002 			ASL	2(R3)		; MAKE TOTAL MULTIPLICATION BY 8
    105	000126	006123 				ROL	(R3)+		; NOW HAVE (NEW NUMBER) = (OLD NUMBER)*8
    106
    107	000130	020127 	000012 			CMP	R1,#10.		; CHECK WHAT RADIX WE'RE IN
    108	000134	001402 				BEQ	60$		; EQUAL IF DECIMAL
    109	000136	022626 				CMP	(SP)+,(SP)+	; OCTAL - THROW AWAY (OLD NUMBER)*2
    110	000140	000403 				BR	70$
    111
    112	000142	062613 			60$:	ADD	(SP)+,(R3)	; ADD BACK (OLD NUMBER)*2
    113	000144	005543 				ADC	-(R3)		; ADD ANY OVERFLOW TO HIGH ORDER
    114	000146	062623 				ADD	(SP)+,(R3)+	; NOW HAVE (NEW NUMBER) = (OLD NUMBER)*10
    115
    116	000150	060213 			70$:	ADD	R2,(R3)		; ADD THIS DIGIT TO MAKE NEW TOTAL
    117	000152	005563 	177776 			ADC	-2(R3)		; MAKE SURE OVERFLOW IS CONSIDERED
    118	000156	005304 				DEC	R4		; COUNT CHARACTERS
    119	000160	001344 				BNE	50$		; GO GET NEXT DIGIT
    120
    121	000162	005726 				TST	(SP)+		; CHECK NEGATIVE FLAG
    122	000164	001405 				BEQ	80$		; POSITIVE
    123	000166	005443 				NEG	-(R3)		; COMPLEMENT HIGH ORDER
    124	000170	005463 	000002 			NEG	2(R3)		; COMPLEMENT LOW ORDER
    125	000174	005613 				SBC	(R3)		; AND PROPAGATE THE CARRY
    126	000176	000257 				CCC			; SET SUCCESS
    127	000200				80$:	RETURN
    128
    129					; TO HERE ON AN ILLEGAL CHARACTER
    130
    131	000202	005726 			90$:	TST	(SP)+		; CLEAN THE STACK
    132	000204	000261 				SEC			; SET THE CARRY
    133	000206					RETURN
    134
    135						.DSABL	LSB
    136
    137		000001 				.END
OD2CT - CONVERT FROM ASCII TO T	MACRO M1108  05-DEC-77 23:46  PAGE 2-2
SYMBOL TABLE

.DD2CT  000000RG 	.OD2CT  000012RG 	.SAVR1= ****** GX

. ABS.	000000	   000
      	000210	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  171 WORDS  ( 1 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:05
[46,10]OD2CT,[46,20]OD2CT/-SP=[46,30]OD2CT
OVGCL	MACRO M1108  05-DEC-77 23:46  PAGE 1


      1						.TITLE	OVGCL
      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					; WRITTEN BY:
     22					;
     23					;	C.A. D'ELIA	23-MAR-74
     24					;
     25					;+
     26					;
     27					; *-$OVGCL-*-GET COMMAND LINE
     28					; *-$RVGCL-*-RESTORE COMMAND LINE TO TOP LEVEL
     29					;
     30					; INPUTS:
     31					;	R0=ADDRESS OF THE ROOT GCML BLOCK
     32					;
     33					; OUTPUTS:
     34					;	R0=UNCHANGED
     35					;	C-BIT=AS SET BY GET COMMAND LINE
     36					;
     37					; NOTES:  THIS ROUTINE ASSUMES THE EXISTENCE OF A GCML BLOCK
     38					; (IN P-SECTION $GCMLB) AND A PARTIAL GCML BLOCK, CONTAINING ONLY
     39					; THE IMPURE GCML INFORMATION (IN THE ROOT). THE USER MUST GENERATE
     40					; THE WHOLE (CALLED LOCAL) GCML BLOCK IN A PROGRAM SECTION WITH THE
     41					; FOLLOWING ATTRIBUTES:
     42					;
     43					;	.PSECT	$GCMLB,D,GBL,OVR
     44					;
     45					; THIS BLOCK IS THE ONE USED BY GET COMMAND LINE. WHEN CALLED, THIS
     46					; ROUTINE COPIES INTO IT THE IMPURE INFORMATION IN THE ROOT GCML BLOCK.
     47					; THEN IT ISSUES A CALL TO GET COMMAND LINE (.GCML1). BEFORE RETURNING
     48					; TO THE CALLER, THE IMPURE INFORMATION IS COPIED BACK INTO THE ROOT
     49					; BLOCK. THIS ALLOWS THE USER TO STILL USE GET COMMAND LINE, BUT IT
     50					; SAVES SPACE BY REQUIRING THE USER TO ONLY SUPPLY PART OF THE GCML
     51					; BLOCK IN THE ROOT.
     52					;
     53					; RESTRICTIONS: THE PURE GCML DATA IN THE ROOT MUST MATCH THAT
     54					; SPECIFIED IN THE LOCAL GCML BLOCK. SINCE THIS SCHEME WILL WORK
     55					; ONLY IF THE GCML FILE IS CLOSED AFTER EACH REQUEST, THIS ROUTINE
     56					; FORCES THAT TO OCCUR. FURTHERMORE, THE GCML BLOCKS MUST BE
     57					; CONSTRUCTED WITH PUSH-DOWN STORAGE ALLOCATED ELSEWHERE.
OVGCL	MACRO M1108  05-DEC-77 23:46  PAGE 1-1


     58					;
     59					;-
     60
     61
     62						.MCALL	CALL,RETURN,GCMLD$
     63
     64	000000					GCMLD$			;DEFINE GCML SYMBOLS
     65
     66		000140'			GCLIMP=GCLBLK+S.FDB		;ADDR OF OVERLAY GCMLB IMPURE AREA
     67
     68
     69						.ENABL	LSB
     70
     71	000000	004567 	000000G		$OVGCL::JSR	R5,.SAVR1	;SAVE REGISTERS
     72	000004	012703 	000000G			MOV	#.GCML1,R3	;SETUP TO 'GET COMMAND LINE'
     73	000010	000404 				BR	10$		;BRANCH INTO THE COMMON CODE
     74
     75	000012	004567 	000000G		$RVGCL::JSR	R5,.SAVR1	;SAVE REGISTERS
     76	000016	012703 	000000G			MOV	#.GCML2,R3	;SETUP TO 'RETURN GCML TO TOP LEVEL'
     77
     78	000022	010046 			10$:	MOV	R0,-(SP)	;SAVE R0 (ADDR OF ROOT GCML BLOCK)
     79	000024	062700 	000140 			ADD	#S.FDB,R0	;POINT R0 TO ROOT GCMLB IMPURE AREA
     80	000030	012701 	000140'			MOV	#GCLIMP,R1	;POINT R1 TO OVERLAY GCMLB IMPURE AREA
     81	000034	012702 	000010 			MOV	#G.ISIZ/2,R2	;PUT SIZE OF GCMLB IMPURE AREA IN R2
     82	000040	012021 			20$:	MOV	(R0)+,(R1)+	;COPY THE ROOT GCMLB IMPURE AREA ...
     83	000042	005302 				DEC	R2		;... INTO THE OVERLAY GCMLB ...
     84	000044	003375 				BGT	20$		;... IMPURE AREA
     85	000046	012700 	000000'			MOV	#GCLBLK,R0	;POINT R0 TO THE OVERLAY GCML BLOCK
     86	000052	152760 	000004 	000141 		BISB	#GE.CLO,G.MODE(R0)  ;FORCE GCML FILE CLOSED AFTER OPERATION
     87	000060					CALL	(R3)		;CALL THE APPROPRIATE GCML ROUTINE
     88	000062	006004 				ROR	R4		;SAVE C-BIT (GCML RETURN STATUS)
     89	000064	012701 	000140'			MOV	#GCLIMP,R1	;POINT R1 TO OVERLAY GCMLB IMPURE AREA
     90	000070	011600 				MOV	(SP),R0		;POINT R0 TO ROOT GCML BLOCK
     91	000072	062700 	000140 			ADD	#S.FDB,R0	;AND TO ROOT GCMLB IMPURE AREA
     92	000076	012702 	000010 			MOV	#G.ISIZ/2,R2	;PUT SIZE OF GCMLB IMPURE AREA IN R2
     93	000102	012120 			30$:	MOV	(R1)+,(R0)+	;COPY THE OVERLAY GCMLB IMPURE ...
     94	000104	005302 				DEC	R2		;... AREA BACK INTO THE ROOT ...
     95	000106	003375 				BGT	30$		;... GCMLB IMPURE AREA
     96	000110	012600 				MOV	(SP)+,R0	;RESTORE R0
     97	000112	006104 				ROL	R4		;RESTORE C-BIT (GCML RETURN STATUS)
     98	000114					RETURN			;RETURN TO CALLER
     99
    100						.DSABL	LSB
    101
    102
    103
    104	000000					.PSECT	$GCMLB,D,GBL,OVR
    105	000000				GCLBLK:				;REF LABEL TO OVERLAY GCML BLOCK
    106
    107
    108		000001 				.END
OVGCL	MACRO M1108  05-DEC-77 23:46  PAGE 1-2
SYMBOL TABLE

GCLBLK  000000R     002	GE.IOR= 177777   	G.ERR = 000140   	S.FNB = 000036   	$RVGCL  000012RG
GCLIMP= 000140R     002	GE.LC = 000010   	G.ISIZ= 000020   	S.FNBW= 000017   	$$    = 000013
GE.BIF= 177775   	GE.MDE= 177774   	G.MODE= 000141   	S.FNTY= 000004   	.GCML1= ****** GX
GE.CLO= 000004   	GE.OPR= 177776   	G.PSDS= 000142   	S.FTYP= 000002   	.GCML2= ****** GX
GE.COM= 000001   	G.CMLD= 000146   	S.FDB = 000140   	S.NFEN= 000020   	.SAVR1= ****** GX
GE.EOF= 177766   	G.DPRM= 000160   	S.FNAM= 000006   	$OVGCL  000000RG 	...TPC= 000140
GE.IND= 000002

. ABS.	000000	   000
      	000116	   001
$GCMLB	000000	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  1480 WORDS  ( 6 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:12
[46,10]OVGCL,[46,20]OVGCL/-SP=[46,30]OVGCL