Google
 

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


      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.
ACCESS	D0214, ACCESS A FILE	MACRO M1108  05-DEC-77 16:54  PAGE 6


      1						.TITLE	ACCESS	D0214, ACCESS A FILE
						.IDENT	"D0214"
      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					;
					; VERSION D214, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  26 FEB 75  15:52
     23					; PETER H. LIPMAN	21-JAN-74
     24					;
     25					; ACCESS QI/O - ACCESS FOR READ, ACCESS FOR READ WRITE, ACCESS FOR
     26					; READ WRITE EXTEND.
     27
     28					;
     29					;+
     30					; **.ACCES - ACCESS A FILE
     31					;
     32					; THIS ROUTINE IMPLEMENTS THE THREE ACCESS QI/O'S.
     33					; THE FCB CHAIN IS SCANNED TO SEE IF THE FILE IS ALREADY ACCESSED, AND
     34					; IF IT ISN'T, AN FCB IS ALLOCATED AND INITIALIZED. THEN A WINDOW IS ALLOCATED
     35					; AND INITIALIZED. NEXT THE VARIOUS FILE ACCESS, AND FILE PROTECTION
     36					; CHECKS ARE MADE.
     37					; THE ACCESS IS RECORDED IN THE FILE CONTROL BLOCK, AND THE STATISTICS
     38					; BLOCK AND USER FILE ATTRIBUTES ARE WRITTEN TO USER MEMORY IF DESIRED.
     39					; FINALLY THE WINDOW ADDRESS IS STORED IN THE 2ND WORD OF THE LUT.
     40					;
     41					;-
     42
     43	000000					ASSUME	W.CTL,0		; HOLDS THROUGHOUT THIS MODULE
     44
     45	000000				.ACCES::
     46	000000	010500 				MOV	R5,R0
     47	000002	062700 	000030 			ADD	#I.EXTD,R0	; POSITION TO EXTEND CONTROL
     48	000006	012001 				MOV	(R0)+,R1	; NO EXTEND ALLOWED
     49	000010	052001 				BIS	(R0)+,R1	;
     50	000012	005720 				TST	(R0)+		; ACCESS MUST BE ENABLED
     51	000014	002002 				BGE	10$		; BRANCH IF NO ACCESS REQUEST
     52	000016	052001 				BIS	(R0)+,R1	; NO FILE NAME BLOCK
     56	000020	001401 				BEQ	20$		; BRANCH IF OK
     57	000022				10$:	ERRX	IE.BAD,<BAD PARAMETERS TO ACCESS QI/O>
ACCESS	D0214, ACCESS A FILE	MACRO M1108  05-DEC-77 16:54  PAGE 6-1


	000022	   000C	   211 			TRAP	-IE.BAD		; BAD PARAMETERS TO ACCESS QI/O
     58
     59	000024				20$:
     61	000024					GETLUN	R0		; LOOK AT CALLER'S LUTN2
     62	000030	001401 				BEQ	30$
     63	000032					ERRX	IE.ALN,<FILE ALREADY ACCESSED ON LUN>
	000032	   000C	   211 			TRAP	-IE.ALN		; FILE ALREADY ACCESSED ON LUN
     64
     66	000034				30$:	CALL	.GTFID		; SET UP .FILNO, .FILSQ
     67	000040					CALL	.SCFAC		; SET .FCBAD IF FILE ACCESSED
     68	000044					CALL	.RDFHD		; READ THE HEADER
     69	000050	132767 	000100 	000014G		BITB	#UC.DLK,.HDBUF+H.UCHA ; IS DEACCESS LOCK SET?
     70	000056	001401 				BEQ	40$		; BRANCH IF NOT
     71	000060					ERRX	IE.CLO,<FILE CLOSE CHECKED>
	000060	   000C	   211 			TRAP	-IE.CLO		; FILE CLOSE CHECKED
     72
     73	000062	005767 	000000G		40$:	TST	.FCBAD		; FILE CONTROL BLOCK SET?
     74	000066	001004 				BNE	50$		; BRANCH IF YES
     75	000070					CALL	.CRFCB		; CREATE AND INITIALIZE AN FCB
     76	000074	010067 	000000G			MOV	R0,.FCBAD	; SET FCB ADDRESS
     77					;
     78					; ALLOCATE AND INITIALIZE A WINDOW
     79					;
     80	000100	116500 	000015 		50$:	MOVB	I.FCN+1(R5),R0	; R0=ACCESS FUNCTION CODE
     81	000104	162700 	000000C			SUB	#IO.ACR/256.,R0	; R0=ACCESS CODE, 0=R, 1=RW, 2=RWE
     82	000110	010046 				MOV	R0,-(SP)	; SAVE ACCESS CODE FOR PROTECTION CHECK
     83	000112					CALL	.INWIN
     84					;
     85					; SEE IF DESIRED ACCESS IS ALLOWED. IF FILE IS CURRENTLY WRITE ACCESSED,
     86					; THEN THE LOCK REQUEST BIT MUST NOT BE SET, AND IF WRITE ACCESS IS
     87					; DESIRED, THE LOCK COUNT IN THE FCB MUST BE ZERO.
     88					;
     89	000116	016700 	000000G			MOV	.FCBAD,R0	; R0=ADDRESS OF FILE CONTROL BLOCK
     90	000122	032777 	004000 	000000G		BIT	#WI.LCK,@.WNDOW	; LOCK AGAINST WRITE ACCESS REQUESTED
     91	000130	001404 				BEQ	60$		; BRANCH IF READ SHARED
     92	000132	105760 	000040 			TSTB	F.NWAC(R0)	; IS FILE CURRENTLY ACCESSED FOR WRITE
     93	000136	001401 				BEQ	60$		; BRANCH IF NO
     94	000140					ERRX	IE.WAC,<FILE IS ALREADY ACCESSED FOR WRITE>
	000140	   000C	   211 			TRAP	-IE.WAC		; FILE IS ALREADY ACCESSED FOR WRITE
     95	000142	032777 	001000 	000000G	60$:	BIT	#WI.WRV,@.WNDOW	; WRITE ACCESS DESIRED?
     96	000150	001404 				BEQ	70$		; BRANCH IF NO.
     97	000152	105760 	000037 			TSTB	F.NLCK(R0)	; ALREADY LOCKED AGAINST WRITERS
     98	000156	001401 				BEQ	70$		;
     99	000160					ERRX	IE.LCK,<FILE IS LOCKED AGAINST WRITE ACCESS>
	000160	   000C	   211 			TRAP	-IE.LCK		; FILE IS LOCKED AGAINST WRITE ACCESS
    100					;
    101					; DOES THIS USER HAVE THE PRIVILEGES NECESSARY TO ACCESS THE FILE AS HE WISHES
    102					;
    103	000162	012600 			70$:	MOV	(SP)+,R0	; R0=ACCESS CODE, 0=R, 1=RW, 2=RWE
    104	000164	006300 				ASL	R0		; FORM 2=RW, 4=RWE
    105	000166	001001 				BNE	80$
    106	000170	005200 				INC	R0		; AND 1=R
    107	000172				80$:	CALL	.PROCK		; CHECK FILE PROTECTION
    109					;
    110					; SEE IF THIS FILE HAS MULTIPLE HEADERS. IF SO, READ EACH HEADER,
    111					; CREATE AN FCB FOR IT, AND UPDATE THE WINDOW.
    112					;
ACCESS	D0214, ACCESS A FILE	MACRO M1108  05-DEC-77 16:54  PAGE 6-2


    113	000176	016746 	000000G			MOV	.FCBAD,-(SP)	; SAVE CURRENT FCB ADDR
    114	000202				90$:	CALL	.NXHDR		; READ NEXT HEADER
    115	000206	103444 				BCS	110$		; BRANCH IF NONE
    116	000210	011600 				MOV	(SP),R0		; GET LAST FCB ADDRESS
    117	000212	016000 	000002 			MOV	F.FEXT(R0),R0	; LOOK AT ITS EXTENSION POINTER
    118	000216	001027 				BNE	100$		; NEXT FCB ALREADY EXISTS
    119	000220					CALL	.CRFCB		; DOES NOT - CREATE ONE
    120	000224	011601 				MOV	(SP),R1		; GET OLD FCB ADDRESS AGAIN
    121	000226	010061 	000002 			MOV	R0,F.FEXT(R1)	; LINK NEW ONE TO ITS EXTENSION
    122	000232	016701 	000000G			MOV	.FCBAD,R1		 ; GET ADDR OF PRIMARY FCB
    123	000236	066160 	000032 	000046 		ADD	F.SIZE(R1),F.FVBN(R0)	 ; SET STARTING VBN OF NEW FCB
    124	000244	066160 	000034 	000050 		ADD	F.SIZE+2(R1),F.FVBN+2(R0) ; TO ONE PAST SIZE OF FILE
    125	000252	005560 	000046 			ADC	F.FVBN(R0)		 ; SO FAR
    126	000256	066061 	000032 	000032 		ADD	F.SIZE(R0),F.SIZE(R1)	 ; ADD SIZE OF THIS HEADER
    127	000264	066061 	000034 	000034 		ADD	F.SIZE+2(R0),F.SIZE+2(R1) ; TO TOTAL IN PRIMARY FCB
    128	000272	005561 	000032 			ADC	F.SIZE(R1)
    129
    130	000276	010016 			100$:	MOV	R0,(SP)		; UPDATE STACK
    131	000300	016701 	000000G			MOV	.WNDOW,R1	; POINT TO WINDOW
    132	000304	005002 				CLR	R2
    133	000306	012703 	000001 			MOV	#1,R3		; SET VBN = 1
    134	000312					CALL	.WTRN1		; AND UPDATE THE WINDOW
    135	000316	000731 				BR	90$		; GO FOR NEXT FILE HEADER
    136
    137	000320	005726 			110$:	TST	(SP)+		; CLEAN THE STACK
    139					;
    140					; SET ACCESS INFORMATION INTO FCB AND LINK IT INTO THE FCB LIST
    141					;
    142	000322	016700 	000000G			MOV	.FCBAD,R0	;
    143	000326	032777 	001000 	000000G		BIT	#WI.WRV,@.WNDOW	; IF THIS IS A WRITE ACCESS
    144	000334	001420 				BEQ	130$
    145	000336	105260 	000040 			INCB	F.NWAC(R0)	; COUNT THIS WRITE ACCESS
    146
    147	000342	026727 	000000G	000001 		CMP	.FILNO,#IDXFNU	; IS THIS GUY WRITE ACCESSING THE INDEX FILE?
    148	000350	001003 				BNE	120$		; NO
    149	000352	152764 	000001 	000054 		BISB	#VC.IFW,V.STAT(R4) ; YES - RECORD THE FACT
    150	000360	026727 	000000G	000002 	120$:	CMP	.FILNO,#BITFNU	; OR IS HE ACCESSING THE STORAGE BITMAP?
    151	000366	001003 				BNE	130$		; NOT EITHER
    152	000370	152764 	000002 	000054 		BISB	#VC.BMW,V.STAT(R4) ; YES - MARK THE ACCESS
    153
    154	000376	105760 	000036 		130$:	TSTB	F.NACS(R0)	; IS THIS THE FIRST ACCESSOR?
    155	000402	001007 				BNE	150$		; BRANCH IF NO.
    156	000404	010074 	000010 		140$:	MOV	R0,@V.FCB+2(R4)	; YES, ADD TO FCB LIST
    157	000410	010064 	000010 			MOV	R0,V.FCB+2(R4)	;
    159	000414	016000 	000002 			MOV	F.FEXT(R0),R0	; CHAIN TO NEXT EXTENSION FCB
    160	000420	001371 				BNE	140$		; AND LINK IT IN
    162
    163	000422				150$:
    165	000422	016700 	000000G			MOV	.FCBAD,R0
    167	000426	105260 	000036 			INCB	F.NACS(R0)	; COUNT THIS ACCESSOR
    168	000432	032777 	004000 	000000G		BIT	#WI.LCK,@.WNDOW	; REQUESTING LOCK AGAINST OTHER WRITERS?
    169	000440	001402 				BEQ	160$		; BRANCH IF NO
    170	000442	105260 	000037 			INCB	F.NLCK(R0)	; YES, COUNT IT
    171					;
    172					; ANY ERROR FROM THIS POINT ON REQUIRES A PARTIAL DEACCESS
    173					;
    174	000446	105267 	000000G		160$:	INCB	.EXSTS		; INDICATE ACCESS PHASE 1 COMPLETE
ACCESS	D0214, ACCESS A FILE	MACRO M1108  05-DEC-77 16:54  PAGE 6-3


    175					;
    176					; READ ATTRIBUTES IF SPECIFIED
    177					;
    179	000452					CALL	.RDFHD		; READ PRIMARY HEADER AGAIN
    181	000456					CALL	.RATCM
    182					;
    183					; ACCESS IS NOW COMPLETE AND SUCCESSFUL
    184					;
    185	000462					ASSUME	V.TRCT,0
    186	000462	005214 			170$:	INC	(R4)		; INCREMENT VOLUME TRANSACTION COUNT
    188	000464	016500 	000006 			MOV	I.ATL(R5),R0	; POINT TO CALLER'S ATL
    193	000470					PUTLUN	.WNDOW		; RETURN WINDOW ADDRESS
    194	000476					RETURN
    195					;
    196					;
    197	000500					$END	ACCESS
    198					;
    199					;
    200		000001 				.END
ACCESS	D0214, ACCESS A FILE	MACRO M1108  05-DEC-77 16:54  PAGE 6-4
SYMBOL TABLE

AC.DLK= 000002   	F.RVN   000012   	I.EFN   000013   	M.MAX = 000011   	WI.DLK= 010000
AC.LCK= 000001   	F.SCHA  000021   	I.EXDT= 000046   	M.RTRV= 000012   	WI.EXT= 002000
BITFNU= 000002   	F.SIZE  000032   	I.EXTD  000030   	M.USE = 000010   	WI.LCK= 004000
EX.AC1= 000001   	F.STAT  000040   	I.FCN   000014   	QIOEFN= 000002   	WI.RDV= 000400
EX.AC2= 000002   	F.STD   000004   	I.FIDP  000024   	R$$10F= 000001   	WI.WRV= 001000
EX.ADF= 000010   	F.UCHA  000020   	I.FNAM= 000000   	R$$11D= 000001   	W.CTL   000000
EX.ENA= 000200   	F11PR$= 000000   	I.FNBP  000036   	SC.BAD= 000100   	W.FCB   000002
EX.FCO= 000004   	HIFCN = 000030   	I.FTYP= 000006   	SC.MDL= 000200   	W.RTRV  000012
E$$MSG= 000001   	H.CKSM= 000776   	I.FVER= 000010   	S.HDHD= 000056   	W.STD   000004
E$$TRP= 000001   	H.FCHA= 000014   	I.IOSB  000016   	S.IDHD= 000056   	W.VBN   000006
FCPLUN= 000001   	H.FLEV= 000006   	I.LGTH  000040   	S.MPHD= 000012   	W.WISZ  000007
FC.CEF= 020000   	H.FNUM= 000002   	I.LNK   000000   	S.STBK= 000012   	$$    = 000067
FC.DIR= 040000   	H.FOWN= 000010   	I.LUN   000012   	UC.CON= 000200   	.ACCES  000000RG
FC.FCO= 010000   	H.FPRO= 000012   	I.PRI   000010   	UC.DLK= 000100   	.CRFCB= ****** GX
FC.WAC= 100000   	H.FSEQ= 000004   	I.PRM   000024   	VC.BMW= 000002   	.DFEXT= 000005
FP.DEL= 000010   	H.IDOF= 000000   	I.RTRV  000034   	VC.IFW= 000001   	.DFPRO= 164000
FP.EXT= 000004   	H.MPOF= 000001   	I.RVDT= 000014   	V.FCB   000006   	.EXSTS= ****** GX
FP.RAT= 000001   	H.PROG= 000010   	I.RVNO= 000012   	V.FFNU  000055   	.FCBAD= ****** GX
FP.RDV= 000001   	H.PROJ= 000011   	I.RVTI= 000023   	V.FIEX  000025   	.FILNO= ****** GX
FP.WRV= 000002   	H.SCHA= 000015   	I.RWAD= 000024   	V.FMAX  000016   	.GTFID= ****** GX
F$$LVL= 000001   	H.UCHA= 000014   	I.RWAT  000026   	V.FPRO  000030   	.HDBUF= ****** GX
F.DREF  000042   	H.UFAT= 000016   	I.RWCT= 000026   	V.FRBK  000034   	.INWIN= ****** GX
F.DRNM  000044   	IDXFNU= 000001   	I.RWVB= 000032   	V.IBLB  000012   	.LUTN2= ****** GX
F.FEXT  000002   	ID$$$ = 000214   	I.STD   000004   	V.IBSZ  000013   	.NXHDR= ****** GX
F.FNUM  000006   	IE.ALN= ****** GX	I.TISZ= 000006   	V.IFWI  000002   	.PRFIL= 000004
F.FOWN  000014   	IE.BAD= ****** GX	I.UIC   000022   	V.LABL  000040   	.PROCK= ****** GX
F.FPRO  000016   	IE.CLO= ****** GX	LEV11M= 000401   	V.LGTH  000056   	.RATCM= ****** GX
F.FSEQ  000010   	IE.LCK= ****** GX	LOWFCN= 000011   	V.LRUC  000035   	.RDFHD= ****** GX
F.FSQN  000013   	IE.WAC= ****** GX	MFDFNO= 000004   	V.SBCL  000021   	.RTPTF= 001401
F.FVBN  000046   	IO.ACR= ****** GX	MFDFSQ= 000004   	V.SBLB  000024   	.SCFAC= ****** GX
F.HDLB  000022   	I.ACTL  000035   	M$$HDR= 000001   	V.SBSZ  000022   	.SYUIC= 000010
F.LBN   000026   	I.AST   000020   	M.CTSZ= 000006   	V.STAT  000054   	.VBSIZ= 001000
F.LGTH  000052   	I.ATL   000006   	M.EFNU= 000002   	V.STD   000004   	.WNDOW= ****** GX
F.LINK  000000   	I.CRDT= 000031   	M.EFSQ= 000004   	V.TRCT  000000   	.WTRN1= ****** GX
F.NACS  000036   	I.CRTI= 000040   	M.ERVN= 000001   	V.WISZ  000020   	...GBL= 000000
F.NLCK  000037   	I.DASZ= 000007   	M.ESQN= 000000   	WI.BPS= 100000   	...TPC= 000012
F.NWAC  000040   	I.DPB   000011   	M.LBSZ= 000007

. ABS.	000056	   000
      	000500	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2695 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:20
[40,10]ACCESS,[40,20]ACCESS/-SP=[40,30]RSXDC,F11PRE,ACCESS
RSXDC	MACRO M1108  05-DEC-77 16:54  PAGE 3


      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.
ALLOC	D0201, ALLOCATE AND ZER	MACRO M1108  05-DEC-77 16:54  PAGE 6


      1						.TITLE	ALLOC	D0201, ALLOCATE AND ZERO CORE BLOCK
						.IDENT	"D0201"
      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					;
					; VERSION D201, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  10 SEP 74  11:24:28
     23					; PETER H. LIPMAN	22-JAN-74
     24					;
     25					; ALLOCATE AND ZERO A CORE BLOCK
     26
     27					;+
     28					; **.ALLOC-ALLOCATE AND ZERO A CORE BLOCK
     29					;
     30					; THIS ROUTINE SWITCHES TO SYSTEM STACK AND REQUESTS A CORE BLOCK
     31					; IF SUCCESSFUL IT ZEROES THE BLOCK AND RETURNS. IF NO CORE AVAILABLE IT
     32					; EXITS THROUGH ERRX.
     33					;
     34					; INPUTS:
     35					;
     36					; 	R1=NO. OF BYTES TO ALLOCATE
     38					;	R2=STD OF TASK TO CHARGE SPACE TO
     40					;
     41					; OUTPUTS:
     42					;
     43					; 	R0=ADDRESS ALLOCATED
     44					; 	R1,R2	ALTERED
     45					; 	R3-R5 	PRESERVED
     46					; 	RETURNS IN LINE IF AND ONLY IF SUCCESSFUL
     47					;-
     48
     50	000000				.ALLOC::
     51	000000					CALL	..ALCB
     52	000004	103405 				BCS	30$
     53	000006	010002 				MOV	R0,R2
     54	000010	006201 				ASR	R1
     55	000012	005022 			20$:	CLR	(R2)+
     56	000014	077102 				SOB	R1,20$
     57	000016					RETURN
ALLOC	D0201, ALLOCATE AND ZER	MACRO M1108  05-DEC-77 16:54  PAGE 6-1


     58					;
     59	000020				30$:	ERRX	IE.NOD,<FAILED TO ALLOCATE CORE BLOCK>
	000020	   000C	   211 			TRAP	-IE.NOD		; FAILED TO ALLOCATE CORE BLOCK
    100					;
    101					;
    102	000022					$END	ALLOC
    103					;
    104					;
    105		000001 				.END
ALLOC	D0201, ALLOCATE AND ZER	MACRO M1108  05-DEC-77 16:54  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.CRTI= 000040   	M$$HDR= 000001   	V.LGTH  000056
AC.LCK= 000001   	F.NACS  000036   	I.DASZ= 000007   	M.CTSZ= 000006   	V.LRUC  000035
BITFNU= 000002   	F.NLCK  000037   	I.DPB   000011   	M.EFNU= 000002   	V.SBCL  000021
EX.AC1= 000001   	F.NWAC  000040   	I.EFN   000013   	M.EFSQ= 000004   	V.SBLB  000024
EX.AC2= 000002   	F.RVN   000012   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBSZ  000022
EX.ADF= 000010   	F.SCHA  000021   	I.EXTD  000030   	M.ESQN= 000000   	V.STAT  000054
EX.ENA= 000200   	F.SIZE  000032   	I.FCN   000014   	M.LBSZ= 000007   	V.STD   000004
EX.FCO= 000004   	F.STAT  000040   	I.FIDP  000024   	M.MAX = 000011   	V.TRCT  000000
E$$MSG= 000001   	F.STD   000004   	I.FNAM= 000000   	M.RTRV= 000012   	V.WISZ  000020
E$$TRP= 000001   	F.UCHA  000020   	I.FNBP  000036   	M.USE = 000010   	WI.BPS= 100000
FCPLUN= 000001   	F11PR$= 000000   	I.FTYP= 000006   	QIOEFN= 000002   	WI.DLK= 010000
FC.CEF= 020000   	HIFCN = 000030   	I.FVER= 000010   	R$$10F= 000001   	WI.EXT= 002000
FC.DIR= 040000   	H.CKSM= 000776   	I.IOSB  000016   	R$$11D= 000001   	WI.LCK= 004000
FC.FCO= 010000   	H.FCHA= 000014   	I.LGTH  000040   	SC.BAD= 000100   	WI.RDV= 000400
FC.WAC= 100000   	H.FLEV= 000006   	I.LNK   000000   	SC.MDL= 000200   	WI.WRV= 001000
FP.DEL= 000010   	H.FNUM= 000002   	I.LUN   000012   	S.HDHD= 000056   	W.CTL   000000
FP.EXT= 000004   	H.FOWN= 000010   	I.PRI   000010   	S.IDHD= 000056   	W.FCB   000002
FP.RAT= 000001   	H.FPRO= 000012   	I.PRM   000024   	S.MPHD= 000012   	W.RTRV  000012
FP.RDV= 000001   	H.FSEQ= 000004   	I.RTRV  000034   	S.STBK= 000012   	W.STD   000004
FP.WRV= 000002   	H.IDOF= 000000   	I.RVDT= 000014   	UC.CON= 000200   	W.VBN   000006
F$$LVL= 000001   	H.MPOF= 000001   	I.RVNO= 000012   	UC.DLK= 000100   	W.WISZ  000007
F.DREF  000042   	H.PROG= 000010   	I.RVTI= 000023   	VC.BMW= 000002   	$$    = 000067
F.DRNM  000044   	H.PROJ= 000011   	I.RWAD= 000024   	VC.IFW= 000001   	.ALLOC  000000RG
F.FEXT  000002   	H.SCHA= 000015   	I.RWAT  000026   	V.FCB   000006   	.DFEXT= 000005
F.FNUM  000006   	H.UCHA= 000014   	I.RWCT= 000026   	V.FFNU  000055   	.DFPRO= 164000
F.FOWN  000014   	H.UFAT= 000016   	I.RWVB= 000032   	V.FIEX  000025   	.PRFIL= 000004
F.FPRO  000016   	IDXFNU= 000001   	I.STD   000004   	V.FMAX  000016   	.RTPTF= 001401
F.FSEQ  000010   	ID$$$ = 000201   	I.TISZ= 000006   	V.FPRO  000030   	.SYUIC= 000010
F.FSQN  000013   	IE.NOD= ****** GX	I.UIC   000022   	V.FRBK  000034   	.VBSIZ= 001000
F.FVBN  000046   	I.ACTL  000035   	LEV11M= 000401   	V.IBLB  000012   	..ALCB= ****** GX
F.HDLB  000022   	I.AST   000020   	LOWFCN= 000011   	V.IBSZ  000013   	...GBL= 000000
F.LBN   000026   	I.ATL   000006   	MFDFNO= 000004   	V.IFWI  000002   	...TPC= 000012
F.LGTH  000052   	I.CRDT= 000031   	MFDFSQ= 000004   	V.LABL  000040

. ABS.	000056	   000
      	000022	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2507 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:15
[40,10]ALLOC,[40,20]ALLOC/-SP=[40,30]RSXDC,F11PRE,ALLOC
RSXDC	MACRO M1108  05-DEC-77 16:54  PAGE 3


      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.
ATCTL	D0201, ATTRIBUTE CONTRO	MACRO M1108  05-DEC-77 16:54  PAGE 6


      1						.TITLE	ATCTL	D0201, ATTRIBUTE CONTROL TABLE
						.IDENT	"D0201"
      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					;
					; VERSION D201, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  11 JAN 75  20:12
     23					; PETER H. LIPMAN	5-MAR-74
     24					;
     25					; ATTRIBUTE CONTROL TABLE AND BIT DEFINITIONS
     26					;
     27					; BIT DEFINITIONS IN THE ATTRIBUTE CONTROL BYTE OF THE ATTRIBUTE CONTROL TABLE
     28					;
     29		000200 				AT.RO==200		; SET IF ATTRIBUTE IS READ ONLY
     30		000100 				AT.FCB==100		; SET IF ATTRIBUTE IS IN THE FCB
     31		000040 				AT.PRO==40		; SET IF ATTRIBUTE IS PROTECTED
     32		000000 				AT.HDR==0		; ATTRIBUTE IS IN HEADER AREA
     33		000001 				AT.IDN==1		; ATTRIBUTE IS IN IDENT AREA
     34		000002 				AT.MAP==2		; ATTRIBUTE IS IN MAP AREA
     35					;+
     36					; ATTRIBUTE CONTROL TABLE
     37					;
     38					; THIS TABLE CONTAINS 3 BYTES FOR EACH LEGAL ATTRIBUTE CODE FROM 1
     39					; THROUGH .ATMAX
     40					;
     41					; THE FIRST BYTE CONTAINS THE MAXIMUM NUMBER OF BYTES THAT MAY BE TRANSFERRED
     42					; FOR THIS ATTRIBUTE. A VALUE OF ZERO MEANS 512. BYTES.
     43					; 	THE SECOND BYTE IS THE BYTE OFFSET OF THE ATTRIBUTE FROM
     44					; THE BEGINNING OF THE SPECIFIED SECTION OF THE FILE HEADER OR FROM
     45					; THE FCB.  THIS VALUE IS ASSUMED AS A 7 BIT UNSIGNED VALUE
     46					; 	THE THIRD BYTE IS THE ATTRIBUTE CONTROL BYTE.
     47					; THE HIGH ORDER BITS ARE DEFINED ABOVE. THE LOW 2 BITS ARE THE HEADER
     48					; SECTION. 0=THE MAIN HEADER AREA, 1=IDENT AREA, AND 2=MAP AREA.
     49					;
     50					;-
     51
     52	000000				.ATCTL::
     53
     54	000000	   005 	   010 	   040 		.BYTE	5,H.FOWN,AT.HDR!AT.PRO	; 1-OWNER'S UIC-(& #2, #3)
ATCTL	D0201, ATTRIBUTE CONTRO	MACRO M1108  05-DEC-77 16:54  PAGE 6-1


     55	000003	   003 	   012 	   040 		.BYTE	3,H.FPRO,AT.HDR!AT.PRO	; 2-FILE PROTECTION CODE-(& #3)
     56	000006	   001 	   014 	   040 		.BYTE	1,H.UCHA,AT.HDR!AT.PRO	; 3-USER CONTROLLED FILE CHARACTERISTICS
     57	000011	   040 	   016 	   000 		.BYTE	32.,H.UFAT,AT.HDR	; 4-USER'S FILE ATTRIBUTES
     58	000014	   012 	   000 	   041 		.BYTE	10.,I.FNAM,AT.IDN!AT.PRO ; 5-FILE NAME-(& #6, #7)
     59	000017	   004 	   006 	   041 		.BYTE	4,I.FTYP,AT.IDN!AT.PRO	; 6-FILE TYPE-(& #7)
     60	000022	   002 	   010 	   041 		.BYTE	2,I.FVER,AT.IDN!AT.PRO	; 7-FILE VERSION
     61	000025	   007 	   046 	   041 		.BYTE	I.DASZ,I.EXDT,AT.IDN!AT.PRO ; 8-EXPIRATION DATE
     62	000030	   012 	   026 	   300 		.BYTE	S.STBK,F.LBN,AT.RO!AT.FCB ; 9-STATISTICS BLOCK READ ONLY
     63	000033	   000 	   000 	   200 		.BYTE	0,0,AT.RO	; 10-COMPLETE FILE HEADER READ ONLY
     64		000012 				.ATMAX==<.-.ATCTL>/3
     65		000005 				.ACBMX==<<I.LGTH+3>&177774>/6 ; ATT CTL BLOCK MAXIMUM ENTRIES
     66
     67						.EVEN
     68					;
     69					;
     70	000036					$END	ATCTL
     71					;
     72					;
     73		000001 				.END
ATCTL	D0201, ATTRIBUTE CONTRO	MACRO M1108  05-DEC-77 16:54  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.FSQN  000013   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040
AC.LCK= 000001   	F.FVBN  000046   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056
AT.FCB= 000100 G 	F.HDLB  000022   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035
AT.HDR= 000000 G 	F.LBN   000026   	I.CRTI= 000040   	M.CTSZ= 000006   	V.SBCL  000021
AT.IDN= 000001 G 	F.LGTH  000052   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBLB  000024
AT.MAP= 000002 G 	F.LINK  000000   	I.DPB   000011   	M.EFSQ= 000004   	V.SBSZ  000022
AT.PRO= 000040 G 	F.NACS  000036   	I.EFN   000013   	M.ERVN= 000001   	V.STAT  000054
AT.RO = 000200 G 	F.NLCK  000037   	I.EXDT= 000046   	M.ESQN= 000000   	V.STD   000004
BITFNU= 000002   	F.NWAC  000040   	I.EXTD  000030   	M.LBSZ= 000007   	V.TRCT  000000
EX.AC1= 000001   	F.RVN   000012   	I.FCN   000014   	M.MAX = 000011   	V.WISZ  000020
EX.AC2= 000002   	F.SCHA  000021   	I.FIDP  000024   	M.RTRV= 000012   	WI.BPS= 100000
EX.ADF= 000010   	F.SIZE  000032   	I.FNAM= 000000   	M.USE = 000010   	WI.DLK= 010000
EX.ENA= 000200   	F.STAT  000040   	I.FNBP  000036   	QIOEFN= 000002   	WI.EXT= 002000
EX.FCO= 000004   	F.STD   000004   	I.FTYP= 000006   	R$$10F= 000001   	WI.LCK= 004000
E$$MSG= 000001   	F.UCHA  000020   	I.FVER= 000010   	R$$11D= 000001   	WI.RDV= 000400
E$$TRP= 000001   	F11PR$= 000000   	I.IOSB  000016   	SC.BAD= 000100   	WI.WRV= 001000
FCPLUN= 000001   	HIFCN = 000030   	I.LGTH  000040   	SC.MDL= 000200   	W.CTL   000000
FC.CEF= 020000   	H.CKSM= 000776   	I.LNK   000000   	S.HDHD= 000056   	W.FCB   000002
FC.DIR= 040000   	H.FCHA= 000014   	I.LUN   000012   	S.IDHD= 000056   	W.RTRV  000012
FC.FCO= 010000   	H.FLEV= 000006   	I.PRI   000010   	S.MPHD= 000012   	W.STD   000004
FC.WAC= 100000   	H.FNUM= 000002   	I.PRM   000024   	S.STBK= 000012   	W.VBN   000006
FP.DEL= 000010   	H.FOWN= 000010   	I.RTRV  000034   	UC.CON= 000200   	W.WISZ  000007
FP.EXT= 000004   	H.FPRO= 000012   	I.RVDT= 000014   	UC.DLK= 000100   	.ACBMX= 000005 G
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVNO= 000012   	VC.BMW= 000002   	.ATCTL  000000RG
FP.RDV= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	VC.IFW= 000001   	.ATMAX= 000012 G
FP.WRV= 000002   	H.MPOF= 000001   	I.RWAD= 000024   	V.FCB   000006   	.DFEXT= 000005
F$$LVL= 000001   	H.PROG= 000010   	I.RWAT  000026   	V.FFNU  000055   	.DFPRO= 164000
F.DREF  000042   	H.PROJ= 000011   	I.RWCT= 000026   	V.FIEX  000025   	.PRFIL= 000004
F.DRNM  000044   	H.SCHA= 000015   	I.RWVB= 000032   	V.FMAX  000016   	.RTPTF= 001401
F.FEXT  000002   	H.UCHA= 000014   	I.STD   000004   	V.FPRO  000030   	.SYUIC= 000010
F.FNUM  000006   	H.UFAT= 000016   	I.TISZ= 000006   	V.FRBK  000034   	.VBSIZ= 001000
F.FOWN  000014   	IDXFNU= 000001   	I.UIC   000022   	V.IBLB  000012   	...GBL= 000000
F.FPRO  000016   	ID$$$ = 000201   	LEV11M= 000401   	V.IBSZ  000013   	...TPC= 000012
F.FSEQ  000010   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002

. ABS.	000056	   000
      	000036	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2522 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:16
[40,10]ATCTL,[40,20]ATCTL/-SP=[40,30]RSXDC,F11PRE,ATCTL
RSXDC	MACRO M1108  05-DEC-77 16:54  PAGE 3


      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.
BLXIO	D0200, BLOCK TRANSFER I	MACRO M1108  05-DEC-77 16:54  PAGE 6


      1						.TITLE	BLXIO	D0200, BLOCK TRANSFER IN/OUT
						.IDENT	"D0200"
      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					;
					; VERSION D200, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  13 AUG 1974
     23					; PETER H. LIPMAN	16-JAN-74
     24					;
     25					; ROUTINES TO TRANSFER DATA TO OR FROM USER MEMORY
     26					;
     27					;+
     28					; **-.BLXI-BLOCK TRANSFER IN (FROM USER MEMORY)
     29					;
     30					; THIS ROUTINE MOVES N BYTES OF DATA, ONE BYTE AT A TIME FROM USER
     31					; MEMORY TO THE TASKS ADDRESS SPACE.
     32					;
     33					; INPUTS:
     34					;
     35					; 	R0=ADDRESS OF DOUBLE WORD USER MEMORY ADDRESS
     36					; 	R1=DESTINATION ADDRESS
     37					; 	R2=BYTE COUNT
     38					;
     39					; OUTPUT:
     40					;
     41					; 	R0-R2 ALTERED
     42					; 	R3-R5 PRESERVED
     43					;
     44					;-
     45
     46						.ENABL	LSB
     59
     60	000000				.BLXI::
     61	000000					PUSH	<R3,R4>		; SAVE REGISTERS
     62	000004	010104 				MOV	R1,R4		; SHUFFLE ARGUMENTS ABOUT
     63	000006	010203 				MOV	R2,R3
     64	000010	011002 				MOV	(R0),R2		; USER VIRTUAL ADDRESS
     65	000012	016701 	000000G			MOV	.IOPKT,R1	; GET I/O PACKET ADDRESS
     66	000016					CALL	..BLXI		; CALL ROUTINE IN SYSTEM COMMON
BLXIO	D0200, BLOCK TRANSFER I	MACRO M1108  05-DEC-77 16:54  PAGE 6-1


     67	000022	103013 				BCC	20$
     68
     69	000024				10$:	ERRX	IE.SPC,<ILLEGAL USER BUFFER ADDRESS>
	000024	   000C	   211 			TRAP	-IE.SPC		; ILLEGAL USER BUFFER ADDRESS
BLXIO	D0200, BLOCK TRANSFER I	MACRO M1108  05-DEC-77 16:54  PAGE 7


     72					;+
     73					; **-.BLXO-TRANSFER OUT (TO USER MEMORY)
     74					;
     75					; THIS ROUTINE TRANSFERS N BYTES OF DATA FROM THE TASK'S ADDRESS
     76					; SPACE TO USER MEMORY
     77					;
     78					; INPUTS:
     79					;
     80					; 	R0=SOURCE ADDRESS (TASK ADDRESS SPACE)
     81					; 	R1=ADDRESS OF DOUBLE WORD USER MEMORY ADDRESS
     82					; 	R2=BYTE COUNT
     83					;
     84					; OUTPUTS:
     85					;
     86					; 	R0-R2 ALTERED
     87					; 	R3-R5 PRESERVED
     88					;-
     89
    106	000026				.BLXO::
    107	000026					PUSH	<R3,R4>		; SAVE REGISTERS
    108	000032	010004 				MOV	R0,R4		; PUSH ARGUMENTS ABOUT
    109	000034	010203 				MOV	R2,R3
    110	000036	011102 				MOV	(R1),R2		; USER VIRTUAL ADDRESS
    111	000040	016701 	000000G			MOV	.IOPKT,R1	; GET I/O PACKET ADDRESS
    112	000044					CALL	..BLXO		; CALL SYSTEM COMMON
    113	000050	103765 				BCS	10$
    114	000052				20$:	POP	<R4,R3>		; RESTORE REGISTERS
    115	000056					RETURN
    117
    118
    119						.DSABL	LSB
    120
    121					;
    122					;
    123	000060					$END	BLXIO
    124					;
    125					;
    126		000001 				.END
BLXIO	D0200, BLOCK TRANSFER I	MACRO M1108  05-DEC-77 16:54  PAGE 7-1
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.DPB   000011   	M.EFNU= 000002   	V.SBCL  000021
AC.LCK= 000001   	F.NLCK  000037   	I.EFN   000013   	M.EFSQ= 000004   	V.SBLB  000024
BITFNU= 000002   	F.NWAC  000040   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBSZ  000022
EX.AC1= 000001   	F.RVN   000012   	I.EXTD  000030   	M.ESQN= 000000   	V.STAT  000054
EX.AC2= 000002   	F.SCHA  000021   	I.FCN   000014   	M.LBSZ= 000007   	V.STD   000004
EX.ADF= 000010   	F.SIZE  000032   	I.FIDP  000024   	M.MAX = 000011   	V.TRCT  000000
EX.ENA= 000200   	F.STAT  000040   	I.FNAM= 000000   	M.RTRV= 000012   	V.WISZ  000020
EX.FCO= 000004   	F.STD   000004   	I.FNBP  000036   	M.USE = 000010   	WI.BPS= 100000
E$$MSG= 000001   	F.UCHA  000020   	I.FTYP= 000006   	QIOEFN= 000002   	WI.DLK= 010000
E$$TRP= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$10F= 000001   	WI.EXT= 002000
FCPLUN= 000001   	HIFCN = 000030   	I.IOSB  000016   	R$$11D= 000001   	WI.LCK= 004000
FC.CEF= 020000   	H.CKSM= 000776   	I.LGTH  000040   	SC.BAD= 000100   	WI.RDV= 000400
FC.DIR= 040000   	H.FCHA= 000014   	I.LNK   000000   	SC.MDL= 000200   	WI.WRV= 001000
FC.FCO= 010000   	H.FLEV= 000006   	I.LUN   000012   	S.HDHD= 000056   	W.CTL   000000
FC.WAC= 100000   	H.FNUM= 000002   	I.PRI   000010   	S.IDHD= 000056   	W.FCB   000002
FP.DEL= 000010   	H.FOWN= 000010   	I.PRM   000024   	S.MPHD= 000012   	W.RTRV  000012
FP.EXT= 000004   	H.FPRO= 000012   	I.RTRV  000034   	S.STBK= 000012   	W.STD   000004
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	UC.CON= 000200   	W.VBN   000006
FP.RDV= 000001   	H.IDOF= 000000   	I.RVNO= 000012   	UC.DLK= 000100   	W.WISZ  000007
FP.WRV= 000002   	H.MPOF= 000001   	I.RVTI= 000023   	VC.BMW= 000002   	$$    = 000067
F$$LVL= 000001   	H.PROG= 000010   	I.RWAD= 000024   	VC.IFW= 000001   	.BLXI   000000RG
F.DREF  000042   	H.PROJ= 000011   	I.RWAT  000026   	V.FCB   000006   	.BLXO   000026RG
F.DRNM  000044   	H.SCHA= 000015   	I.RWCT= 000026   	V.FFNU  000055   	.DFEXT= 000005
F.FEXT  000002   	H.UCHA= 000014   	I.RWVB= 000032   	V.FIEX  000025   	.DFPRO= 164000
F.FNUM  000006   	H.UFAT= 000016   	I.STD   000004   	V.FMAX  000016   	.IOPKT= ****** GX
F.FOWN  000014   	IDXFNU= 000001   	I.TISZ= 000006   	V.FPRO  000030   	.PRFIL= 000004
F.FPRO  000016   	ID$$$ = 000200   	I.UIC   000022   	V.FRBK  000034   	.RTPTF= 001401
F.FSEQ  000010   	IE.SPC= ****** GX	LEV11M= 000401   	V.IBLB  000012   	.SYUIC= 000010
F.FSQN  000013   	I.ACTL  000035   	LOWFCN= 000011   	V.IBSZ  000013   	.VBSIZ= 001000
F.FVBN  000046   	I.AST   000020   	MFDFNO= 000004   	V.IFWI  000002   	..BLXI= ****** GX
F.HDLB  000022   	I.ATL   000006   	MFDFSQ= 000004   	V.LABL  000040   	..BLXO= ****** GX
F.LBN   000026   	I.CRDT= 000031   	M$$HDR= 000001   	V.LGTH  000056   	...GBL= 000000
F.LGTH  000052   	I.CRTI= 000040   	M.CTSZ= 000006   	V.LRUC  000035   	...TPC= 000012
F.LINK  000000   	I.DASZ= 000007

. ABS.	000056	   000
      	000060	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2522 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[40,10]BLXIO,[40,20]BLXIO/-SP=[40,30]RSXDC,F11PRE,BLXIO
RSXDC	MACRO M1108  05-DEC-77 16:55  PAGE 3


      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.
CKSUM	D0200, CALCULATE AND CH	MACRO M1108  05-DEC-77 16:55  PAGE 6


      1						.TITLE	CKSUM	D0200, CALCULATE AND CHECK A CHECKSUM
						.IDENT	"D0200"
      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					;
					; VERSION D200, ASSEMBLED FOR RSX-11D
					;
     20
     21					; ANDREW C. GOLDSTEIN  13 AUG 1974
     22					; PETER H. LIPMAN	7-MAR-74
     23					;
     24					; CALCULATE AND CHECK A FILES-11 ADDITIVE CHECKSUM
     25					;
     26					;+
     27					; **-.CKSUM-CALCULATE AND CHECK A CHECKSUM
     28					;
     29					; THIS ROUTINE CALCULATES THE FILES 11 ADDITIVE CHECKSUM AND COMPARES
     30					; IT AGAINST THE CHECKSUM WORD.
     31					;
     32					; INPUTS:
     33					;
     34					; 	R1=ADDRESS OF DATA TO CHECKSUM
     35					;
     36					; OUTPUTS:
     37					;
     38					; 	C=0 IF CHECKSUM IS OK
     39					; 	C=1 IF CHECKSUM DOES NOT AGREE
     40					; 	R0=CHECKSUM VALUE CALCULATED
     41					; 	R1=ADDRESS TO STORE CHECKSUM
     42					; 	R2=0
     43					; 	R3-R5 PRESERVED
     44					;
     45					; **-.CKSM1-ALTERNATE ENTRY TO CHECKSUM ROUTINE
     46					;
     47					; THIS ENTRY POINT IS USED FOR CHECKING/CALCULATING
     48					; THE FIRST CHECKSUM WORD IN THE HOME BLOCK
     49					;
     50					; INPUTS:
     51					;
     52					; 	R1=ADDRESS OF DATA TO CHECKSUM
     53					; 	R2=NO. OF WORDS -2 TO CHECKSUM (27.)
     54					;
CKSUM	D0200, CALCULATE AND CH	MACRO M1108  05-DEC-77 16:55  PAGE 6-1


     55					;-
     56
     57	000000				.CKSUM::
     58	000000	012702 	000376 			MOV	#<.VBSIZ/2>-2,R2
     59					;
     60					; R2=NO. OF WORDS -2 TO CHECK
     61					;
     62	000004				.CKSM1::
     63	000004	012100 				MOV	(R1)+,R0
     64	000006	062100 			10$:	ADD	(R1)+,R0
     65	000010	077202 				SOB	R2,10$
     66	000012	020011 				CMP	R0,(R1)
     67	000014	001401 				BEQ	20$		; CARRY CLEAR
     68	000016	000261 				SEC
     69	000020				20$:	RETURN
     70					;
     71					;
     72	000022					$END	CKSUM
     73					;
     74					;
     75		000001 				.END
CKSUM	D0200, CALCULATE AND CH	MACRO M1108  05-DEC-77 16:55  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.DASZ= 000007   	M$$HDR= 000001   	V.LABL  000040
AC.LCK= 000001   	F.NACS  000036   	I.DPB   000011   	M.CTSZ= 000006   	V.LGTH  000056
BITFNU= 000002   	F.NLCK  000037   	I.EFN   000013   	M.EFNU= 000002   	V.LRUC  000035
EX.AC1= 000001   	F.NWAC  000040   	I.EXDT= 000046   	M.EFSQ= 000004   	V.SBCL  000021
EX.AC2= 000002   	F.RVN   000012   	I.EXTD  000030   	M.ERVN= 000001   	V.SBLB  000024
EX.ADF= 000010   	F.SCHA  000021   	I.FCN   000014   	M.ESQN= 000000   	V.SBSZ  000022
EX.ENA= 000200   	F.SIZE  000032   	I.FIDP  000024   	M.LBSZ= 000007   	V.STAT  000054
EX.FCO= 000004   	F.STAT  000040   	I.FNAM= 000000   	M.MAX = 000011   	V.STD   000004
E$$MSG= 000001   	F.STD   000004   	I.FNBP  000036   	M.RTRV= 000012   	V.TRCT  000000
E$$TRP= 000001   	F.UCHA  000020   	I.FTYP= 000006   	M.USE = 000010   	V.WISZ  000020
FCPLUN= 000001   	F11PR$= 000000   	I.FVER= 000010   	QIOEFN= 000002   	WI.BPS= 100000
FC.CEF= 020000   	HIFCN = 000030   	I.IOSB  000016   	R$$10F= 000001   	WI.DLK= 010000
FC.DIR= 040000   	H.CKSM= 000776   	I.LGTH  000040   	R$$11D= 000001   	WI.EXT= 002000
FC.FCO= 010000   	H.FCHA= 000014   	I.LNK   000000   	SC.BAD= 000100   	WI.LCK= 004000
FC.WAC= 100000   	H.FLEV= 000006   	I.LUN   000012   	SC.MDL= 000200   	WI.RDV= 000400
FP.DEL= 000010   	H.FNUM= 000002   	I.PRI   000010   	S.HDHD= 000056   	WI.WRV= 001000
FP.EXT= 000004   	H.FOWN= 000010   	I.PRM   000024   	S.IDHD= 000056   	W.CTL   000000
FP.RAT= 000001   	H.FPRO= 000012   	I.RTRV  000034   	S.MPHD= 000012   	W.FCB   000002
FP.RDV= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	S.STBK= 000012   	W.RTRV  000012
FP.WRV= 000002   	H.IDOF= 000000   	I.RVNO= 000012   	UC.CON= 000200   	W.STD   000004
F$$LVL= 000001   	H.MPOF= 000001   	I.RVTI= 000023   	UC.DLK= 000100   	W.VBN   000006
F.DREF  000042   	H.PROG= 000010   	I.RWAD= 000024   	VC.BMW= 000002   	W.WISZ  000007
F.DRNM  000044   	H.PROJ= 000011   	I.RWAT  000026   	VC.IFW= 000001   	.CKSM1  000004RG
F.FEXT  000002   	H.SCHA= 000015   	I.RWCT= 000026   	V.FCB   000006   	.CKSUM  000000RG
F.FNUM  000006   	H.UCHA= 000014   	I.RWVB= 000032   	V.FFNU  000055   	.DFEXT= 000005
F.FOWN  000014   	H.UFAT= 000016   	I.STD   000004   	V.FIEX  000025   	.DFPRO= 164000
F.FPRO  000016   	IDXFNU= 000001   	I.TISZ= 000006   	V.FMAX  000016   	.PRFIL= 000004
F.FSEQ  000010   	ID$$$ = 000200   	I.UIC   000022   	V.FPRO  000030   	.RTPTF= 001401
F.FSQN  000013   	I.ACTL  000035   	LEV11M= 000401   	V.FRBK  000034   	.SYUIC= 000010
F.FVBN  000046   	I.AST   000020   	LOWFCN= 000011   	V.IBLB  000012   	.VBSIZ= 001000
F.HDLB  000022   	I.ATL   000006   	MFDFNO= 000004   	V.IBSZ  000013   	...GBL= 000000
F.LBN   000026   	I.CRDT= 000031   	MFDFSQ= 000004   	V.IFWI  000002   	...TPC= 000012
F.LGTH  000052   	I.CRTI= 000040

. ABS.	000056	   000
      	000022	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2497 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:15
[40,10]CKSUM,[40,20]CKSUM/-SP=[40,30]RSXDC,F11PRE,CKSUM
RSXDC	MACRO M1108  05-DEC-77 16:55  PAGE 3


      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.
CLACC	D0207, CLEANUP FROM ACC	MACRO M1108  05-DEC-77 16:55  PAGE 6


      1						.TITLE	CLACC	D0207, CLEANUP FROM ACCESS ERROR
						.IDENT	"D0207"
      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					;
					; VERSION D207, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  20 MAR 75  18:03
     23					; PETER H. LIPMAN	14-MAR-74
     24					;
     25					; ROUTINE TO CLEAN UP FROM AN ABORTED ACCESS QI/O
     26					;
     27					;+
     28					; **.CLACC-CLEAN UP FROM ABORTED ACCESS QI/O
     29					;
     30					; IF .EXSTS=0 THEN RELEASE THE WINDOW IF .WNDOW IS NON ZERO AND RELEASE
     31					; 	THE FILE CONTROL BLOCK IF .FCBAD IS NON-ZERO AND ACCESS COUNT
     32					; 	IS ZERO.
     33					; IF .EXSTS=1 THEN DEACCESS THE FCB AND RELEASE IT IF NO OTHER ACCESSES.
     34					; 	ALSO RELEASE THE WINDOW
     35					; IN BOTH CASES ZERO THE 2ND WORD OF THE LUT.
     36					;
     37					; INPUT:
     38					;
     39					; 	R0=.EXSTS
     40					; 	R4=VOLUME CONTROL BLOCK ADDRESS
     41					; 	R5=I/O PACKET ADDRESS
     42					;
     43					; OUTPUT:
     44					;
     45					; 	R0-R3 ALTERED
     46					; 	R4-R5 PRESERVED
     47					;
     48					;-
     49
     50						.ENABL	LSB
     51
     52	000000	005700 			.CLACC::TST	R0		; IF .EXSTS=1, THEN
     53	000002	001021 				BNE	.CLAC1		; DEACCESS FCB, RELEASE WINDOW
     54	000004	016700 	000000G			MOV	.FCBAD,R0	; OTHERWISE RELEASE FCB IF NECESSARY
CLACC	D0207, CLEANUP FROM ACC	MACRO M1108  05-DEC-77 16:55  PAGE 6-1


     55	000010	001477 				BEQ	60$		;
     56	000012	105760 	000036 			TSTB	F.NACS(R0)	; ANY OTHER ACCESSORS?
     57	000016	001074 				BNE	60$		; BRANCH IF YES
     58	000020	012701 	000052 			MOV	#F.LGTH,R1	;
     60	000024	016002 	000002 		10$:	MOV	F.FEXT(R0),R2	; PICK UP FCB EXTENSION POINTER
     62	000030					CALL	.RLEAS		; RELEASE THE FCB
     64	000034	010200 				MOV	R2,R0		; GET ADDR OF NEXT FCB EXTENSION
     65	000036	001372 				BNE	10$		; AND RELEASE IT
     67	000040	005067 	000000G			CLR	.FCBAD		; AND SAY FCB IS RELEASED
     68	000044	000461 				BR	60$		; AND GO RELEASE THE WINDOW
     69					;
     70					; ENTER HERE TO DEACCESS THE FCB (IF IT EXISTS) AND RELEASE THE WINDOW
     71					;
     72	000046				.CLAC1::PUTLUN	#0		; ZERO LUTN2
     73	000052	016700 	000000G			MOV	.FCBAD,R0
     74	000056	001454 				BEQ	60$		; BRANCH IF NO FCB
     75	000060	032777 	004000 	000000G		BIT	#WI.LCK,@.WNDOW	; LOCKED FOR THIS USER?
     76	000066	001402 				BEQ	20$		; BRANCH IF NO
     77	000070	105360 	000037 			DECB	F.NLCK(R0)	; YES, DECREMENT THE LOCK COUNT
     78	000074	032777 	001000 	000000G	20$:	BIT	#WI.WRV,@.WNDOW	; IF THIS USER WAS WRITING
     79	000102	001427 				BEQ	40$		;
     80	000104	105360 	000040 			DECB	F.NWAC(R0)	; BUMP DOWN THE WRITE ACCESS COUNT
     81	000110	001024 				BNE	40$		; BRANCH IF THERE ARE OTHER WRITE ACCESSORS
     82	000112	026727 	000000G	000001 		CMP	.FILNO,#IDXFNU	; WAS THIS A WRITE ACCESS TO THE INDEX FILE?
     83	000120	001003 				BNE	30$		; NO
     84	000122	142764 	000001 	000054 		BICB	#VC.IFW,V.STAT(R4) ; YES -  NOTE IT NO LONGER ACCESSED
     85	000130	026727 	000000G	000002 	30$:	CMP	.FILNO,#BITFNU	; OR WAS THIS A WRITE ACCESS TO THE BITMAP?
     86	000136	001011 				BNE	40$		; NO
     87	000140	142764 	000002 	000054 		BICB	#VC.BMW,V.STAT(R4) ; YES - MARK NOT ACCESSED ANY MORE
     88	000146	026767 	000000G	000000G		CMP	.SMUCB,.UCBAD	; WAS A BITMAP BLOCK FROM THIS VOLUME IN CORE?
     89	000154	001002 				BNE	40$		; NO
     90	000156	005067 	000000G			CLR	.SMUCB		; YES - INVALIDATE IT
     91
     92	000162	105360 	000036 		40$:	DECB	F.NACS(R0)	; LAST ACCESSOR?
     93	000166	001010 				BNE	60$		; BRANCH IF NO
     95	000170	016002 	000002 		50$:	MOV	F.FEXT(R0),R2	; PICK UP EXTENSION POINTER
     97	000174					CALL	.RLFCB		; RELEASE THE FCB
     99	000200	010200 				MOV	R2,R0		; GET EXTENSION, IF ANY
    100	000202	001372 				BNE	50$		; AND RELEASE IT
    102	000204	005067 	000000G			CLR	.FCBAD		; NOTE THAT FCB IS RELEASED
    103					;
    104					; RELEASE THE WINDOW
    105					;
    106	000210	016700 	000000G		60$:	MOV	.WNDOW,R0
    107	000214	001414 				BEQ	70$		; BRANCH IF NO WINDOW
    108	000216	116001 	000007 			MOVB	W.WISZ(R0),R1	; R1=SIZE IN RTRV PTRS OF WINDOW
    114	000222	006301 				ASL	R1
    115	000224	010146 				MOV	R1,-(SP)
    116	000226	006301 				ASL	R1
    117	000230	062601 				ADD	(SP)+,R1
    119	000232	062701 	000012 			ADD	#W.RTRV,R1	; R1=SIZE IN BYTES OF WINDOW
    120	000236					CALL	.RLEAS		; RELEASE CORE BLOCK TO SYSTEM.
    121	000242	005067 	000000G			CLR	.WNDOW		; NOTE WINDOW RELEASED
    122	000246				70$:	RETURN
    123
    124						.DSABL	LSB
    125					;
CLACC	D0207, CLEANUP FROM ACC	MACRO M1108  05-DEC-77 16:55  PAGE 6-2


    126					; CLEAN UP FROM DIRECTORY OPERATION
    127					;
    128	000250				.CLDIR::
    129	000250	016700 	000000G			MOV	.FCBAD,R0
    130	000254	001406 				BEQ	80$		; BRANCH IF NO FCB
    131	000256	032760 	040000 	000040 		BIT	#FC.DIR,F.STAT(R0) ; IS FCB IN DIRECTORY LRU?
    132	000264	001402 				BEQ	80$		; BRANCH IF NO
    133	000266	005067 	000000G			CLR	.FCBAD		; YES, JUST SAY NO FCB PRESENT
    134	000272	005000 			80$:	CLR	R0
    135	000274					GETLUN	-(SP)
    136	000300					CALL	.CLACC
    137	000304					PUTLUN	(SP)+
    138	000310					RETURN
    139					;
    140					;
    141	000312					$END	CLACC
    142					;
    143					;
    144		000001 				.END
CLACC	D0207, CLEANUP FROM ACC	MACRO M1108  05-DEC-77 16:55  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.NLCK  000037   	I.EXTD  000030   	M.LBSZ= 000007   	V.TRCT  000000
AC.LCK= 000001   	F.NWAC  000040   	I.FCN   000014   	M.MAX = 000011   	V.WISZ  000020
BITFNU= 000002   	F.RVN   000012   	I.FIDP  000024   	M.RTRV= 000012   	WI.BPS= 100000
EX.AC1= 000001   	F.SCHA  000021   	I.FNAM= 000000   	M.USE = 000010   	WI.DLK= 010000
EX.AC2= 000002   	F.SIZE  000032   	I.FNBP  000036   	QIOEFN= 000002   	WI.EXT= 002000
EX.ADF= 000010   	F.STAT  000040   	I.FTYP= 000006   	R$$10F= 000001   	WI.LCK= 004000
EX.ENA= 000200   	F.STD   000004   	I.FVER= 000010   	R$$11D= 000001   	WI.RDV= 000400
EX.FCO= 000004   	F.UCHA  000020   	I.IOSB  000016   	SC.BAD= 000100   	WI.WRV= 001000
E$$MSG= 000001   	F11PR$= 000000   	I.LGTH  000040   	SC.MDL= 000200   	W.CTL   000000
E$$TRP= 000001   	HIFCN = 000030   	I.LNK   000000   	S.HDHD= 000056   	W.FCB   000002
FCPLUN= 000001   	H.CKSM= 000776   	I.LUN   000012   	S.IDHD= 000056   	W.RTRV  000012
FC.CEF= 020000   	H.FCHA= 000014   	I.PRI   000010   	S.MPHD= 000012   	W.STD   000004
FC.DIR= 040000   	H.FLEV= 000006   	I.PRM   000024   	S.STBK= 000012   	W.VBN   000006
FC.FCO= 010000   	H.FNUM= 000002   	I.RTRV  000034   	UC.CON= 000200   	W.WISZ  000007
FC.WAC= 100000   	H.FOWN= 000010   	I.RVDT= 000014   	UC.DLK= 000100   	$$    = 000067
FP.DEL= 000010   	H.FPRO= 000012   	I.RVNO= 000012   	VC.BMW= 000002   	.CLACC  000000RG
FP.EXT= 000004   	H.FSEQ= 000004   	I.RVTI= 000023   	VC.IFW= 000001   	.CLAC1  000046RG
FP.RAT= 000001   	H.IDOF= 000000   	I.RWAD= 000024   	V.FCB   000006   	.CLDIR  000250RG
FP.RDV= 000001   	H.MPOF= 000001   	I.RWAT  000026   	V.FFNU  000055   	.DFEXT= 000005
FP.WRV= 000002   	H.PROG= 000010   	I.RWCT= 000026   	V.FIEX  000025   	.DFPRO= 164000
F$$LVL= 000001   	H.PROJ= 000011   	I.RWVB= 000032   	V.FMAX  000016   	.FCBAD= ****** GX
F.DREF  000042   	H.SCHA= 000015   	I.STD   000004   	V.FPRO  000030   	.FILNO= ****** GX
F.DRNM  000044   	H.UCHA= 000014   	I.TISZ= 000006   	V.FRBK  000034   	.LUTN2= ****** GX
F.FEXT  000002   	H.UFAT= 000016   	I.UIC   000022   	V.IBLB  000012   	.PRFIL= 000004
F.FNUM  000006   	IDXFNU= 000001   	LEV11M= 000401   	V.IBSZ  000013   	.RLEAS= ****** GX
F.FOWN  000014   	ID$$$ = 000207   	LOWFCN= 000011   	V.IFWI  000002   	.RLFCB= ****** GX
F.FPRO  000016   	I.ACTL  000035   	MFDFNO= 000004   	V.LABL  000040   	.RTPTF= 001401
F.FSEQ  000010   	I.AST   000020   	MFDFSQ= 000004   	V.LGTH  000056   	.SMUCB= ****** GX
F.FSQN  000013   	I.ATL   000006   	M$$HDR= 000001   	V.LRUC  000035   	.SYUIC= 000010
F.FVBN  000046   	I.CRDT= 000031   	M.CTSZ= 000006   	V.SBCL  000021   	.UCBAD= ****** GX
F.HDLB  000022   	I.CRTI= 000040   	M.EFNU= 000002   	V.SBLB  000024   	.VBSIZ= 001000
F.LBN   000026   	I.DASZ= 000007   	M.EFSQ= 000004   	V.SBSZ  000022   	.WNDOW= ****** GX
F.LGTH  000052   	I.DPB   000011   	M.ERVN= 000001   	V.STAT  000054   	...GBL= 000000
F.LINK  000000   	I.EFN   000013   	M.ESQN= 000000   	V.STD   000004   	...TPC= 000012
F.NACS  000036   	I.EXDT= 000046

. ABS.	000056	   000
      	000312	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2570 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:18
[40,10]CLACC,[40,20]CLACC/-SP=[40,30]RSXDC,F11PRE,CLACC
RSXDC	MACRO M1108  05-DEC-77 16:55  PAGE 3


      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.
CLCRE	D0201, CLEANUP FROM ABO	MACRO M1108  05-DEC-77 16:55  PAGE 6


      1						.TITLE	CLCRE	D0201, CLEANUP FROM ABORTED CREATE QIO
						.IDENT	"D0201"
      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					;
					; VERSION D201, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  21 FEB 75  23:34
     23
     24					;
     25					; CLEANUP ABORTED CREATE FILE QI/O
     26					;
     27
     28					;
     29					; RETURN WRITE ATTRIBUTE NODE IF NON ZERO ADDRESS
     30					; IF	.EXSTS=0, EXIT
     31					; IF	.EXSTS=1, THEN USING .FILNO, RELEASE THE HEADER FROM INDEX FILE BIT MAP.
     32					; IF	.EXSTS>=2, THEN DELETE THE FILE, MAKING SURE THAT THE
     33					; HEADER IN CORE IS USED AND THE HEADER IS ZEROED.
     34					;
     35
     36	000000				.CLCRE::
     37					;
     38					; SET CONTEXT TO DELETE SO THAT THE FILE WILL GO AWAY EVEN IF THE
     39					; CLEANUP FAILS.
     40					;
     41	000000	112767 	000000C	000000G		MOVB	#<<IO.DEL/256.>-<LOWFCN-1>>*2,.EXDSP
     42	000006	005300 				DEC	R0		; IF .EXSTS=0, THEN NOTHING TO DO
     43	000010	002413 				BLT	30$
     44	000012	001004 				BNE	10$		; IF .EXSTS .GT. 1, THEN DELETE FILE
     45	000014	016701 	000000G			MOV	.FILNO,R1	; GET FILE NUMBER
     46	000020					CALLR	.DLHD1		; JUST RELEASE THE HEADER FROM THE INDEX FILE BIT MAP
     47	000024				10$:
     49	000024	016500 	000026 			MOV	I.FIDP+2(R5),R0	; ZERO THE FILE ID
     50	000030	005020 				CLR	(R0)+
     51	000032	005010 				CLR	(R0)
     73
     74	000034				20$:	CALLR	.DLFIL		; DELETE THE FILE
     75	000040				30$:	RETURN
     76					;
CLCRE	D0201, CLEANUP FROM ABO	MACRO M1108  05-DEC-77 16:55  PAGE 6-1


     77					;
     78	000042					$END	CLCRE
     79					;
     80					;
     81		000001 				.END
CLCRE	D0201, CLEANUP FROM ABO	MACRO M1108  05-DEC-77 16:55  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.DASZ= 000007   	M.CTSZ= 000006   	V.LRUC  000035
AC.LCK= 000001   	F.NLCK  000037   	I.DPB   000011   	M.EFNU= 000002   	V.SBCL  000021
BITFNU= 000002   	F.NWAC  000040   	I.EFN   000013   	M.EFSQ= 000004   	V.SBLB  000024
EX.AC1= 000001   	F.RVN   000012   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBSZ  000022
EX.AC2= 000002   	F.SCHA  000021   	I.EXTD  000030   	M.ESQN= 000000   	V.STAT  000054
EX.ADF= 000010   	F.SIZE  000032   	I.FCN   000014   	M.LBSZ= 000007   	V.STD   000004
EX.ENA= 000200   	F.STAT  000040   	I.FIDP  000024   	M.MAX = 000011   	V.TRCT  000000
EX.FCO= 000004   	F.STD   000004   	I.FNAM= 000000   	M.RTRV= 000012   	V.WISZ  000020
E$$MSG= 000001   	F.UCHA  000020   	I.FNBP  000036   	M.USE = 000010   	WI.BPS= 100000
E$$TRP= 000001   	F11PR$= 000000   	I.FTYP= 000006   	QIOEFN= 000002   	WI.DLK= 010000
FCPLUN= 000001   	HIFCN = 000030   	I.FVER= 000010   	R$$10F= 000001   	WI.EXT= 002000
FC.CEF= 020000   	H.CKSM= 000776   	I.IOSB  000016   	R$$11D= 000001   	WI.LCK= 004000
FC.DIR= 040000   	H.FCHA= 000014   	I.LGTH  000040   	SC.BAD= 000100   	WI.RDV= 000400
FC.FCO= 010000   	H.FLEV= 000006   	I.LNK   000000   	SC.MDL= 000200   	WI.WRV= 001000
FC.WAC= 100000   	H.FNUM= 000002   	I.LUN   000012   	S.HDHD= 000056   	W.CTL   000000
FP.DEL= 000010   	H.FOWN= 000010   	I.PRI   000010   	S.IDHD= 000056   	W.FCB   000002
FP.EXT= 000004   	H.FPRO= 000012   	I.PRM   000024   	S.MPHD= 000012   	W.RTRV  000012
FP.RAT= 000001   	H.FSEQ= 000004   	I.RTRV  000034   	S.STBK= 000012   	W.STD   000004
FP.RDV= 000001   	H.IDOF= 000000   	I.RVDT= 000014   	UC.CON= 000200   	W.VBN   000006
FP.WRV= 000002   	H.MPOF= 000001   	I.RVNO= 000012   	UC.DLK= 000100   	W.WISZ  000007
F$$LVL= 000001   	H.PROG= 000010   	I.RVTI= 000023   	VC.BMW= 000002   	.CLCRE  000000RG
F.DREF  000042   	H.PROJ= 000011   	I.RWAD= 000024   	VC.IFW= 000001   	.DFEXT= 000005
F.DRNM  000044   	H.SCHA= 000015   	I.RWAT  000026   	V.FCB   000006   	.DFPRO= 164000
F.FEXT  000002   	H.UCHA= 000014   	I.RWCT= 000026   	V.FFNU  000055   	.DLFIL= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.RWVB= 000032   	V.FIEX  000025   	.DLHD1= ****** GX
F.FOWN  000014   	IDXFNU= 000001   	I.STD   000004   	V.FMAX  000016   	.EXDSP= ****** GX
F.FPRO  000016   	ID$$$ = 000201   	I.TISZ= 000006   	V.FPRO  000030   	.FILNO= ****** GX
F.FSEQ  000010   	IO.DEL= ****** GX	I.UIC   000022   	V.FRBK  000034   	.PRFIL= 000004
F.FSQN  000013   	I.ACTL  000035   	LEV11M= 000401   	V.IBLB  000012   	.RTPTF= 001401
F.FVBN  000046   	I.AST   000020   	LOWFCN= 000011   	V.IBSZ  000013   	.SYUIC= 000010
F.HDLB  000022   	I.ATL   000006   	MFDFNO= 000004   	V.IFWI  000002   	.VBSIZ= 001000
F.LBN   000026   	I.CRDT= 000031   	MFDFSQ= 000004   	V.LABL  000040   	...GBL= 000000
F.LGTH  000052   	I.CRTI= 000040   	M$$HDR= 000001   	V.LGTH  000056   	...TPC= 000012
F.LINK  000000

. ABS.	000056	   000
      	000042	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2595 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:15
[40,10]CLCRE,[40,20]CLCRE/-SP=[40,30]RSXDC,F11PRE,CLCRE
RSXDC	MACRO M1108  05-DEC-77 16:56  PAGE 3


      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.
CLCOM	D0200, SMALL CLEANUP RO	MACRO M1108  05-DEC-77 16:56  PAGE 6


      1						.TITLE	CLCOM	D0200, SMALL CLEANUP ROUTINES
						.IDENT	"D0200"
      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					;
     20					;
					; VERSION D200, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  21 FEB 75  19:28
CLCOM	D0200, SMALL CLEANUP RO	MACRO M1108  05-DEC-77 16:56  PAGE 7


     24					;+
     25					;
     26					; CLEAN UP FROM ACP CONTROL OPERATION.
     27					; SINCE THE ONLY CONTROL FUNCTIONS AT PRESENT ARE MOUNT AND DISMOUNT,
     28					; THERE IS NO FURTHER DISPATCH.
     29					; THE SUBFUNCTION IS FOUND IN .EXSTS.
     30					;
     31					;-
     32
     33	000000				.CLCTL::
     34	000000	020027 	000001 			CMP	R0,#1		; SEE IF A MOUNT WAS IN PROGRESS
     35	000004	001401 				BEQ	.CLMOU		; YES
     36	000006					RETURN			; NO OTHER CLEANUP REQUIRED
     37
     38					;+
     39					;
     40					; CLEAN UP FROM ABORTED MOUNT VOLUME OPERATION
     41					;
     42					; RELEASE ALL CONTROL BLOCKS ALLOCATED SO FAR
     43					;
     44					;-
     45
     46	000010				.CLMOU::
     47	000010	005704 				TST	R4		; SEE IF A VCB EXISTS
     48	000012	001431 				BEQ	30$		; NO
     49
     50	000014	016400 	000002 			MOV	V.IFWI(R4),R0	; LOOK AT INDEX FILE WINDOW
     51	000020	001412 				BEQ	10$		; NONE
     52	000022	116001 	000007 			MOVB	W.WISZ(R0),R1	; GET RETRIEVAL POINTER COUNT
     53	000026					MUL	#6,R1		; COMPUTE BYTE COUNT
     54	000036	062701 	000012 			ADD	#W.RTRV,R1	; COMPUTE TOTAL WINDOW SIZE
     55	000042					CALL	.RLEAS		; RELEASE THE WINDOW
     56
     57	000046	016400 	000006 		10$:	MOV	V.FCB(R4),R0	; LOOK AT INDEX FILE FCB
     58	000052	001404 				BEQ	20$		; NONE
     59	000054	012701 	000052 			MOV	#F.LGTH,R1	; GET BYTE COUNT
     60	000060					CALL	.RLEAS		; RELEASE THE FCB
     61
     62	000064	010400 			20$:	MOV	R4,R0		; GET VCB ADDRESS
     63	000066	012701 	000056 			MOV	#V.LGTH,R1	; GET BYTE COUNT
     64	000072					CALL	.RLEAS		; RELEASE THE VCB
     65
     66	000076	016703 	000000G		30$:	MOV	.UCBAD,R3	; POINT TO THE PUD
     67	000102	005063 	000000G			CLR	U.VA(R3)	; CLEAN OUT VCB POINTER
     68	000106	005063 	000000G			CLR	U.ACP(R3)	; ZAP OUT ACP POINTER IN PUD
     69	000112	116363 	000001G	000000G		MOVB	U.CH+1(R3),U.CH(R3) ; RESTORE OFF LINE CHARACTERISTICS
     70	000120					RETURN
CLCOM	D0200, SMALL CLEANUP RO	MACRO M1108  05-DEC-77 16:56  PAGE 8


     72					;+
     73					;
     74					; CLEAN UP FROM ABORTED DELETE QI/O
     75					;
     76					; IF .EXTST=0 THEN NOTHING TO DO; IF .EXTST=1 THEN RELEASE THE FILE HEADER
     77					; FROM THE INDEX FILE BIT MAP.
     78					; IF THIS IS AN ABORTED TRUNCATE, FIX UP THE HEADER TO MAP ONLY
     79					; THE TRUNCATED FILE AND WRITE IT OUT.
     80					;
     81					; INPUTS:
     82					;
     83					; 	R0=.EXSTS
     84					;-
     85
     86	000122				.CLDEL::
     87	000122	005700 				TST	R0		; IF .EXSTS=0 THEN NO CLEANUP
     88	000124	003415 				BLE	20$
     89	000126	005067 	000000G			CLR	.SMUCB		; INVALIDATE BITMAP BUFFER
     90	000132	005067 	000000G			CLR	.SMVBN		; SINCE IT MAY BE DIRTY
     91	000136	126527 	000015 	000000C		CMPB	I.FCN+1(R5),#IO.CRE/256. ; SEE IF THIS WAS A CREATE ORIGINALLY
     92	000144	001403 				BEQ	10$		; IF SO, DO THE DELETE
     93	000146	005765 	000030 			TST	I.EXTD(R5)	; CHECK THE EXTEND CONTROL IN THE QIO
     94	000152	002403 				BLT	30$		; ON - THIS WAS A TRUNCATE
     95	000154				10$:	CALL	.DLHDR		; OTHERWISE JUST RELEASE THE HEADER
     96	000160				20$:	RETURN
     97					;
     98					; CLEAN UP ABORTED TRUNCATE OPERATION.
     99					;
    100	000162				30$:
    102	000162	026767 	000000G	000002G		CMP	.EXHDR,.HDBUF+H.FNUM ; SEE IF THIS IS THE STARTING HEADER
    103	000170	001371 				BNE	10$		; JUST RELEASE THE HEADER IF NOT
    105	000172					CALL	.GTMAP		; POINT TO MAP AREA
    107	000176					ASSUME	M.ESQN,0
    108	000176					ASSUME	M.EFNU,M.ESQN+2
    109	000176					ASSUME	M.EFSQ,M.EFNU+2
    110	000176					ASSUME	M.CTSZ,M.EFSQ+2
    111	000176					ASSUME	M.USE,M.CTSZ+2
    112	000176					ASSUME	M.RTRV,M.USE+2
    113	000176	005721 				TST	(R1)+
    114	000200	005021 				CLR	(R1)+		; CLEAR HEADER'S EXTENSION DATA
    115	000202	005021 				CLR	(R1)+
    116	000204	005721 				TST	(R1)+		; SKIP OVER COUNT FIELD SIZE
    120	000206	116711 	000000G			MOVB	.EXTSV,(R1)	; PUT IN TRUNCATED POINTER COUNT
    121	000212	005000 				CLR	R0
    122	000214	151100 				BISB	(R1),R0		; GET COUNT
    123	000216	001405 				BEQ	40$		; EMPTY HEADER
    124	000220	060001 				ADD	R0,R1		; POINT AT LAST VALID RETRIEVAL POINTER
    125	000222	060001 				ADD	R0,R1
    126	000224	116761 	000001G	177777 		MOVB	.EXTSV+1,-1(R1)	; FIX BLOCK COUNT OF LAST POINTER
    127	000232	005721 			40$:	TST	(R1)+		; POINT TO NEXT POINTER
    128	000234	005021 			50$:	CLR	(R1)+		; ZERO OUT REST OF HEADER
    129	000236	020127 	001000G			CMP	R1,#.HDBUF+.VBSIZ
    130	000242	103774 				BLO	50$
    131	000244					CALL	.WRHDR		; WRITE THE CLEANED UP HEADER
    132	000250					CALLR	@.CLFC1		; AND CLEAN UP ASSOCIATED FCB'S
    133
    134					;+
CLCOM	D0200, SMALL CLEANUP RO	MACRO M1108  05-DEC-77 16:56  PAGE 8-1


    135					;
    136					; CLEANUP FROM ABORTED READ ATTRIBUTES
    137					; 	IF .EXSTS =0 THEN NOTHING TO DO
    138					; 	IF .EXSTS =1 THEN RELEASE FCB IN .FCBAD
    139					;
    140					; INPUTS:
    141					;
    142					; 	R0=.EXSTS
    143					;-
    144
    145	000254				.CLRAT::
    146	000254	005700 				TST	R0		; IF ZERO THEN NOTHING TO DO
    147	000256	001406 				BEQ	60$
    148	000260	016700 	000000G			MOV	.FCBAD,R0	; OTHERWISE RELEASE THE FCB
    149	000264	012701 	000052 			MOV	#F.LGTH,R1
    150	000270					CALL	.RLEAS
    151	000274				60$:	RETURN
    152					;
    153					;+
    154					;
    155					; CLEANUP FROM ABORTED WRITE ATTRIBUTES
    156					; 	IF .EXSTS =0 THEN NOTHING TO DO
    157					; 	IF .EXSTS =1 THEN MUST WRITE FILE HEADER
    158					;
    159					; INPUTS:
    160					;
    161					; 	R0=.EXSTS
    162					;-
    163
    164	000276				.CLWAT::
    165	000276	005700 				TST	R0		; IF .EXSTS=1
    166	000300	002404 				BLT	80$		; NEGATIVE IF WRITE ERROR
    167	000302	001402 				BEQ	70$
    168	000304					CALL	.WRHDR		; WRITE FILE HEADER
    169	000310				70$:	RETURN
    170	000312	000177 	000000G		80$:	JMP	@.CLFC1		; CLEAN UP FCB IF FILE IS ACCESSED
    171					;
    172					;
    173	000316					$END	CLNUP
    174					;
    175					;
    176		000001 				.END
CLCOM	D0200, SMALL CLEANUP RO	MACRO M1108  05-DEC-77 16:56  PAGE 8-2
SYMBOL TABLE

AC.DLK= 000002   	F.RVN   000012   	I.FNAM= 000000   	R$$11D= 000001   	WI.LCK= 004000
AC.LCK= 000001   	F.SCHA  000021   	I.FNBP  000036   	SC.BAD= 000100   	WI.RDV= 000400
BITFNU= 000002   	F.SIZE  000032   	I.FTYP= 000006   	SC.MDL= 000200   	WI.WRV= 001000
EX.AC1= 000001   	F.STAT  000040   	I.FVER= 000010   	S.HDHD= 000056   	W.CTL   000000
EX.AC2= 000002   	F.STD   000004   	I.IOSB  000016   	S.IDHD= 000056   	W.FCB   000002
EX.ADF= 000010   	F.UCHA  000020   	I.LGTH  000040   	S.MPHD= 000012   	W.RTRV  000012
EX.ENA= 000200   	F11PR$= 000000   	I.LNK   000000   	S.STBK= 000012   	W.STD   000004
EX.FCO= 000004   	HIFCN = 000030   	I.LUN   000012   	UC.CON= 000200   	W.VBN   000006
E$$MSG= 000001   	H.CKSM= 000776   	I.PRI   000010   	UC.DLK= 000100   	W.WISZ  000007
E$$TRP= 000001   	H.FCHA= 000014   	I.PRM   000024   	U.ACP = ****** GX	$MUL  = ****** GX
FCPLUN= 000001   	H.FLEV= 000006   	I.RTRV  000034   	U.CH  = ****** GX	$$    = 000067
FC.CEF= 020000   	H.FNUM= 000002   	I.RVDT= 000014   	U.VA  = ****** GX	.CLCTL  000000RG
FC.DIR= 040000   	H.FOWN= 000010   	I.RVNO= 000012   	VC.BMW= 000002   	.CLDEL  000122RG
FC.FCO= 010000   	H.FPRO= 000012   	I.RVTI= 000023   	VC.IFW= 000001   	.CLFC1= ****** GX
FC.WAC= 100000   	H.FSEQ= 000004   	I.RWAD= 000024   	V.FCB   000006   	.CLMOU  000010RG
FP.DEL= 000010   	H.IDOF= 000000   	I.RWAT  000026   	V.FFNU  000055   	.CLRAT  000254RG
FP.EXT= 000004   	H.MPOF= 000001   	I.RWCT= 000026   	V.FIEX  000025   	.CLWAT  000276RG
FP.RAT= 000001   	H.PROG= 000010   	I.RWVB= 000032   	V.FMAX  000016   	.DFEXT= 000005
FP.RDV= 000001   	H.PROJ= 000011   	I.STD   000004   	V.FPRO  000030   	.DFPRO= 164000
FP.WRV= 000002   	H.SCHA= 000015   	I.TISZ= 000006   	V.FRBK  000034   	.DLHDR= ****** GX
F$$LVL= 000001   	H.UCHA= 000014   	I.UIC   000022   	V.IBLB  000012   	.EXHDR= ****** GX
F.DREF  000042   	H.UFAT= 000016   	LEV11M= 000401   	V.IBSZ  000013   	.EXTSV= ****** GX
F.DRNM  000044   	IDXFNU= 000001   	LOWFCN= 000011   	V.IFWI  000002   	.FCBAD= ****** GX
F.FEXT  000002   	ID$$$ = 000200   	MFDFNO= 000004   	V.LABL  000040   	.GTMAP= ****** GX
F.FNUM  000006   	IO.CRE= ****** GX	MFDFSQ= 000004   	V.LGTH  000056   	.HDBUF= ****** GX
F.FOWN  000014   	I.ACTL  000035   	M$$HDR= 000001   	V.LRUC  000035   	.PRFIL= 000004
F.FPRO  000016   	I.AST   000020   	M.CTSZ= 000006   	V.SBCL  000021   	.RLEAS= ****** GX
F.FSEQ  000010   	I.ATL   000006   	M.EFNU= 000002   	V.SBLB  000024   	.RTPTF= 001401
F.FSQN  000013   	I.CRDT= 000031   	M.EFSQ= 000004   	V.SBSZ  000022   	.SMUCB= ****** GX
F.FVBN  000046   	I.CRTI= 000040   	M.ERVN= 000001   	V.STAT  000054   	.SMVBN= ****** GX
F.HDLB  000022   	I.DASZ= 000007   	M.ESQN= 000000   	V.STD   000004   	.SYUIC= 000010
F.LBN   000026   	I.DPB   000011   	M.LBSZ= 000007   	V.TRCT  000000   	.UCBAD= ****** GX
F.LGTH  000052   	I.EFN   000013   	M.MAX = 000011   	V.WISZ  000020   	.VBSIZ= 001000
F.LINK  000000   	I.EXDT= 000046   	M.RTRV= 000012   	WI.BPS= 100000   	.WRHDR= ****** GX
F.NACS  000036   	I.EXTD  000030   	M.USE = 000010   	WI.DLK= 010000   	...GBL= 000000
F.NLCK  000037   	I.FCN   000014   	QIOEFN= 000002   	WI.EXT= 002000   	...TPC= 000012
F.NWAC  000040   	I.FIDP  000024   	R$$10F= 000001

. ABS.	000056	   000
      	000316	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2665 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:19
[40,10]CLCOM,[40,20]CLCOM/-SP=[40,30]RSXDC,F11PRE,CLCOM
RSXDC	MACRO M1108  05-DEC-77 16:56  PAGE 3


      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.
CLDAC	D0202, CLEAN UP AND DEA	MACRO M1108  05-DEC-77 16:56  PAGE 6


      1						.TITLE	CLDAC	D0202, CLEAN UP AND DEACCESS FILE
						.IDENT	"D0202"
      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					;
					; VERSION D202, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  24 SEP 74  11:20:54
     23					; PETER H. LIPMAN	22-JAN-74
     24					;
     25					; DEACCESS FILE CONTROL BLOCK, RELEASE FCB AND WINDOW
     26					;
     27					;+
     28					;
     29					; **.CLDAC-CLEAN UP AND DEACCESS THE FILE CONTROL BLOCK
     30					;
     31					; THIS ROUTINE DEACCESSES THE FCB AND RELEASES THE WINDOW.
     32					; THEN IF THIS WAS THE LAST ACCESSOR AND THE FILE WAS MARKED FOR
     33					; DELETE, IT DELETES THE FILE.  IF THIS WAS NOT THE LAST ACCESSOR
     34					; OR THE FILE WAS NOT MARKED FOR DELETE, THEN IT WRITES THE FILE
     35					; HEADER IF .EXSTS >1.
     36					;
     37					; INPUTS:
     38					;
     39					; 	.EXSTS=-1 IF WRITE ERROR OCCURRED DURING DEACCESSS
     40					;	.EXSTS=0 IF DEACCESS IS TO BE REJECTED (DO NOTHING)
     41					; 	.EXSTS=1 IF ONLY RELEASING FCB AND WINDOW (IF THEY EXIST)
     42					; 	.EXSTS=2 IF ALSO CHECKING DELETE BIT
     43					; 	.EXSTS=3 IF ALSO WRITING THE FILE HEADER
     44					; 	R4=VCB ADDRESS
     45					; 	R5=I/O PACKET ADDRESS
     46					; 	.FCBAD=FILE CONTROL BLOCK ADDRESS
     47					; 	.WNDOW=WINDOW ADDRESS
     48					;
     49					; OUTPUTS:
     50					;
     51					; 	R0-R3 ALTERED
     52					; 	R4-R5 PRESERVED
     53					; 	ALWAYS RETURNS IN LINE
     54					;
CLDAC	D0202, CLEAN UP AND DEA	MACRO M1108  05-DEC-77 16:56  PAGE 6-1


     55					;-
     56
     57	000000				.CLDAC::
     58	000000	105767 	000000G			TSTB	.EXSTS		; CHECK EXIT STATUS
     59	000004	001001 				BNE	10$
     63	000006					RETURN			; ZERO MEANS DEACCESS REJECTED - NO ACTION
     64
     65	000010				10$:	CALL	.CLAC1		; DEACCESS THE FCB AND RELEASE THE WINDOW
     66	000014	116700 	000000G			MOVB	.EXSTS,R0
     67	000020	005300 				DEC	R0
     68	000022	002417 				BLT	40$		; NEGATIVE MEANS WRITE ERROR DURING DEACCESS
     69	000024	001414 				BEQ	30$		; BRANCH IF NOTHING ELSE TO DO
     70	000026	005767 	000000G			TST	.FCBAD		; IF FCB STILL EXISTS
     71	000032	001005 				BNE	20$		; THEN IT'S STILL ACCESSED, IGNORE DELETE
     72	000034					ASSUME	SC.MDL,200	; MARK FOR DELETE BIT IS SIGN BIT OF BYTE
     73	000034	105767 	000015G			TSTB	.HDBUF+H.SCHA	; IS FILE MARKED FOR DELETE?
     74	000040	100002 				BPL	20$		; BRANCH IF NO
     75	000042	000177 	000000G			JMP	@.DLFL1		; YES, DELETE IT NOW AND RETURN
     76
     77	000046	005300 			20$:	DEC	R0		; MUST WE WRITE THE FILE HEADER?
     78	000050	001402 				BEQ	30$		; BRANCH IF NO
     79	000052					CALL	.WRHDR		; YES, WRITE IT NOW
     80	000056				30$:	CALLR	.DMOCK
     81
     82	000062	000177 	000000G		40$:	JMP	@.CLFC1		; CLEAN UP FCB AFTER WRITE ERROR
     83					;
     84					;
     85	000066					$END	CLDAC
     86					;
     87					;
     88		000001 				.END
CLDAC	D0202, CLEAN UP AND DEA	MACRO M1108  05-DEC-77 16:56  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.EFN   000013   	M.ERVN= 000001   	V.STAT  000054
AC.LCK= 000001   	F.NLCK  000037   	I.EXDT= 000046   	M.ESQN= 000000   	V.STD   000004
BITFNU= 000002   	F.NWAC  000040   	I.EXTD  000030   	M.LBSZ= 000007   	V.TRCT  000000
EX.AC1= 000001   	F.RVN   000012   	I.FCN   000014   	M.MAX = 000011   	V.WISZ  000020
EX.AC2= 000002   	F.SCHA  000021   	I.FIDP  000024   	M.RTRV= 000012   	WI.BPS= 100000
EX.ADF= 000010   	F.SIZE  000032   	I.FNAM= 000000   	M.USE = 000010   	WI.DLK= 010000
EX.ENA= 000200   	F.STAT  000040   	I.FNBP  000036   	QIOEFN= 000002   	WI.EXT= 002000
EX.FCO= 000004   	F.STD   000004   	I.FTYP= 000006   	R$$10F= 000001   	WI.LCK= 004000
E$$MSG= 000001   	F.UCHA  000020   	I.FVER= 000010   	R$$11D= 000001   	WI.RDV= 000400
E$$TRP= 000001   	F11PR$= 000000   	I.IOSB  000016   	SC.BAD= 000100   	WI.WRV= 001000
FCPLUN= 000001   	HIFCN = 000030   	I.LGTH  000040   	SC.MDL= 000200   	W.CTL   000000
FC.CEF= 020000   	H.CKSM= 000776   	I.LNK   000000   	S.HDHD= 000056   	W.FCB   000002
FC.DIR= 040000   	H.FCHA= 000014   	I.LUN   000012   	S.IDHD= 000056   	W.RTRV  000012
FC.FCO= 010000   	H.FLEV= 000006   	I.PRI   000010   	S.MPHD= 000012   	W.STD   000004
FC.WAC= 100000   	H.FNUM= 000002   	I.PRM   000024   	S.STBK= 000012   	W.VBN   000006
FP.DEL= 000010   	H.FOWN= 000010   	I.RTRV  000034   	UC.CON= 000200   	W.WISZ  000007
FP.EXT= 000004   	H.FPRO= 000012   	I.RVDT= 000014   	UC.DLK= 000100   	$$    = 000067
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVNO= 000012   	VC.BMW= 000002   	.CLAC1= ****** GX
FP.RDV= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	VC.IFW= 000001   	.CLDAC  000000RG
FP.WRV= 000002   	H.MPOF= 000001   	I.RWAD= 000024   	V.FCB   000006   	.CLFC1= ****** GX
F$$LVL= 000001   	H.PROG= 000010   	I.RWAT  000026   	V.FFNU  000055   	.DFEXT= 000005
F.DREF  000042   	H.PROJ= 000011   	I.RWCT= 000026   	V.FIEX  000025   	.DFPRO= 164000
F.DRNM  000044   	H.SCHA= 000015   	I.RWVB= 000032   	V.FMAX  000016   	.DLFL1= ****** GX
F.FEXT  000002   	H.UCHA= 000014   	I.STD   000004   	V.FPRO  000030   	.DMOCK= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.TISZ= 000006   	V.FRBK  000034   	.EXSTS= ****** GX
F.FOWN  000014   	IDXFNU= 000001   	I.UIC   000022   	V.IBLB  000012   	.FCBAD= ****** GX
F.FPRO  000016   	ID$$$ = 000202   	LEV11M= 000401   	V.IBSZ  000013   	.HDBUF= ****** GX
F.FSEQ  000010   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002   	.PRFIL= 000004
F.FSQN  000013   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040   	.RTPTF= 001401
F.FVBN  000046   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056   	.SYUIC= 000010
F.HDLB  000022   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035   	.VBSIZ= 001000
F.LBN   000026   	I.CRTI= 000040   	M.CTSZ= 000006   	V.SBCL  000021   	.WRHDR= ****** GX
F.LGTH  000052   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBLB  000024   	...GBL= 000000
F.LINK  000000   	I.DPB   000011   	M.EFSQ= 000004   	V.SBSZ  000022   	...TPC= 000012

. ABS.	000056	   000
      	000066	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2542 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:16
[40,10]CLDAC,[40,20]CLDAC/-SP=[40,30]RSXDC,F11PRE,CLDAC
RSXDC	MACRO M1108  05-DEC-77 16:56  PAGE 3


      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.
CLEXT	D0211, CLEANUP FROM EXT	MACRO M1108  05-DEC-77 16:56  PAGE 6


      1						.TITLE	CLEXT	D0211, CLEANUP FROM EXTEND FAILURE
						.IDENT	"D0211"
      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					;
					; VERSION D211, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  21 FEB 75  17:49
     23					; PETER H. LIPMAN	27-FEB-74
     24					;
     25					; CLEAN UP FROM ABORTED EXTEND REQUEST
     26					;
     27					;+
     28					; **-.CLEXT-CLEAN UP FROM ABORTED EXTEND FILE REQUEST
     29					;
     30					; THIS ROUTINE DELETES ALL BLOCKS ALLOCATED TO A FILE DUE TO AN ABORTED ATTEMPT TO
     31					; EXTEND THE FILE
     32					;
     33					; INPUTS:
     34					;
     35					;	.EXSTS = 0 OR NEG: NO CLEANUP NECESSARY
     36					;	.EXSTS = 1:	NORMAL CLEANUP OF HEADERS (HEADER IN CORE)
     37					;	.EXSTS = 2:	LAST HEADER WRITTEN
     38					;	.EXSTS = 3:	LAST HEADER ALLOCATED, BUT NOT VALID
     39					; 	THE BYTE .EXTSV CONTAINS THE ORIGINAL NO. OF WORDS
     40					; 		OF RETRIEVAL POINTERS IN USE
     41					; 	THE BYTE .EXTSV+1 CONTAINS THE BLOCK COUNT -1
     42					; 		OF THE LAST VALID RETRIEVAL POINTER
     43					; 	.HDBUF ASSUMED TO CONTAIN THE LAST HEADER IN PROCESS
     44					;	.EXHDR = FILE NO. OF HEADER IN WHICH EXTEND STARTED
     45					;	.EXNHD = NO. OF NEW HEADERS CREATED
     46					;
     47					; OUTPUTS:
     48					;
     49					; 	R0-R3 ALTERED
     50					; 	R4-R5 PRESERVED
     51					;
     52					;-
     53
     54	000000				.CLEXT::
CLEXT	D0211, CLEANUP FROM EXT	MACRO M1108  05-DEC-77 16:56  PAGE 6-1


     55	000000	005700 				TST	R0		; NEGATIVE EXSTS MEANS WRITE ERROR HAPPENED
     56	000002	003570 				BLE	120$		; BRANCH IF NEGATIVE, (PROBABLY WRITE LOCKED)
     57	000004	016701 	000000G			MOV	.SM1BT,R1	; PICK UP UNRECORDED BUT ALLOCATED
     58	000010	016702 	000002G			MOV	.SM1BT+2,R2	; BLOCKS
     59	000014	010146 				MOV	R1,-(SP)
     60	000016	050226 				BIS	R2,(SP)+	; SEE IF THERE WERE ANY
     61	000020	001402 				BEQ	10$		; NO
     62	000022					CALL	.SMDEL		; YES - RETURN THEM
     63	000026				10$:
     65	000026	116700 	000000G			MOVB	.EXSTS,R0	; CHECK EXIT STATUS AGAIN
     66	000032	105300 				DECB	R0		; SEE IF A HEADER EXTENSION WAS IN PROGRESS
     67	000034	001407 				BEQ	20$		; NO
     68	000036	105300 				DECB	R0		; DID WE CREATE A NEW HEADER ALREADY?
     69	000040	001414 				BEQ	30$		; NO
     70	000042	016701 	000000G			MOV	.EXFNU,R1	; YES - GET ITS FILE NUMBER
     71	000046					CALL	.DLHD1		; FREE THE NEWLY ALLOCATED HEADER
     72	000052	000407 				BR	30$
     73
     74	000054	005367 	000000G		20$:	DEC	.EXNHD		; SEE IF WE CREATED ANY NEW HEADERS
     75	000060	002410 				BLT	40$		; NO
     76	000062					CALL	.DLBLK		; YES - FREE THE BLOCKS IN IT
     77	000066					CALL	.DLHDR		; AND FREE THE HEADER
     78	000072	016700 	000000G		30$:	MOV	.EXHDR,R0	; GET FILE NO. OF STARTING HEADER
     79	000076					CALL	.RHDFN		; AND READ IT
     81
     82	000102	016703 	000000G		40$:	MOV	.EXTSV,R3
     83	000106					CALL	.GTMAP		; POINT TO HEADER MAP AREA
     84	000112	062701 	000010 			ADD	#M.USE,R1	; TO POINTER USE COUNT, IN PARTICULAR
     85	000116	010100 				MOV	R1,R0
     86	000120	005046 				CLR	-(SP)		; RESERVE SPACE FOR SAVED RETRIEVAL PTR
     87	000122	005046 				CLR	-(SP)
     88	000124	005740 				TST	-(R0)		; SET SO THAT ADD OF RTRV PTR CNT
     89									; WILL POINT AT LAST LEGAL RTRV PTR
     90	000126	005002 				CLR	R2
     91	000130	150302 				BISB	R3,R2		; R2=SAVED COUNT OF RTRV PTR WORDS IN USE
     92	000132	001427 				BEQ	50$		; BRANCH IF DELETING EVERYTHING
     93	000134	006302 				ASL	R2		; BYTES OF RTRV PTRS IN USE
     94	000136	060200 				ADD	R2,R0		; R0=2ND WORD OF LAST LEGAL RETRIEVAL PTR
     95	000140	105003 				CLRB	R3
     96	000142	000303 				SWAB	R3		; R3=COUNT -1 OF ORIGINAL RTRV PTR
     97	000144	005002 				CLR	R2
     98	000146	156002 	000001 			BISB	1(R0),R2	; R2=CURRENT RETRIEVAL POINTER COUNT
     99	000152	160302 				SUB	R3,R2		; IF CURRENT SIZE=SAVED SIZE
    100	000154	001416 				BEQ	50$		; START DELETE FROM NEXT RTRV PTR
    101					;
    102					; SOME BLOCKS WERE ADDED TO THIS RETRIEVAL POINTER, SAVE THE LBN AND
    103					; ORIGINAL COUNT, SET THE RETRIEVAL POINTER TO REFLECT JUST THE NEW
    104					; PORTION, AND DELETE STARTING AT THE RETRIEVAL POINTER
    105					;
    106	000156	016066 	000002 	000002 		MOV	2(R0),2(SP)	; SAVE THE RETRIEVAL POINTER
    107	000164	011016 				MOV	(R0),(SP)
    108	000166	110366 	000001 			MOVB	R3,1(SP)	; WITH THE OLD BLOCK COUNT
    109	000172	005302 				DEC	R2		; R2=BLOCK COUNT -1 OF ADDED CHUNK
    110	000174	110260 	000001 			MOVB	R2,1(R0)
    111	000200	005203 				INC	R3		; R3=ACTUAL COUNT OF ORIGINAL BLOCKS
    112	000202	060360 	000002 			ADD	R3,2(R0)	; ADJUST LBN TO STARTING LBN OF NEW CHUNK
    113	000206	005510 				ADC	(R0)
CLEXT	D0211, CLEANUP FROM EXT	MACRO M1108  05-DEC-77 16:56  PAGE 6-2


    114	000210	000401 				BR	60$
    115	000212	022020 			50$:	CMP	(R0)+,(R0)+	; POINT TO NEXT RETRIEVAL POINTER
    116					;
    117					; R0=POINTER TO FIRST RETRIEVAL POINTER TO DELETE, R1=POINTER TO M.USE
    118					;
    119	000214	010046 			60$:	MOV	R0,-(SP)
    120	000216	010146 				MOV	R1,-(SP)
    121	000220					CALL	.DLBL1		; RELEASE THE BLOCKS
    122	000224	012601 				MOV	(SP)+,R1
    123	000226	012600 				MOV	(SP)+,R0
    124	000230	012620 				MOV	(SP)+,(R0)+	; RESTORE SAVED RETRIEVAL POINTER
    125	000232	012620 				MOV	(SP)+,(R0)+	; IT'S ZERO IF NONE SAVED
    126	000234	005020 			70$:	CLR	(R0)+		; ZERO THE REST OF THE RTRV PTRS
    127	000236	020027 	000776G			CMP	R0,#.HDBUF+.VBSIZ-2
    128	000242	103774 				BLO	70$
    129	000244	116711 	000000G			MOVB	.EXTSV,(R1)	; RESTORE SAVED "IN USE" COUNT
    131					;
    132					; CLEAN UP ALL SUBSEQUENT HEADERS - CLEAN OUT EXTENSION DATA, RELEASE
    133					; BLOCKS ALLOCATED, AND RELEASE THE HEADERS.
    134					;
    135	000250				80$:	CALL	.GTMAP		; POINT TO MAP AREA
    136	000254					ASSUME	M.ESQN,0
    137	000254					ASSUME	M.EFNU,M.ESQN+2
    138	000254					ASSUME	M.EFSQ,M.EFNU+2
    139	000254					PUSH	(R1)+		; SAVE HEADER EXTENSION DATA
    140	000256					PUSH	(R1)
    141	000260	005021 				CLR	(R1)+		; CLEANING IT OUT AS WE GO
    142	000262					PUSH	(R1)
    143	000264	005021 				CLR	(R1)+
    144	000266	026767 	000002G	000000G		CMP	.HDBUF+H.FNUM,.EXHDR ; SEE IF THIS THE STARTING HEADER
    145	000274	001003 				BNE	90$		; NO
    146	000276					CALL	.WRHDR		; FIRST HEADER WAS RESTORED ABOVE - JUST
    147	000302	000404 				BR	100$		; WRITE IT OUT
    148
    149	000304				90$:	CALL	.DLBLK		; SUBSEQUENT HEADER - RELEASE ITS BLOCKS
    150	000310					CALL	.DLHDR		; RELEASE THE HEADER
    151
    152	000314				100$:	POP	<R1,R0,R2>	; GET EXTENSION DATA
    153	000322	005367 	000000G			DEC	.EXNHD		; COUNT HEADERS CREATED
    154	000326	002403 				BLT	110$		; THAT'S ALL
    155	000330					CALL	.NXHD1		; READ NEXT HEADER
    156	000334	103345 				BCC	80$		; AND LOOP
    157
    158	000336				110$:
    162	000336	005003 				CLR	R3
    163	000340					CALL	.SMRVB		; FLUSH THE STORAGE MAP BUFFER
    164	000344	132765 	000001 	000031 		BITB	#EX.AC1,I.EXTD+1(R5) ; IF NON CONTIGUOUS EXTEND
    165	000352	001004 				BNE	120$
    166	000354	105067 	000001G			CLRB	.IOSTS+1	; RETURN ZERO BLOCK COUNT
    167	000360	005067 	000002G			CLR	.IOSTS+2
    168	000364				120$:
    170	000364					CALLR	@.CLFC1		; CLEAN UP WHAT WE DID TO THE FCB'S
    174					;
    175					;
    176	000370					$END	CLEXT
    177					;
    178					;
CLEXT	D0211, CLEANUP FROM EXT	MACRO M1108  05-DEC-77 16:56  PAGE 6-3


    179		000001 				.END
CLEXT	D0211, CLEANUP FROM EXT	MACRO M1108  05-DEC-77 16:56  PAGE 6-4
SYMBOL TABLE

AC.DLK= 000002   	F.RVN   000012   	I.FNAM= 000000   	R$$10F= 000001   	WI.WRV= 001000
AC.LCK= 000001   	F.SCHA  000021   	I.FNBP  000036   	R$$11D= 000001   	W.CTL   000000
BITFNU= 000002   	F.SIZE  000032   	I.FTYP= 000006   	SC.BAD= 000100   	W.FCB   000002
EX.AC1= 000001   	F.STAT  000040   	I.FVER= 000010   	SC.MDL= 000200   	W.RTRV  000012
EX.AC2= 000002   	F.STD   000004   	I.IOSB  000016   	S.HDHD= 000056   	W.STD   000004
EX.ADF= 000010   	F.UCHA  000020   	I.LGTH  000040   	S.IDHD= 000056   	W.VBN   000006
EX.ENA= 000200   	F11PR$= 000000   	I.LNK   000000   	S.MPHD= 000012   	W.WISZ  000007
EX.FCO= 000004   	HIFCN = 000030   	I.LUN   000012   	S.STBK= 000012   	$$    = 000067
E$$MSG= 000001   	H.CKSM= 000776   	I.PRI   000010   	UC.CON= 000200   	.CLEXT  000000RG
E$$TRP= 000001   	H.FCHA= 000014   	I.PRM   000024   	UC.DLK= 000100   	.CLFC1= ****** GX
FCPLUN= 000001   	H.FLEV= 000006   	I.RTRV  000034   	VC.BMW= 000002   	.DFEXT= 000005
FC.CEF= 020000   	H.FNUM= 000002   	I.RVDT= 000014   	VC.IFW= 000001   	.DFPRO= 164000
FC.DIR= 040000   	H.FOWN= 000010   	I.RVNO= 000012   	V.FCB   000006   	.DLBLK= ****** GX
FC.FCO= 010000   	H.FPRO= 000012   	I.RVTI= 000023   	V.FFNU  000055   	.DLBL1= ****** GX
FC.WAC= 100000   	H.FSEQ= 000004   	I.RWAD= 000024   	V.FIEX  000025   	.DLHDR= ****** GX
FP.DEL= 000010   	H.IDOF= 000000   	I.RWAT  000026   	V.FMAX  000016   	.DLHD1= ****** GX
FP.EXT= 000004   	H.MPOF= 000001   	I.RWCT= 000026   	V.FPRO  000030   	.EXFNU= ****** GX
FP.RAT= 000001   	H.PROG= 000010   	I.RWVB= 000032   	V.FRBK  000034   	.EXHDR= ****** GX
FP.RDV= 000001   	H.PROJ= 000011   	I.STD   000004   	V.IBLB  000012   	.EXNHD= ****** GX
FP.WRV= 000002   	H.SCHA= 000015   	I.TISZ= 000006   	V.IBSZ  000013   	.EXSTS= ****** GX
F$$LVL= 000001   	H.UCHA= 000014   	I.UIC   000022   	V.IFWI  000002   	.EXTSV= ****** GX
F.DREF  000042   	H.UFAT= 000016   	LEV11M= 000401   	V.LABL  000040   	.GTMAP= ****** GX
F.DRNM  000044   	IDXFNU= 000001   	LOWFCN= 000011   	V.LGTH  000056   	.HDBUF= ****** GX
F.FEXT  000002   	ID$$$ = 000211   	MFDFNO= 000004   	V.LRUC  000035   	.IOSTS= ****** GX
F.FNUM  000006   	I.ACTL  000035   	MFDFSQ= 000004   	V.SBCL  000021   	.NXHD1= ****** GX
F.FOWN  000014   	I.AST   000020   	M$$HDR= 000001   	V.SBLB  000024   	.PRFIL= 000004
F.FPRO  000016   	I.ATL   000006   	M.CTSZ= 000006   	V.SBSZ  000022   	.RHDFN= ****** GX
F.FSEQ  000010   	I.CRDT= 000031   	M.EFNU= 000002   	V.STAT  000054   	.RTPTF= 001401
F.FSQN  000013   	I.CRTI= 000040   	M.EFSQ= 000004   	V.STD   000004   	.SMDEL= ****** GX
F.FVBN  000046   	I.DASZ= 000007   	M.ERVN= 000001   	V.TRCT  000000   	.SMRVB= ****** GX
F.HDLB  000022   	I.DPB   000011   	M.ESQN= 000000   	V.WISZ  000020   	.SM1BT= ****** GX
F.LBN   000026   	I.EFN   000013   	M.LBSZ= 000007   	WI.BPS= 100000   	.SYUIC= 000010
F.LGTH  000052   	I.EXDT= 000046   	M.MAX = 000011   	WI.DLK= 010000   	.VBSIZ= 001000
F.LINK  000000   	I.EXTD  000030   	M.RTRV= 000012   	WI.EXT= 002000   	.WRHDR= ****** GX
F.NACS  000036   	I.FCN   000014   	M.USE = 000010   	WI.LCK= 004000   	...GBL= 000000
F.NLCK  000037   	I.FIDP  000024   	QIOEFN= 000002   	WI.RDV= 000400   	...TPC= 000012
F.NWAC  000040

. ABS.	000056	   000
      	000370	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2650 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:20
[40,10]CLEXT,[40,20]CLEXT/-SP=[40,30]RSXDC,F11PRE,CLEXT
RSXDC	MACRO M1108  05-DEC-77 16:57  PAGE 3


      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.
CLFCB	D0202, CLEAN UP FCB	MACRO M1108  05-DEC-77 16:57  PAGE 6


      1						.TITLE	CLFCB	D0202, CLEAN UP FCB
						.IDENT	"D0202"
      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					;
					; VERSION D202, ASSEMBLED FOR RSX-11D
					;
     20
     21					; ANDREW C. GOLDSTEIN  29 OCT 74  13:15
     22					; PETER H. LIPMAN	9-APR-74
     23					;
     24					; CLEAN UP THE FILE CONTROL BLOCK BY REINITIALIZING IT
     25					; THIS ROUTINE IS INVOKED IF A WRITE ERROR OCCURRED IN FCP.
     26					;
     27					;+
     28					;
     29					; **-.CLFCB-CLEAN UP FCB
     30					;
     31					; POSSIBLE CLEANUP OF FCB NEEDED, HEADER MAY HAVE BEEN ALTERED
     32					; BY A WRITE ATTRIBUTES WHICH ALSO UPDATES THE FCB.  THE WRITE OF
     33					; THE HEADER FAILED, PROBABLY WRITE LOCKED DISK, AND NOW, IF THE
     34					; FILE IS ACCESSED THE FCB MUST BE CORRECTED
     35					;
     36					; THIS ROUTINE MUST ONLY BE CALLED JUST BEFORE RETURNING TO
     37					; EXIT SINCE IT WILL DISMOUNT THE VOLUME IF POSSIBLE
     38					;
     39					; INPUTS:
     40					;
     41					; 	R4=VCB ADDRESS
     42					; 	R5=I/O PACKET ADDRESS
     43					; 	.FCBAD CONTAINS THE FCB ADDRESS IF NON ZERO
     44					;
     45					; OUTPUTS:
     46					;
     47					; 	R0-R3 ALTERED, R4,R5 PRESERVED
     48					; 	ONLY RETURNS IN LINE IF VOLUME IS NOT DISMOUNTABLE
     49					;
     50					;-
     51
     52	000000				.CLFCB::
     53	000000	005767 	000000G			TST	.FCBAD		; ANY FCB AROUND TO CLEAN UP?
     54	000004	001451 				BEQ	40$		; BRANCH IF NO
CLFCB	D0202, CLEAN UP FCB	MACRO M1108  05-DEC-77 16:57  PAGE 6-1


     55	000006					CALL	.RDFHD		; READ A FRESH COPY OF THE FILE HEADER
     56	000012	016700 	000000G			MOV	.FCBAD,R0
     57	000016					CALL	.INFCB		; AND REINIT THE FCB
     59	000022	016002 	000002 		10$:	MOV	F.FEXT(R0),R2	; SEE IF THIS FCB HAS AN EXTENSION
     60	000026	001440 				BEQ	40$		; NO
     61	000030					CALL	.GTMAP		; YES - POINT TO HEADER'S MAP AREA
     62	000034	005761 	000002 			TST	M.EFNU(R1)	; SEE IF THE HEADER HAS AN EXTENSION
     63	000040	001422 				BEQ	20$		; NO
     64	000042	010200 				MOV	R2,R0		; YES - CHAIN TO EXTENSION FCB
     65	000044					PUSH	R0		; SAVE IT
     66	000046					CALL	.RDHDR		; READ THE EXTENSION HEADER
     67	000052					POP	R0		; GET EXTENSION FCB ADDR
     68	000054					CALL	.INFCB		; RE-INIT THE FCB
     69	000060	016701 	000000G			MOV	.FCBAD,R1	; POINT TO PRIMARY FCB
     70	000064	066061 	000032 	000032 		ADD	F.SIZE(R0),F.SIZE(R1) ; ACCUMULATE FILE SIZE
     71	000072	066061 	000034 	000034 		ADD	F.SIZE+2(R0),F.SIZE+2(R1)
     72	000100	005561 	000032 			ADC	F.SIZE(R1)
     73	000104	000746 				BR	10$		; LOOP FOR NEXT EXTENSION
     74					;
     75					; WE GET HERE IF WE FIND AN EXTENSION FCB WITH NO CORRESPONDING HEADER
     76					;
     77	000106	005060 	000002 		20$:	CLR	F.FEXT(R0)	; CLEAR EXTENSION POINTER
     78	000112	010200 				MOV	R2,R0		; CHAIN TO NEXT FCB
     79	000114	016002 	000002 		30$:	MOV	F.FEXT(R0),R2	; GET ITS EXTENSION POINTER
     80	000120					CALL	.RLFCB		; AND RELEASE IT
     81	000124	010200 				MOV	R2,R0		; CHAIN TO NEXT EXTENSION
     82	000126	001372 				BNE	30$		; LOOP FOR THE CHAIN
     83
     85	000130				40$:	CALLR	.DMOCK		; CHECK IF VOLUME IS MARKED FOR DISMOUNT
     86					;
     87					;
     88	000134					$END	CLFCB
     89					;
     90					;
     91		000001 				.END
CLFCB	D0202, CLEAN UP FCB	MACRO M1108  05-DEC-77 16:57  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.EFN   000013   	M.ERVN= 000001   	V.STAT  000054
AC.LCK= 000001   	F.NLCK  000037   	I.EXDT= 000046   	M.ESQN= 000000   	V.STD   000004
BITFNU= 000002   	F.NWAC  000040   	I.EXTD  000030   	M.LBSZ= 000007   	V.TRCT  000000
EX.AC1= 000001   	F.RVN   000012   	I.FCN   000014   	M.MAX = 000011   	V.WISZ  000020
EX.AC2= 000002   	F.SCHA  000021   	I.FIDP  000024   	M.RTRV= 000012   	WI.BPS= 100000
EX.ADF= 000010   	F.SIZE  000032   	I.FNAM= 000000   	M.USE = 000010   	WI.DLK= 010000
EX.ENA= 000200   	F.STAT  000040   	I.FNBP  000036   	QIOEFN= 000002   	WI.EXT= 002000
EX.FCO= 000004   	F.STD   000004   	I.FTYP= 000006   	R$$10F= 000001   	WI.LCK= 004000
E$$MSG= 000001   	F.UCHA  000020   	I.FVER= 000010   	R$$11D= 000001   	WI.RDV= 000400
E$$TRP= 000001   	F11PR$= 000000   	I.IOSB  000016   	SC.BAD= 000100   	WI.WRV= 001000
FCPLUN= 000001   	HIFCN = 000030   	I.LGTH  000040   	SC.MDL= 000200   	W.CTL   000000
FC.CEF= 020000   	H.CKSM= 000776   	I.LNK   000000   	S.HDHD= 000056   	W.FCB   000002
FC.DIR= 040000   	H.FCHA= 000014   	I.LUN   000012   	S.IDHD= 000056   	W.RTRV  000012
FC.FCO= 010000   	H.FLEV= 000006   	I.PRI   000010   	S.MPHD= 000012   	W.STD   000004
FC.WAC= 100000   	H.FNUM= 000002   	I.PRM   000024   	S.STBK= 000012   	W.VBN   000006
FP.DEL= 000010   	H.FOWN= 000010   	I.RTRV  000034   	UC.CON= 000200   	W.WISZ  000007
FP.EXT= 000004   	H.FPRO= 000012   	I.RVDT= 000014   	UC.DLK= 000100   	$$    = 000067
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVNO= 000012   	VC.BMW= 000002   	.CLFCB  000000RG
FP.RDV= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	VC.IFW= 000001   	.DFEXT= 000005
FP.WRV= 000002   	H.MPOF= 000001   	I.RWAD= 000024   	V.FCB   000006   	.DFPRO= 164000
F$$LVL= 000001   	H.PROG= 000010   	I.RWAT  000026   	V.FFNU  000055   	.DMOCK= ****** GX
F.DREF  000042   	H.PROJ= 000011   	I.RWCT= 000026   	V.FIEX  000025   	.FCBAD= ****** GX
F.DRNM  000044   	H.SCHA= 000015   	I.RWVB= 000032   	V.FMAX  000016   	.GTMAP= ****** GX
F.FEXT  000002   	H.UCHA= 000014   	I.STD   000004   	V.FPRO  000030   	.INFCB= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.TISZ= 000006   	V.FRBK  000034   	.PRFIL= 000004
F.FOWN  000014   	IDXFNU= 000001   	I.UIC   000022   	V.IBLB  000012   	.RDFHD= ****** GX
F.FPRO  000016   	ID$$$ = 000202   	LEV11M= 000401   	V.IBSZ  000013   	.RDHDR= ****** GX
F.FSEQ  000010   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002   	.RLFCB= ****** GX
F.FSQN  000013   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040   	.RTPTF= 001401
F.FVBN  000046   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056   	.SYUIC= 000010
F.HDLB  000022   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035   	.VBSIZ= 001000
F.LBN   000026   	I.CRTI= 000040   	M.CTSZ= 000006   	V.SBCL  000021   	...GBL= 000000
F.LGTH  000052   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBLB  000024   	...TPC= 000012
F.LINK  000000   	I.DPB   000011   	M.EFSQ= 000004   	V.SBSZ  000022

. ABS.	000056	   000
      	000134	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2542 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[40,10]CLFCB,[40,20]CLFCB/-SP=[40,30]RSXDC,F11PRE,CLFCB
RSXDC	MACRO M1108  05-DEC-77 16:57  PAGE 3


      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.
CLNUP	D0215, CLEANUP FROM ERR	MACRO M1108  05-DEC-77 16:57  PAGE 6


      1						.TITLE	CLNUP	D0215, CLEANUP FROM ERROR EXIT
						.IDENT	"D0215"
      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					;
					; VERSION D215, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  10 APR 75  14:36
     23					; PETER H. LIPMAN	8-JAN-74
     24					;
     25					; ROUTINES TO CLEAN UP PARTIALLY COMPLETED OPERATIONS WHICH FAILED
     26					; AND INVOKED ERRX.
     27
     28					; CLEAN UP ROUTINE DISPATCH TABLE INDEX INTO WITH (I/O FUNCTION
     29					; CODE-LOWFCN+1)*2
     30					;
     31
     32	000000				CLNDSP:
     33	000000	000000 				.WORD	0		; LOW FUNCTION CODE-1
     40	000002	000000G				.WORD	.CLDIR		; 11=FIND FILE IN DIRECTORY
     41	000004	000000 				.WORD	0		; 12=UNUSED
     42	000006	000000G				.WORD	.CLDIR		; 13=REMOVE FILE FROM DIRECTORY
     43	000010	000000G				.WORD	.CLDIR		; 14=ENTER FILE IN DIRECTORY
     44	000012	000000G				.WORD	.CLACC		; 15=ACCESS FOR READ
     45	000014	000000G				.WORD	.CLACC		; 16=ACCESS FOR READ, WRITE
     46	000016	000000G				.WORD	.CLACC		; 17=ACCESS FOR READ, WRITE, EXT.
     47	000020	000000G				.WORD	.CLDAC		; 20=DEACCESS FILE
     48	000022	000000 				.WORD	0		; 21=READ, VIRTUAL BLOCK
     49	000024	000000 				.WORD	0		; 22=WRITE VIRTUAL BLOCK
     50	000026	000000G				.WORD	.CLEXT		; 23=EXTEND FILE
     51	000030	000000G				.WORD	.CLCRE		; 24=CREATE FILE
     52	000032	000000G				.WORD	.CLDEL		; 25=MARK FILE FOR DELETE
     53	000034	000000G				.WORD	.CLRAT		; 26=READ ATTRIBUTES
     54	000036	000000G				.WORD	.CLWAT		; 27=WRITE ATTRIBUTES
     56	000040	000000G				.WORD	.CLCTL		; 30=ACP CONTROL
CLNUP	D0215, CLEANUP FROM ERR	MACRO M1108  05-DEC-77 16:57  PAGE 7


     59					;+
     60					;
     61					; **-.CLEXI - ALTERNATE ENTRY TO CLEAN UP AND EXTEND INDEX FILE
     62					;
     63					; THIS ENTRY CLEANS UP THE OPERATION DONE SO FAR AND THEN CALLS THE INDEX
     64					; FILE EXTEND ROUTINE. AFTER THAT THE FUNCTION IS RE-DISPATCHED AND
     65					; RE-EXECUTED. THIS IS AN OPEN ROUTINE - IT IS CALLED BY JMP AND DOES
     66					; NOT RETURN.
     67					;
     68					; INPUTS: SAME AS BELOW
     69					;
     70					;-
     71
     72	000042				.CLEXI::
     73	000042	116700 	000000G			MOVB	.EXSTS,R0	; SET UP STATUS IN R0
     74	000046					CALL	.CLDSP		; DO THE CLEANUP
     75	000052	000177 	000000G			JMP	@.IXEX1		; AND CALL INDEX FILE EXTEND
     76
     77
     78					;
     79					; CLEANUP FROM ERROR EXIT-
     80					;
     81
     82	000056				.CLNUP::
     83	000056	105767 	000000G			TSTB	.IOSTS		; CONVERT POSITIVE ERROR CODE TO NEGATIVE
     84	000062	002402 				BLT	10$
     85	000064	105467 	000000G			NEGB	.IOSTS
     86	000070	016705 	000000G		10$:	MOV	.IOPKT,R5	; RE-ESTABLISH R4,R5 CONTEXT
     87	000074	016704 	000000G			MOV	.UCBAD,R4	;
     92	000100	016404 	000000G			MOV	U.VA(R4),R4
     94	000104	012706 	000000G			MOV	#.STACK,SP	; RESET STACK
     95	000110	012746 	000000G			MOV	#.EXIT,-(SP)	; SET RETURN LOCATION
     96	000114	012702 	000000G		.CLDSP:	MOV	#.EXDSP,R2
     97	000120	111203 				MOVB	(R2),R3		; R3=DISPATCH CODE
     98	000122	001407 				BEQ	20$		; ZERO MEANS SECONDARY ERROR - JUST GET OUT
     99	000124	105022 				CLRB	(R2)+		; ZERO THIS TO GUARANTEE EXIT IF ANOTHER ERRX
    100	000126	122767 	000000G	000000G		CMPB	#IE.WER,.IOSTS	; FILE PROCESSOR WRITE ERROR?
    101	000134	001012 				BNE	30$		; BRANCH IF NO
    102	000136	112712 	177777 			MOVB	#-1,(R2)	; INDICATE WRITE ERROR FOR CLEANUP ROUTINES
    103	000142	005067 	000000G		20$:	CLR	.HDUCB		; INVALIDATE HEADER BUFFER
    104	000146	005067 	000000G			CLR	.DRUCB		; INVALIDATE DIRECTORY BUFFER
    105	000152	005067 	000000G			CLR	.SMUCB		; INVALIDATE STORAGE MAP BUFFER
    106	000156	005067 	000000G			CLR	.SMVBN
    107	000162	005763 	000000'		30$:	TST	CLNDSP(R3)	; DISPATCH CONTAINS ZERO IF NOTHING TO DO
    108	000166	001001 				BNE	40$
    109	000170					RETURN
    110	000172				40$:
    118	000172	111200 			50$:	MOVB	(R2),R0		; R0=STATUS BYTE OF COMMAND BEFORE ERROR
    119	000174	000173 	000000'			JMP	@CLNDSP(R3)
    120					;
    121					;
    122	000200					$END	CLNUP
    123					;
    124					;
    125		000001 				.END
CLNUP	D0215, CLEANUP FROM ERR	MACRO M1108  05-DEC-77 16:57  PAGE 7-1
SYMBOL TABLE

AC.DLK= 000002   	F.RVN   000012   	I.FNBP  000036   	SC.MDL= 000200   	W.RTRV  000012
AC.LCK= 000001   	F.SCHA  000021   	I.FTYP= 000006   	S.HDHD= 000056   	W.STD   000004
BITFNU= 000002   	F.SIZE  000032   	I.FVER= 000010   	S.IDHD= 000056   	W.VBN   000006
CLNDSP  000000R  	F.STAT  000040   	I.IOSB  000016   	S.MPHD= 000012   	W.WISZ  000007
EX.AC1= 000001   	F.STD   000004   	I.LGTH  000040   	S.STBK= 000012   	$$    = 000067
EX.AC2= 000002   	F.UCHA  000020   	I.LNK   000000   	UC.CON= 000200   	.CLACC= ****** GX
EX.ADF= 000010   	F11PR$= 000000   	I.LUN   000012   	UC.DLK= 000100   	.CLCRE= ****** GX
EX.ENA= 000200   	HIFCN = 000030   	I.PRI   000010   	U.VA  = ****** GX	.CLCTL= ****** GX
EX.FCO= 000004   	H.CKSM= 000776   	I.PRM   000024   	VC.BMW= 000002   	.CLDAC= ****** GX
E$$MSG= 000001   	H.FCHA= 000014   	I.RTRV  000034   	VC.IFW= 000001   	.CLDEL= ****** GX
E$$TRP= 000001   	H.FLEV= 000006   	I.RVDT= 000014   	V.FCB   000006   	.CLDIR= ****** GX
FCPLUN= 000001   	H.FNUM= 000002   	I.RVNO= 000012   	V.FFNU  000055   	.CLDSP  000114R
FC.CEF= 020000   	H.FOWN= 000010   	I.RVTI= 000023   	V.FIEX  000025   	.CLEXI  000042RG
FC.DIR= 040000   	H.FPRO= 000012   	I.RWAD= 000024   	V.FMAX  000016   	.CLEXT= ****** GX
FC.FCO= 010000   	H.FSEQ= 000004   	I.RWAT  000026   	V.FPRO  000030   	.CLNUP  000056RG
FC.WAC= 100000   	H.IDOF= 000000   	I.RWCT= 000026   	V.FRBK  000034   	.CLRAT= ****** GX
FP.DEL= 000010   	H.MPOF= 000001   	I.RWVB= 000032   	V.IBLB  000012   	.CLWAT= ****** GX
FP.EXT= 000004   	H.PROG= 000010   	I.STD   000004   	V.IBSZ  000013   	.DFEXT= 000005
FP.RAT= 000001   	H.PROJ= 000011   	I.TISZ= 000006   	V.IFWI  000002   	.DFPRO= 164000
FP.RDV= 000001   	H.SCHA= 000015   	I.UIC   000022   	V.LABL  000040   	.DRUCB= ****** GX
FP.WRV= 000002   	H.UCHA= 000014   	LEV11M= 000401   	V.LGTH  000056   	.EXDSP= ****** GX
F$$LVL= 000001   	H.UFAT= 000016   	LOWFCN= 000011   	V.LRUC  000035   	.EXIT = ****** GX
F.DREF  000042   	IDXFNU= 000001   	MFDFNO= 000004   	V.SBCL  000021   	.EXSTS= ****** GX
F.DRNM  000044   	ID$$$ = 000215   	MFDFSQ= 000004   	V.SBLB  000024   	.HDUCB= ****** GX
F.FEXT  000002   	IE.WER= ****** GX	M$$HDR= 000001   	V.SBSZ  000022   	.IOPKT= ****** GX
F.FNUM  000006   	I.ACTL  000035   	M.CTSZ= 000006   	V.STAT  000054   	.IOSTS= ****** GX
F.FOWN  000014   	I.AST   000020   	M.EFNU= 000002   	V.STD   000004   	.IXEX1= ****** GX
F.FPRO  000016   	I.ATL   000006   	M.EFSQ= 000004   	V.TRCT  000000   	.PRFIL= 000004
F.FSEQ  000010   	I.CRDT= 000031   	M.ERVN= 000001   	V.WISZ  000020   	.RTPTF= 001401
F.FSQN  000013   	I.CRTI= 000040   	M.ESQN= 000000   	WI.BPS= 100000   	.SMUCB= ****** GX
F.FVBN  000046   	I.DASZ= 000007   	M.LBSZ= 000007   	WI.DLK= 010000   	.SMVBN= ****** GX
F.HDLB  000022   	I.DPB   000011   	M.MAX = 000011   	WI.EXT= 002000   	.STACK= ****** GX
F.LBN   000026   	I.EFN   000013   	M.RTRV= 000012   	WI.LCK= 004000   	.SYUIC= 000010
F.LGTH  000052   	I.EXDT= 000046   	M.USE = 000010   	WI.RDV= 000400   	.UCBAD= ****** GX
F.LINK  000000   	I.EXTD  000030   	QIOEFN= 000002   	WI.WRV= 001000   	.VBSIZ= 001000
F.NACS  000036   	I.FCN   000014   	R$$10F= 000001   	W.CTL   000000   	...GBL= 000000
F.NLCK  000037   	I.FIDP  000024   	R$$11D= 000001   	W.FCB   000002   	...TPC= 000012
F.NWAC  000040   	I.FNAM= 000000   	SC.BAD= 000100

. ABS.	000056	   000
      	000200	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2635 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[40,10]CLNUP,[40,20]CLNUP/-SP=[40,30]RSXDC,F11PRE,CLNUP
RSXDC	MACRO M1108  05-DEC-77 16:57  PAGE 3


      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.
CNTRL	D0202, ACP CONTROL	MACRO M1108  05-DEC-77 16:57  PAGE 6


      1						.TITLE	CNTRL	D0202, ACP CONTROL
						.IDENT	"D0202"
      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					;
					; VERSION D202, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  12 SEP 74  11:16:50
     23					;
     24
     25	000000				CTLBLK:	.BLKW	2		; SPACE FOR CONTROL FUNCTION CODE
     26
     27					; THIS ROUTINE IMPLEMENTS THE ACP CONTROL FUNCTION, WHICH IS A
     28					; CATCH-ALL FOR MISCELLANEOUS OPERATIONS.
     29					; THE ONLY FUNCTIONS IMPLEMENTED AT PRESENT ARE MOUNT AND DISMOUNT.
     30					; BOTH ARE IN THE PRIVILEGED FUNCTION GROUP.
     31
     32		000010 			IS.PRI	= 10			; PRIVILEGED FUNCTION BIT
     33
     34	000004				.CNTRL::
     35	000004	036527 	000014 	000010 		BIT	I.FCN(R5),#IS.PRI ; CHECK FOR PRIVILEGE BIT
     36	000012	001413 				BEQ	10$		; MUST BE SET
     37	000014	010500 				MOV	R5,R0
     38	000016	062700 	000024 			ADD	#I.PRM,R0	; POINT TO PARAMETER LIST
     39	000022	012001 				MOV	(R0)+,R1	; CHECK FILE ID POINTER
     40	000024	005720 				TST	(R0)+		; CONTROL LIST MUST BE PRESENT
     41	000026	001405 				BEQ	10$
     42	000030	052001 				BIS	(R0)+,R1	; ALL OTHER PARAMETERS MUST BE 0
     43	000032	052001 				BIS	(R0)+,R1
     44	000034	052001 				BIS	(R0)+,R1
     45	000036	052001 				BIS	(R0)+,R1
     46	000040	001401 				BEQ	20$
     47	000042				10$:	ERRX	IE.BAD		; BAD PARAMETERS
	000042	   000C	   211 			TRAP	-IE.BAD		;
     48
     49	000044	016501 	000004 		20$:	MOV	I.STD(R5),R1	; GET CALLER'S STD ADDRESS
     50	000050	136127 	000000G	000000G		BITB	S.FW(R1),#SF.PT	; SEE IF CALLER IS PRIVILEGED
     51	000056	001001 				BNE	30$		; YES
     52	000060					ERRX	IE.PRI		; PRIVILEGE VIOLATION
	000060	   000C	   211 			TRAP	-IE.PRI		;
CNTRL	D0202, ACP CONTROL	MACRO M1108  05-DEC-77 16:57  PAGE 6-1


     53
     54	000062	162700 	000012 		30$:	SUB	#10.,R0		; POINT TO CONTROL LIST POINTER IN I/O PACKET
     55	000066	012701 	000000'			MOV	#CTLBLK,R1	; POINT TO BUFFER
     56	000072	012702 	000004 			MOV	#4,R2		; TRANSFER 4 BYTES
     57	000076					CALL	.BLXI		; READ CONTROL LIST
     58
     59	000102	012700 	000000'			MOV	#CTLBLK,R0
     60	000106	112001 				MOVB	(R0)+,R1	; GET CONTROL SUBFUNCTION
     61	000110	005002 				CLR	R2
     62	000112	152002 				BISB	(R0)+,R2	; GET STRING BYTE COUNT
     63	000114	001002 				BNE	40$
     64	000116	012702 	001000 			MOV	#512.,R2	; 0 MEANS 512
     65	000122	110167 	000000G		40$:	MOVB	R1,.EXSTS	; SAVE SUBFUNCTION FOR CLEANUP
     66	000126	020127 	000001 			CMP	R1,#1		; CHECK FOR MOUNT FUNCTION
     67	000132	001002 				BNE	50$
     68	000134					CALLR	.MOUNT		; YES - GO MOUNT VOLUME
     69	000140	020127 	000002 		50$:	CMP	R1,#2		; CHECK FOR DISMOUNT FUNCTION
     70	000144	001336 				BNE	10$		; IF NOT, BAD PARAMETERS
     71	000146					CALLR	@.DMOU1		; GO DO DISMOUNT
     72					;
     73					;
     74	000152					$END	CNTRL
     75					;
     76					;
     77		000001 				.END
CNTRL	D0202, ACP CONTROL	MACRO M1108  05-DEC-77 16:57  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.DASZ= 000007   	M.EFNU= 000002   	V.LRUC  000035
AC.LCK= 000001   	F.NLCK  000037   	I.DPB   000011   	M.EFSQ= 000004   	V.SBCL  000021
BITFNU= 000002   	F.NWAC  000040   	I.EFN   000013   	M.ERVN= 000001   	V.SBLB  000024
CTLBLK  000000R  	F.RVN   000012   	I.EXDT= 000046   	M.ESQN= 000000   	V.SBSZ  000022
EX.AC1= 000001   	F.SCHA  000021   	I.EXTD  000030   	M.LBSZ= 000007   	V.STAT  000054
EX.AC2= 000002   	F.SIZE  000032   	I.FCN   000014   	M.MAX = 000011   	V.STD   000004
EX.ADF= 000010   	F.STAT  000040   	I.FIDP  000024   	M.RTRV= 000012   	V.TRCT  000000
EX.ENA= 000200   	F.STD   000004   	I.FNAM= 000000   	M.USE = 000010   	V.WISZ  000020
EX.FCO= 000004   	F.UCHA  000020   	I.FNBP  000036   	QIOEFN= 000002   	WI.BPS= 100000
E$$MSG= 000001   	F11PR$= 000000   	I.FTYP= 000006   	R$$10F= 000001   	WI.DLK= 010000
E$$TRP= 000001   	HIFCN = 000030   	I.FVER= 000010   	R$$11D= 000001   	WI.EXT= 002000
FCPLUN= 000001   	H.CKSM= 000776   	I.IOSB  000016   	SC.BAD= 000100   	WI.LCK= 004000
FC.CEF= 020000   	H.FCHA= 000014   	I.LGTH  000040   	SC.MDL= 000200   	WI.RDV= 000400
FC.DIR= 040000   	H.FLEV= 000006   	I.LNK   000000   	SF.PT = ****** GX	WI.WRV= 001000
FC.FCO= 010000   	H.FNUM= 000002   	I.LUN   000012   	S.FW  = ****** GX	W.CTL   000000
FC.WAC= 100000   	H.FOWN= 000010   	I.PRI   000010   	S.HDHD= 000056   	W.FCB   000002
FP.DEL= 000010   	H.FPRO= 000012   	I.PRM   000024   	S.IDHD= 000056   	W.RTRV  000012
FP.EXT= 000004   	H.FSEQ= 000004   	I.RTRV  000034   	S.MPHD= 000012   	W.STD   000004
FP.RAT= 000001   	H.IDOF= 000000   	I.RVDT= 000014   	S.STBK= 000012   	W.VBN   000006
FP.RDV= 000001   	H.MPOF= 000001   	I.RVNO= 000012   	UC.CON= 000200   	W.WISZ  000007
FP.WRV= 000002   	H.PROG= 000010   	I.RVTI= 000023   	UC.DLK= 000100   	$$    = 000067
F$$LVL= 000001   	H.PROJ= 000011   	I.RWAD= 000024   	VC.BMW= 000002   	.BLXI = ****** GX
F.DREF  000042   	H.SCHA= 000015   	I.RWAT  000026   	VC.IFW= 000001   	.CNTRL  000004RG
F.DRNM  000044   	H.UCHA= 000014   	I.RWCT= 000026   	V.FCB   000006   	.DFEXT= 000005
F.FEXT  000002   	H.UFAT= 000016   	I.RWVB= 000032   	V.FFNU  000055   	.DFPRO= 164000
F.FNUM  000006   	IDXFNU= 000001   	I.STD   000004   	V.FIEX  000025   	.DMOU1= ****** GX
F.FOWN  000014   	ID$$$ = 000202   	I.TISZ= 000006   	V.FMAX  000016   	.EXSTS= ****** GX
F.FPRO  000016   	IE.BAD= ****** GX	I.UIC   000022   	V.FPRO  000030   	.MOUNT= ****** GX
F.FSEQ  000010   	IE.PRI= ****** GX	LEV11M= 000401   	V.FRBK  000034   	.PRFIL= 000004
F.FSQN  000013   	IS.PRI= 000010   	LOWFCN= 000011   	V.IBLB  000012   	.RTPTF= 001401
F.FVBN  000046   	I.ACTL  000035   	MFDFNO= 000004   	V.IBSZ  000013   	.SYUIC= 000010
F.HDLB  000022   	I.AST   000020   	MFDFSQ= 000004   	V.IFWI  000002   	.VBSIZ= 001000
F.LBN   000026   	I.ATL   000006   	M$$HDR= 000001   	V.LABL  000040   	...GBL= 000000
F.LGTH  000052   	I.CRDT= 000031   	M.CTSZ= 000006   	V.LGTH  000056   	...TPC= 000012
F.LINK  000000   	I.CRTI= 000040

. ABS.	000056	   000
      	000152	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2565 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:18
[40,10]CNTRL,[40,20]CNTRL/-SP=[40,30]RSXDC,F11PRE,CNTRL
RSXDC	MACRO M1108  05-DEC-77 16:58  PAGE 3


      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.
CRFIL	D0212, CREATE A NEW FIL	MACRO M1108  05-DEC-77 16:58  PAGE 6


      1						.TITLE	CRFIL	D0212, CREATE A NEW FILE
						.IDENT	"D0212"
      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					;
					; VERSION D212, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  4 MAR 75  16:19
     23					; PETER H. LIPMAN	16-JAN-74
     24					;
     25					; CREATE QI/O
     26					;
     33					;
     34					;+
     35					; **.CRFIL - CREATE A NEW FILE
     36					;
     37					; THIS ROUTINE IMPLEMENTS THE CREATE QI/O.
     38					; FIRST, THE INDEX FILE BIT MAP IS SCANNED FOR THE 1ST FREE BIT (=0).
     39					; THIS BIT IS THEN SET BUSY AND THE INDEX FILE BIT MAP IS REWRITTEN.
     40					; THE INDEX FILE IS EXTENDED IF NECESSARY TO INCLUDE THE HEADER BLOCK
     41					; ASSOCIATED WITH THE BIT IN THE INDEX FILE BIT MAP. THE HEADER IS
     42					; INITIALIZED AND USER SPECIFIED ATTRIBUTES ARE MOVED INTO THE HEADER
     43					; IF THAT PARAMETER WAS SPECIFIED. THE FILE IS THEN EXTENDED IF THAT
     44					; PARAMETER WAS SPECIFIED AND FINALLY THE HEADER IS WRITTEN OUT
     45					; AND THE FILE ID IS RETURNED TO THE SPECIFIED ADDRESS.
     46					;
     47					; INPUTS:
     48					;
     49					; 	R4=VOLUME CONTROL BLOCK ADDRESS
     50					; 	R5=I/O PACKET ADDRESS
     51					;
     52					; OUTPUTS:
     53					;
     54					; 	R0-R3 ALTERED
     55					; 	R4-R5 PRESERVED
     56					; 	RETURNS IN LINE IF AND ONLY IF SUCCESSFUL
     57					;
     58					; EFFECTS:
     59					;
     60					; 	.IOSTS AND .IOSTST+2 CONTAIN THE I/O STATUS BLOCK INFORMATION
CRFIL	D0212, CREATE A NEW FIL	MACRO M1108  05-DEC-77 16:58  PAGE 6-1


     61					; 	TO RETURN
     62					; 	.HDBUF CONTAINS THE HEADER FOR THIS FILE
     63					;
     64					;-
     65
     66					;
     67					; MAXIMUM NUMBER OF WORDS AVAILABLE FOR RETRIEVAL POINTERS
     68					; IN THE FILE HEADER.
     69					;
     70
     71		000314 				RTRMAX=<H.CKSM-S.HDHD-S.IDHD-S.MPHD>/2
     72
     73	000000				.CRFIL::
     74	000000	010500 				MOV	R5,R0
     79	000002	062700 	000024 			ADD	#I.FIDP,R0	; SET 1ST WORD OF FILE ID POINTER
     80	000006	010001 				MOV	R0,R1		; SAVE ADDR OF FILE ID POINTER
     82	000010	005720 				TST	(R0)+		; MUST BE NON ZERO
     83	000012	001406 				BEQ	10$		;
     88	000014	062700 	000006 			ADD	#I.RTRV-I.FIDP-2,R0 ; POINT TO ACCESS PARAMETER
     90	000020	005720 				TST	(R0)+
     91	000022	100402 				BMI	10$		; NO ACCESS ALLOWED
     92	000024	012002 				MOV	(R0)+,R2	; NO FILE NAME BLOCK EITHER
     96	000026	001401 				BEQ	20$		; BRANCH IF ALL PARAMETER WHICH SHOULD BE 0 ARE 0
     97	000030				10$:	ERRX	IE.BAD,<BAD PARAMETERS>
	000030	   000C	   211 			TRAP	-IE.BAD		; BAD PARAMETERS
     98
     99	000032				20$:
    101	000032					GETLUN	R0		; LOOK AT CALLER'S LUTN2
    102	000036	001401 				BEQ	30$
    103	000040					ERRX	IE.ALN,<FILE ALREADY ACCESSED ON LUN>
	000040	   000C	   211 			TRAP	-IE.ALN		; FILE ALREADY ACCESSED ON LUN
    104
    106	000042	016703 	000000G		30$:	MOV	.UCBAD,R3	; GET PUD ADDRESS
    107	000046	032763 	000000G	000000G		BIT	#UC.SWL,U.C1(R3) ; SEE IF DEVICE IS SOFTWARE WRITE-LOCKED
    108	000054	001401 				BEQ	40$		; NO
    109	000056					ERRX	IE.WLK,<DEVICE IS SOFTWARE WRITE-LOCKED>
	000056	   000C	   211 			TRAP	-IE.WLK		; DEVICE IS SOFTWARE WRITE-LOCKED
    110	000060				40$:
    112	000060	012700 	000000G			MOV	#.FILNO,R0	; POINT TO FILE ID (ZERO AT PRESENT)
    113	000064	012702 	000004 			MOV	#4,R2		; SET BYTE COUNT TO 4
    114	000070					CALL	.BLXO		; ZERO CALLER'S ID BLOCK
    115									; (MAINLY TO VALIDATE THE FID POINTER!)
    117	000074					CALL	.CRFID		; ALLOCATE A FILE NUMBER
    118	000100	103003 				BCC	50$		; BRANCH IF SUCCESSFUL
    119	000102	010046 				MOV	R0,-(SP)	; SAVE AWAY DESIRED FILE NUMBER
    120	000104	000177 	000000G			JMP	@.IXEX1		; INDEX FILE MUST BE EXTENDED
    121
    122	000110	105267 	000000G		50$:	INCB	.EXSTS		; CREATE PHASE 1 COMPLETE
    123
    124					;
    125					; NOW GET HEADER LBN AND INITIALIZE THE HEADER
    126					;
    127
    128	000114	010067 	000000G			MOV	R0,.FILNO	; STORE FILE NUMBER
    129	000120					CALL	.MPHDR
    130	000124	103001 				BCC	60$
    131	000126					FATAL	<FAILED TO MAP HEADER, BUT HDR IS ALLOCATED>
CRFIL	D0212, CREATE A NEW FIL	MACRO M1108  05-DEC-77 16:58  PAGE 6-2


	000126	000004 				IOT			; *** FATAL ERROR FAILED TO MAP HEADER, BUT HDR IS ALLOCATED
    132
    133	000130	012701 	000000G		60$:	MOV	#.HDLBN,R1
    134	000134	010221 				MOV	R2,(R1)+	; STORE HEADER LBN
    135	000136	010321 				MOV	R3,(R1)+
    136	000140					CALL	.RD1LB		; READ IN THE OLD FILE HEADER
    137	000144	105267 	000000G			INCB	.EXSTS		; HEADER OK, NO ERRX UNTIL IT IS!!
    138					;
    139					; SET IDENT AND MAP AREA OFFSETS AND INITIALIZE THE HEADER AREA
    140					;
    141
    142	000150	012721 	027027 			MOV	#<<S.HDHD/2>+<200*<S.HDHD+S.IDHD>>>,(R1)+
    143	000154	016721 	000000G			MOV	.FILNO,(R1)+	; FILE NUMBER
    144	000160	005211 				INC	(R1)		; BUMP THE FILE SEQUENCE NO.
    145	000162	012167 	000000G			MOV	(R1)+,.FILSQ	; ALSO SET FCP CONTEXT
    146	000166	012721 	000401 			MOV	#LEV11M,(R1)+
    153	000172	016521 	000022 			MOV	I.UIC(R5),(R1)+	; GET FILE OWNER FROM I/O PACKET
    155	000176	016421 	000030 			MOV	V.FPRO(R4),(R1)+  ; DEFAULT FILE PROTECTION
    156	000202	012700 	000371 			MOV	#<H.CKSM-H.FCHA>/2,R0
    157	000206	005021 			70$:	CLR	(R1)+		; ZERO THE REST OF THE HDR
    158	000210	077002 				SOB	R0,70$
    159
    160					;
    161					; SET THE CREATION DATE AND TIME
    162					;
    163
    164	000212	012703 	000107G			MOV	#.HDBUF+S.HDHD+I.CRDT,R3
    165	000216					CALL	.DATIM
    166
    167					;
    168					; INITIALIZE THE MAP AREA
    169					;
    170
    171	000222	012767 	001401 	000142G		MOV	#.RTPTF,.HDBUF+S.HDHD+S.IDHD+M.CTSZ
    172	000230	112767 	000314 	000145G		MOVB	#RTRMAX,.HDBUF+S.HDHD+S.IDHD+M.MAX
    173
    174					;
    175					; WRITE ATTRIBUTES IF SPECIFIED
    176					;
    177
    178	000236	005000 				CLR	R0		; SET ALL PERMISSIONS
    179	000240					CALL	.WATCM
    180					;
    181					; RETURN FILE ID TO USER
    182					;
    183
    184	000244	010501 				MOV	R5,R1
    185	000246	062701 	000024 			ADD	#I.FIDP,R1	; R1=DBL WORD ADDRESS OF FID BLOCK
    186	000252	012700 	000002G			MOV	#.HDBUF+H.FNUM,R0
    187	000256	012702 	000004 			MOV	#4,R2
    188	000262					CALL	.BLXO
    189
    190					;
    191					; EXTEND FILE IF DESIRED
    192					;
    193
    194	000266	016500 	000030 			MOV	I.EXTD(R5),R0
CRFIL	D0212, CREATE A NEW FIL	MACRO M1108  05-DEC-77 16:58  PAGE 6-3


    195	000272	002004 				BGE	80$
    196	000274	016501 	000032 			MOV	I.EXTD+2(R5),R1
    197	000300	000177 	000000G			JMP	@.EXCM1
    198
    199					;
    200					; WRITE THE HEADER
    201					;
    202
    203	000304				80$:	CALLR	.WRHDR
    204
    205					;
    206					;
    207	000310					$END	CRFIL
    208					;
    209					;
    210		000001 				.END
CRFIL	D0212, CREATE A NEW FIL	MACRO M1108  05-DEC-77 16:58  PAGE 6-4
SYMBOL TABLE

AC.DLK= 000002   	F.RVN   000012   	I.FCN   000014   	QIOEFN= 000002   	WI.EXT= 002000
AC.LCK= 000001   	F.SCHA  000021   	I.FIDP  000024   	RTRMAX= 000314   	WI.LCK= 004000
BITFNU= 000002   	F.SIZE  000032   	I.FNAM= 000000   	R$$10F= 000001   	WI.RDV= 000400
EX.AC1= 000001   	F.STAT  000040   	I.FNBP  000036   	R$$11D= 000001   	WI.WRV= 001000
EX.AC2= 000002   	F.STD   000004   	I.FTYP= 000006   	SC.BAD= 000100   	W.CTL   000000
EX.ADF= 000010   	F.UCHA  000020   	I.FVER= 000010   	SC.MDL= 000200   	W.FCB   000002
EX.ENA= 000200   	F11PR$= 000000   	I.IOSB  000016   	S.HDHD= 000056   	W.RTRV  000012
EX.FCO= 000004   	HIFCN = 000030   	I.LGTH  000040   	S.IDHD= 000056   	W.STD   000004
E$$MSG= 000001   	H.CKSM= 000776   	I.LNK   000000   	S.MPHD= 000012   	W.VBN   000006
E$$TRP= 000001   	H.FCHA= 000014   	I.LUN   000012   	S.STBK= 000012   	W.WISZ  000007
FCPLUN= 000001   	H.FLEV= 000006   	I.PRI   000010   	UC.CON= 000200   	$$    = 000067
FC.CEF= 020000   	H.FNUM= 000002   	I.PRM   000024   	UC.DLK= 000100   	.BLXO = ****** GX
FC.DIR= 040000   	H.FOWN= 000010   	I.RTRV  000034   	UC.SWL= ****** GX	.CRFID= ****** GX
FC.FCO= 010000   	H.FPRO= 000012   	I.RVDT= 000014   	U.C1  = ****** GX	.CRFIL  000000RG
FC.WAC= 100000   	H.FSEQ= 000004   	I.RVNO= 000012   	VC.BMW= 000002   	.DATIM= ****** GX
FP.DEL= 000010   	H.IDOF= 000000   	I.RVTI= 000023   	VC.IFW= 000001   	.DFEXT= 000005
FP.EXT= 000004   	H.MPOF= 000001   	I.RWAD= 000024   	V.FCB   000006   	.DFPRO= 164000
FP.RAT= 000001   	H.PROG= 000010   	I.RWAT  000026   	V.FFNU  000055   	.EXCM1= ****** GX
FP.RDV= 000001   	H.PROJ= 000011   	I.RWCT= 000026   	V.FIEX  000025   	.EXSTS= ****** GX
FP.WRV= 000002   	H.SCHA= 000015   	I.RWVB= 000032   	V.FMAX  000016   	.FILNO= ****** GX
F$$LVL= 000001   	H.UCHA= 000014   	I.STD   000004   	V.FPRO  000030   	.FILSQ= ****** GX
F.DREF  000042   	H.UFAT= 000016   	I.TISZ= 000006   	V.FRBK  000034   	.HDBUF= ****** GX
F.DRNM  000044   	IDXFNU= 000001   	I.UIC   000022   	V.IBLB  000012   	.HDLBN= ****** GX
F.FEXT  000002   	ID$$$ = 000212   	LEV11M= 000401   	V.IBSZ  000013   	.IXEX1= ****** GX
F.FNUM  000006   	IE.ALN= ****** GX	LOWFCN= 000011   	V.IFWI  000002   	.LUTN2= ****** GX
F.FOWN  000014   	IE.BAD= ****** GX	MFDFNO= 000004   	V.LABL  000040   	.MPHDR= ****** GX
F.FPRO  000016   	IE.WLK= ****** GX	MFDFSQ= 000004   	V.LGTH  000056   	.PRFIL= 000004
F.FSEQ  000010   	I.ACTL  000035   	M$$HDR= 000001   	V.LRUC  000035   	.RD1LB= ****** GX
F.FSQN  000013   	I.AST   000020   	M.CTSZ= 000006   	V.SBCL  000021   	.RTPTF= 001401
F.FVBN  000046   	I.ATL   000006   	M.EFNU= 000002   	V.SBLB  000024   	.SYUIC= 000010
F.HDLB  000022   	I.CRDT= 000031   	M.EFSQ= 000004   	V.SBSZ  000022   	.UCBAD= ****** GX
F.LBN   000026   	I.CRTI= 000040   	M.ERVN= 000001   	V.STAT  000054   	.VBSIZ= 001000
F.LGTH  000052   	I.DASZ= 000007   	M.ESQN= 000000   	V.STD   000004   	.WATCM= ****** GX
F.LINK  000000   	I.DPB   000011   	M.LBSZ= 000007   	V.TRCT  000000   	.WRHDR= ****** GX
F.NACS  000036   	I.EFN   000013   	M.MAX = 000011   	V.WISZ  000020   	...GBL= 000000
F.NLCK  000037   	I.EXDT= 000046   	M.RTRV= 000012   	WI.BPS= 100000   	...TPC= 000012
F.NWAC  000040   	I.EXTD  000030   	M.USE = 000010   	WI.DLK= 010000

. ABS.	000056	   000
      	000310	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2665 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:19
[40,10]CRFIL,[40,20]CRFIL/-SP=[40,30]RSXDC,F11PRE,CRFIL
RSXDC	MACRO M1108  05-DEC-77 16:58  PAGE 3


      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.
CRFID	D0202, CREATE A NEW FIL	MACRO M1108  05-DEC-77 16:58  PAGE 6


      1						.TITLE	CRFID	D0202, CREATE A NEW FILE ID
						.IDENT	"D0202"
      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					;
     20					;
					; VERSION D202, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  26 FEB 75  16:12
     23					;
     24					; CREATE A NEW FILE ID
     25
     26					;+
     27					;
     28					; **.CRFID - CREATE A NEW FILE ID
     29					;
     30					; THIS ROUTINE SCANS THE INDEX FILE BITMAP FOR AN AVAILABLE FILE
     31					; NUMBER. IF NO FILE NUMBERS ARE AVAILABLE WITHIN THE MAXIMUM
     32					; FOR THE VOLUME IT TRAPS. IF THE HEADER CORRESPONDING TO THE
     33					; NEW FILE NUMBER IS ALLOCATED, THE FILE NUMBER IS MARKED USED
     34					; IN THE INDEX FILE BITMAP. IF THE HEADER DOES NOT EXIST, IT IS
     35					; NOT MARKED USED AND THE ROUTINE EXITS WITH CARRY SET.
     36					;
     37					; INPUTS:
     38					;
     39					;	R4 = VCB ADDRESS
     40					;
     41					; OUTPUTS:
     42					;
     43					;	R0 = FILE NUMBER
     44					;	R1 - R3 ALTERED
     45					;	R4 - R5 PRESERVED
     46					;	C = 0	HEADER IS ALLOCATED
     47					;	C = 1	HEADER IS NOT ALLOCATED
     48					;	.HDBUF ALTERED
     49					;	INDEX FILE BITMAP UPDATED
     50					;
     51					;-
     52
     53	000000				.CRFID::
     55	000000	116403 	000055 			MOVB	V.FFNU(R4),R3	; GET NUMBER IF BITMAP BLOCK WITH FIRST FREE FILE
CRFID	D0202, CREATE A NEW FIL	MACRO M1108  05-DEC-77 16:58  PAGE 6-1


     56	000004	010300 				MOV	R3,R0
     60	000006	000241 				CLC
     61	000010	006000 				ROR	R0		; MULT BY 4096 BITS PER BLOCK (THE HARD WAY)
     62	000012	006000 				ROR	R0
     63	000014	006000 				ROR	R0
     64	000016	006000 				ROR	R0
     65	000020	006000 				ROR	R0
     67	000022	010046 				MOV	R0,-(SP)	; SET INITIAL FILE NUMBER
     71	000024	116402 	000013 			MOVB	V.IBSZ(R4),R2	; R2=NO. OF INDEX BIT MAP BLOCKS (<128.)
     73	000030	160302 				SUB	R3,R2		; DEDUCT BLOCKS THAT WON'T BE SCANNED
     74	000032	003435 				BLE	30$		; NO BLOCKS TO SCAN - YOU LOSE
     76	000034	010246 				MOV	R2,-(SP)
     77	000036	005002 				CLR	R2
     78	000040	156402 	000012 			BISB	V.IBLB(R4),R2	;
     80	000044	066403 	000014 			ADD	V.IBLB+2(R4),R3	; R2,R3=1ST INDEX BIT MAP LBN
     81	000050	005502 				ADC	R2
     85	000052	012701 	000000G		10$:	MOV	#.HDUCB,R1	; R1=ADDR OF HEADER UCB ADDRESS
     86	000056	016721 	000000G			MOV	.UCBAD,(R1)+	; STORE UCB ADDRESS OF INDEX FILE BIT MAP
     87	000062	010221 				MOV	R2,(R1)+	; STORE LBN OF CURRENT INDEX FILE BIT MAP
     88	000064	010321 				MOV	R3,(R1)+	; STORE LOW ORDER WORD OF LBN
     89	000066					CALL	.RD1LB
     90	000072	012700 	000400 			MOV	#.VBSIZ/2,R0	; NO. OF WORDS IN BLOCK
     91	000076	022721 	177777 		20$:	CMP	#-1,(R1)+	; FIND FIRST WORD WITH FREE BIT
     92	000102	001012 				BNE	40$
     93	000104	062766 	000020 	000002 		ADD	#16.,2(SP)
     94	000112	077007 				SOB	R0,20$
     95					;
     96					; NO FREE FILES IN THIS BLOCK OF INDEX BIT MAP, TRY NEXT BLOCK
     97					;
     98
     99	000114	062703 	000001 			ADD	#1,R3		; INCREMENT THE LBN
    100	000120	005502 				ADC	R2
    101	000122	005316 				DEC	(SP)
    102	000124	003352 				BGT	10$
    103	000126				30$:	ERRX	IE.IFU,<INDEX FILE FULL>
	000126	   000C	   211 			TRAP	-IE.IFU		; INDEX FILE FULL
    104	000130	022641 			40$:	CMP	(SP)+,-(R1)	; POINT BACK AT WORD WITH FREE BIT
    105									; AND POP NO. OF INDEX BIT MAP BLOCKS
    106	000132	012700 	000001 			MOV	#1,R0		; INITIALIZE BIT MASK
    107	000136	005216 			50$:	INC	(SP)		; COUNT THIS HEADER
    108	000140	030011 				BIT	R0,(R1)		; IS THIS FILE HEADER FREE
    109	000142	001402 				BEQ	60$		; BRANCH IF YES
    110	000144	006300 				ASL	R0		; MASK NEXT BIT
    111	000146	000773 				BR	50$		; ONE MUST BE FREE
    112	000150	050011 			60$:	BIS	R0,(R1)		; MARK HEADER BUSY
    113
    114					;
    115					; (SP) CONTAINS THE FILE NUMBER OF THE FILE ABOUT TO
    116					; BE CREATED
    117					;
    118
    119	000152	021664 	000016 			CMP	(SP),V.FMAX(R4) ; BEYOND MAX FILE NUMBER
    120	000156	101363 				BHI	30$		; BRANCH IF YES
    121	000160	116403 	000013 			MOVB	V.IBSZ(R4),R3	; R3=SIZE OF INDEX FILE BIT MAP
    122	000164	122323 				CMPB	(R3)+,(R3)+	; ADD 2 FOR BOOT AND HOME BLOCKS
    123	000166	005002 				CLR	R2
    124	000170	061603 				ADD	(SP),R3	; FORM DOUBLE PRECISION VBN
CRFID	D0202, CREATE A NEW FIL	MACRO M1108  05-DEC-77 16:58  PAGE 6-2


    125	000172	005502 				ADC	R2		; IN R2,R3
    126	000174	016401 	000002 			MOV	V.IFWI(R4),R1	; R1=INDEX FILE WINDOW ADDRESS
    127	000200	016100 	000002 			MOV	W.FCB(R1),R0	; R0=INDEX FILE FCB ADDRESS
    128
    129	000204	026002 	000032 			CMP	F.SIZE(R0),R2	; IS THIS FILE HEADER BEYOND EOF
    130	000210	001002 				BNE	70$
    131	000212	026003 	000034 			CMP	F.SIZE+2(R0),R3	; THIS SETS CARRY THE RIGHT WAY!
    132	000216	103402 			70$:	BLO	80$		; BRANCH IF HEADER IS ALLOCATED
    133					;
    134					; WRITE THE INDEX BITMAP BLOCK-UPDATED TO SHOW THAT THIS
    135					; FILE HEADER IS IN USE-INVALID HEADER CURRENTLY
    136					; ON DEVICE
    137					;
    138	000220					CALL	.WRHD1		; WRITE THE INDEX FILE BIT MAP
    139	000224	012600 			80$:	MOV	(SP)+,R0	; PUT FILE NUMBER IN R0
    140	000226					RETURN
    141					;
    142					;
    143	000230					$END	CRFID
    144					;
    145					;
    146		000001 				.END
CRFID	D0202, CREATE A NEW FIL	MACRO M1108  05-DEC-77 16:58  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.DPB   000011   	M.EFNU= 000002   	V.SBCL  000021
AC.LCK= 000001   	F.NLCK  000037   	I.EFN   000013   	M.EFSQ= 000004   	V.SBLB  000024
BITFNU= 000002   	F.NWAC  000040   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBSZ  000022
EX.AC1= 000001   	F.RVN   000012   	I.EXTD  000030   	M.ESQN= 000000   	V.STAT  000054
EX.AC2= 000002   	F.SCHA  000021   	I.FCN   000014   	M.LBSZ= 000007   	V.STD   000004
EX.ADF= 000010   	F.SIZE  000032   	I.FIDP  000024   	M.MAX = 000011   	V.TRCT  000000
EX.ENA= 000200   	F.STAT  000040   	I.FNAM= 000000   	M.RTRV= 000012   	V.WISZ  000020
EX.FCO= 000004   	F.STD   000004   	I.FNBP  000036   	M.USE = 000010   	WI.BPS= 100000
E$$MSG= 000001   	F.UCHA  000020   	I.FTYP= 000006   	QIOEFN= 000002   	WI.DLK= 010000
E$$TRP= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$10F= 000001   	WI.EXT= 002000
FCPLUN= 000001   	HIFCN = 000030   	I.IOSB  000016   	R$$11D= 000001   	WI.LCK= 004000
FC.CEF= 020000   	H.CKSM= 000776   	I.LGTH  000040   	SC.BAD= 000100   	WI.RDV= 000400
FC.DIR= 040000   	H.FCHA= 000014   	I.LNK   000000   	SC.MDL= 000200   	WI.WRV= 001000
FC.FCO= 010000   	H.FLEV= 000006   	I.LUN   000012   	S.HDHD= 000056   	W.CTL   000000
FC.WAC= 100000   	H.FNUM= 000002   	I.PRI   000010   	S.IDHD= 000056   	W.FCB   000002
FP.DEL= 000010   	H.FOWN= 000010   	I.PRM   000024   	S.MPHD= 000012   	W.RTRV  000012
FP.EXT= 000004   	H.FPRO= 000012   	I.RTRV  000034   	S.STBK= 000012   	W.STD   000004
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	UC.CON= 000200   	W.VBN   000006
FP.RDV= 000001   	H.IDOF= 000000   	I.RVNO= 000012   	UC.DLK= 000100   	W.WISZ  000007
FP.WRV= 000002   	H.MPOF= 000001   	I.RVTI= 000023   	VC.BMW= 000002   	$$    = 000067
F$$LVL= 000001   	H.PROG= 000010   	I.RWAD= 000024   	VC.IFW= 000001   	.CRFID  000000RG
F.DREF  000042   	H.PROJ= 000011   	I.RWAT  000026   	V.FCB   000006   	.DFEXT= 000005
F.DRNM  000044   	H.SCHA= 000015   	I.RWCT= 000026   	V.FFNU  000055   	.DFPRO= 164000
F.FEXT  000002   	H.UCHA= 000014   	I.RWVB= 000032   	V.FIEX  000025   	.HDUCB= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.STD   000004   	V.FMAX  000016   	.PRFIL= 000004
F.FOWN  000014   	IDXFNU= 000001   	I.TISZ= 000006   	V.FPRO  000030   	.RD1LB= ****** GX
F.FPRO  000016   	ID$$$ = 000202   	I.UIC   000022   	V.FRBK  000034   	.RTPTF= 001401
F.FSEQ  000010   	IE.IFU= ****** GX	LEV11M= 000401   	V.IBLB  000012   	.SYUIC= 000010
F.FSQN  000013   	I.ACTL  000035   	LOWFCN= 000011   	V.IBSZ  000013   	.UCBAD= ****** GX
F.FVBN  000046   	I.AST   000020   	MFDFNO= 000004   	V.IFWI  000002   	.VBSIZ= 001000
F.HDLB  000022   	I.ATL   000006   	MFDFSQ= 000004   	V.LABL  000040   	.WRHD1= ****** GX
F.LBN   000026   	I.CRDT= 000031   	M$$HDR= 000001   	V.LGTH  000056   	...GBL= 000000
F.LGTH  000052   	I.CRTI= 000040   	M.CTSZ= 000006   	V.LRUC  000035   	...TPC= 000012
F.LINK  000000   	I.DASZ= 000007

. ABS.	000056	   000
      	000230	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2552 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[40,10]CRFID,[40,20]CRFID/-SP=[40,30]RSXDC,F11PRE,CRFID
DARITH - DOUBLE PRECISION MUL, 	MACRO M1108  05-DEC-77 16:58  PAGE 1


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


     58	000022	060200 				ADD	R2,R0
     59	000024	006303 			20$:	ASL	R3		;IN EITHER CASE, DOUBLE THE MULTIPLICAND
     60	000026	006102 				ROL	R2
     61	000030	000766 				BR	10$		;AND SEE IF ANY MORE MULTIPLIER
     62	000032	005726 			30$:	TST	(SP)+		;CLEAN UP THE STACK, RETURN C=0
     63	000034					RETURN			;AND RETURN
DARITH - DOUBLE PRECISION MUL, 	MACRO M1108  05-DEC-77 16:58  PAGE 2


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

$DDIV   000036RG    002	$DMUL   000000RG    002

. ABS.	000000	   000
      	000000	   001
PURE  	000100	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  132 WORDS  ( 1 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:03
[40,10]DARITH,[40,20]DARITH/-SP=[40,30]DARITH
RSXDC	MACRO M1108  05-DEC-77 16:58  PAGE 3


      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.
DATIM	D0201, CONVERT DATE AND	MACRO M1108  05-DEC-77 16:58  PAGE 6


      1						.TITLE	DATIM	D0201, CONVERT DATE AND TIME TO STRING
						.IDENT	"D0201"
      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					;
					; VERSION D201, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  10 SEP 74  12:04:06
     23					; PETER H. LIPMAN	8-JAN-74
     24					;
     25					; CONVERT INTERNAL DATE AND TIME TO ASCII STRING
     26
     27						.MCALL	GTIM$S
     28
     29					;
     30					; MONTH CONVERSION STRING
     31					;
     32
     33	000000	   112 	   101 	   116 	DATMON:	.ASCII	/JANFEBMARAPRMAYJUN/
	000003	   106 	   105 	   102
	000006	   115 	   101 	   122
	000011	   101 	   120 	   122
	000014	   115 	   101 	   131
	000017	   112 	   125 	   116
     34	000022	   112 	   125 	   114 		.ASCII	/JULAUGSEPOCTNOVDEC/
	000025	   101 	   125 	   107
	000030	   123 	   105 	   120
	000033	   117 	   103 	   124
	000036	   116 	   117 	   126
	000041	   104 	   105 	   103
     35
     36		000003 				DATMOS=<.-DATMON>/12.
     37						.EVEN
     38
DATIM	D0201, CONVERT DATE AND	MACRO M1108  05-DEC-77 16:58  PAGE 7


     40					;+
     41					; **-.DATIM-CONVERT INTERNAL DATE AND TIME TO ASCII STRING
     42					;
     43					; THIS ROUTINE TAKES THE CURRENT DATE AND TIME IN INTERNAL FORMAT
     44					; AND PRODUCES THE ASCII STRING DDMMMYYHHMMSS.
     45					;
     46					; INPUTS:
     47					;
     48					; 	R3=STRING ADDRESS TO STORE ASCII STRING
     49					;
     50					; OUTPUTS:
     51					;
     52					; 	R3 UPDATED STRING ADDRESS
     53					; 	R0-R2 ALTERED
     54					; 	R4-R5 PRESERVED
     55					;
     56					;-
     57
     58	000044				.DATIM::
     59	000044	162706 	000020 			SUB	#16.,SP		; ALLOCATE PARAMETER BUFFER ON STACK
     60	000050	010600 				MOV	SP,R0
     61	000052					GTIM$S	R0		; GET TIME PARAMETERS
     62	000062	016600 	000004 		10$:	MOV	4(SP),R0	; DAY OF MONTH
     63	000066					CALL	DATDEC
     64	000072	016601 	000002 			MOV	2(SP),R1	; MONTH OF YEAR
     65	000076					MUL	#DATMOS,R1	; R1=INDEX INTO MONTH TABLE
     66	000106	062701 	177775'			ADD	#DATMON-DATMOS,R1 ; R1=ADDRESS OF MONTH STRING
     67		000003 				.REPT	DATMOS
     68						MOVB	(R1)+,(R3)+	; MOVE THE MONTH STRING CHARACTERS
     69						.ENDR
     70	000120	012600 				MOV	(SP)+,R0	; YEAR
     71	000122					CALL	DATDEC
     72	000126	022626 				CMP	(SP)+,(SP)+	; POP MONTH AND DAY
     73	000130	012702 	000003 			MOV	#3,R2		; LOOP THROUGH HOURS, MINUTES, SECONDS
     74	000134	012600 			20$:	MOV	(SP)+,R0
     75	000136					CALL	DATDEC
     76	000142	077204 				SOB	R2,20$
     77	000144	022626 				CMP	(SP)+,(SP)+	; CLEAN LAST TWO WORDS OFF STACK
     78
     79	000146					RETURN
DATIM	D0201, CONVERT DATE AND	MACRO M1108  05-DEC-77 16:58  PAGE 8


     81					;+
     82					; **-DATDEC-CONVERT A SMALL BINARY NUMBER TO TWO ASCII CHARACTERS
     83					;
     84					; GENERATES TWO DECIMAL ASCII CHARACTERS FROM THE BINARY VALUE IN R0.
     85					;
     86					; INPUTS:
     87					;
     88					; 	R0=NUMBER TO CONVERT
     89					; 	R3=STRING ADDRESS TO STORE CHARACTERS
     90					;
     91					; OUTPUTS:
     92					;
     93					; 	R3=UPDATED STRING POINTER
     94					; 	R0,R1 ALTERED
     95					; 	R2,R4,R5 PRESERVED
     96					;
     97					;-
     98
     99	000150				DATDEC:
    105	000150	012701 	000012 			MOV	#10.,R1		; DIVISOR IN R1, DIVIDEND IN R0
    106	000154					CALL	$DIV
    108	000160	062700 	000060 			ADD	#'0,R0		; MAKE QUOTIENT ASCII DIGIT
    109	000164	062701 	000060 			ADD	#'0,R1		; MAKE REMAINDER ASCII DIGIT
    110	000170	110023 				MOVB	R0,(R3)+	; STORE HIGH DIGIT
    111	000172	110123 				MOVB	R1,(R3)+	; STORE LOW DIGIT
    112	000174					RETURN
    113
    114					;
    115					;
    116	000176					$END	DATIM
    117					;
    118					;
    119		000001 				.END
DATIM	D0201, CONVERT DATE AND	MACRO M1108  05-DEC-77 16:58  PAGE 8-1
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	ID$$$ = 000201   	LOWFCN= 000011   	V.LABL  000040
AC.LCK= 000001   	F.NACS  000036   	I.ACTL  000035   	MFDFNO= 000004   	V.LGTH  000056
BITFNU= 000002   	F.NLCK  000037   	I.AST   000020   	MFDFSQ= 000004   	V.LRUC  000035
DATDEC  000150R  	F.NWAC  000040   	I.ATL   000006   	M$$HDR= 000001   	V.SBCL  000021
DATMON  000000R  	F.RVN   000012   	I.CRDT= 000031   	M.CTSZ= 000006   	V.SBLB  000024
DATMOS= 000003   	F.SCHA  000021   	I.CRTI= 000040   	M.EFNU= 000002   	V.SBSZ  000022
EX.AC1= 000001   	F.SIZE  000032   	I.DASZ= 000007   	M.EFSQ= 000004   	V.STAT  000054
EX.AC2= 000002   	F.STAT  000040   	I.DPB   000011   	M.ERVN= 000001   	V.STD   000004
EX.ADF= 000010   	F.STD   000004   	I.EFN   000013   	M.ESQN= 000000   	V.TRCT  000000
EX.ENA= 000200   	F.UCHA  000020   	I.EXDT= 000046   	M.LBSZ= 000007   	V.WISZ  000020
EX.FCO= 000004   	F11PR$= 000000   	I.EXTD  000030   	M.MAX = 000011   	WI.BPS= 100000
E$$MSG= 000001   	G.TICP= 000016   	I.FCN   000014   	M.RTRV= 000012   	WI.DLK= 010000
E$$TRP= 000001   	G.TICT= 000014   	I.FIDP  000024   	M.USE = 000010   	WI.EXT= 002000
FCPLUN= 000001   	G.TIDA= 000004   	I.FNAM= 000000   	QIOEFN= 000002   	WI.LCK= 004000
FC.CEF= 020000   	G.TIHR= 000006   	I.FNBP  000036   	R$$10F= 000001   	WI.RDV= 000400
FC.DIR= 040000   	G.TIMI= 000010   	I.FTYP= 000006   	R$$11D= 000001   	WI.WRV= 001000
FC.FCO= 010000   	G.TIMO= 000002   	I.FVER= 000010   	SC.BAD= 000100   	W.CTL   000000
FC.WAC= 100000   	G.TISC= 000012   	I.IOSB  000016   	SC.MDL= 000200   	W.FCB   000002
FP.DEL= 000010   	G.TIYR= 000000   	I.LGTH  000040   	S.HDHD= 000056   	W.RTRV  000012
FP.EXT= 000004   	HIFCN = 000030   	I.LNK   000000   	S.IDHD= 000056   	W.STD   000004
FP.RAT= 000001   	H.CKSM= 000776   	I.LUN   000012   	S.MPHD= 000012   	W.VBN   000006
FP.RDV= 000001   	H.FCHA= 000014   	I.PRI   000010   	S.STBK= 000012   	W.WISZ  000007
FP.WRV= 000002   	H.FLEV= 000006   	I.PRM   000024   	UC.CON= 000200   	$DIV  = ****** GX
F$$LVL= 000001   	H.FNUM= 000002   	I.RTRV  000034   	UC.DLK= 000100   	$MUL  = ****** GX
F.DREF  000042   	H.FOWN= 000010   	I.RVDT= 000014   	VC.BMW= 000002   	$$    = 000067
F.DRNM  000044   	H.FPRO= 000012   	I.RVNO= 000012   	VC.IFW= 000001   	$$$OST= 000020
F.FEXT  000002   	H.FSEQ= 000004   	I.RVTI= 000023   	V.FCB   000006   	.DATIM  000044RG
F.FNUM  000006   	H.IDOF= 000000   	I.RWAD= 000024   	V.FFNU  000055   	.DFEXT= 000005
F.FOWN  000014   	H.MPOF= 000001   	I.RWAT  000026   	V.FIEX  000025   	.DFPRO= 164000
F.FPRO  000016   	H.PROG= 000010   	I.RWCT= 000026   	V.FMAX  000016   	.PRFIL= 000004
F.FSEQ  000010   	H.PROJ= 000011   	I.RWVB= 000032   	V.FPRO  000030   	.RTPTF= 001401
F.FSQN  000013   	H.SCHA= 000015   	I.STD   000004   	V.FRBK  000034   	.SYUIC= 000010
F.FVBN  000046   	H.UCHA= 000014   	I.TISZ= 000006   	V.IBLB  000012   	.VBSIZ= 001000
F.HDLB  000022   	H.UFAT= 000016   	I.UIC   000022   	V.IBSZ  000013   	...GBL= 000000
F.LBN   000026   	IDXFNU= 000001   	LEV11M= 000401   	V.IFWI  000002   	...TPC= 000012
F.LGTH  000052

. ABS.	000056	   000
      	000176	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2647 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:20
[40,10]DATIM,[40,20]DATIM/-SP=[40,30]RSXDC,F11PRE,DATIM
RSXDC	MACRO M1108  05-DEC-77 16:59  PAGE 3


      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.
DEACC	D0212, DEACCESS A FILE	MACRO M1108  05-DEC-77 16:59  PAGE 6


      1						.TITLE	DEACC	D0212, DEACCESS A FILE
						.IDENT	"D0212"
      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					;
					; VERSION D212, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  11 JAN 75  20:22
     23					; PETER H. LIPMAN	22-JAN-74
     24					;
     25					; DEACCESS QI/O
     26
     27					;
     28					;+
     29					; **.DEACC-DEACCESS A FILE
     30					;
     31					; THIS ROUTINE IMPLEMENTS THE DEACCESS QI/O.
     32					;
     33					; IF THE USER SPECIFIED THAT THE USER'S FILE ATTRIBUTES SHOULD BE WRITTEN
     34					; TO THE FILE HEADER, THE HEADER IS READ, UPDATED AND WRITTEN. IF THE
     35					; USER'S FILE ATTRIBUTE ADDRESS WAS NOT SPECIFIED AND THE DEACCESS LOCK WAS
     36					; ENABLED IN THE WINDOW, THEN THE FILE HEADER IS READ, THE DEACCESS LOCK
     37					; BIT IS SET AND THE HEADER IS WRITTEN. FINALLY THE FILE CONTROL BLOCK IS
     38					; DEACCESSED BY CALLING .CLDAC
     39					;
     40					; INPUTS:
     41					;
     42					; 	R4=VOLUME CONTROL BLOCK
     43					; 	R5=I/O PACKET
     44					;
     45					; OUTPUTS:
     46					;
     47					; 	R0-R3 ALTERED
     48					; 	R4-R5 PRESERVED
     49					; 	RETURNS IN LINE IF AND ONLY IF SUCCESSFUL
     50					;
     51					; EFFECTS:
     52					; 	LUTN2	CLEARED IN USER LOGICAL UNIT TABLE
     53					; 	.HDBUF	CONTAINS THIS HEADER IF THE USER
     54					; 		WROTE FILE ATTRIBUTES OR ENABLED THE
DEACC	D0212, DEACCESS A FILE	MACRO M1108  05-DEC-77 16:59  PAGE 6-1


     55					; 		DEACCESS LOCK AT ACCESS TIME.
     56					;
     57					;-
     58
     59						.ENABL	LSB
     60
     62	000000				.PURGD::			; ALTERNATE ENTRY FOR FILE PURGE
     63	000000	016703 	000000G			MOV	.ATLAD,R3	; GET CALLER'S ATL ADDR
     64	000004	000413 				BR	20$		; AND SKIP PACKET VALIDATION
     65
     67	000006				.DEACC::
     68	000006	010500 				MOV	R5,R0
     69	000010	062700 	000030 			ADD	#I.EXTD,R0	; FILE ID AND ATTRIBUTES OPTIONAL
     70	000014	012001 				MOV	(R0)+,R1	; NO EXTEND (2 WORDS)
     71	000016	052001 				BIS	(R0)+,R1
     72	000020	005720 				TST	(R0)+		; IGNORE ACCESS
     73	000022	052001 				BIS	(R0)+,R1	; NO FILE NAME BLOCK
     77	000024	001401 				BEQ	10$
     78	000026					ERRX	IE.BAD,<ILLEGAL DEACCESS PARAMETERS>
	000026	   000C	   211 			TRAP	-IE.BAD		; ILLEGAL DEACCESS PARAMETERS
     79
     80	000030				10$:
     82	000030	016503 	000006 			MOV	I.ATL(R5),R3	; POINT TO CALLER'S ATL
     84	000034				20$:	CALL	.GTFID
     86	000040	005767 	000000G			TST	.WNDOW
     87	000044	001001 				BNE	30$		; CHECK IF WINDOW INDEED EXISTS
     88	000046					ERRX	IE.NLN,<NO FILE ACCESSED ON LUN>
	000046	   000C	   211 			TRAP	-IE.NLN		; NO FILE ACCESSED ON LUN
     89
     93	000050				30$:
     96	000050	005314 				DEC	(R4)		; DECREMENT VOLUME TRANSACTION COUNT
     97	000052	105267 	000000G			INCB	.EXSTS		; INDICATE DEACCESS VALID FOR CLEANUP
     98
     99	000056	032777 	001000 	000000G		BIT	#WI.WRV,@.WNDOW	; FILE ACCESSED FOR WRITING
    100	000064	001441 				BEQ	50$		; BRANCH IF NO, SKIP HEADER UPDATE
    101					;
    102					; FILE IS ACCESSED FOR WRITING, READ AND UPDATE THE HEADER
    103					;
    104	000066					CALL	.RDFHD		; READ THE FILE HEADER
    105	000072	005003 				CLR	R3		;
    106	000074	156703 	000000G			BISB	.HDBUF+H.IDOF,R3 ; OFFSET TO IDENT AREA
    107	000100	006303 				ASL	R3
    108	000102	062703 	000012G			ADD	#.HDBUF+I.RVNO,R3 ; R3=ADDRESS OF REVISION NUMBER
    109	000106	005223 				INC	(R3)+		; INCREMENT REVISION NUMBER
    110	000110					CALL	.DATIM		; AND SET REVISION DATA AND TIME
    111	000114	112767 	000003 	000000G		MOVB	#3,.EXSTS	; HEADER MUST BE WRITTEN IF ERROR
    112
    113					; SET DEACCESS LOCK IN FILE HEADER IF SPECIFIED.
    114
    115	000122	032777 	010000 	000000G		BIT	#WI.DLK,@.WNDOW	; DEACCESS LOCK ENABLED?
    116	000130	001403 				BEQ	40$		; BRANCH IF NO
    117	000132	152767 	000100 	000014G		BISB	#UC.DLK,.HDBUF+H.UCHA ; SET DEACCESS LOCK INDICATION
    118					;
    119					; WRITE ATTRIBUTES IF SPECIFIED
    120					;
    121	000140				40$:
    123	000140	005705 				TST	R5		; CHECK IF I/O PACKET EXISTS
DEACC	D0212, DEACCESS A FILE	MACRO M1108  05-DEC-77 16:59  PAGE 6-2


    124	000142	001423 				BEQ	70$		; NO - SKIP WRITE ATTRIBUTES
    126	000144	005765 	000026 			TST	I.RWAT(R5)
    127	000150	001420 				BEQ	70$		; BRANCH IF NO ATTRIBUTES SPECIFIED
    128	000152	010500 				MOV	R5,R0		; R0 NON-ZERO - UNPROTECTED ITEMS ONLY
    129	000154					CALL	.WATCM		; WRITE THE ATTRIBUTES
    130	000160	142767 	000100 	000014G		BICB	#UC.DLK,.HDBUF+H.UCHA ; SUCCESSFUL - CLEAR DEACCESS LOCK
    131	000166	000411 				BR	70$		;
    132					;
    133					; FILE WAS ACCESSED READ ONLY
    134					;
    135	000170	016700 	000000G		50$:	MOV	.FCBAD,R0	; R0=FILE CONTROL BLOCK ADDRESS
    136	000174					ASSUME	SC.MDL,200	; DELETE BIT IS SIGN BIT OF THE BYTE
    137	000174	105760 	000021 			TSTB	F.SCHA(R0)	; IS THIS FILE MARKED FOR DELETE?
    138	000200	100004 				BPL	60$		; BRANCH IF NO
    139	000202					CALL	.RDFHD		; YES, MUST READ THE FILE HEADER
    140	000206	105267 	000000G			INCB	.EXSTS		; INDICATE THAT .CLDAC MUST CHECK DELETE BIT
    141	000212				60$:
    149	000212				70$:	CALLR	.CLDAC
    150
    151						.DSABL	LSB
    152					;
    153					;
    154	000216					$END	DEACC
    155					;
    156					;
    157		000001 				.END
DEACC	D0212, DEACCESS A FILE	MACRO M1108  05-DEC-77 16:59  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.NLCK  000037   	I.EFN   000013   	M.ESQN= 000000   	V.TRCT  000000
AC.LCK= 000001   	F.NWAC  000040   	I.EXDT= 000046   	M.LBSZ= 000007   	V.WISZ  000020
BITFNU= 000002   	F.RVN   000012   	I.EXTD  000030   	M.MAX = 000011   	WI.BPS= 100000
EX.AC1= 000001   	F.SCHA  000021   	I.FCN   000014   	M.RTRV= 000012   	WI.DLK= 010000
EX.AC2= 000002   	F.SIZE  000032   	I.FIDP  000024   	M.USE = 000010   	WI.EXT= 002000
EX.ADF= 000010   	F.STAT  000040   	I.FNAM= 000000   	QIOEFN= 000002   	WI.LCK= 004000
EX.ENA= 000200   	F.STD   000004   	I.FNBP  000036   	R$$10F= 000001   	WI.RDV= 000400
EX.FCO= 000004   	F.UCHA  000020   	I.FTYP= 000006   	R$$11D= 000001   	WI.WRV= 001000
E$$MSG= 000001   	F11PR$= 000000   	I.FVER= 000010   	SC.BAD= 000100   	W.CTL   000000
E$$TRP= 000001   	HIFCN = 000030   	I.IOSB  000016   	SC.MDL= 000200   	W.FCB   000002
FCPLUN= 000001   	H.CKSM= 000776   	I.LGTH  000040   	S.HDHD= 000056   	W.RTRV  000012
FC.CEF= 020000   	H.FCHA= 000014   	I.LNK   000000   	S.IDHD= 000056   	W.STD   000004
FC.DIR= 040000   	H.FLEV= 000006   	I.LUN   000012   	S.MPHD= 000012   	W.VBN   000006
FC.FCO= 010000   	H.FNUM= 000002   	I.PRI   000010   	S.STBK= 000012   	W.WISZ  000007
FC.WAC= 100000   	H.FOWN= 000010   	I.PRM   000024   	UC.CON= 000200   	$$    = 000067
FP.DEL= 000010   	H.FPRO= 000012   	I.RTRV  000034   	UC.DLK= 000100   	.ATLAD= ****** GX
FP.EXT= 000004   	H.FSEQ= 000004   	I.RVDT= 000014   	VC.BMW= 000002   	.CLDAC= ****** GX
FP.RAT= 000001   	H.IDOF= 000000   	I.RVNO= 000012   	VC.IFW= 000001   	.DATIM= ****** GX
FP.RDV= 000001   	H.MPOF= 000001   	I.RVTI= 000023   	V.FCB   000006   	.DEACC  000006RG
FP.WRV= 000002   	H.PROG= 000010   	I.RWAD= 000024   	V.FFNU  000055   	.DFEXT= 000005
F$$LVL= 000001   	H.PROJ= 000011   	I.RWAT  000026   	V.FIEX  000025   	.DFPRO= 164000
F.DREF  000042   	H.SCHA= 000015   	I.RWCT= 000026   	V.FMAX  000016   	.EXSTS= ****** GX
F.DRNM  000044   	H.UCHA= 000014   	I.RWVB= 000032   	V.FPRO  000030   	.FCBAD= ****** GX
F.FEXT  000002   	H.UFAT= 000016   	I.STD   000004   	V.FRBK  000034   	.GTFID= ****** GX
F.FNUM  000006   	IDXFNU= 000001   	I.TISZ= 000006   	V.IBLB  000012   	.HDBUF= ****** GX
F.FOWN  000014   	ID$$$ = 000212   	I.UIC   000022   	V.IBSZ  000013   	.PRFIL= 000004
F.FPRO  000016   	IE.BAD= ****** GX	LEV11M= 000401   	V.IFWI  000002   	.PURGD  000000RG
F.FSEQ  000010   	IE.NLN= ****** GX	LOWFCN= 000011   	V.LABL  000040   	.RDFHD= ****** GX
F.FSQN  000013   	I.ACTL  000035   	MFDFNO= 000004   	V.LGTH  000056   	.RTPTF= 001401
F.FVBN  000046   	I.AST   000020   	MFDFSQ= 000004   	V.LRUC  000035   	.SYUIC= 000010
F.HDLB  000022   	I.ATL   000006   	M$$HDR= 000001   	V.SBCL  000021   	.VBSIZ= 001000
F.LBN   000026   	I.CRDT= 000031   	M.CTSZ= 000006   	V.SBLB  000024   	.WATCM= ****** GX
F.LGTH  000052   	I.CRTI= 000040   	M.EFNU= 000002   	V.SBSZ  000022   	.WNDOW= ****** GX
F.LINK  000000   	I.DASZ= 000007   	M.EFSQ= 000004   	V.STAT  000054   	...GBL= 000000
F.NACS  000036   	I.DPB   000011   	M.ERVN= 000001   	V.STD   000004   	...TPC= 000012

. ABS.	000056	   000
      	000216	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2590 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:18
[40,10]DEACC,[40,20]DEACC/-SP=[40,30]RSXDC,F11PRE,DEACC
RSXDC	MACRO M1108  05-DEC-77 16:53  PAGE 3


      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.
DISPAT	D0221, DEQUEUE & DISPAT	MACRO M1108  05-DEC-77 16:53  PAGE 6


      1						.TITLE	DISPAT	D0221, DEQUEUE & DISPATCH
						.IDENT	"D0221"
      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					;
					; VERSION D221, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  12 FEB 75  16:35
     23					; PETER LIPMAN	17-JAN-74
     24					;
     25					; DEQUEUE AND DISPATCH AN ANCILLARY CONTROL PROCESSOR REQUEST
     26					;
     27					; MCALL THE MACRO USED IN THIS MODULE
     28					;
     33						.MCALL	RCVX$S,SVTK$S
     35
     36					;
     37					; DISPATCH TABLE FOR QI/O FUNCTION CODE (LOWFCN-1)
     38					;
     39
     40	000000				DSPFCN:
     47	000000	000000G				.WORD	.FNDNM		; 11=FIND FILE IN DIRECTORY
     48	000002	000454'				.WORD	ILLCOD		; 12=UNUSED
     49	000004	000000G				.WORD	.RMVNM		; 13=REMOVE FILE FROM DIRECTORY
     50	000006	000000G				.WORD	.ENTNM		; 14=ENTER FILE IN DIRECTORY
     51	000010	000000G				.WORD	.ACCES		; 15=ACCESS FOR READ
     52	000012	000000G				.WORD	.ACCES		; 16=ACCESS FOR READ, WRITE
     53	000014	000000G				.WORD	.ACCES		; 17=ACCESS FOR READ, WRITE, EXT.
     54	000016	000000G				.WORD	.DEACC		; 20=DEACCESS FILE
     55	000020	000000G				.WORD	.RWVB		; 21=READ, VIRTUAL BLOCK
     56	000022	000000G				.WORD	.RWVB		; 22=WRITE VIRTUAL BLOCK
     57	000024	000000G				.WORD	.EXTEN		; 23=EXTEND FILE
     58	000026	000000G				.WORD	.CRFIL		; 24=CREATE FILE
     59	000030	000000G				.WORD	.DLMRK		; 25=MARK FILE FOR DELETE
     60	000032	000000G				.WORD	.RDATT		; 26=READ ATTRIBUTES
     61	000034	000000G				.WORD	.WRATT		; 27=WRITE ATTRIBUTES
     63	000036	000000G				.WORD	.CNTRL		; 30=ACP CONTROL
     65
     66	000040					ASSUME	<<<.-DSPFCN>/2>+LOWFCN-1>,HIFCN
     67
DISPAT	D0221, DEQUEUE & DISPAT	MACRO M1108  05-DEC-77 16:53  PAGE 6-1


     68					;
     69					; OTHER READ ONLY TRANSFER VECTORS
     70					;
     71
     72	000040	000000G			.EXCM1::.WORD	.EXCOM		; EXTEND FILE OVERLAY
     73	000042	000000G			.IXEX1::.WORD	.IXEXT		; INDEX FILE EXTEND
     74	000044	000000G			.CLEX1::.WORD	.CLEXT		; CLEAN UP EXTEND OPERATION
     76	000046	000000G			.CLEX2::.WORD	.CLEXI		; CLEAN UP EXTEND AND EXTEND INDEX FILE
     77	000050	000000G			.EXTH1::.WORD	.EXTHD		; CREATE AN EXTENSION FILE HEADER
     78	000052	000000G			.EXCM2::.WORD	.EXCMH		; RETURN TO EXCOM WITH NEW FILE HEADER
     80	000054	000000G			.DLFL1::.WORD	.DLFIL		; DELETE A FILE
     81	000056	000000G			.CLFC1::.WORD	.CLFCB		; CLEAN UP FCB FROM WRITE ERROR
     82	000060	000000G			.DREX1::.WORD	.DREXT		; DIRECTORY EXTEND ROUTINE
     83	000062	000000G			.DREF1::.WORD	.DREOF		; RESET DIRECTORY END OF FE
     84	000064	000000G			.DRAC1::.WORD	.DRACC		; ACCESS A DIRECTORY FILE
     85	000066	000000G			.RWVB1::.WORD	.RWVBL		; READ/WRITE VIRTUAL LONG
     87	000070	000000G			.DMOU1::.WORD	.DMOUN
     89					;
     90					; DEQUEUE AN I/O PACKET IF ANY WAITING, OTHERWISE WAIT.
     91					;
     92
    112	000072				.START::
    114	000072					SVTK$S	#.SSTVC,#.SSTSZ
    116	000110					RCVX$S	,#.RCVBF	; RECEIVE FROM ANY TASK
    118					;
    119					; I/O PACKET IN .IOPKT, NO REGISTERS SET UP, COME HERE TO
    120					; RE-EXECUTE A GIVEN I/O PACKET
    121					;
    122	000126				.AGAIN::
    123	000126	016705 	000000G			MOV	.IOPKT,R5
    129	000132	016704 	000000G			MOV	.UCBAD,R4	; GET PUD ADDRESS
    130					;
    131					; ASSIGN OUR LUN TO THE DEVICE IN QUESTION.
    132					;
    133	000136	016700 	000000G			MOV	.CRTSK,R0	; GET ATL ADDRESS OF THIS TASK
    134	000142					GTSKHD	R0		; MAP TO TASK HEADER
    135	000146	010460 	000002G			MOV	R4,H.LUT+2+<<FCPLUN-1>*4>(R0) ; STUFF PUD POINTER INTO
    136									; OUR LUT TO ASSIGN IT
    137	000152					XTSKHD			; RESTORE MAPPING
    138
    139	000152	016404 	000000G			MOV	U.VA(R4),R4	; R4=VOLUME CONTROL BLOCK ADDRESS
    140	000156	016703 	000000G			MOV	.IOFC,R3	; GET THE I/O FUNCTION CODE
    141	000162	020327 	000000G			CMP	R3,#SF.PRG	; CHECK FOR I/O RUNDOWN CALL
    142	000166	001002 				BNE	30$		; NO - EXECUTE THE I/O PACKET
    143	000170	000167 	000000G			JMP	.PURGE		; YES - GO DO IT
    145					;
    146					; INITIALIZE THE MAIN FCP IMPURE AREA
    147					;
    148	000174	012701 	000000G		30$:	MOV	#.ZERCT,R1	; R1=COUNT OF WORDS TO ZERO
    149	000200	012700 	000000G			MOV	#.IOSTS,R0	;
    150	000204	012720 	000001 			MOV	#1,(R0)+	; .IOSTS=1
    151	000210	005020 			40$:	CLR	(R0)+		; ZERO VOLATILE FCP CONTEXT
    152	000212	077102 				SOB	R1,40$
    154					;
    155					; GET THE WINDOW POINTER FROM THE CALLER'S LUT
    156					;
    157	000214	016500 	000006 			MOV	I.ATL(R5),R0	; GET CALLER'S ATL
DISPAT	D0221, DEQUEUE & DISPAT	MACRO M1108  05-DEC-77 16:53  PAGE 6-2


    158	000220					GTSKHD	R0		; MAP TO HIS TASK HEADER
    159	000224	116501 	000012 			MOVB	I.LUN(R5),R1	; GET LUN NUMBER
    160	000230	006301 				ASL	R1		; CONVERT TO BYTE OFFSET
    161	000232	006301 				ASL	R1
    162	000234	060100 				ADD	R1,R0		; FORM ADDRESS
    163	000236	016067 	000000G	000000G		MOV	H.LUT(R0),.LUTN2 ; GET CALLER'S WINDOW POINTER
    164	000244					XTSKHD			; RESTORE MAPPING
    165
    166	000244	020327 	000000G			CMP	R3,#IO.APV	; SEE IF THIS IS A PRIVILEGED CONTROL FCN
    167	000250	001402 				BEQ	50$		; YES
    168	000252	005704 				TST	R4		; NO - VOLUME MUST BE MOUNTED
    169	000254	001500 				BEQ	NMOUNT		; VOLUME DISMOUNTED WHILE THIS WAS IN THE QUEUE
    170					;
    171					; CLEAN OUT UNSPECIFIED PARAMETERS IN THE I/O PACKET
    172					;
    173	000256	116500 	000011 		50$:	MOVB	I.DPB(R5),R0	; GET DPB SIZE
    174	000262	162700 	000014 			SUB	#12.,R0		; COMPARE TO MAXIMUM
    175	000266	003072 				BGT	ILLCOD		; DPB TOO LARGE - OUT
    176	000270	001411 				BEQ	.DSPAT		; FULL SIZE DPB - NOTHING TO CLEAN OUT
    177	000272	005400 				NEG	R0		; POSITIVE COUNT OF UNUSED WORDS
    178	000274	020027 	000006 			CMP	R0,#6		; CHECK COUNT
    179	000300	101065 				BHI	ILLCOD		; ONLY THE PARMETERS ARE OPTIONAL!
    180	000302	010501 				MOV	R5,R1		; COPY PACKET ADDRESS
    181	000304	062701 	000040 			ADD	#I.LGTH,R1	; POINT TO END OF I/O PACKET
    182	000310	005041 			60$:	CLR	-(R1)		; CLEAR OUT UNUSED PARAMETERS
    183	000312	077002 				SOB	R0,60$
    185
    186					;
    187					; R5=I/O PACKET ADDRESS, R4=VCB ADDRESS
    188					;
    189
    190	000314				.DSPAT::
    191	000314	012706 	000000G			MOV	#.STACK,SP	; INIT THE STACK
    192	000320	116500 	000015 			MOVB	I.FCN+1(R5),R0
    193	000324	162700 	000010 			SUB	#LOWFCN-1,R0	; 5-27(8)
    194	000330	003451 				BLE	ILLCOD
    195	000332	022700 	000020 			CMP	#HIFCN-LOWFCN+1,R0
    196	000336	002446 				BLT	ILLCOD
    197	000340	006300 			80$:	ASL	R0		; DOUBLE TO WORD INDEX
    198	000342	010067 	000000G			MOV	R0,.EXDSP	; SAVE FOR .ERRX
    199					;
    200					; DISPATCH TO DESIRED FUNCTION
    201					;
    202
    203	000346					CALL	@DSPFCN-2(R0)
    204					;
    205					; R4=VCB ADDRESS, R5=I/O PACKET ADDRESS
    206					;
    207
    218	000352	026727 	000000G	000000G	.EXIT::	CMP	.IOFC,#SF.PRG	; IS THIS A PURGE IN PROGRESS?
    219	000360	001002 				BNE	90$		; NO
    220	000362	000167 	000000G			JMP	.PURGX		; YES - CONTINUE PURGE FROM ERROR
    221	000366	016703 	000000G		90$:	MOV	.ERMSG,R3	; PICK UP ERROR MESSAGE CODE
    222	000372	001402 				BEQ	100$		; BRANCH IF NONE
    223	000374					CALL	.ERRMG		; OUTPUT TO MESSAGE TASK
    224	000400	016500 	000006 		100$:	MOV	I.ATL(R5),R0	; GET CALLER'S ATL ADDRESS
    225	000404					GTSKHD	R0		; MAP TO HIS TASK HEADER
DISPAT	D0221, DEQUEUE & DISPAT	MACRO M1108  05-DEC-77 16:53  PAGE 6-3


    226	000410	116501 	000012 			MOVB	I.LUN(R5),R1	; GET HIS LUN
    227	000414	006301 				ASL	R1		; CONVERT TO BYTE OFFSET
    228	000416	006301 				ASL	R1
    229	000420	060100 				ADD	R1,R0		; FORM ADDRESS
    230	000422	016760 	000000G	000000G		MOV	.LUTN2,H.LUT(R0) ; UPDATE HIS WINDOW POINTER
    231	000430					XTSKHD			; RESTORE MAPPING
    232
    233	000430	010501 				MOV	R5,R1		; GET I/O PACKET ADDRESS
    234	000432	005002 				CLR	R2
    235	000434	016703 	000000G			MOV	.IOSTS,R3	; PICK UP I/O STATUS WORDS
    236	000440	016704 	000002G			MOV	.IOSTS+2,R4
    237	000444					CALL	..IODN		; AND SIGNAL I/O DONE
    238	000450	000167 	177416 			JMP	.START		; GO TO THE TOP
    240
    241					;
    242					; ILLEGAL FUNCTION CODE-SHOULD NOT HAVE BEEN QUEUED TO F11ACP
    243					;
    244
    245	000454				ILLCOD:	ERRX	IE.BAD
	000454	   000C	   211 			TRAP	-IE.BAD		;
    247					;
    248					; VOLUME FOUND DISMOUNTED - REJECT THE REQUEST
    249					;
    250	000456				NMOUNT:	ERRX	IE.PRI,<PRIVILEGE VIOLATION - VOLUME NOT MOUNTED>
	000456	   000C	   211 			TRAP	-IE.PRI		; PRIVILEGE VIOLATION - VOLUME NOT MOUNTED
    258					;
    259					;
    260	000460					$END	DISPAT
    261					;
    262					;
    263		000072'				.END	.START
DISPAT	D0221, DEQUEUE & DISPAT	MACRO M1108  05-DEC-77 16:53  PAGE 6-4
SYMBOL TABLE

AC.DLK= 000002   	H.CKSM= 000776   	I.RVTI= 000023   	V.IFWI  000002   	.DREF1  000062RG
AC.LCK= 000001   	H.FCHA= 000014   	I.RWAD= 000024   	V.LABL  000040   	.DREOF= ****** GX
A.HA  = ****** GX	H.FLEV= 000006   	I.RWAT  000026   	V.LGTH  000056   	.DREXT= ****** GX
BITFNU= 000002   	H.FNUM= 000002   	I.RWCT= 000026   	V.LRUC  000035   	.DREX1  000060RG
DSPFCN  000000R  	H.FOWN= 000010   	I.RWVB= 000032   	V.SBCL  000021   	.DSPAT  000314RG
EX.AC1= 000001   	H.FPRO= 000012   	I.STD   000004   	V.SBLB  000024   	.ENTNM= ****** GX
EX.AC2= 000002   	H.FSEQ= 000004   	I.TISZ= 000006   	V.SBSZ  000022   	.ERMSG= ****** GX
EX.ADF= 000010   	H.IDOF= 000000   	I.UIC   000022   	V.STAT  000054   	.ERRMG= ****** GX
EX.ENA= 000200   	H.LUT = ****** GX	LEV11M= 000401   	V.STD   000004   	.EXCMH= ****** GX
EX.FCO= 000004   	H.MPOF= 000001   	LOWFCN= 000011   	V.TRCT  000000   	.EXCM1  000040RG
E$$MSG= 000001   	H.PROG= 000010   	MFDFNO= 000004   	V.WISZ  000020   	.EXCM2  000052RG
E$$TRP= 000001   	H.PROJ= 000011   	MFDFSQ= 000004   	WI.BPS= 100000   	.EXCOM= ****** GX
FCPLUN= 000001   	H.SCHA= 000015   	M$$HDR= 000001   	WI.DLK= 010000   	.EXDSP= ****** GX
FC.CEF= 020000   	H.UCHA= 000014   	M.CTSZ= 000006   	WI.EXT= 002000   	.EXIT   000352RG
FC.DIR= 040000   	H.UFAT= 000016   	M.EFNU= 000002   	WI.LCK= 004000   	.EXTEN= ****** GX
FC.FCO= 010000   	IDXFNU= 000001   	M.EFSQ= 000004   	WI.RDV= 000400   	.EXTHD= ****** GX
FC.WAC= 100000   	ID$$$ = 000221   	M.ERVN= 000001   	WI.WRV= 001000   	.EXTH1  000050RG
FP.DEL= 000010   	IE.BAD= ****** GX	M.ESQN= 000000   	W.CTL   000000   	.FNDNM= ****** GX
FP.EXT= 000004   	IE.PRI= ****** GX	M.LBSZ= 000007   	W.FCB   000002   	.IOFC = ****** GX
FP.RAT= 000001   	ILLCOD  000454R  	M.MAX = 000011   	W.RTRV  000012   	.IOPKT= ****** GX
FP.RDV= 000001   	IO.APV= ****** GX	M.RTRV= 000012   	W.STD   000004   	.IOSTS= ****** GX
FP.WRV= 000002   	I.ACTL  000035   	M.USE = 000010   	W.VBN   000006   	.IXEXT= ****** GX
F$$LVL= 000001   	I.AST   000020   	NMOUNT  000456R  	W.WISZ  000007   	.IXEX1  000042RG
F.DREF  000042   	I.ATL   000006   	QIOEFN= 000002   	$$    = 000067   	.LUTN2= ****** GX
F.DRNM  000044   	I.CRDT= 000031   	R$$10F= 000001   	$$$T1 = 000004   	.PRFIL= 000004
F.FEXT  000002   	I.CRTI= 000040   	R$$11D= 000001   	.ACCES= ****** GX	.PURGE= ****** GX
F.FNUM  000006   	I.DASZ= 000007   	SC.BAD= 000100   	.AGAIN  000126RG 	.PURGX= ****** GX
F.FOWN  000014   	I.DPB   000011   	SC.MDL= 000200   	.CLEXI= ****** GX	.RCVBF= ****** GX
F.FPRO  000016   	I.EFN   000013   	SF.PRG= ****** GX	.CLEXT= ****** GX	.RDATT= ****** GX
F.FSEQ  000010   	I.EXDT= 000046   	S.HDHD= 000056   	.CLEX1  000044RG 	.RMVNM= ****** GX
F.FSQN  000013   	I.EXTD  000030   	S.IDHD= 000056   	.CLEX2  000046RG 	.RTPTF= 001401
F.FVBN  000046   	I.FCN   000014   	S.MPHD= 000012   	.CLFCB= ****** GX	.RWVB = ****** GX
F.HDLB  000022   	I.FIDP  000024   	S.STBK= 000012   	.CLFC1  000056RG 	.RWVBL= ****** GX
F.LBN   000026   	I.FNAM= 000000   	UC.CON= 000200   	.CNTRL= ****** GX	.RWVB1  000066RG
F.LGTH  000052   	I.FNBP  000036   	UC.DLK= 000100   	.CRFIL= ****** GX	.SSTSZ= ****** GX
F.LINK  000000   	I.FTYP= 000006   	U.VA  = ****** GX	.CRTSK= ****** GX	.SSTVC= ****** GX
F.NACS  000036   	I.FVER= 000010   	VC.BMW= 000002   	.DEACC= ****** GX	.STACK= ****** GX
F.NLCK  000037   	I.IOSB  000016   	VC.IFW= 000001   	.DFEXT= 000005   	.START  000072RG
F.NWAC  000040   	I.LGTH  000040   	V.FCB   000006   	.DFPRO= 164000   	.SYUIC= 000010
F.RVN   000012   	I.LNK   000000   	V.FFNU  000055   	.DLFIL= ****** GX	.UCBAD= ****** GX
F.SCHA  000021   	I.LUN   000012   	V.FIEX  000025   	.DLFL1  000054RG 	.VBSIZ= 001000
F.SIZE  000032   	I.PRI   000010   	V.FMAX  000016   	.DLMRK= ****** GX	.WRATT= ****** GX
F.STAT  000040   	I.PRM   000024   	V.FPRO  000030   	.DMOUN= ****** GX	.ZERCT= ****** GX
F.STD   000004   	I.RTRV  000034   	V.FRBK  000034   	.DMOU1  000070RG 	..IODN= ****** GX
F.UCHA  000020   	I.RVDT= 000014   	V.IBLB  000012   	.DRACC= ****** GX	...GBL= 000000
F11PR$= 000000   	I.RVNO= 000012   	V.IBSZ  000013   	.DRAC1  000064RG 	...TPC= 000012
HIFCN = 000030

. ABS.	000056	   000
      	000460	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2921 WORDS  ( 12 PAGES)
DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:00:24
[40,10]DISPAT,[40,20]DISPAT/-SP=[40,30]RSXDC,F11PRE,DISPAT
RSXDC	MACRO M1108  05-DEC-77 16:59  PAGE 3


      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.
DLBLK	D0201, DELETE BLOCKS FR	MACRO M1108  05-DEC-77 16:59  PAGE 6


      1						.TITLE	DLBLK	D0201, DELETE BLOCKS FROM FILE
						.IDENT	"D0201"
      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					;
					; VERSION D201, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  5 SEP 74  23:21:06
     23					; PETER H. LIPMAN	27-FEB-74
     24					;
     25					; RELEASE THE BLOCKS IN THE FILE STARTING FROM THE FIRST RETRIEVAL POINTER
     26					; OR FROM THE SPECIFIED RETRIEVAL POINTER
     27					;
     28					;+
     29					; **-.DLBLK-DELETE ALL THE BLOCKS ALLOCATED TO THIS FILE
     30					;
     31					; THIS ROUTINE SCANS THROUGH ALL THE RETRIEVAL POINTERS IN THE FILE HEADER
     32					; AND RELEASES ALL THE BLOCKS REFERENCED. IT DOES NOT WRITE THE FILE
     33					; HEADER AND DOES NOT FORCE THE LAST STORAGE MAP BLOCK TO BE WRITTEN.
     34					;
     35					; INPUTS:
     36					;
     37					; 	R4=VOLUME CONTROL BLOCKS ADDRESS
     38					; 	R5=I/O PACKET ADDRESS
     39					;
     40					; OUTPUTS:
     41					;
     42					; 	R0-R3 ALTERED, R4,R5 PRESERVED
     43					;-
     44
     45	000000				.DLBLK::
     46	000000	005001 				CLR	R1
     47	000002	156701 	000001G			BISB	.HDBUF+H.MPOF,R1
     48	000006	006301 				ASL	R1
     49	000010	062701 	000010G			ADD	#.HDBUF+M.USE,R1 ; R1=PTR TO WORDS OF RTRV PTRS IN USE
     50	000014	010100 				MOV	R1,R0
     51	000016	005720 				TST	(R0)+		; R0 POINTS TO FIRST RTRV PTR TO DELETE
     52					;+
     53					; **-.DLBL1-TRUNCATE THE FILE
     54					;
DLBLK	D0201, DELETE BLOCKS FR	MACRO M1108  05-DEC-77 16:59  PAGE 6-1


     55					; THIS ROUTINE DELETES ALL THE BLOCKS STARTING AT THE SPECIFIED
     56					; RETRIEVAL POINTER TO THE END OF THE FILE
     57					;
     58					; INPUTS:
     59					;
     60					; 	R0=ADDRESS OF FIRST RETRIEVAL POINTER
     61					; 	R1=POINTER TO M.USE IN THE FILE HEADER
     62					; 	R4=VCB ADDRESS
     63					; 	R5=I/O PACKET ADDRESS
     64					;
     65					; OUTPUTS:
     66					;
     67					; 	R0-R3 ALTERED, R4,R5 PRESERVED
     68					;
     69					;-
     70
     71	000020				.DLBL1::
     72	000020	026767 	000000G	000000G		CMP	.UCBAD,.HDUCB	; MAKE SURE IT'S THE RIGHT DEVICE
     73	000026	001401 				BEQ	10$
     74	000030					FATAL	<TRIED TO DELETE FILE OFF WRONG VOLUME>
	000030	000004 				IOT			; *** FATAL ERROR TRIED TO DELETE FILE OFF WRONG VOLUME
     75	000032	005046 			10$:	CLR	-(SP)
     76	000034	151116 				BISB	(R1),(SP)
     77	000036	006316 				ASL	(SP)		; (SP)=BYTES OF RTRV PTRS IN USE
     78	000040	060116 				ADD	R1,(SP)		; (SP)=ADDRESS OF LAST RTRV PTR
     79	000042	020016 			20$:	CMP	R0,(SP)
     80	000044	101047 				BHI	50$		; BRANCH IF NO MORE RTRV PTRS
     81	000046	012705 	000000G			MOV	#.SVLBN,R5
     82	000052	111025 				MOVB	(R0),(R5)+	; STORE LBN IN .SVLBN
     83	000054	105025 				CLRB	(R5)+
     84	000056	016025 	000002 			MOV	2(R0),(R5)+
     85	000062	005025 				CLR	(R5)+		; ZERO .SM1BT, .SM1BT+2
     86	000064	005015 				CLR	(R5)
     87					;
     88					; FORM LBN AND BLOCK COUNT TO DELETE, PUTTING CONTIGUOUS
     89					; RETRIEVAL POINTERS TOGETHER.
     90					;
     91	000066	012705 	000000G		30$:	MOV	#.SVLBN,R5
     92	000072	012501 				MOV	(R5)+,R1	; R1,R2=STARTING LBN
     93	000074	012502 				MOV	(R5)+,R2	;
     94	000076	062501 				ADD	(R5)+,R1	; ADD HIGH ORDER COUNT
     95	000100	061502 				ADD	(R5),R2		; ADD LOW ORDER COUNT
     96	000102	005501 				ADC	R1		;
     97					;
     98					; IS R1,R2 LBN THE STARTING LBN OF THIS RETRIEVAL POINTER?
     99					;
    100	000104	120110 				CMPB	R1,(R0)
    101	000106	001015 				BNE	40$
    102	000110	020260 	000002 			CMP	R2,2(R0)
    103	000114	001012 				BNE	40$
    104					;
    105					; ADD THIS RETRIEVAL POINTER BLOCK COUNT TO THE DELETE COUNT
    106					;
    107	000116	005003 				CLR	R3
    108	000120	156003 	000001 			BISB	1(R0),R3
    109	000124	005203 				INC	R3		; R3=BLOCK COUNT FOR THIS RTRV PTR
    110	000126	060315 				ADD	R3,(R5)		; ADD COUNT TO .SM1BT, .SM1BT+2
DLBLK	D0201, DELETE BLOCKS FR	MACRO M1108  05-DEC-77 16:59  PAGE 6-2


    111	000130	005565 	177776 			ADC	-2(R5)
    112	000134	022020 				CMP	(R0)+,(R0)+	; POINT R0 AT NEXT RETRIEVAL POINTER
    113	000136	020016 				CMP	R0,(SP)		; PROCESSED LAST RETRIEVAL POINTER?
    114	000140	101752 				BLOS	30$		; BRANCH IF NO
    115					;
    116					; R0 POINTS TO NEXT RETRIEVAL POINTER TO DELETE .SVLBN, .SVLBN+2
    117					; CONTAINS THE STARTING LOGICAL BLOCK NUMBER AND .SM1BT, .SM1BT+2
    118					; CONTAINS THE BLOCK COUNT OF THE CHUNK OF BLOCKS TO BE MARKED FREE
    119					; IN THE STORAGE MAP R5 POINTS TO .SM1BT+2
    120					;
    121	000142	010046 			40$:	MOV	R0,-(SP)	; PRESERVE POINTER TO NEXT RTRV PTR
    122	000144	011502 				MOV	(R5),R2		;
    123	000146	014501 				MOV	-(R5),R1	; R1,R2=BLOCK COUNT TO BE FREED
    124	000150	016705 	000000G			MOV	.IOPKT,R5	;
    125	000154					CALL	.SMDEL		; MARK THE BLOCKS FREE
    126	000160	012600 				MOV	(SP)+,R0	;
    127	000162	000727 				BR	20$
    128					;
    129					; ALL RETRIEVAL POINTERS PROCESSED, DEALLOCATION COMPLETE
    130					;
    131	000164	016705 	000000G		50$:	MOV	.IOPKT,R5	; RESTORE R5
    132	000170	005726 				TST	(SP)+		; CLEAN UP THE STACK
    133	000172					RETURN			; AND EXIT TO CALLER
    134					;
    135					;
    136	000174					$END	DLBLK
    137					;
    138					;
    139		000001 				.END
DLBLK	D0201, DELETE BLOCKS FR	MACRO M1108  05-DEC-77 16:59  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.EFN   000013   	M.ERVN= 000001   	V.STAT  000054
AC.LCK= 000001   	F.NLCK  000037   	I.EXDT= 000046   	M.ESQN= 000000   	V.STD   000004
BITFNU= 000002   	F.NWAC  000040   	I.EXTD  000030   	M.LBSZ= 000007   	V.TRCT  000000
EX.AC1= 000001   	F.RVN   000012   	I.FCN   000014   	M.MAX = 000011   	V.WISZ  000020
EX.AC2= 000002   	F.SCHA  000021   	I.FIDP  000024   	M.RTRV= 000012   	WI.BPS= 100000
EX.ADF= 000010   	F.SIZE  000032   	I.FNAM= 000000   	M.USE = 000010   	WI.DLK= 010000
EX.ENA= 000200   	F.STAT  000040   	I.FNBP  000036   	QIOEFN= 000002   	WI.EXT= 002000
EX.FCO= 000004   	F.STD   000004   	I.FTYP= 000006   	R$$10F= 000001   	WI.LCK= 004000
E$$MSG= 000001   	F.UCHA  000020   	I.FVER= 000010   	R$$11D= 000001   	WI.RDV= 000400
E$$TRP= 000001   	F11PR$= 000000   	I.IOSB  000016   	SC.BAD= 000100   	WI.WRV= 001000
FCPLUN= 000001   	HIFCN = 000030   	I.LGTH  000040   	SC.MDL= 000200   	W.CTL   000000
FC.CEF= 020000   	H.CKSM= 000776   	I.LNK   000000   	S.HDHD= 000056   	W.FCB   000002
FC.DIR= 040000   	H.FCHA= 000014   	I.LUN   000012   	S.IDHD= 000056   	W.RTRV  000012
FC.FCO= 010000   	H.FLEV= 000006   	I.PRI   000010   	S.MPHD= 000012   	W.STD   000004
FC.WAC= 100000   	H.FNUM= 000002   	I.PRM   000024   	S.STBK= 000012   	W.VBN   000006
FP.DEL= 000010   	H.FOWN= 000010   	I.RTRV  000034   	UC.CON= 000200   	W.WISZ  000007
FP.EXT= 000004   	H.FPRO= 000012   	I.RVDT= 000014   	UC.DLK= 000100   	$$    = 000067
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVNO= 000012   	VC.BMW= 000002   	.DFEXT= 000005
FP.RDV= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	VC.IFW= 000001   	.DFPRO= 164000
FP.WRV= 000002   	H.MPOF= 000001   	I.RWAD= 000024   	V.FCB   000006   	.DLBLK  000000RG
F$$LVL= 000001   	H.PROG= 000010   	I.RWAT  000026   	V.FFNU  000055   	.DLBL1  000020RG
F.DREF  000042   	H.PROJ= 000011   	I.RWCT= 000026   	V.FIEX  000025   	.HDBUF= ****** GX
F.DRNM  000044   	H.SCHA= 000015   	I.RWVB= 000032   	V.FMAX  000016   	.HDUCB= ****** GX
F.FEXT  000002   	H.UCHA= 000014   	I.STD   000004   	V.FPRO  000030   	.IOPKT= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.TISZ= 000006   	V.FRBK  000034   	.PRFIL= 000004
F.FOWN  000014   	IDXFNU= 000001   	I.UIC   000022   	V.IBLB  000012   	.RTPTF= 001401
F.FPRO  000016   	ID$$$ = 000201   	LEV11M= 000401   	V.IBSZ  000013   	.SMDEL= ****** GX
F.FSEQ  000010   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002   	.SVLBN= ****** GX
F.FSQN  000013   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040   	.SYUIC= 000010
F.FVBN  000046   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056   	.UCBAD= ****** GX
F.HDLB  000022   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035   	.VBSIZ= 001000
F.LBN   000026   	I.CRTI= 000040   	M.CTSZ= 000006   	V.SBCL  000021   	...GBL= 000000
F.LGTH  000052   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBLB  000024   	...TPC= 000012
F.LINK  000000   	I.DPB   000011   	M.EFSQ= 000004   	V.SBSZ  000022

. ABS.	000056	   000
      	000174	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2537 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[40,10]DLBLK,[40,20]DLBLK/-SP=[40,30]RSXDC,F11PRE,DLBLK
RSXDC	MACRO M1108  05-DEC-77 16:59  PAGE 3


      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.
DLFIL	D0203, DELETE THE FILE	MACRO M1108  05-DEC-77 16:59  PAGE 6


      1						.TITLE	DLFIL	D0203, DELETE THE FILE
						.IDENT	"D0203"
      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					;
					; VERSION D203, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  6 NOV 74  22:08
     23					; PETER H. LIPMAN	11-MAR-74
     24					;
     25					; DELETE ALL THE BLOCKS OF THE FILE AND RELEASE THE FILE HEADER
     26
     27					;
     28					;+
     29					;
     30					; **-.DLFIL-DELETE THE FILE
     31					;
     32					; THIS ROUTINE DELETES ALL THE BLOCKS OF THE FILE AND RELEASES
     33					; THE FILE HEADER
     34					;
     35					; INPUTS:
     36					;
     37					; 	R4=VOLUME CONTROL BLOCK
     38					; 	R5=I/O PACKET
     39					;
     40					; OUTPUTS:
     41					;
     42					; 	R0-R3 ALTERED, R4-R5 PRESERVED
     43					;-
     44
     45	000000				.DLFIL::
     46					;
     47					; SET UP ERRX CONTEXT SO THAT AN ERROR WILL GO THROUGH CLDEL
     48					;
     49	000000	012767 	000000C	000000G		MOV	#<<<IO.DEL/256.>-<LOWFCN-1>>*2+<1*400>>,.EXDSP
     50	000006				10$:
     52	000006					CALL	.GTMAP		; POINT TO HEADER'S MAP AREA
     53	000012					ASSUME	M.ESQN,0
     54	000012					ASSUME	M.EFNU,M.ESQN+2
     55	000012					ASSUME	M.EFSQ,M.EFNU+2
DLFIL	D0203, DELETE THE FILE	MACRO M1108  05-DEC-77 16:59  PAGE 6-1


     56	000012					PUSH	<(R1)+,(R1)+,(R1)+> ; SAVE FILE EXTENSION DATA
     58	000020					CALL	.DLBLK		; DELETE ALL THE BLOCKS OF THE FILE
     59	000024					CALL	.DLHDR		; RELEASE THE FILE HEADER AND RETURN
     61	000030					POP	<R1,R0,R2>	; GET FILE EXTENSION DATA
     62	000036					CALL	.NXHD1		; SEE IF AN EXTENSION HEADER EXISTS
     63	000042	103361 				BCC	10$		; YES - DELETE IT
     65	000044	005003 				CLR	R3
     66	000046					CALL	.SMRVB		; FORCE WRITE OF STORAGE MAP
     67	000052					CALLR	.DMOCK		; CHECK IF VOLUME MARKED FOR DISMOUNT
     68
     69					;
     70					;
     71	000056					$END	DLFIL
     72					;
     73					;
     74		000001 				.END
DLFIL	D0203, DELETE THE FILE	MACRO M1108  05-DEC-77 16:59  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.DPB   000011   	M.EFSQ= 000004   	V.SBSZ  000022
AC.LCK= 000001   	F.NLCK  000037   	I.EFN   000013   	M.ERVN= 000001   	V.STAT  000054
BITFNU= 000002   	F.NWAC  000040   	I.EXDT= 000046   	M.ESQN= 000000   	V.STD   000004
EX.AC1= 000001   	F.RVN   000012   	I.EXTD  000030   	M.LBSZ= 000007   	V.TRCT  000000
EX.AC2= 000002   	F.SCHA  000021   	I.FCN   000014   	M.MAX = 000011   	V.WISZ  000020
EX.ADF= 000010   	F.SIZE  000032   	I.FIDP  000024   	M.RTRV= 000012   	WI.BPS= 100000
EX.ENA= 000200   	F.STAT  000040   	I.FNAM= 000000   	M.USE = 000010   	WI.DLK= 010000
EX.FCO= 000004   	F.STD   000004   	I.FNBP  000036   	QIOEFN= 000002   	WI.EXT= 002000
E$$MSG= 000001   	F.UCHA  000020   	I.FTYP= 000006   	R$$10F= 000001   	WI.LCK= 004000
E$$TRP= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$11D= 000001   	WI.RDV= 000400
FCPLUN= 000001   	HIFCN = 000030   	I.IOSB  000016   	SC.BAD= 000100   	WI.WRV= 001000
FC.CEF= 020000   	H.CKSM= 000776   	I.LGTH  000040   	SC.MDL= 000200   	W.CTL   000000
FC.DIR= 040000   	H.FCHA= 000014   	I.LNK   000000   	S.HDHD= 000056   	W.FCB   000002
FC.FCO= 010000   	H.FLEV= 000006   	I.LUN   000012   	S.IDHD= 000056   	W.RTRV  000012
FC.WAC= 100000   	H.FNUM= 000002   	I.PRI   000010   	S.MPHD= 000012   	W.STD   000004
FP.DEL= 000010   	H.FOWN= 000010   	I.PRM   000024   	S.STBK= 000012   	W.VBN   000006
FP.EXT= 000004   	H.FPRO= 000012   	I.RTRV  000034   	UC.CON= 000200   	W.WISZ  000007
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	UC.DLK= 000100   	$$    = 000067
FP.RDV= 000001   	H.IDOF= 000000   	I.RVNO= 000012   	VC.BMW= 000002   	.DFEXT= 000005
FP.WRV= 000002   	H.MPOF= 000001   	I.RVTI= 000023   	VC.IFW= 000001   	.DFPRO= 164000
F$$LVL= 000001   	H.PROG= 000010   	I.RWAD= 000024   	V.FCB   000006   	.DLBLK= ****** GX
F.DREF  000042   	H.PROJ= 000011   	I.RWAT  000026   	V.FFNU  000055   	.DLFIL  000000RG
F.DRNM  000044   	H.SCHA= 000015   	I.RWCT= 000026   	V.FIEX  000025   	.DLHDR= ****** GX
F.FEXT  000002   	H.UCHA= 000014   	I.RWVB= 000032   	V.FMAX  000016   	.DMOCK= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.STD   000004   	V.FPRO  000030   	.EXDSP= ****** GX
F.FOWN  000014   	IDXFNU= 000001   	I.TISZ= 000006   	V.FRBK  000034   	.GTMAP= ****** GX
F.FPRO  000016   	ID$$$ = 000203   	I.UIC   000022   	V.IBLB  000012   	.NXHD1= ****** GX
F.FSEQ  000010   	IO.DEL= ****** GX	LEV11M= 000401   	V.IBSZ  000013   	.PRFIL= 000004
F.FSQN  000013   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002   	.RTPTF= 001401
F.FVBN  000046   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040   	.SMRVB= ****** GX
F.HDLB  000022   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056   	.SYUIC= 000010
F.LBN   000026   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035   	.VBSIZ= 001000
F.LGTH  000052   	I.CRTI= 000040   	M.CTSZ= 000006   	V.SBCL  000021   	...GBL= 000000
F.LINK  000000   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBLB  000024   	...TPC= 000012

. ABS.	000056	   000
      	000056	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2645 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[40,10]DLFIL,[40,20]DLFIL/-SP=[40,30]RSXDC,F11PRE,DLFIL
RSXDC	MACRO M1108  05-DEC-77 17:00  PAGE 3


      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.
DLHDR	D0203, DELETE FILE HEAD	MACRO M1108  05-DEC-77 17:00  PAGE 6


      1						.TITLE	DLHDR	D0203, DELETE FILE HEADER FROM INDEX FILE
						.IDENT	"D0203"
      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					;
					; VERSION D203, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  26 FEB 75  16:16
     23					; PETER H. LIPMAN	29-FEB-74
     24					;
     25					; WRITE AN INVALIDATED HEADER AND MARK THE HEADER FREE IN THE INDEX
     26					; FILE BIT MAP
     27					;
     28					;
     29					;+
     30					; **-.DLHDR-INVALIDATE HEADER AND DELETE FROM INDEX FILE BIT MAP
     31					;
     32					; THIS ROUTINE INVALIDATES AND WRITES THE FILE HEADER AND UPDATES THE INDEX
     33					; FILE BIT MAP MAKING THE HEADER AVAILABLE FOR USE AGAIN.
     34					;
     35					; INPUTS:
     36					;
     37					; 	.HDBUF CONTAINS THE HEADER TO BE DELETED
     38					; 	R4=VCB ADDRESS
     39					;
     40					; OUTPUTS:
     41					;
     42					; 	R0-R3 ALTERED, R4-R5 PRESERVED
     43					;
     44					;-
     45
     46	000000				.DLHDR::
     47	000000	016746 	000002G			MOV	.HDBUF+H.FNUM,-(SP) ; SET FILE NUMBER FROM HEADER
     48	000004	005067 	000002G			CLR	.HDBUF+H.FNUM	; ZERO THE FILE NUMBER
     49	000010	005067 	000776G			CLR	.HDBUF+H.CKSM	; AND CHECKSUM, INVALIDATING HEADER
     50	000014					CALL	.WRHD1		; AND WRITE IT OUT
     51	000020	005067 	000000G			CLR	.HDUCB		; SAY HEADER BUFFER EMPTY
     52	000024	012601 				MOV	(SP)+,R1	; GET FILE NUMBER
DLHDR	D0203, DELETE FILE HEAD	MACRO M1108  05-DEC-77 17:00  PAGE 7


     54					;+
     55					; **-.DLHD1-DELETE FILE HEADER FROM INDEX FILE BIT MAP
     56					;
     57					; THIS ENTRY POINT PROVIDES THE FACILITY TO JUST RELEASE THE FILE HEADER
     58					; FROM THE INDEX FILE BIT MAP.  .HDBUF IS NOT ASSUMED TO CONTAIN THE
     59					; FILE HEADER
     60					;
     61					; INPUTS:
     62					;
     63					; 	R1 CONTAINS THE FILE NUMBER TO BE RELEASED
     64					; 	R4=VOLUME CONTROL BLOCK ADDRESS
     65					;-
     66
     67	000026				.DLHD1::
     73	000026	016700 	000000G			MOV	.FILNO,R0	;
     74	000032	005300 				DEC	R0		; MAKE FILE NO. START AT 0
     75	000034	012701 	010000 			MOV	#.VBSIZ*8.,R1
     76	000040					CALL	$DIV		; R0=BLOCK # IN INDEX FILE BIT MAP
     79	000044	120064 	000055 			CMPB	R0,V.FFNU(R4)	; SEE IF FILE ABOUT TO BE RELEASED IS IN A
     80									; BITMAP BLOCK PRIOR TO CURRENT FIRST FREE FILE
     81	000050	103002 				BHIS	10$		; BRANCH IF NOT
     82	000052	110064 	000055 			MOVB	R0,V.FFNU(R4)	; YES - UPDATE FIRST FREE FILE INFO
     84	000056	005002 			10$:	CLR	R2
     85	000060	156402 	000012 			BISB	V.IBLB(R4),R2	; R2,R3=LBN OF FIRST INDEX BIT MAP BLOCK
     86	000064	016403 	000014 			MOV	V.IBLB+2(R4),R3	;
     87	000070	060003 				ADD	R0,R3		; FORM LBN OF INDEX BIT MAP BLOCK
     88	000072	005502 				ADC	R2
     89	000074	010146 				MOV	R1,-(SP)	; SAVE BIT NO. IN BLOCK
     90	000076	012701 	000000G			MOV	#.HDBUF,R1	;
     91	000102					CALL	.RD1LB		; READ INDEX BIT MAP BLOCK
     92	000106	011600 				MOV	(SP),R0
     96	000110	006200 				ASR	R0		; FORM R0=WORD NO. IN BLOCK
     97	000112	006200 				ASR	R0
     98	000114	006200 				ASR	R0
     99	000116	006200 				ASR	R0
    101	000120	006300 				ASL	R0		; R0=BYTE NO. IN BLOCK
    102	000122	060001 				ADD	R0,R1		; R1=ADR IN BIT MAP BLOCK TO CLEAR BIT
    103	000124	042716 	177760 			BIC	#177760,(SP)	; BIT NUMBER IN BLOCK
    108	000130	005000 				CLR	R0		; IF NO EXTENDED INSTRUCTION SET
    109	000132	000261 				SEC
    110	000134	006100 			20$:	ROL	R0		; USE A SHIFT LOOP TO FORM MASK
    111	000136	005316 				DEC	(SP)
    112	000140	002375 				BGE	20$
    113	000142	005726 				TST	(SP)+		; CLEAN COUNT OFF STACK
    115	000144	040011 				BIC	R0,(R1)		; INDICATE THIS HEADER IS NOW AVAILABLE
    116	000146	012701 	000000G			MOV	#.HDBUF,R1	;
    117					;
    118					; R2,R3 STILL HAVE INDEX BIT MAP LBN
    119					;
    120	000152					CALLR	.WR1LB		; WRITE THE INDEX BLOCK AND RETURN
    121					;
    122					;
    123	000156					$END	DLHDR
    124					;
    125					;
    126		000001 				.END
DLHDR	D0203, DELETE FILE HEAD	MACRO M1108  05-DEC-77 17:00  PAGE 7-1
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.EFN   000013   	M.ERVN= 000001   	V.STAT  000054
AC.LCK= 000001   	F.NLCK  000037   	I.EXDT= 000046   	M.ESQN= 000000   	V.STD   000004
BITFNU= 000002   	F.NWAC  000040   	I.EXTD  000030   	M.LBSZ= 000007   	V.TRCT  000000
EX.AC1= 000001   	F.RVN   000012   	I.FCN   000014   	M.MAX = 000011   	V.WISZ  000020
EX.AC2= 000002   	F.SCHA  000021   	I.FIDP  000024   	M.RTRV= 000012   	WI.BPS= 100000
EX.ADF= 000010   	F.SIZE  000032   	I.FNAM= 000000   	M.USE = 000010   	WI.DLK= 010000
EX.ENA= 000200   	F.STAT  000040   	I.FNBP  000036   	QIOEFN= 000002   	WI.EXT= 002000
EX.FCO= 000004   	F.STD   000004   	I.FTYP= 000006   	R$$10F= 000001   	WI.LCK= 004000
E$$MSG= 000001   	F.UCHA  000020   	I.FVER= 000010   	R$$11D= 000001   	WI.RDV= 000400
E$$TRP= 000001   	F11PR$= 000000   	I.IOSB  000016   	SC.BAD= 000100   	WI.WRV= 001000
FCPLUN= 000001   	HIFCN = 000030   	I.LGTH  000040   	SC.MDL= 000200   	W.CTL   000000
FC.CEF= 020000   	H.CKSM= 000776   	I.LNK   000000   	S.HDHD= 000056   	W.FCB   000002
FC.DIR= 040000   	H.FCHA= 000014   	I.LUN   000012   	S.IDHD= 000056   	W.RTRV  000012
FC.FCO= 010000   	H.FLEV= 000006   	I.PRI   000010   	S.MPHD= 000012   	W.STD   000004
FC.WAC= 100000   	H.FNUM= 000002   	I.PRM   000024   	S.STBK= 000012   	W.VBN   000006
FP.DEL= 000010   	H.FOWN= 000010   	I.RTRV  000034   	UC.CON= 000200   	W.WISZ  000007
FP.EXT= 000004   	H.FPRO= 000012   	I.RVDT= 000014   	UC.DLK= 000100   	$DIV  = ****** GX
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVNO= 000012   	VC.BMW= 000002   	$$    = 000067
FP.RDV= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	VC.IFW= 000001   	.DFEXT= 000005
FP.WRV= 000002   	H.MPOF= 000001   	I.RWAD= 000024   	V.FCB   000006   	.DFPRO= 164000
F$$LVL= 000001   	H.PROG= 000010   	I.RWAT  000026   	V.FFNU  000055   	.DLHDR  000000RG
F.DREF  000042   	H.PROJ= 000011   	I.RWCT= 000026   	V.FIEX  000025   	.DLHD1  000026RG
F.DRNM  000044   	H.SCHA= 000015   	I.RWVB= 000032   	V.FMAX  000016   	.FILNO= ****** GX
F.FEXT  000002   	H.UCHA= 000014   	I.STD   000004   	V.FPRO  000030   	.HDBUF= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.TISZ= 000006   	V.FRBK  000034   	.HDUCB= ****** GX
F.FOWN  000014   	IDXFNU= 000001   	I.UIC   000022   	V.IBLB  000012   	.PRFIL= 000004
F.FPRO  000016   	ID$$$ = 000203   	LEV11M= 000401   	V.IBSZ  000013   	.RD1LB= ****** GX
F.FSEQ  000010   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002   	.RTPTF= 001401
F.FSQN  000013   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040   	.SYUIC= 000010
F.FVBN  000046   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056   	.VBSIZ= 001000
F.HDLB  000022   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035   	.WRHD1= ****** GX
F.LBN   000026   	I.CRTI= 000040   	M.CTSZ= 000006   	V.SBCL  000021   	.WR1LB= ****** GX
F.LGTH  000052   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBLB  000024   	...GBL= 000000
F.LINK  000000   	I.DPB   000011   	M.EFSQ= 000004   	V.SBSZ  000022   	...TPC= 000012

. ABS.	000056	   000
      	000156	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2532 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[40,10]DLHDR,[40,20]DLHDR/-SP=[40,30]RSXDC,F11PRE,DLHDR
RSXDC	MACRO M1108  05-DEC-77 17:00  PAGE 3


      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.
DLMRK	D0204, MARK FOR DELETE 	MACRO M1108  05-DEC-77 17:00  PAGE 6


      1						.TITLE	DLMRK	D0204, MARK FOR DELETE QI/O
						.IDENT	"D0204"
      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					;
					; VERSION D204, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  20 NOV 74  18:42
     23					; PETER H. LIPMAN	10-MAR-74
     24					;
     25					; MARK FOR DELETE QI/O
     26
     27					;
     28					;+
     29					;
     30					; **-.DLMRK-MARK THE FILE FILE FOR DELETE
     31					;
     32					; THIS ROUTINE IMPLEMENTS THE MARK FOR DELETE QI/O. THE DPB PARAMETER REQUIREMENTS
     33					; ARE AS FOLLOWS:
     34					;
     35					; 	FILE ID ADDRESS-OPTIONAL IF FILE IS ACCESSED, OTHERWISE REQUIRED
     36					; 	READ/WRITE ATTRIBUTE CONTROL BLOCK ADDRESS -0
     37					; 	EXTEND PARAMETERS (2 WORDS) - OPTIONAL
     38					; 	ACCESS CONTROL WORD -0
     39					; 	FILE NAME BLOCK ADDRESS -0
     40					;
     41					; IF EXTEND CONTROL IS ZERO:
     42					; THE ROUTINE SETS THE MARKED FOR DELETE BIT IN THE FILE HEADER AND FILE
     43					; CONTROL BLOCK (IF ACCESSED). THEN, IF THE FILE IS NOT ACCESSED, IT DELETES
     44					; THE BLOCKS OF THE FILE AND RELEASES THE FILE HEADER.
     45					; 	IF THE FILE IS NOT ACCESSED BY THIS USER AND IS ALREADY MARKED FOR DELETE,
     46					; THEN IE.NSF IS RETURNED.
     47					; 	IF THE FILE IS ACCESSED BY THIS USER AND IS ALREADY MARKED FOR DELETE, THEN
     48					; OPERATION IS SUCCESSFUL.
     49					;
     50					; IF EXTEND CONTROL IS ENABLED:
     51					; THE QIO IS INTERPRETED AS A TRUNCATE FUNCTION. THE FILE IS NOT DELETED,
     52					; BUT IS TRUNCATED TO THE SIZE SPECIFIED BY THE REMAINING 31 BITS IN
     53					; THE EXTEND CONTROL WORDS.
     54					;
DLMRK	D0204, MARK FOR DELETE 	MACRO M1108  05-DEC-77 17:00  PAGE 6-1


     55					; INPUTS:
     56					;
     57					; 	R4=VOLUME CONTROL BLOCK ADDRESS
     58					; 	R5=I/O PACKET ADDRESS
     59					;
     60					; OUTPUTS:
     61					;
     62					; 	R0-R3 ALTERED, R4-R5 PRESERVED
     63					; 	RETURNS IN LINE IF AND ONLY IF SUCCESSFUL
     64					;-
     65
     66	000000				.DLMRK::
     67	000000	010500 				MOV	R5,R0
     68	000002	062700 	000026 			ADD	#I.RWAT,R0
     69	000006	012001 				MOV	(R0)+,R1	; NO ATTRIBUTES ALLOWED
     70	000010	022020 				CMP	(R0)+,(R0)+
     71	000012	052001 				BIS	(R0)+,R1	; NO ACCESS
     72	000014	052001 				BIS	(R0)+,R1	; NO FILE BLOCK POINTER
     76	000016	001044 				BNE	40$		; BRANCH IF BAD PARAMETERS
     77	000020					CALL	.GTFID		;
     78	000024	026727 	000000G	000004 		CMP	.FILNO,#.PRFIL	; MUST NOT BE A PROTECTED FILE
     79	000032	101436 				BLOS	40$		;
     80	000034					CALL	.SCFAC		;
     81	000040					CALL	.RDFHD
     82	000044	005765 	000030 			TST	I.EXTD(R5)	; CHECK THE EXTEND CONTROL
     83	000050	100002 				BPL	10$		; BRANCH IF DISABLED
     84	000052	000167 	000000G			JMP	.TRUNC		; ENABLED - DO TRUNCATE
     85	000056	012700 	000010 		10$:	MOV	#FP.DEL,R0	; CHECK IF DELETE ACCESS IF ALLOWED
     86	000062					CALL	.PRCK2
     87	000066					ASSUME	SC.MDL,200
     88	000066	105767 	000015G			TSTB	.HDBUF+H.SCHA	; IF FILE WAS ALREADY MARKED FOR DELETE
     89	000072	100001 				BPL	20$
     90	000074					ERR	IE.NSF,<INDICATE NO SUCH FILE>  ; BUT CONTINUE TO DELETE IT
	000074	   000G	   211 			TRAP	IE.NSF		; INDICATE NO SUCH FILE
     91	000076	152767 	000200 	000015G	20$:	BISB	#SC.MDL,.HDBUF+H.SCHA ; SET MARKED FOR DELETE
     92	000104	016700 	000000G			MOV	.FCBAD,R0	; ACCESSED BY ANYONE?
     93	000110	001002 				BNE	30$		; BRANCH IF YES, DELETE LATER
     94	000112	000177 	000000G			JMP	@.DLFL1		; NOT ACCESSED, DELETE AND RETURN
     95
     96	000116	152760 	000200 	000021 	30$:	BISB	#SC.MDL,F.SCHA(R0) ; SET BIT IN FCB TOO.
     97	000124					CALLR	.WRHDR		; WRITE THE HEADER AND RETURN
     98
     99	000130				40$:	ERRX	IE.BAD,<ILLEGAL PARAMETERS TO MARK FOR DELETE>
	000130	   000C	   211 			TRAP	-IE.BAD		; ILLEGAL PARAMETERS TO MARK FOR DELETE
    100					;
    101					;
    102	000132					$END	DLMRK
    103					;
    104					;
    105		000001 				.END
DLMRK	D0204, MARK FOR DELETE 	MACRO M1108  05-DEC-77 17:00  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NLCK  000037   	I.EFN   000013   	M.ESQN= 000000   	V.TRCT  000000
AC.LCK= 000001   	F.NWAC  000040   	I.EXDT= 000046   	M.LBSZ= 000007   	V.WISZ  000020
BITFNU= 000002   	F.RVN   000012   	I.EXTD  000030   	M.MAX = 000011   	WI.BPS= 100000
EX.AC1= 000001   	F.SCHA  000021   	I.FCN   000014   	M.RTRV= 000012   	WI.DLK= 010000
EX.AC2= 000002   	F.SIZE  000032   	I.FIDP  000024   	M.USE = 000010   	WI.EXT= 002000
EX.ADF= 000010   	F.STAT  000040   	I.FNAM= 000000   	QIOEFN= 000002   	WI.LCK= 004000
EX.ENA= 000200   	F.STD   000004   	I.FNBP  000036   	R$$10F= 000001   	WI.RDV= 000400
EX.FCO= 000004   	F.UCHA  000020   	I.FTYP= 000006   	R$$11D= 000001   	WI.WRV= 001000
E$$MSG= 000001   	F11PR$= 000000   	I.FVER= 000010   	SC.BAD= 000100   	W.CTL   000000
E$$TRP= 000001   	HIFCN = 000030   	I.IOSB  000016   	SC.MDL= 000200   	W.FCB   000002
FCPLUN= 000001   	H.CKSM= 000776   	I.LGTH  000040   	S.HDHD= 000056   	W.RTRV  000012
FC.CEF= 020000   	H.FCHA= 000014   	I.LNK   000000   	S.IDHD= 000056   	W.STD   000004
FC.DIR= 040000   	H.FLEV= 000006   	I.LUN   000012   	S.MPHD= 000012   	W.VBN   000006
FC.FCO= 010000   	H.FNUM= 000002   	I.PRI   000010   	S.STBK= 000012   	W.WISZ  000007
FC.WAC= 100000   	H.FOWN= 000010   	I.PRM   000024   	UC.CON= 000200   	$$    = 000067
FP.DEL= 000010   	H.FPRO= 000012   	I.RTRV  000034   	UC.DLK= 000100   	.DFEXT= 000005
FP.EXT= 000004   	H.FSEQ= 000004   	I.RVDT= 000014   	VC.BMW= 000002   	.DFPRO= 164000
FP.RAT= 000001   	H.IDOF= 000000   	I.RVNO= 000012   	VC.IFW= 000001   	.DLFL1= ****** GX
FP.RDV= 000001   	H.MPOF= 000001   	I.RVTI= 000023   	V.FCB   000006   	.DLMRK  000000RG
FP.WRV= 000002   	H.PROG= 000010   	I.RWAD= 000024   	V.FFNU  000055   	.FCBAD= ****** GX
F$$LVL= 000001   	H.PROJ= 000011   	I.RWAT  000026   	V.FIEX  000025   	.FILNO= ****** GX
F.DREF  000042   	H.SCHA= 000015   	I.RWCT= 000026   	V.FMAX  000016   	.GTFID= ****** GX
F.DRNM  000044   	H.UCHA= 000014   	I.RWVB= 000032   	V.FPRO  000030   	.HDBUF= ****** GX
F.FEXT  000002   	H.UFAT= 000016   	I.STD   000004   	V.FRBK  000034   	.PRCK2= ****** GX
F.FNUM  000006   	IDXFNU= 000001   	I.TISZ= 000006   	V.IBLB  000012   	.PRFIL= 000004
F.FOWN  000014   	ID$$$ = 000204   	I.UIC   000022   	V.IBSZ  000013   	.RDFHD= ****** GX
F.FPRO  000016   	IE.BAD= ****** GX	LEV11M= 000401   	V.IFWI  000002   	.RTPTF= 001401
F.FSEQ  000010   	IE.NSF= ****** GX	LOWFCN= 000011   	V.LABL  000040   	.SCFAC= ****** GX
F.FSQN  000013   	I.ACTL  000035   	MFDFNO= 000004   	V.LGTH  000056   	.SYUIC= 000010
F.FVBN  000046   	I.AST   000020   	MFDFSQ= 000004   	V.LRUC  000035   	.TRUNC= ****** GX
F.HDLB  000022   	I.ATL   000006   	M$$HDR= 000001   	V.SBCL  000021   	.VBSIZ= 001000
F.LBN   000026   	I.CRDT= 000031   	M.CTSZ= 000006   	V.SBLB  000024   	.WRHDR= ****** GX
F.LGTH  000052   	I.CRTI= 000040   	M.EFNU= 000002   	V.SBSZ  000022   	...GBL= 000000
F.LINK  000000   	I.DASZ= 000007   	M.EFSQ= 000004   	V.STAT  000054   	...TPC= 000012
F.NACS  000036   	I.DPB   000011   	M.ERVN= 000001   	V.STD   000004

. ABS.	000056	   000
      	000132	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2570 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:18
[40,10]DLMRK,[40,20]DLMRK/-SP=[40,30]RSXDC,F11PRE,DLMRK
RSXDC	MACRO M1108  05-DEC-77 17:00  PAGE 3


      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.
DMOCK	D0201, CHECK IF DISMOUN	MACRO M1108  05-DEC-77 17:00  PAGE 6


      1						.TITLE	DMOCK	D0201, CHECK IF DISMOUNT IS PENDING
						.IDENT	"D0201"
      2					;       CORPORATION.
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D201, ASSEMBLED FOR RSX-11D
					;
     22
     23					; ANDREW C. GOLDSTEIN  10 SEP 74  12:08:22
     24					; PETER H. LIPMAN	8-APR-74
     25					;
     26					; CHECK IF DISMOUNT IS PENDING FOR THIS VOLUME
     27					;
     28					;
     29					;+
     30					; **-.DMOCK- CHECK IF DISMOUNT IS PENDING FOR THIS VOLUME
     31					;
     32					; THIS ROUTINE IS CALLED JUST BEFORE RETURNING TO .EXIT TO SEE IF THE
     33					; VOLUME IS MARKED FOR DISMOUNT.  IF DISMOUNT IS PENDING
     34					; AND THIS IS THE LAST TRANSACTION, THEN THIS ROUTINE
     35					; WILL CALL THE DISMOUNT ROUTINE AND WILL NOT RETURN TO THE CALLER.
     36					; ***** IT IS CRUCIAL THAT THIS ROUTINE ONLY BE CALLED AT A POINT
     37					; SUCH THAT THE CALLER WOULD HAVE BEEN GOING TO .EXIT ANYWAY
     38					; IF .DMOCK RETURNS.
     39					;
     40					; INPUTS:
     41					;
     42					; 	R4=VCB ADDRESS
     43					; 	R5=I/O PACKET ADDRESS
     44					;
     45					; OUTPUTS:
     46					;
     47					; 	IF THIS ROUTINE RETURNS, R0 ALTERED, OTHERS PRESERVED
     48					;
     49					;-
     50
     51	000000				.DMOCK::
     52	000000	016700 	000000G			MOV	.UCBAD,R0	; R0=UCB ADDRESS
     56	000004	132760 	000000G	000000G		BITB	#CH.UNL,U.CH(R0) ; IS VOLUME MARKED FOR DISMOUNT?
     58	000012	001403 				BEQ	10$		; BRANCH IF NO
DMOCK	D0201, CHECK IF DISMOUN	MACRO M1108  05-DEC-77 17:00  PAGE 6-1


     59	000014	021427 	000001 			CMP	(R4),#1		; IS THIS THE LAST TRANSACTION?
     60	000020	101401 				BLOS	20$		; BRANCH IF YES
     61	000022				10$:	RETURN
     62	000024	000177 	000000G		20$:	JMP	@.DMOU1		; DISMOUNT THE VOLUME
     63					;
     64					;
     65	000030					$END	DMOCK
     66					;
     67					;
     68		000001 				.END
DMOCK	D0201, CHECK IF DISMOUN	MACRO M1108  05-DEC-77 17:00  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.LGTH  000052   	I.CRTI= 000040   	M$$HDR= 000001   	V.LABL  000040
AC.LCK= 000001   	F.LINK  000000   	I.DASZ= 000007   	M.CTSZ= 000006   	V.LGTH  000056
BITFNU= 000002   	F.NACS  000036   	I.DPB   000011   	M.EFNU= 000002   	V.LRUC  000035
CH.UNL= ****** GX	F.NLCK  000037   	I.EFN   000013   	M.EFSQ= 000004   	V.SBCL  000021
EX.AC1= 000001   	F.NWAC  000040   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBLB  000024
EX.AC2= 000002   	F.RVN   000012   	I.EXTD  000030   	M.ESQN= 000000   	V.SBSZ  000022
EX.ADF= 000010   	F.SCHA  000021   	I.FCN   000014   	M.LBSZ= 000007   	V.STAT  000054
EX.ENA= 000200   	F.SIZE  000032   	I.FIDP  000024   	M.MAX = 000011   	V.STD   000004
EX.FCO= 000004   	F.STAT  000040   	I.FNAM= 000000   	M.RTRV= 000012   	V.TRCT  000000
E$$MSG= 000001   	F.STD   000004   	I.FNBP  000036   	M.USE = 000010   	V.WISZ  000020
E$$TRP= 000001   	F.UCHA  000020   	I.FTYP= 000006   	QIOEFN= 000002   	WI.BPS= 100000
FCPLUN= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$10F= 000001   	WI.DLK= 010000
FC.CEF= 020000   	HIFCN = 000030   	I.IOSB  000016   	R$$11D= 000001   	WI.EXT= 002000
FC.DIR= 040000   	H.CKSM= 000776   	I.LGTH  000040   	SC.BAD= 000100   	WI.LCK= 004000
FC.FCO= 010000   	H.FCHA= 000014   	I.LNK   000000   	SC.MDL= 000200   	WI.RDV= 000400
FC.WAC= 100000   	H.FLEV= 000006   	I.LUN   000012   	S.HDHD= 000056   	WI.WRV= 001000
FP.DEL= 000010   	H.FNUM= 000002   	I.PRI   000010   	S.IDHD= 000056   	W.CTL   000000
FP.EXT= 000004   	H.FOWN= 000010   	I.PRM   000024   	S.MPHD= 000012   	W.FCB   000002
FP.RAT= 000001   	H.FPRO= 000012   	I.RTRV  000034   	S.STBK= 000012   	W.RTRV  000012
FP.RDV= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	UC.CON= 000200   	W.STD   000004
FP.WRV= 000002   	H.IDOF= 000000   	I.RVNO= 000012   	UC.DLK= 000100   	W.VBN   000006
F$$LVL= 000001   	H.MPOF= 000001   	I.RVTI= 000023   	U.CH  = ****** GX	W.WISZ  000007
F.DREF  000042   	H.PROG= 000010   	I.RWAD= 000024   	VC.BMW= 000002   	.DFEXT= 000005
F.DRNM  000044   	H.PROJ= 000011   	I.RWAT  000026   	VC.IFW= 000001   	.DFPRO= 164000
F.FEXT  000002   	H.SCHA= 000015   	I.RWCT= 000026   	V.FCB   000006   	.DMOCK  000000RG
F.FNUM  000006   	H.UCHA= 000014   	I.RWVB= 000032   	V.FFNU  000055   	.DMOU1= ****** GX
F.FOWN  000014   	H.UFAT= 000016   	I.STD   000004   	V.FIEX  000025   	.PRFIL= 000004
F.FPRO  000016   	IDXFNU= 000001   	I.TISZ= 000006   	V.FMAX  000016   	.RTPTF= 001401
F.FSEQ  000010   	ID$$$ = 000201   	I.UIC   000022   	V.FPRO  000030   	.SYUIC= 000010
F.FSQN  000013   	I.ACTL  000035   	LEV11M= 000401   	V.FRBK  000034   	.UCBAD= ****** GX
F.FVBN  000046   	I.AST   000020   	LOWFCN= 000011   	V.IBLB  000012   	.VBSIZ= 001000
F.HDLB  000022   	I.ATL   000006   	MFDFNO= 000004   	V.IBSZ  000013   	...GBL= 000000
F.LBN   000026   	I.CRDT= 000031   	MFDFSQ= 000004   	V.IFWI  000002   	...TPC= 000012

. ABS.	000056	   000
      	000030	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2502 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:16
[40,10]DMOCK,[40,20]DMOCK/-SP=[40,30]RSXDC,F11PRE,DMOCK
RSXDC	MACRO M1108  05-DEC-77 17:01  PAGE 3


      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.
DMOUNT	D0213, DISMOUNT THE VOL	MACRO M1108  05-DEC-77 17:01  PAGE 6


      1						.TITLE	DMOUNT	D0213, DISMOUNT THE VOLUME
						.IDENT	"D0213"
      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					;
					; VERSION D213, ASSEMBLED FOR RSX-11D
					;
     20
     21					; ANDREW C. GOLDSTEIN  23 FEB 75  22:48
     22					; PETER H. LIPMAN	8-APR-74
     23					;
     24					; DISMOUNT THE VOLUME IF THE TRANSACTION COUNT SHOWS IT IS INACTIVE
     25					;
     27						.MCALL	HMBOF$
     28	000000					HMBOF$			; DEFINE HOME BLOCK OFFSETS
     30					;
     31					;+
     32					; **-.DMOUN-DISMOUNT THE VOLUME
     33					;
     34					; THIS ROUTINE FIRST CHECKS TO SEE THAT THERE IS NO ACTIVITY ON THE VOLUME
     35					; AND THEN ISSUES I/O COMPLETE FOR THE FUNCTION THAT INVOKED THIS
     36					; (EITHER THE DISMOUNT I/O PACKET FROM THE DMO MCR FUNCTION OR THE
     37					; LAST DEACCESS).    THEN IT RELEASES THE INDEX FILE WINDOW,
     38					; ALL THE FCB'S IN THE FCB CHAIN (INDEX FILE AND DIRECTORY FILES)
     39					; AND FINALLY IT RELEASES THE VCB ITSELF AND ZEROS THE SLOT IN THE UNIT
     40					; CONTROL BLOCK.
     41					; 	ONCE THE CLEANUP IS COMPLETE, THE DISMOUNT BIT IS SET, AND THE
     42					; MARKED FOR DISMOUNT BIT IS RESET, THE DISMOUNT MESSAGE IS SENT (VIA
     43					; TKTN).  THEN IF THIS WAS THE LAST VOLUME FOR WHICH FCP WAS MOUNTED
     44					; FCP CALLS TASK EXIT AND COMMITS SUICICIDE.
     45					;
     46					; INPUTS:
     47					;
     48					; 	R4=VCB ADDRESS
     49					; 	R5=I/O PACKET ADDRESS
     50					;
     58					;-
     59
     60	000000				.DMOUN::
     61	000000					ASSUME	V.TRCT,0
     62	000000	021427 	000001 			CMP	(R4),#1		; IS THIS THE LAST TRANSACTION ON THE VOLUME
     67	000004	003067 				BGT	100$		; BRANCH IF NO, WAIT FOR DEACCESS
DMOUNT	D0213, DISMOUNT THE VOL	MACRO M1108  05-DEC-77 17:01  PAGE 6-1


     72	000006	016705 	000000G			MOV	.UCBAD,R5	; R5=UCB ADDRESS
     73	000012	020567 	000000G			CMP	R5,.HDUCB	; HEADER FROM THIS VOL IN MEMORY?
     74	000016	001002 				BNE	10$		; BRANCH IF NO
     75	000020	005067 	000000G			CLR	.HDUCB		; INVALIDATE HEADER BUFFER
     76	000024	020567 	000000G		10$:	CMP	R5,.DRUCB	; DIRECTORY BLOCK FROM THIS VOL IN MEMORY
     77	000030	001002 				BNE	20$		; BRANCH IF NO
     78	000032	005067 	000000G			CLR	.DRUCB		; YES, INVALIDATE IT
     79	000036	020567 	000000G		20$:	CMP	R5,.SMUCB	; STORAGE MAP FROM THIS VOL IN MEMORY
     80	000042	001002 				BNE	30$		; BRANCH IF NO
     81	000044	005067 	000000G			CLR	.SMUCB		; YES, INVALIDATE IT
     82	000050				30$:
     90	000050	016504 	000000G		50$:	MOV	U.VA(R5),R4	; R4=VOLUME CONTROL BLOCK
     91	000054	001443 				BEQ	100$		; OOPS - VOLUME IS ALREADY DISMOUNTED
     93	000056	016400 	000002 			MOV	V.IFWI(R4),R0	; RELEASE THE INDEX FILE WINDOW
     94	000062	116001 	000007 			MOVB	W.WISZ(R0),R1	; R1=SIZE IN RTRV PTRS
    100	000066	006301 				ASL	R1
    101	000070	010146 				MOV	R1,-(SP)
    102	000072	006301 				ASL	R1
    103	000074	062601 				ADD	(SP)+,R1
    105	000076	062701 	000012 			ADD	#W.RTRV,R1	; R1=SIZE IN BYTES OF WINDOW
    106	000102					CALL	.RLEAS
    107					;
    108					; RELEASE ALL FCB'S IN THE FCB CHAIN
    109					;
    110	000106	016403 	000006 			MOV	V.FCB(R4),R3	; R3=ADDRESS OF 1ST FCB IN LIST
    111	000112	012701 	000052 			MOV	#F.LGTH,R1	; R1=SIZE OF FCB
    112	000116	010300 			60$:	MOV	R3,R0
    113	000120	001404 				BEQ	70$		; ZERO MEANS END OF FCB LIST
    114	000122	011303 				MOV	(R3),R3		; CHAIN TO NEXT FCB BEFORE RELEASING THIS
    115	000124					CALL	.RLEAS
    116	000130	000772 				BR	60$
    117	000132	010400 			70$:	MOV	R4,R0		; RELEASE THE VCB
    118	000134	012701 	000056 			MOV	#V.LGTH,R1
    119	000140					CALL	.RLEAS
    140	000144	005065 	000000G			CLR	U.VA(R5)	; AND ZERO THE POINTER IN THE UCB
    141	000150	005065 	000000G			CLR	U.ACP(R5)	; CLEAR ACP POINTER
    142	000154	116565 	000001G	000000G		MOVB	U.CH+1(R5),U.CH(R5) ; RESTORE OFF LINE CHARACTERISTICS
    143	000162					ERRP	E.DMO,<DISMOUNT COMPLETE> ; OUTPUT DISMOUNT MESSAGE
	000162	   000G	   210 			EMT	E.DMO		; DISMOUNT COMPLETE
    144	000164	016705 	000000G		100$:	MOV	.IOPKT,R5	; RESTORE I/O PACKET ADDR
    145	000170					RETURN
    147					;
    148					;
    149	000172					$END	DMOUNT
    150					;
    151					;
    152		000001 				.END
DMOUNT	D0213, DISMOUNT THE VOL	MACRO M1108  05-DEC-77 17:01  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.SCHA  000021   	H.VPRO= 000040   	LOWFCN= 000011   	V.LABL  000040
AC.LCK= 000001   	F.SIZE  000032   	H.WISZ= 000054   	MFDFNO= 000004   	V.LGTH  000056
BITFNU= 000002   	F.STAT  000040   	IDXFNU= 000001   	MFDFSQ= 000004   	V.LRUC  000035
EX.AC1= 000001   	F.STD   000004   	ID$$$ = 000213   	M$$HDR= 000001   	V.SBCL  000021
EX.AC2= 000002   	F.UCHA  000020   	I.ACTL  000035   	M.CTSZ= 000006   	V.SBLB  000024
EX.ADF= 000010   	F11PR$= 000000   	I.AST   000020   	M.EFNU= 000002   	V.SBSZ  000022
EX.ENA= 000200   	HIFCN = 000030   	I.ATL   000006   	M.EFSQ= 000004   	V.STAT  000054
EX.FCO= 000004   	H.CHK1= 000072   	I.CRDT= 000031   	M.ERVN= 000001   	V.STD   000004
E$$MSG= 000001   	H.CHK2= 000776   	I.CRTI= 000040   	M.ESQN= 000000   	V.TRCT  000000
E$$TRP= 000001   	H.CKSM= 000776   	I.DASZ= 000007   	M.LBSZ= 000007   	V.WISZ  000020
E.DMO = ****** GX	H.DVTY= 000012   	I.DPB   000011   	M.MAX = 000011   	WI.BPS= 100000
FCPLUN= 000001   	H.FCHA= 000014   	I.EFN   000013   	M.RTRV= 000012   	WI.DLK= 010000
FC.CEF= 020000   	H.FIEX= 000055   	I.EXDT= 000046   	M.USE = 000010   	WI.EXT= 002000
FC.DIR= 040000   	H.FLEV= 000006   	I.EXTD  000030   	QIOEFN= 000002   	WI.LCK= 004000
FC.FCO= 010000   	H.FMAX= 000006   	I.FCN   000014   	R$$10F= 000001   	WI.RDV= 000400
FC.WAC= 100000   	H.FNUM= 000002   	I.FIDP  000024   	R$$11D= 000001   	WI.WRV= 001000
FP.DEL= 000010   	H.FOWN= 000010   	I.FNAM= 000000   	SC.BAD= 000100   	W.CTL   000000
FP.EXT= 000004   	H.FPRO= 000044   	I.FNBP  000036   	SC.MDL= 000200   	W.FCB   000002
FP.RAT= 000001   	H.FSEQ= 000004   	I.FTYP= 000006   	S.HDHD= 000056   	W.RTRV  000012
FP.RDV= 000001   	H.IBLB= 000002   	I.FVER= 000010   	S.IDHD= 000056   	W.STD   000004
FP.WRV= 000002   	H.IBSZ= 000000   	I.IOSB  000016   	S.MPHD= 000012   	W.VBN   000006
F$$LVL= 000001   	H.IDOF= 000000   	I.LGTH  000040   	S.STBK= 000012   	W.WISZ  000007
F.DREF  000042   	H.INDF= 000760   	I.LNK   000000   	UC.CON= 000200   	$$    = 000067
F.DRNM  000044   	H.INDN= 000730   	I.LUN   000012   	UC.DLK= 000100   	.DFEXT= 000005
F.FEXT  000002   	H.INDO= 000744   	I.PRI   000010   	U.ACP = ****** GX	.DFPRO= 164000
F.FNUM  000006   	H.LRUC= 000056   	I.PRM   000024   	U.CH  = ****** GX	.DMOUN  000000RG
F.FOWN  000014   	H.MPOF= 000001   	I.RTRV  000034   	U.VA  = ****** GX	.DRUCB= ****** GX
F.FPRO  000016   	H.PROG= 000010   	I.RVDT= 000014   	VC.BMW= 000002   	.HDUCB= ****** GX
F.FSEQ  000010   	H.PROJ= 000011   	I.RVNO= 000012   	VC.IFW= 000001   	.IOPKT= ****** GX
F.FSQN  000013   	H.SBCL= 000010   	I.RVTI= 000023   	V.FCB   000006   	.PRFIL= 000004
F.FVBN  000046   	H.SCHA= 000015   	I.RWAD= 000024   	V.FFNU  000055   	.RLEAS= ****** GX
F.HDLB  000022   	H.UCHA= 000014   	I.RWAT  000026   	V.FIEX  000025   	.RTPTF= 001401
F.LBN   000026   	H.UFAT= 000016   	I.RWCT= 000026   	V.FMAX  000016   	.SMUCB= ****** GX
F.LGTH  000052   	H.VCHA= 000042   	I.RWVB= 000032   	V.FPRO  000030   	.SYUIC= 000010
F.LINK  000000   	H.VDAT= 000074   	I.STD   000004   	V.FRBK  000034   	.UCBAD= ****** GX
F.NACS  000036   	H.VLEV= 000014   	I.TISZ= 000006   	V.IBLB  000012   	.VBSIZ= 001000
F.NLCK  000037   	H.VNAM= 000016   	I.UIC   000022   	V.IBSZ  000013   	...GBL= 000000
F.NWAC  000040   	H.VOWN= 000036   	LEV11M= 000401   	V.IFWI  000002   	...TPC= 001000
F.RVN   000012

. ABS.	000056	   000
      	000172	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2670 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:21
[40,10]DMOUNT,[40,20]DMOUNT/-SP=[40,30]RSXDC,F11PRE,DMOUNT
RSXDC	MACRO M1108  05-DEC-77 17:01  PAGE 3


      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.
DRACC	D0202, ACCESS A DIRECTO	MACRO M1108  05-DEC-77 17:01  PAGE 6


      1						.TITLE	DRACC	D0202, ACCESS A DIRECTORY
						.IDENT	"D0202"
      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					;
					; VERSION D202, ASSEMBLED FOR RSX-11D
					;
     22
     23					; ANDREW C. GOLDSTEIN  24 OCT 74  18:01
     24					; PETER H. LIPMAN	7-JUN-74
     25					;
     26					; ACCESS A DIRECTORY FILE
     27
     28					;
     29					;+
     30					; **-.DRACC-ACCESS A DIRECTORY
     31					;
     32					; THIS ROUTINE IS NOT CALLED AS A CLOSED ROUTINE. IT IS ENTERED BY A JMP
     33					; @.DRAC1 AND IT EXITS BY A JMP .DSPAT AFTER RESETTING THE STACK (SP=.STACK).
     34					; THE PURPOSE OF THE ROUTINE IS TO SET UP .FCBAD WITH THE ADDRESS OF THE FCB
     35					; FOR THE DIRECTORY. IF THE DIRECTORY IS CONTIGUOUS THE FCB WILL BE LINKED
     36					; IN TO THE FCB CHAIN AND THE FC.DIR BIT WILL BE SET IN F.STAT. THIS DIRECTORY
     37					; WILL THUS HAVE BEEN PLACED IN THE DIRECTORY LRU TABLE (THE FCB CHAIN ITSELF)
     38					; AND IS "PRE-ACCESSED" FOR FASTER SUBSEQUENT ACCESS. IF THE DIRECTORY IS
     39					; NON-CONTIGUOUS, A WINDOW IS ALSO INITIALIZED FOR IT AND THE FCB IS NOT
     40					; PUT IN THE LRU. THE EXIT THROUGH .DSPAT CAUSES THE CALLING FUNCTION TO BE
     41					; REEXECUTED WITHOUT INITIALIZING FCP CONTEXT SO THE .FCBAD CELL WILL CONTAIN
     42					; THE DESIRED FCB.
     43					;
     44					; INPUTS:
     45					;
     46					; 	R4=VCB ADDRESS
     47					;
     48					; OUTPUTS:
     49					;
     50					; 	R0-R3 ALTERED
     51					; 	R5=I/O PACKET ADDRESS
     52					; 	R4 PRESERVED
     53					; 	HEADER READ IN FOR DIRECTORY
     54					; 	.FCBAD SET TO FCB
DRACC	D0202, ACCESS A DIRECTO	MACRO M1108  05-DEC-77 17:01  PAGE 6-1


     55					; 	.WNDOW SET IF NON CONTIGUOUS DIRECTORY
     56					;-
     57
     58	000000				.DRACC::
     59	000000	012706 	000000G			MOV	#.STACK,SP	; RESET THE STACK
     60	000004	016705 	000000G			MOV	.IOPKT,R5	; R5=I/O PACKET ADDRESS
     61	000010					CALL	.RDFHD		; READ THE HEADER FOR THE DIRECTORY
     62	000014	122767 	000000G	000000C		CMPB	#R.FIX,.HDBUF+H.UFAT+F.RTYP ; RECORD TYPE MUST BE FIXED
     63	000022	001004 				BNE	10$
     64	000024	022767 	000000G	000000C		CMP	#S.NFEN,.HDBUF+H.UFAT+F.RSIZ ; AND THE RECORD SIZE CORRECT
     65	000032	001401 				BEQ	20$		; BRANCH IF IT IS
     66	000034				10$:	ERRX	IE.BDR,<BAD DIRECTORY FILE>
	000034	   000C	   211 			TRAP	-IE.BDR		; BAD DIRECTORY FILE
     67
     68	000036				20$:	CALL	.SCFAC		; SEE IF ITS ALREADY ACCESSED
     69	000042	001070 				BNE	90$		; BRANCH IF IT IS
     70	000044					ASSUME	UC.CON,200
     71	000044	105767 	000014G			TSTB	.HDBUF+H.UCHA	; IS FILE CONTIGUOUS?
     72	000050	100040 				BPL	70$		; BRANCH IF NO
     73	000052	105764 	000035 			TSTB	V.LRUC(R4)	; ANY MORE FCB'S ALLOWED IN LRU?
     74	000056	001035 				BNE	70$		; BRANCH IF YES (NEGATIVE MEANS DISABLED)
     75	000060	010402 				MOV	R4,R2
     76	000062	062702 	000006 			ADD	#V.FCB,R2
     77	000066	000401 				BR	40$
     78
     79	000070	011202 			30$:	MOV	(R2),R2
     80	000072	011200 			40$:	MOV	(R2),R0
     81	000074	001424 				BEQ	60$		; BRANCH IF END OF FCB LIST (ERROR)
     82	000076	032760 	040000 	000040 		BIT	#FC.DIR,F.STAT(R0)
     83	000104	001771 				BEQ	30$
     84	000106	010067 	000000G			MOV	R0,.FCBAD
     85	000112	005710 				TST	(R0)		; UNLESS THE FCB IS ALREADY AT THE END
     86	000114	001406 				BEQ	50$
     87	000116	011012 				MOV	(R0),(R2)	; REMOVE IT FROM THE MIDDLE
     88	000120	005010 				CLR	(R0)		; SAY ITS THE LAST
     89	000122	010074 	000010 			MOV	R0,@V.FCB+2(R4)	; AND CHAIN IT TO THE END
     90	000126	010064 	000010 			MOV	R0,V.FCB+2(R4)
     91	000132				50$:	CALL	.INFCB		; REINIT THE EXISTING FCB
     92	000136	042760 	030000 	000040 		BIC	#FC.FCO!FC.CEF,F.STAT(R0) ; CLEAR OBSOLETE BITS
     93	000144	000447 				BR	120$
     94
     95	000146	105364 	000035 		60$:	DECB	V.LRUC(R4)	; WAS 0, MAKE NEGATIVE, DISABLING LRU
     96	000152				70$:	CALL	.CRFCB		; CREATE AND INIT AN FCB
     97	000156	010067 	000000G			MOV	R0,.FCBAD	; SAVE FCB ADDRESS
     98	000162	010003 				MOV	R0,R3		; R3=ADDRESS OF NEW FCB
     99	000164					ASSUME	UC.CON,200	;
    100	000164	105763 	000020 			TSTB	F.UCHA(R3)	; IF NOT CONTIGUOUS
    101	000170	100015 				BPL	90$		; THEN DON'T PUT IN LRU
    102	000172	105364 	000035 			DECB	V.LRUC(R4)	; COUNT THE NEW FCB IN THE LRU
    103	000176	002410 				BLT	80$		; BRANCH IF LRU IS DISABLED
    104	000200	052763 	040000 	000040 		BIS	#FC.DIR,F.STAT(R3) ; SET DIRECTORY BIT
    105	000206	010374 	000010 			MOV	R3,@V.FCB+2(R4) ; CHAIN THE NEW FCB IN TO LIST
    106	000212	010364 	000010 			MOV	R3,V.FCB+2(R4)
    107	000216	000422 				BR	120$
    108					;
    109					; R3=FCB ADDRESS, ACCESS THE DIRECTORY AND DO NOT PUT THE FCB IN THE LRU TABLE.
    110					;
DRACC	D0202, ACCESS A DIRECTO	MACRO M1108  05-DEC-77 17:01  PAGE 6-2


    111	000220	105264 	000035 		80$:	INCB	V.LRUC(R4)
    112	000224	116500 	000015 		90$:	MOVB	I.FCN+1(R5),R0
    113	000230	162700 	000000C			SUB	#<IO.FNA/256.+1>,R0 ;-1=R, 1=RW, 2=RWE
    114	000234	003001 				BGT	100$
    115	000236	005000 				CLR	R0		; 0=R, 1=RW, 2=RWE
    116	000240					ASSUME	UC.CON,200
    117	000240	010046 			100$:	MOV	R0,-(SP)
    118	000242	105763 	000020 			TSTB	F.UCHA(R3)	; IF FILE IS CONTIGUOUS
    119	000246	002402 				BLT	110$		; THEN SKIP THE CREATION OF A WINDOW
    120	000250					CALL	.INWIN		; OTHERWISE CREATE & INIT A WINDOW
    121	000254	005726 			110$:	TST	(SP)+		; IF THIS ACCESS REQUIRE WRITE ACCESS
    122	000256	001402 				BEQ	120$		;
    123	000260					CALL	.WACCK		; SEE IF WRITE ACCESS WOULD BE ALLOWED
    124	000264	016700 	000000G		120$:	MOV	.FCBAD,R0	;
    125	000270	005001 				CLR	R1
    126	000272	156701 	000000G			BISB	.HDBUF+H.IDOF,R1
    127	000276	006301 				ASL	R1		; FORM BYTE OFFSET TO IDENT AREA OF HEADER
    128	000300	016160 	000000G	000044 		MOV	.HDBUF+I.FNAM(R1),F.DRNM(R0) ; SET 1ST WORD OF DIR NAME
    129	000306	016701 	000000C			MOV	.HDBUF+H.UFAT+F.EFBK+2,R1 ; R1=DIRECTORY EOF BLOCK NO.
    130	000312	016702 	000000C			MOV	.HDBUF+H.UFAT+F.FFBY,R2 ; IF FFBY=0
    131	000316	001001 				BNE	130$
    132	000320	005301 				DEC	R1		; THEN DIRECTORY EOF IS 1 TOO BIG
    133	000322	026001 	000034 		130$:	CMP	F.SIZE+2(R0),R1	; DIRECTORY EOF BEYOND LAST BLOCK?
    134	000326	103003 				BHIS	140$		; BRANCH IF NO
    135	000330	016001 	000034 			MOV	F.SIZE+2(R0),R1	; YES, SET IT BACK
    136	000334	000406 				BR	150$
    137	000336	005702 			140$:	TST	R2		; IF SAVED FFBY NON ZERO
    138	000340	001004 				BNE	150$		; MUST UPDATE HEADER
    139	000342	026067 	000034 	000000C		CMP	F.SIZE+2(R0),.HDBUF+H.UFAT+F.HIBK+2 ; IS HIBK CORRECT?
    140	000350	001403 				BEQ	160$		; BRANCH IF YES, HEADER OK
    141	000352	052760 	020000 	000040 	150$:	BIS	#FC.CEF,F.STAT(R0) ; NOTE HEADER SHOULD BE FIXED
    142	000360	010160 	000042 		160$:	MOV	R1,F.DREF(R0)	; SAVE DIRECTORY EOF BLOCK IN FCB
    143	000364	000167 	000000G			JMP	.DSPAT		; AND REDISPATCH
    144					;
    145					;
    146	000370					$END	DRACC
    147					;
    148					;
    149		000001 				.END
DRACC	D0202, ACCESS A DIRECTO	MACRO M1108  05-DEC-77 17:01  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.DPB   000011   	M.ESQN= 000000   	V.STD   000004
AC.LCK= 000001   	F.NLCK  000037   	I.EFN   000013   	M.LBSZ= 000007   	V.TRCT  000000
BITFNU= 000002   	F.NWAC  000040   	I.EXDT= 000046   	M.MAX = 000011   	V.WISZ  000020
EX.AC1= 000001   	F.RSIZ= ****** GX	I.EXTD  000030   	M.RTRV= 000012   	WI.BPS= 100000
EX.AC2= 000002   	F.RTYP= ****** GX	I.FCN   000014   	M.USE = 000010   	WI.DLK= 010000
EX.ADF= 000010   	F.RVN   000012   	I.FIDP  000024   	QIOEFN= 000002   	WI.EXT= 002000
EX.ENA= 000200   	F.SCHA  000021   	I.FNAM= 000000   	R$$10F= 000001   	WI.LCK= 004000
EX.FCO= 000004   	F.SIZE  000032   	I.FNBP  000036   	R$$11D= 000001   	WI.RDV= 000400
E$$MSG= 000001   	F.STAT  000040   	I.FTYP= 000006   	R.FIX = ****** GX	WI.WRV= 001000
E$$TRP= 000001   	F.STD   000004   	I.FVER= 000010   	SC.BAD= 000100   	W.CTL   000000
FCPLUN= 000001   	F.UCHA  000020   	I.IOSB  000016   	SC.MDL= 000200   	W.FCB   000002
FC.CEF= 020000   	F11PR$= 000000   	I.LGTH  000040   	S.HDHD= 000056   	W.RTRV  000012
FC.DIR= 040000   	HIFCN = 000030   	I.LNK   000000   	S.IDHD= 000056   	W.STD   000004
FC.FCO= 010000   	H.CKSM= 000776   	I.LUN   000012   	S.MPHD= 000012   	W.VBN   000006
FC.WAC= 100000   	H.FCHA= 000014   	I.PRI   000010   	S.NFEN= ****** GX	W.WISZ  000007
FP.DEL= 000010   	H.FLEV= 000006   	I.PRM   000024   	S.STBK= 000012   	$$    = 000067
FP.EXT= 000004   	H.FNUM= 000002   	I.RTRV  000034   	UC.CON= 000200   	.CRFCB= ****** GX
FP.RAT= 000001   	H.FOWN= 000010   	I.RVDT= 000014   	UC.DLK= 000100   	.DFEXT= 000005
FP.RDV= 000001   	H.FPRO= 000012   	I.RVNO= 000012   	VC.BMW= 000002   	.DFPRO= 164000
FP.WRV= 000002   	H.FSEQ= 000004   	I.RVTI= 000023   	VC.IFW= 000001   	.DRACC  000000RG
F$$LVL= 000001   	H.IDOF= 000000   	I.RWAD= 000024   	V.FCB   000006   	.DSPAT= ****** GX
F.DREF  000042   	H.MPOF= 000001   	I.RWAT  000026   	V.FFNU  000055   	.FCBAD= ****** GX
F.DRNM  000044   	H.PROG= 000010   	I.RWCT= 000026   	V.FIEX  000025   	.HDBUF= ****** GX
F.EFBK= ****** GX	H.PROJ= 000011   	I.RWVB= 000032   	V.FMAX  000016   	.INFCB= ****** GX
F.FEXT  000002   	H.SCHA= 000015   	I.STD   000004   	V.FPRO  000030   	.INWIN= ****** GX
F.FFBY= ****** GX	H.UCHA= 000014   	I.TISZ= 000006   	V.FRBK  000034   	.IOPKT= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.UIC   000022   	V.IBLB  000012   	.PRFIL= 000004
F.FOWN  000014   	IDXFNU= 000001   	LEV11M= 000401   	V.IBSZ  000013   	.RDFHD= ****** GX
F.FPRO  000016   	ID$$$ = 000202   	LOWFCN= 000011   	V.IFWI  000002   	.RTPTF= 001401
F.FSEQ  000010   	IE.BDR= ****** GX	MFDFNO= 000004   	V.LABL  000040   	.SCFAC= ****** GX
F.FSQN  000013   	IO.FNA= ****** GX	MFDFSQ= 000004   	V.LGTH  000056   	.STACK= ****** GX
F.FVBN  000046   	I.ACTL  000035   	M$$HDR= 000001   	V.LRUC  000035   	.SYUIC= 000010
F.HDLB  000022   	I.AST   000020   	M.CTSZ= 000006   	V.SBCL  000021   	.VBSIZ= 001000
F.HIBK= ****** GX	I.ATL   000006   	M.EFNU= 000002   	V.SBLB  000024   	.WACCK= ****** GX
F.LBN   000026   	I.CRDT= 000031   	M.EFSQ= 000004   	V.SBSZ  000022   	...GBL= 000000
F.LGTH  000052   	I.CRTI= 000040   	M.ERVN= 000001   	V.STAT  000054   	...TPC= 000012
F.LINK  000000   	I.DASZ= 000007

. ABS.	000056	   000
      	000370	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2730 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:20
[40,10]DRACC,[40,20]DRACC/-SP=[40,30]RSXDC,F11PRE,DRACC
RSXDC	MACRO M1108  05-DEC-77 17:01  PAGE 3


      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.
DRALC	D0200, ALLOCATE DIRECTO	MACRO M1108  05-DEC-77 17:01  PAGE 6


      1						.TITLE	DRALC	D0200, ALLOCATE DIRECTORY SPACE
						.IDENT	"D0200"
      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					;
					; VERSION D200, ASSEMBLED FOR RSX-11D
					;
     20
     21					; ANDREW C. GOLDSTEIN  25 JUL 1974
     22					; PETER H. LIPMAN	12-JUN-74
     23					;
     24					; ALLOCATE A CONTIGUOUS CHUNK OF STORAGE FOR THE DIRECTORY FILE
     25					;
     26					; **-.DRALC-ALLOCATE SPACE FOR DIRECTORY EXTENSION
     27					;
     28					; THIS ROUTINE CALLS THE STORAGE ALLOCATOR FOR A CONTIGUOUS PIECE OF STORAGE
     29					;
     30					; INPUTS:
     31					;
     32					; 	R2=NO. OF BLOCKS TO ALLOCATE
     33					; 	R4=VOLUME CONTROL BLOCK ADDRESS
     34					; 	R5=I/O PACKET ADDRESS
     35					;
     36					; OUTPUTS:
     37					;
     38					; 	C=0 IF SUCCESSFUL, C=1 IF NOT
     39					; 	R0,R1 = STARTING LBN OF ALLOCATED BLOCKS, IF C=0
     40					; 	R2=NO. OF BLOCKS ALLOCATED, IF C=0
     41					; 	R3 ALTERED, R4,R5 PRESERVED
     42					;-
     43
     44	000000				.DRALC::
     45	000000	005001 				CLR	R1		; R1,R2=DESIRED BLOCK COUNT
     46	000002	112767 	000201 	000000G		MOVB	#EX.ENA!EX.AC1,.SMCTL ; SET EXTEND CONTROL TO CONTIGUOUS
     47	000010					CALL	.SMALC
     48	000014	016702 	000002G			MOV	.SM1BT+2,R2	; R2=ALLOCATED BLOCKS IF C=0
     49	000020					RETURN			; RETURN C BIT FROM .SMALC
     50					;
     51					;
     52	000022					$END	DRALC
     53					;
     54					;
DRALC	D0200, ALLOCATE DIRECTO	MACRO M1108  05-DEC-77 17:01  PAGE 6-1


     55		000001 				.END
DRALC	D0200, ALLOCATE DIRECTO	MACRO M1108  05-DEC-77 17:01  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.DASZ= 000007   	M.CTSZ= 000006   	V.LRUC  000035
AC.LCK= 000001   	F.NACS  000036   	I.DPB   000011   	M.EFNU= 000002   	V.SBCL  000021
BITFNU= 000002   	F.NLCK  000037   	I.EFN   000013   	M.EFSQ= 000004   	V.SBLB  000024
EX.AC1= 000001   	F.NWAC  000040   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBSZ  000022
EX.AC2= 000002   	F.RVN   000012   	I.EXTD  000030   	M.ESQN= 000000   	V.STAT  000054
EX.ADF= 000010   	F.SCHA  000021   	I.FCN   000014   	M.LBSZ= 000007   	V.STD   000004
EX.ENA= 000200   	F.SIZE  000032   	I.FIDP  000024   	M.MAX = 000011   	V.TRCT  000000
EX.FCO= 000004   	F.STAT  000040   	I.FNAM= 000000   	M.RTRV= 000012   	V.WISZ  000020
E$$MSG= 000001   	F.STD   000004   	I.FNBP  000036   	M.USE = 000010   	WI.BPS= 100000
E$$TRP= 000001   	F.UCHA  000020   	I.FTYP= 000006   	QIOEFN= 000002   	WI.DLK= 010000
FCPLUN= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$10F= 000001   	WI.EXT= 002000
FC.CEF= 020000   	HIFCN = 000030   	I.IOSB  000016   	R$$11D= 000001   	WI.LCK= 004000
FC.DIR= 040000   	H.CKSM= 000776   	I.LGTH  000040   	SC.BAD= 000100   	WI.RDV= 000400
FC.FCO= 010000   	H.FCHA= 000014   	I.LNK   000000   	SC.MDL= 000200   	WI.WRV= 001000
FC.WAC= 100000   	H.FLEV= 000006   	I.LUN   000012   	S.HDHD= 000056   	W.CTL   000000
FP.DEL= 000010   	H.FNUM= 000002   	I.PRI   000010   	S.IDHD= 000056   	W.FCB   000002
FP.EXT= 000004   	H.FOWN= 000010   	I.PRM   000024   	S.MPHD= 000012   	W.RTRV  000012
FP.RAT= 000001   	H.FPRO= 000012   	I.RTRV  000034   	S.STBK= 000012   	W.STD   000004
FP.RDV= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	UC.CON= 000200   	W.VBN   000006
FP.WRV= 000002   	H.IDOF= 000000   	I.RVNO= 000012   	UC.DLK= 000100   	W.WISZ  000007
F$$LVL= 000001   	H.MPOF= 000001   	I.RVTI= 000023   	VC.BMW= 000002   	$$    = 000067
F.DREF  000042   	H.PROG= 000010   	I.RWAD= 000024   	VC.IFW= 000001   	.DFEXT= 000005
F.DRNM  000044   	H.PROJ= 000011   	I.RWAT  000026   	V.FCB   000006   	.DFPRO= 164000
F.FEXT  000002   	H.SCHA= 000015   	I.RWCT= 000026   	V.FFNU  000055   	.DRALC  000000RG
F.FNUM  000006   	H.UCHA= 000014   	I.RWVB= 000032   	V.FIEX  000025   	.PRFIL= 000004
F.FOWN  000014   	H.UFAT= 000016   	I.STD   000004   	V.FMAX  000016   	.RTPTF= 001401
F.FPRO  000016   	IDXFNU= 000001   	I.TISZ= 000006   	V.FPRO  000030   	.SMALC= ****** GX
F.FSEQ  000010   	ID$$$ = 000200   	I.UIC   000022   	V.FRBK  000034   	.SMCTL= ****** GX
F.FSQN  000013   	I.ACTL  000035   	LEV11M= 000401   	V.IBLB  000012   	.SM1BT= ****** GX
F.FVBN  000046   	I.AST   000020   	LOWFCN= 000011   	V.IBSZ  000013   	.SYUIC= 000010
F.HDLB  000022   	I.ATL   000006   	MFDFNO= 000004   	V.IFWI  000002   	.VBSIZ= 001000
F.LBN   000026   	I.CRDT= 000031   	MFDFSQ= 000004   	V.LABL  000040   	...GBL= 000000
F.LGTH  000052   	I.CRTI= 000040   	M$$HDR= 000001   	V.LGTH  000056   	...TPC= 000012

. ABS.	000056	   000
      	000022	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2497 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:15
[40,10]DRALC,[40,20]DRALC/-SP=[40,30]RSXDC,F11PRE,DRALC
RSXDC	MACRO M1108  05-DEC-77 17:02  PAGE 3


      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.
DRCPY	D0200, COPY THE DIRECTO	MACRO M1108  05-DEC-77 17:02  PAGE 6


      1						.TITLE	DRCPY	D0200, COPY THE DIRECTORY TO NEW BLOCKS
						.IDENT	"D0200"
      2					;
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D200, ASSEMBLED FOR RSX-11D
					;
     22
     23					; ANDREW C. GOLDSTEIN  25 JUL 1974
     24					; PETER H. LIPMAN	12-JUN-74
     25					;
     26					; COPY THE EXISTING DIRECTORY BLOCKS TO THE NEWLY ALLOCATED BLOCKS
     27					;
     28					; SCRATCH STORAGE FOR THE COPY ROUTINE
     29					;
     30	000000				VBN:	.BLKW	1		; CURRENT VBN BEING COPIED
     31	000002				BLKCNT:	.BLKW	1		; COUNT OF BLOCKS NOT YET COPIED
     32	000004				NEWLBN:	.BLKW	2		; OUTPUT LBN FOR CURRENT BLOCK
     33	000010				BUF:	.BLKB	.VBSIZ		; BUFFER FOR THE BLOCKS BEING COPIED
     34					;
     35					;+
     36					; **-.DRCPY-COPY THE DIRECTORY BLOCKS TO THE NEW AREA
     37					;
     38					; THIS ROUTINE COPIES THE EXISTING BLOCKS OF THE DIRECTORY TO THE NEWLY
     39					; ALLOCATED CONTIGUOUSAREA
     40					;
     41					; INPUTS:
     42					;
     43					; 	R0,R1=STARTING LBN OF NEWLY ALLOCATED AREA
     44					; 	R4=VOLUME CONTROL BLOCK ADDRESS
     45					;
     46					; OUTPUTS:
     47					;
     48					; 	R0-R3 ALTERED
     49					; 	R4-R5 PRESERVED
     50					;-
     51
     52	001010				.DRCPY::
     53	001010	005067 	176764 			CLR	VBN		; INIT THE STARING VBN
     54	001014	010067 	176764 			MOV	R0,NEWLBN	; AND THE STARTING LBN OF THE NEW AREA
DRCPY	D0200, COPY THE DIRECTO	MACRO M1108  05-DEC-77 17:02  PAGE 6-1


     55	001020	010167 	176762 			MOV	R1,NEWLBN+2
     56	001024	016703 	000000G			MOV	.FCBAD,R3	; R3=FCB ADDRESS
     57	001030	016367 	000042 	176744 		MOV	F.DREF(R3),BLKCNT ; NO. OF BLOCKS TO COPY
     58	001036	005267 	176736 		10$:	INC	VBN		; COPY THE NEXT VBN
     59	001042	016700 	176732 			MOV	VBN,R0
     60	001046	016703 	000000G			MOV	.FCBAD,R3
     61	001052					CALL	.DRVLB		; CONVERT VBN TO LBN
     62	001056	012701 	000010'			MOV	#BUF,R1
     63	001062					CALL	.RD1LB		; READ THE BLOCK INTO BUF
     64	001066	016702 	176712 			MOV	NEWLBN,R2	; R2,R3=LBN TO WRITE TO
     65	001072	016703 	176710 			MOV	NEWLBN+2,R3
     66	001076					CALL	.WR1LB		; AND WRITE THE BLOCK
     67	001102	062767 	000001 	176676 		ADD	#1,NEWLBN+2	; NEXT LBN
     68	001110	005567 	176670 			ADC	NEWLBN
     69	001114	005367 	176662 			DEC	BLKCNT		; ANY MORE BLOCKS?
     70	001120	003346 				BGT	10$		; BRANCH IF YES
     71	001122					RETURN			; NO, ALL DONE
     72					;
     73					;
     74	001124					$END	DRCPY
     75					;
     76					;
     77		000001 				.END
DRCPY	D0200, COPY THE DIRECTO	MACRO M1108  05-DEC-77 17:02  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.LGTH  000052   	I.DASZ= 000007   	M.EFNU= 000002   	V.LRUC  000035
AC.LCK= 000001   	F.LINK  000000   	I.DPB   000011   	M.EFSQ= 000004   	V.SBCL  000021
BITFNU= 000002   	F.NACS  000036   	I.EFN   000013   	M.ERVN= 000001   	V.SBLB  000024
BLKCNT  000002R  	F.NLCK  000037   	I.EXDT= 000046   	M.ESQN= 000000   	V.SBSZ  000022
BUF     000010R  	F.NWAC  000040   	I.EXTD  000030   	M.LBSZ= 000007   	V.STAT  000054
EX.AC1= 000001   	F.RVN   000012   	I.FCN   000014   	M.MAX = 000011   	V.STD   000004
EX.AC2= 000002   	F.SCHA  000021   	I.FIDP  000024   	M.RTRV= 000012   	V.TRCT  000000
EX.ADF= 000010   	F.SIZE  000032   	I.FNAM= 000000   	M.USE = 000010   	V.WISZ  000020
EX.ENA= 000200   	F.STAT  000040   	I.FNBP  000036   	NEWLBN  000004R  	WI.BPS= 100000
EX.FCO= 000004   	F.STD   000004   	I.FTYP= 000006   	QIOEFN= 000002   	WI.DLK= 010000
E$$MSG= 000001   	F.UCHA  000020   	I.FVER= 000010   	R$$10F= 000001   	WI.EXT= 002000
E$$TRP= 000001   	F11PR$= 000000   	I.IOSB  000016   	R$$11D= 000001   	WI.LCK= 004000
FCPLUN= 000001   	HIFCN = 000030   	I.LGTH  000040   	SC.BAD= 000100   	WI.RDV= 000400
FC.CEF= 020000   	H.CKSM= 000776   	I.LNK   000000   	SC.MDL= 000200   	WI.WRV= 001000
FC.DIR= 040000   	H.FCHA= 000014   	I.LUN   000012   	S.HDHD= 000056   	W.CTL   000000
FC.FCO= 010000   	H.FLEV= 000006   	I.PRI   000010   	S.IDHD= 000056   	W.FCB   000002
FC.WAC= 100000   	H.FNUM= 000002   	I.PRM   000024   	S.MPHD= 000012   	W.RTRV  000012
FP.DEL= 000010   	H.FOWN= 000010   	I.RTRV  000034   	S.STBK= 000012   	W.STD   000004
FP.EXT= 000004   	H.FPRO= 000012   	I.RVDT= 000014   	UC.CON= 000200   	W.VBN   000006
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVNO= 000012   	UC.DLK= 000100   	W.WISZ  000007
FP.RDV= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	VBN     000000R  	$$    = 000067
FP.WRV= 000002   	H.MPOF= 000001   	I.RWAD= 000024   	VC.BMW= 000002   	.DFEXT= 000005
F$$LVL= 000001   	H.PROG= 000010   	I.RWAT  000026   	VC.IFW= 000001   	.DFPRO= 164000
F.DREF  000042   	H.PROJ= 000011   	I.RWCT= 000026   	V.FCB   000006   	.DRCPY  001010RG
F.DRNM  000044   	H.SCHA= 000015   	I.RWVB= 000032   	V.FFNU  000055   	.DRVLB= ****** GX
F.FEXT  000002   	H.UCHA= 000014   	I.STD   000004   	V.FIEX  000025   	.FCBAD= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.TISZ= 000006   	V.FMAX  000016   	.PRFIL= 000004
F.FOWN  000014   	IDXFNU= 000001   	I.UIC   000022   	V.FPRO  000030   	.RD1LB= ****** GX
F.FPRO  000016   	ID$$$ = 000200   	LEV11M= 000401   	V.FRBK  000034   	.RTPTF= 001401
F.FSEQ  000010   	I.ACTL  000035   	LOWFCN= 000011   	V.IBLB  000012   	.SYUIC= 000010
F.FSQN  000013   	I.AST   000020   	MFDFNO= 000004   	V.IBSZ  000013   	.VBSIZ= 001000
F.FVBN  000046   	I.ATL   000006   	MFDFSQ= 000004   	V.IFWI  000002   	.WR1LB= ****** GX
F.HDLB  000022   	I.CRDT= 000031   	M$$HDR= 000001   	V.LABL  000040   	...GBL= 000000
F.LBN   000026   	I.CRTI= 000040   	M.CTSZ= 000006   	V.LGTH  000056   	...TPC= 000012

. ABS.	000056	   000
      	001124	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2532 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:16
[40,10]DRCPY,[40,20]DRCPY/-SP=[40,30]RSXDC,F11PRE,DRCPY
RSXDC	MACRO M1108  05-DEC-77 17:02  PAGE 3


      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.
DREOF	D0202, SET DIRECTORY EO	MACRO M1108  05-DEC-77 17:02  PAGE 6


      1						.TITLE	DREOF	D0202, SET DIRECTORY EOF IN HEADER
						.IDENT	"D0202"
      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					;
					; VERSION D202, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  10 SEP 74  12:26:25
     23					; PETER H. LIPMAN	22-JUN-74
     24					;
     25					; UPDATE RECORD ATTRIBUTE SECTION OF THE DIRECTORY FILE HEADER WITH THE
     26					; CORRECT END OF FILE AND SIZE FROM THE FCB.
     27					;
     28					;
     29					;+
     30					; **-.DREOF-UPDATE THE DIRECTORY END OF FILE IN THE HEADER
     31					;
     32					; THIS ROUTINE UPDATES THE RECORD ATTRIBUTE SECTION OF A DIRECTORY
     33					; FILE HEADER SO THAT IT REFLECTS THE CORRECT LOGICAL AND PHYSICAL EOF
     34					; INFORMATION RECORDED IN THE FILE CONTROL BLOCK
     35					; 	THIS ROUTINE EXITS THROUGH .CLDIR CLEANING UP AFTER A DIRECTORY
     36					; OPERATION.  THUS IT IS INTENDED THAT .DREOF WILL BE CALLED AS THE LAST
     37					; OPERATION OF A DIRECTORY WRITE OPERATION (ENTER, REMOVE)
     38					;
     39					; INPUTS:
     40					;
     41					; 	R4=VOLUME CONTROL BLOCK ADDRESS
     42					; 	R5=I/O PACKET ADDRESS
     43					; 	.FCBAD CONTAINS THE FILE CONTROL BLOCK ADDRESS
     44					;
     45					; OUTPUTS:
     46					;
     47					; 	R0-R3 ALTERED, R4-R5 PRESERVED
     48					; 	HEADER READ, UPDATED, AND WRITTEN
     49					;
     50					; ALTERNATE ENTRY:
     51					;
     52					; **-.DRSEF-UPDATE DIRECTORY EOF INFORMATION IN THE FILE HEADER
     53					;
     54					; THIS ROUTINE ASSUMES THE FILE  HEADER IS IN MEMORY AND DOES NOT WRITE
DREOF	D0202, SET DIRECTORY EO	MACRO M1108  05-DEC-77 17:02  PAGE 6-1


     55					; IT AFTER ALTERING IT.  IT MERELY UPDATES THE RECORD ATTRIBUTE SECTION
     56					;
     57					;-
     58
     59	000000				.DREOF::
     60	000000					CALL	.RDFHD
     61	000004					CALL	.DRSEF		; RESET DIRECTORY EOF
     62	000010					CALL	.WRHDR		; UPDATE THE DIRECTORY HEADER
     63	000014					CALLR	.CLDIR		; EXIT FROM DIRECTORY FUNCTION
     64					;
     65					; SET DIRECTORY END OF FILE FROM FCB HEADER IN MEMORY
     66					;
     67	000020				.DRSEF::
     68	000020	016700 	000000G			MOV	.FCBAD,R0
     69	000024	016067 	000034 	000000C		MOV	F.SIZE+2(R0),.HDBUF+H.UFAT+F.HIBK+2 ; UPDATE F.HIBK
     70	000032	016067 	000042 	000000C		MOV	F.DREF(R0),.HDBUF+H.UFAT+F.EFBK+2
     71	000040	005267 	000000C			INC	.HDBUF+H.UFAT+F.EFBK+2	; SET POINTER TO LAST+1 BLOCK
     72	000044	005067 	000000C			CLR	.HDBUF+H.UFAT+F.FFBY	; 1ST BYTE
     73	000050	042760 	020000 	000040 		BIC	#FC.CEF,F.STAT(R0) ; NEW EOF RECORDED
     74	000056					RETURN
     75					;
     76					;
     77
     78	000060					$END	DREOF
     79					;
     80					;
     81		000001 				.END
DREOF	D0202, SET DIRECTORY EO	MACRO M1108  05-DEC-77 17:02  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.LGTH  000052   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBLB  000024
AC.LCK= 000001   	F.LINK  000000   	I.DPB   000011   	M.EFSQ= 000004   	V.SBSZ  000022
BITFNU= 000002   	F.NACS  000036   	I.EFN   000013   	M.ERVN= 000001   	V.STAT  000054
EX.AC1= 000001   	F.NLCK  000037   	I.EXDT= 000046   	M.ESQN= 000000   	V.STD   000004
EX.AC2= 000002   	F.NWAC  000040   	I.EXTD  000030   	M.LBSZ= 000007   	V.TRCT  000000
EX.ADF= 000010   	F.RVN   000012   	I.FCN   000014   	M.MAX = 000011   	V.WISZ  000020
EX.ENA= 000200   	F.SCHA  000021   	I.FIDP  000024   	M.RTRV= 000012   	WI.BPS= 100000
EX.FCO= 000004   	F.SIZE  000032   	I.FNAM= 000000   	M.USE = 000010   	WI.DLK= 010000
E$$MSG= 000001   	F.STAT  000040   	I.FNBP  000036   	QIOEFN= 000002   	WI.EXT= 002000
E$$TRP= 000001   	F.STD   000004   	I.FTYP= 000006   	R$$10F= 000001   	WI.LCK= 004000
FCPLUN= 000001   	F.UCHA  000020   	I.FVER= 000010   	R$$11D= 000001   	WI.RDV= 000400
FC.CEF= 020000   	F11PR$= 000000   	I.IOSB  000016   	SC.BAD= 000100   	WI.WRV= 001000
FC.DIR= 040000   	HIFCN = 000030   	I.LGTH  000040   	SC.MDL= 000200   	W.CTL   000000
FC.FCO= 010000   	H.CKSM= 000776   	I.LNK   000000   	S.HDHD= 000056   	W.FCB   000002
FC.WAC= 100000   	H.FCHA= 000014   	I.LUN   000012   	S.IDHD= 000056   	W.RTRV  000012
FP.DEL= 000010   	H.FLEV= 000006   	I.PRI   000010   	S.MPHD= 000012   	W.STD   000004
FP.EXT= 000004   	H.FNUM= 000002   	I.PRM   000024   	S.STBK= 000012   	W.VBN   000006
FP.RAT= 000001   	H.FOWN= 000010   	I.RTRV  000034   	UC.CON= 000200   	W.WISZ  000007
FP.RDV= 000001   	H.FPRO= 000012   	I.RVDT= 000014   	UC.DLK= 000100   	$$    = 000067
FP.WRV= 000002   	H.FSEQ= 000004   	I.RVNO= 000012   	VC.BMW= 000002   	.CLDIR= ****** GX
F$$LVL= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	VC.IFW= 000001   	.DFEXT= 000005
F.DREF  000042   	H.MPOF= 000001   	I.RWAD= 000024   	V.FCB   000006   	.DFPRO= 164000
F.DRNM  000044   	H.PROG= 000010   	I.RWAT  000026   	V.FFNU  000055   	.DREOF  000000RG
F.EFBK= ****** GX	H.PROJ= 000011   	I.RWCT= 000026   	V.FIEX  000025   	.DRSEF  000020RG
F.FEXT  000002   	H.SCHA= 000015   	I.RWVB= 000032   	V.FMAX  000016   	.FCBAD= ****** GX
F.FFBY= ****** GX	H.UCHA= 000014   	I.STD   000004   	V.FPRO  000030   	.HDBUF= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.TISZ= 000006   	V.FRBK  000034   	.PRFIL= 000004
F.FOWN  000014   	IDXFNU= 000001   	I.UIC   000022   	V.IBLB  000012   	.RDFHD= ****** GX
F.FPRO  000016   	ID$$$ = 000202   	LEV11M= 000401   	V.IBSZ  000013   	.RTPTF= 001401
F.FSEQ  000010   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002   	.SYUIC= 000010
F.FSQN  000013   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040   	.VBSIZ= 001000
F.FVBN  000046   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056   	.WRHDR= ****** GX
F.HDLB  000022   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035   	...GBL= 000000
F.HIBK= ****** GX	I.CRTI= 000040   	M.CTSZ= 000006   	V.SBCL  000021   	...TPC= 000012
F.LBN   000026

. ABS.	000056	   000
      	000060	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2590 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:16
[40,10]DREOF,[40,20]DREOF/-SP=[40,30]RSXDC,F11PRE,DREOF
RSXDC	MACRO M1108  05-DEC-77 17:02  PAGE 3


      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.
DREX	D0200, EXIT FROM DIRECT	MACRO M1108  05-DEC-77 17:02  PAGE 6


      1						.TITLE	DREX	D0200, EXIT FROM DIRECTORY OPERATION
						.IDENT	"D0200"
      2					;
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D200, ASSEMBLED FOR RSX-11D
					;
     22
     23					; ANDREW C. GOLDSTEIN  25 JUL 1974
     24					; PETER H. LIPMAN	12-JUN-74
     25					;
     26					; SET UP TO EXIT FROM DIRECTORY OPERATION BY RETURNING THE FNB TO USER
     27					;
     28					;+
     29					; **-.DREX-EXIT FROM DIRECTORY OPERATION
     30					;
     31					; THIS ROUTINE RETURNS THE FILE NAME BLOCK TO THE USER PROGRAM
     32					;
     33					; INPUTS:
     34					;
     35					; 	R5=FILE NAME BLOCK ADDRESS
     36					;
     37					; OUTPUTS:
     38					;
     39					; 	R5=I/O PACKET ADDRESS
     40					; 	R0-R3 ALTERED
     41					; 	R4 PRESERVED
     42					;-
     43
     44	000000				.DREX::
     45	000000	012702 	000000G			MOV	#S.DRFN,R2	; R2=NO. OF BYTES TO MOVE TO USER
     46					;+
     47					; **-.DRX1-ALTERNATE ENTRY POINT, DIFFERS ONLY IN THAT CALLER SPECIFIES
     48					; 	THE BYTE COUNT TO BE RETURNED TO THE USER'S FILE NAME BLOCK
     49					;
     50					; INPUTS:
     51					;
     52					; 	R2=BYTE COUNT TO XFER FROM TMP FNB TO USER FNB
     53					; 	R5=SCRATCH FILE NAME BLOCK ADDRESS
     54					;
DREX	D0200, EXIT FROM DIRECT	MACRO M1108  05-DEC-77 17:02  PAGE 6-1


     55					; OUTPUTS:
     56					; 	SAME AS .DREX ABOVE
     57					;-
     58
     59	000004				.DRX1::
     60	000004	010500 				MOV	R5,R0		; R0=ADDRESS OF FNB
     61	000006	016701 	000000G			MOV	.IOPKT,R1	; R1=I/O PACKET ADDRESS
     62	000012	010105 				MOV	R1,R5		; RESTORE R5 TO I/O PACKET ADDRESS
     63	000014	062701 	000036 			ADD	#I.FNBP,R1	; R1=ADDRESS OFUSER DOUBLE WORD ADDRESS
     64	000020					CALLR	.BLXO		; MOVE THE FNB TO USER MEMEORY
     65					;
     66					;
     67	000024					$END	DREX
     68					;
     69					;
     70		000001 				.END
DREX	D0200, EXIT FROM DIRECT	MACRO M1108  05-DEC-77 17:02  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.DASZ= 000007   	M.CTSZ= 000006   	V.LGTH  000056
AC.LCK= 000001   	F.NACS  000036   	I.DPB   000011   	M.EFNU= 000002   	V.LRUC  000035
BITFNU= 000002   	F.NLCK  000037   	I.EFN   000013   	M.EFSQ= 000004   	V.SBCL  000021
EX.AC1= 000001   	F.NWAC  000040   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBLB  000024
EX.AC2= 000002   	F.RVN   000012   	I.EXTD  000030   	M.ESQN= 000000   	V.SBSZ  000022
EX.ADF= 000010   	F.SCHA  000021   	I.FCN   000014   	M.LBSZ= 000007   	V.STAT  000054
EX.ENA= 000200   	F.SIZE  000032   	I.FIDP  000024   	M.MAX = 000011   	V.STD   000004
EX.FCO= 000004   	F.STAT  000040   	I.FNAM= 000000   	M.RTRV= 000012   	V.TRCT  000000
E$$MSG= 000001   	F.STD   000004   	I.FNBP  000036   	M.USE = 000010   	V.WISZ  000020
E$$TRP= 000001   	F.UCHA  000020   	I.FTYP= 000006   	QIOEFN= 000002   	WI.BPS= 100000
FCPLUN= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$10F= 000001   	WI.DLK= 010000
FC.CEF= 020000   	HIFCN = 000030   	I.IOSB  000016   	R$$11D= 000001   	WI.EXT= 002000
FC.DIR= 040000   	H.CKSM= 000776   	I.LGTH  000040   	SC.BAD= 000100   	WI.LCK= 004000
FC.FCO= 010000   	H.FCHA= 000014   	I.LNK   000000   	SC.MDL= 000200   	WI.RDV= 000400
FC.WAC= 100000   	H.FLEV= 000006   	I.LUN   000012   	S.DRFN= ****** GX	WI.WRV= 001000
FP.DEL= 000010   	H.FNUM= 000002   	I.PRI   000010   	S.HDHD= 000056   	W.CTL   000000
FP.EXT= 000004   	H.FOWN= 000010   	I.PRM   000024   	S.IDHD= 000056   	W.FCB   000002
FP.RAT= 000001   	H.FPRO= 000012   	I.RTRV  000034   	S.MPHD= 000012   	W.RTRV  000012
FP.RDV= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	S.STBK= 000012   	W.STD   000004
FP.WRV= 000002   	H.IDOF= 000000   	I.RVNO= 000012   	UC.CON= 000200   	W.VBN   000006
F$$LVL= 000001   	H.MPOF= 000001   	I.RVTI= 000023   	UC.DLK= 000100   	W.WISZ  000007
F.DREF  000042   	H.PROG= 000010   	I.RWAD= 000024   	VC.BMW= 000002   	.BLXO = ****** GX
F.DRNM  000044   	H.PROJ= 000011   	I.RWAT  000026   	VC.IFW= 000001   	.DFEXT= 000005
F.FEXT  000002   	H.SCHA= 000015   	I.RWCT= 000026   	V.FCB   000006   	.DFPRO= 164000
F.FNUM  000006   	H.UCHA= 000014   	I.RWVB= 000032   	V.FFNU  000055   	.DREX   000000RG
F.FOWN  000014   	H.UFAT= 000016   	I.STD   000004   	V.FIEX  000025   	.DRX1   000004RG
F.FPRO  000016   	IDXFNU= 000001   	I.TISZ= 000006   	V.FMAX  000016   	.IOPKT= ****** GX
F.FSEQ  000010   	ID$$$ = 000200   	I.UIC   000022   	V.FPRO  000030   	.PRFIL= 000004
F.FSQN  000013   	I.ACTL  000035   	LEV11M= 000401   	V.FRBK  000034   	.RTPTF= 001401
F.FVBN  000046   	I.AST   000020   	LOWFCN= 000011   	V.IBLB  000012   	.SYUIC= 000010
F.HDLB  000022   	I.ATL   000006   	MFDFNO= 000004   	V.IBSZ  000013   	.VBSIZ= 001000
F.LBN   000026   	I.CRDT= 000031   	MFDFSQ= 000004   	V.IFWI  000002   	...GBL= 000000
F.LGTH  000052   	I.CRTI= 000040   	M$$HDR= 000001   	V.LABL  000040   	...TPC= 000012

. ABS.	000056	   000
      	000024	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2492 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:18
[40,10]DREX,[40,20]DREX/-SP=[40,30]RSXDC,F11PRE,DREX
RSXDC	MACRO M1108  05-DEC-77 17:03  PAGE 3


      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.
DREXT	D0202, EXTEND A DIRECTO	MACRO M1108  05-DEC-77 17:03  PAGE 6


      1						.TITLE	DREXT	D0202, EXTEND A DIRECTORY FILE
						.IDENT	"D0202"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D202, ASSEMBLED FOR RSX-11D
					;
     22
     23					; ANDREW C. GOLDSTEIN  11 NOV 74  11:14
     24					; PETER H. LIPMAN	7-JUN-74
     25					;
     26					; EXTEND A DIRECTORY FILE AND MAKE THE FILE CONTIGUOUS
     27					;
     28
     29
     30	000000				.NDRSZ::.BLKW	1		; SIZE OF NEW DIRECTORY PIECE
     31	000002				.NDRLB::.BLKW	2		; LBN NEW DIRECTIRY PIECE
     32
     33					;+
     34					; **-.DREXT-EXTEND THE DIRECTORY FILE
     35					;
     36					; THIS ROUTINE TRIES TO EXTEND A DIRECTORY AND MAKE THE RESULTING FILE
     37					; CONTIGUOUS. IT MAY ALSO BE CALLED TO JUST MAKE THE DIRECTORY CONTIGUOUS
     38					; (BECAUSE IT WAS NON CONTIGUOUS). IF THE SIZE IN R0 IS NON ZERO, THEN JUST
     39					; MAKE THE FILE CONTIGUOUS IF POSSIBLE. IF IT CONTAINS ONLY 1 RETRIEVAL
     40					; POINTER THEN JUST SET THE CONTIGUOUS BIT. OTHERWISE TRY TO GET A CONTIGUOUS
     41					; PIECE OF N BLOCKS (SPECIFIED IN R0). IF THIS FAILS (NO CONTIGUOUS SPACE)
     42					; JUST LEAVE THE FILE NON CONTIGUOUS AND REDISPATCH TO THE ENTER ROUTINE.
     43					; IF THE CONTIGUOUS BLOCKS WERE ALLOCATED THEN PROCEED AS IF THE FILE WERE
     44					; BEING EXTENDED.
     45					; 	IF R0=0 THEN ALLOCATE A NEW CONTIGUOUS AREA OF DISK 1 AND 1/2 THE
     46					; SIZE OF THE CURRENT FILE OR THE CURRENT SIZE PLUS THE VOLUME DEFAULT EXTEND
     47					; SIZE WHICHEVER IS SMALLER. IF THERE IS NO CONTIGUOUS SPACE, THEN ADD
     48					; 1 BLOCK MAKING THE FILE NON CONTIGUOUS.
     49					; 	ONCE A BIG ENOUGH CONTIGUOUS AREA IS ALLOCATED, THEN THE EXISTING
     50					; DIRECTORY BLOCKS ARE COPIED TO THE NEW AREA, THE EXISTING BLOCKS ARE
     51					; DEALLOCATED AND THE NEW AREA IS RECORDED IN THE MAP. FINALLY THE ENTER
     52					; IS REEXECUTED.
     53					;
     54					; NOTE: THIS ROUTINE IS JMP'ED TO WITH JUST ONE WORD ON THE STACK. (SP=.STACK-2)
DREXT	D0202, EXTEND A DIRECTO	MACRO M1108  05-DEC-77 17:03  PAGE 6-1


     55					;
     56					; INPUTS:
     57					;
     58					; 	R0=0 FOR DIRECTORY EXTEND
     59					; 	  =N WHERE N>0 TO FORCE NON CONTIGUOUS DIRECTORY TO BE CONTIGUOUS
     60					; 	     (N BLOCKS)
     61					; 	.FCBAD SET TO FCB
     62					; 	.WNDOW SET TO A WINDOW IF DIRECTORY WAS NOT CONTIGUOUS
     63					;
     64					; OUTPUTS:
     65					;
     66					; 	THIS ROUTINE EXITS THROUGH .AGAIN WHICH REINITIALIZE AND REEXECUTES
     67					; THE ENTER FUNCTION. IN THE SPECIAL CASE OF A FAILURE TO MAKE A NON-CONTIGUOUS
     68					; DIRECTORY CONTIGUOUS (I.E. MORE DIRECTORY ENTRY ROOM
     69					; WAS NOT NEEDED). THIS ROUTINE RETURNS TO .DSPAT WHICH REDISPATCHES
     70					; TO THE ENTER FUNCTION WITHOUT REINITIALIZING THE CONTEXT. THIS IS NECESSARY
     71					; TO PREVENT ENTER FROM GETTING INTO THE INFINITE LOOP OF TRYING TO MAKE A
     72					; NON CONTIGUOUS DIRECTORY CONTIGUOUS. WITH THE CURRENT DESIGN THOUGH ENTER
     73					; WILL TRY TO MAKE SUCH A DIRECTORY CONTIGUOUS ONCE FOR EACH ENTER OPERATION
     74					; WHICH RATHER SEVERELY DEGRADES THE SPEED OF ENTER. OF COURSE THIS ONLY
     75					; HAPPENS IF THERE IS NOT ENOUGH SPACE FOR A TYPICALLY SMALL CONTIGUOUS  EXTEND.
     76					;-
     77
     78	000006				.DREXT::
     79	000006	016705 	000000G			MOV	.IOPKT,R5	; SET R5=I/O PACKET ADDRESS
     80	000012	012716 	000000G			MOV	#.AGAIN,(SP)	; SET SO THAT RETURN RESTARTS THE
     81									; DIRECTORY ENTER OPERATION
     82	000016	010067 	177756 			MOV	R0,.NDRSZ	; SAVE DESIRED EXTEND IN FORMATION
     83	000022					CALL	.RDFHD
     84	000026	016700 	000000G			MOV	.FCBAD,R0
     85	000032	052760 	010000 	000040 		BIS	#FC.FCO,F.STAT(R0) ; NOTE THAT TRYING TO SET FILE CONTIG
     86	000040	005767 	177734 			TST	.NDRSZ
     87	000044	001010 				BNE	10$		; BRANCH IF MAKING NON CONTIG DIRECTORY CONTIG
     88					;
     89					; UPDATE THE DIRECTORY END OF FILE BLOCK NUMBER
     90					;
     91	000046					CALL	.DRSEF		; UPDATE EOF IN HEADER
     92	000052	012701 	000000G			MOV	#.HDBUF,R1	; AND UPDATE CHECKSUM SO HEADER
     93	000056					CALL	.CKSUM		; WILL BE VALID.
     94	000062	010011 				MOV	R0,(R1)
     95	000064	000413 				BR	20$
     96					;
     97					; WE'RE MAKING THIS DIRECTORY CONTIGUOUS. IF SINGLE RETRIEVAL POINTER,
     98					; THEN JUST SET CONTIGUOUS BIT.
     99					;
    100	000066	005000 			10$:	CLR	R0
    101	000070	156700 	000001G			BISB	.HDBUF+H.MPOF,R0
    102	000074	006300 				ASL	R0
    103	000076	122760 	000002 	000010G		CMPB	#2,.HDBUF+M.USE(R0) ; IF 1 RETRIEVAL PTR (2 WORDS)
    104	000104	001556 				BEQ	140$		; JUST MARK FILE CONTIGUOUS
    105	000106	016702 	177666 			MOV	.NDRSZ,R2	; OTHERWOSE TRY TO EXTEND IT BY
    106	000112	000417 				BR	50$		; A CONTIGUOUS CHUNK
    107
    108	000114	016700 	000000G		20$:	MOV	.FCBAD,R0
    109					;
    110					; CALCULATE SIZE OF EXTEND FROM CURRENT EOF
    111					;
DREXT	D0202, EXTEND A DIRECTO	MACRO M1108  05-DEC-77 17:03  PAGE 6-2


    112	000120	016002 	000042 			MOV	F.DREF(R0),R2	;
    113	000124	001430 				BEQ	70$		; BRANCH IF FILE WAS EMPTY
    114	000126	010201 				MOV	R2,R1
    115	000130	005201 				INC	R1		; ROUND UP AND
    116	000132	006201 				ASR	R1		; CALCULATE HALF THE SIZE
    117	000134	120164 	000025 			CMPB	R1,V.FIEX(R4)	; USE SMALLER OF HALF CURRENT SIZE
    118	000140	101403 				BLOS	40$		; AND DEFAULT EXTEND SIZE
    119	000142	005001 			30$:	CLR	R1
    120	000144	156401 	000025 			BISB	V.FIEX(R4),R1
    121	000150	060102 			40$:	ADD	R1,R2		; R2=DESIRED CONTIGUOUS FILE SIZE
    122	000152				50$:	CALL	.DRALC		; ALLOCATE A CONTIGUOUS PIECE THAT BIG
    123	000156	103035 				BCC	90$		; BRANCH IF SUCCESSFUL
    124	000160	112767 	000001 	000000G		MOVB	#1,.IOSTS	; RESET ERROR CONDITION
    125	000166	005767 	177606 			TST	.NDRSZ
    126	000172	001403 				BEQ	60$		;
    127					;
    128					; FAILED TO MAKE NON CONTIG DIRECTORY CONTIGUOUS, BUT IT'S NOT NECESSARY
    129					; TO EXTEND IT SO RETURN AND ALLOW IT TO BE USED AS IS.
    130					;
    131	000174	005726 				TST	(SP)+		; POP RETURN ADDRESS
    132	000176	000167 	000000G			JMP	.DSPAT		; AND REDISPATCH TO ENTER
    133					;
    134					; DO A 1 BLOCK EXTEND OF THE DIRECTORY - CONTIGUOUS IF DIRECTORY IS
    135					; EMPTY, NON-CONTIG IF NOT.
    136					;
    137	000202	012702 	000001 		60$:	MOV	#1,R2
    138	000206	010246 			70$:	MOV	R2,-(SP)	; SAVE R2=0 IF DEFAULT EXTEND CONTIG
    139									; =1 IF EXTEND BY ONE BLOCK
    140	000210					CALL	.CLDIR
    141	000214					CALL	.SCFAC		; REMOVE FCB FROM LRU IF PRESENT
    142	000220	005067 	000000G			CLR	.FCBAD
    143	000224	005000 				CLR	R0		; ASSUME EXTEND BY ONE BLOCK
    144	000226	012601 				MOV	(SP)+,R1
    145	000230	001003 				BNE	80$
    146	000232	005201 				INC	R1		; MAKE EMPTY FILE 1 BLOCK CONTIGUOUS
    147	000234	012700 	002400 			MOV	#<EX.FCO!EX.AC1>*400,R0
    148	000240				80$:
    149	000240	012767 	000000C	000000G		MOV	#<<IO.EXT/256.>-LOWFCN+1>*2,.EXDSP
    150	000246	000177 	000000G			JMP	@.EXCM1		; MAKE THE DIRECTORY BIG ENOUGH
    151					;
    152					; NEW DIRECTORY AREA IS ALLOCATED - COPY DIRECTORY DATA, FIX DIRECTORY
    153					; HEADER, RETURN OLD DIRECTORY AREA TO STORAGE MAP, ETC.
    154					;
    155	000252	012703 	000000'		90$:	MOV	#.NDRSZ,R3
    156	000256	010223 				MOV	R2,(R3)+	; SAVE # OF BLOCKS ALLOCATED
    157	000260	010023 				MOV	R0,(R3)+	; AND LBN
    158	000262	010113 				MOV	R1,(R3)
    159	000264					CALL	.DRCPY		; COPY THE BLOCKS TO THE NEW AREA
    160	000270					CALL	.DLBLK		; DELETE THE OLD BLOCKS
    161	000274	005000 				CLR	R0		; REINIT THE MAP AREA
    162	000276	156700 	000001G			BISB	.HDBUF+H.MPOF,R0 ;
    163	000302	006300 				ASL	R0
    164	000304	062700 	000010G			ADD	#.HDBUF+M.USE,R0
    165	000310	005001 				CLR	R1
    166	000312	151001 				BISB	(R0),R1		; R1=NO. OF WORDS OF RTRV PTRS TO ZERO
    167	000314	105010 				CLRB	(R0)		; NO. RETRIEVAL POINTERS IN USE
    168	000316					ASSUME	M.RTRV,M.USE+2
DREXT	D0202, EXTEND A DIRECTO	MACRO M1108  05-DEC-77 17:03  PAGE 6-3


    169	000316	010002 				MOV	R0,R2
    170	000320	005722 				TST	(R2)+		; POINT AT FIRST RETRIEVAL POINTER WORD
    171	000322	005022 			100$:	CLR	(R2)+		; ZERO THE DELETED RETRIEVAL POINTERS
    172	000324	077102 				SOB	R1,100$
    173	000326	010046 				MOV	R0,-(SP)	; SAVE POINTER TO M.USE
    174	000330	005720 				TST	(R0)+		; POINT AT 1ST RETRIEVAL POINTER
    175	000332	016702 	177444 			MOV	.NDRLB,R2	; R2,R3 =LBN OF NEW PIECE
    176	000336	016703 	177442 			MOV	.NDRLB+2,R3
    177	000342	016701 	177432 		110$:	MOV	.NDRSZ,R1	; R1=NO. OF NEW BLOCKS
    178	000346	001424 				BEQ	130$		;
    179	000350	020127 	000400 			CMP	R1,#256.	; MORE THAN 1 RTRV PTR WORTH
    180	000354	101402 				BLOS	120$		; BRANCH IF NO
    181	000356	012701 	000400 			MOV	#256.,R1	; YES, USE THE MAXIMUM
    182	000362	160167 	177412 		120$:	SUB	R1,.NDRSZ	; UPDATE COUNT REMAINING
    183	000366	110210 				MOVB	R2,(R0)		; STORE HIGH LBN
    184	000370	010360 	000002 			MOV	R3,2(R0)	; AND LOW LBN
    185	000374	060103 				ADD	R1,R3		; UPDATE LBN
    186	000376	005502 				ADC	R2		;
    187	000400	005301 				DEC	R1		; SET COUNT -1
    188	000402	110160 	000001 			MOVB	R1,1(R0)	; AND STORE BLOCK COUNT
    189	000406	022020 				CMP	(R0)+,(R0)+	; POINT TO NEXT POINTER
    190	000410	062776 	000002 	000000 		ADD	#2,@(SP)	; COUNT THIS RTRV PTR.
    191	000416	000751 				BR	110$
    192
    193	000420	005726 			130$:	TST	(SP)+		; POP THE SAVED M.USE POINTER
    194	000422	005067 	000000G			CLR	.HDUCB		; INVALIDATE HEADER IN CASE THE FOLLOWING FAILS
    195	000426	005003 				CLR	R3
    196	000430					CALL	.SMRVB		; FORCE THE STORAGE MAP BLOCK WRITE
    197	000434	016767 	000000G	000000G		MOV	.UCBAD,.HDUCB	; HEADER IS REALLY VALID
    198	000442				140$:
    199	000442	152767 	000200 	000014G		BISB	#UC.CON,.HDBUF+H.UCHA ; SET CONTIGUOUS BIT
    200	000450					CALL	.WRHDR		; AND WRITE THE HEADER
    201	000454	016700 	000000G			MOV	.FCBAD,R0
    202	000460	042760 	010000 	000040 		BIC	#FC.FCO,F.STAT(R0) ; FILE SUCCESSFULLY MADE CONTIG
    203	000466					CALL	.INFCB		; REINIT THE FCB
    204	000472					CALLR	.CLDIR		; CLEAN UP AND REEXECUTE THE ENTER
    205					;
    206					;
    207	000476					$END	DREXT
    208					;
    209					;
    210		000001 				.END
DREXT	D0202, EXTEND A DIRECTO	MACRO M1108  05-DEC-77 17:03  PAGE 6-4
SYMBOL TABLE

AC.DLK= 000002   	F.SCHA  000021   	I.FNBP  000036   	SC.BAD= 000100   	W.RTRV  000012
AC.LCK= 000001   	F.SIZE  000032   	I.FTYP= 000006   	SC.MDL= 000200   	W.STD   000004
BITFNU= 000002   	F.STAT  000040   	I.FVER= 000010   	S.HDHD= 000056   	W.VBN   000006
EX.AC1= 000001   	F.STD   000004   	I.IOSB  000016   	S.IDHD= 000056   	W.WISZ  000007
EX.AC2= 000002   	F.UCHA  000020   	I.LGTH  000040   	S.MPHD= 000012   	$$    = 000067
EX.ADF= 000010   	F11PR$= 000000   	I.LNK   000000   	S.STBK= 000012   	.AGAIN= ****** GX
EX.ENA= 000200   	HIFCN = 000030   	I.LUN   000012   	UC.CON= 000200   	.CKSUM= ****** GX
EX.FCO= 000004   	H.CKSM= 000776   	I.PRI   000010   	UC.DLK= 000100   	.CLDIR= ****** GX
E$$MSG= 000001   	H.FCHA= 000014   	I.PRM   000024   	VC.BMW= 000002   	.DFEXT= 000005
E$$TRP= 000001   	H.FLEV= 000006   	I.RTRV  000034   	VC.IFW= 000001   	.DFPRO= 164000
FCPLUN= 000001   	H.FNUM= 000002   	I.RVDT= 000014   	V.FCB   000006   	.DLBLK= ****** GX
FC.CEF= 020000   	H.FOWN= 000010   	I.RVNO= 000012   	V.FFNU  000055   	.DRALC= ****** GX
FC.DIR= 040000   	H.FPRO= 000012   	I.RVTI= 000023   	V.FIEX  000025   	.DRCPY= ****** GX
FC.FCO= 010000   	H.FSEQ= 000004   	I.RWAD= 000024   	V.FMAX  000016   	.DREXT  000006RG
FC.WAC= 100000   	H.IDOF= 000000   	I.RWAT  000026   	V.FPRO  000030   	.DRSEF= ****** GX
FP.DEL= 000010   	H.MPOF= 000001   	I.RWCT= 000026   	V.FRBK  000034   	.DSPAT= ****** GX
FP.EXT= 000004   	H.PROG= 000010   	I.RWVB= 000032   	V.IBLB  000012   	.EXCM1= ****** GX
FP.RAT= 000001   	H.PROJ= 000011   	I.STD   000004   	V.IBSZ  000013   	.EXDSP= ****** GX
FP.RDV= 000001   	H.SCHA= 000015   	I.TISZ= 000006   	V.IFWI  000002   	.FCBAD= ****** GX
FP.WRV= 000002   	H.UCHA= 000014   	I.UIC   000022   	V.LABL  000040   	.HDBUF= ****** GX
F$$LVL= 000001   	H.UFAT= 000016   	LEV11M= 000401   	V.LGTH  000056   	.HDUCB= ****** GX
F.DREF  000042   	IDXFNU= 000001   	LOWFCN= 000011   	V.LRUC  000035   	.INFCB= ****** GX
F.DRNM  000044   	ID$$$ = 000202   	MFDFNO= 000004   	V.SBCL  000021   	.IOPKT= ****** GX
F.FEXT  000002   	IO.EXT= ****** GX	MFDFSQ= 000004   	V.SBLB  000024   	.IOSTS= ****** GX
F.FNUM  000006   	I.ACTL  000035   	M$$HDR= 000001   	V.SBSZ  000022   	.NDRLB  000002RG
F.FOWN  000014   	I.AST   000020   	M.CTSZ= 000006   	V.STAT  000054   	.NDRSZ  000000RG
F.FPRO  000016   	I.ATL   000006   	M.EFNU= 000002   	V.STD   000004   	.PRFIL= 000004
F.FSEQ  000010   	I.CRDT= 000031   	M.EFSQ= 000004   	V.TRCT  000000   	.RDFHD= ****** GX
F.FSQN  000013   	I.CRTI= 000040   	M.ERVN= 000001   	V.WISZ  000020   	.RTPTF= 001401
F.FVBN  000046   	I.DASZ= 000007   	M.ESQN= 000000   	WI.BPS= 100000   	.SCFAC= ****** GX
F.HDLB  000022   	I.DPB   000011   	M.LBSZ= 000007   	WI.DLK= 010000   	.SMRVB= ****** GX
F.LBN   000026   	I.EFN   000013   	M.MAX = 000011   	WI.EXT= 002000   	.SYUIC= 000010
F.LGTH  000052   	I.EXDT= 000046   	M.RTRV= 000012   	WI.LCK= 004000   	.UCBAD= ****** GX
F.LINK  000000   	I.EXTD  000030   	M.USE = 000010   	WI.RDV= 000400   	.VBSIZ= 001000
F.NACS  000036   	I.FCN   000014   	QIOEFN= 000002   	WI.WRV= 001000   	.WRHDR= ****** GX
F.NLCK  000037   	I.FIDP  000024   	R$$10F= 000001   	W.CTL   000000   	...GBL= 000000
F.NWAC  000040   	I.FNAM= 000000   	R$$11D= 000001   	W.FCB   000002   	...TPC= 000012
F.RVN   000012

. ABS.	000056	   000
      	000476	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2755 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:20
[40,10]DREXT,[40,20]DREXT/-SP=[40,30]RSXDC,F11PRE,DREXT
RSXDC	MACRO M1108  05-DEC-77 17:03  PAGE 3


      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.
DRGET	D0200, GET DIRECTORY RE	MACRO M1108  05-DEC-77 17:03  PAGE 6


      1						.TITLE	DRGET	D0200, GET DIRECTORY RECORD
						.IDENT	"D0200"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D200, ASSEMBLED FOR RSX-11D
					;
     22
     23					; ANDREW C. GOLDSTEIN  14 AUG 1974
     24					; PETER H. LIPMAN	20-MAR-74
     25					;
     26					; GET A RECORD IN THE DIRECTORY FILE
     27					;
     28					;+
     29					; **-.DRGET-GET A DIRECTORY RECORD
     30					;
     31					; THIS ROUTINE ACCEPTS A DIRECTORY RECORD NUMBER (STARTING AT 1) AND
     32					; RETURNS WITH R1 POINTING AT THE RECORD. THE LOCATION .DRVBN TELLS
     33					; WHAT BLOCK IS CURRENTLY IN THE BUFFER. IF THIS RECORD IS IN THAT BLOCK
     34					; THEN NO READ IS NECESSARY. OTHERWISE, THE APPROPRIATE BLOCK IS READ.
     35					;
     36					; INPUTS:
     37					;
     38					; 	R0=DIRECTORY RECORD NUMBER
     39					; 	R4=VCB
     40					; 	R5=FILE NAME BLOCK
     41					;
     42					; OUTPUTS:
     43					;
     44					; 	C=0 IF SUCCESSFUL, C=1 IF EOF
     45					; 	R0 PRESERVED
     46					; 	R1=ADDRESS OF RECORD
     47					; 	R2=DIRECTORY VBN CONTAINING RECORD
     48					; 	R2-R3 ALTERED, R4-R5 PRESERVED
     49					;-
     50
     51	000000				.DRGET::
     52	000000	010046 				MOV	R0,-(SP)	; SAVE RECORD NUMBER
     53	000002	005300 				DEC	R0		; MAKE RECORD NUMBERS START FROM 0
     57		000005 				.REPT	5
DRGET	D0200, GET DIRECTORY RE	MACRO M1108  05-DEC-77 17:03  PAGE 6-1


     58						ASR	R0		; THEN CALCULATE BLOCK # BY LOTS OF SHIFTS
     59						.ENDR
     61	000016	005200 				INC	R0		; FORM VBN STARTING AT 1
     62	000020	016703 	000000G			MOV	.FCBAD,R3
     63	000024					CALL	.DRVLB		; CONVERT VBN TO LBN
     64	000030	103437 				BCS	30$		; BRANCH IF BEYOND EOF
     65	000032	010046 				MOV	R0,-(SP)	; SAVE VBN
     66	000034	012701 	000000G			MOV	#.DRUCB,R1
     67					;
     68					; SEE IF DESIRED DIRECTORY BLOCK IS ALREADY IN THE BUFFER
     69					;
     70	000040	026721 	000000G			CMP	.UCBAD,(R1)+	; DEVICE THE SAME?
     71	000044	001004 				BNE	10$		; BRANCH IF NO
     72	000046	020221 				CMP	R2,(R1)+	; LBN?
     73	000050	001002 				BNE	10$
     74	000052	020321 				CMP	R3,(R1)+	; LOW ORDER LBN AS WELL
     75	000054	001412 				BEQ	20$		; BRANCH IF BLOCK IN MEMORY
     76					;
     77					; MUST READ THE BLOCK IN
     78					;
     79	000056	012701 	000000G		10$:	MOV	#.DRUCB,R1
     80	000062	005021 				CLR	(R1)+		; SAY BUFFER IS EMPTY
     81	000064	010221 				MOV	R2,(R1)+	; STORE HH LBN WORD
     82	000066	010321 				MOV	R3,(R1)+	; AND LOW LBN
     83	000070					CALL	.RD1LB		; READ THE BLOCK IN
     84	000074	016767 	000000G	000000G		MOV	.UCBAD,.DRUCB	; BUFFER IS NOW VALID
     85	000102	012602 			20$:	MOV	(SP)+,R2	; R2=VBN OF THIS RECORD
     86	000104	011601 				MOV	(SP),R1		; R1=DESIRED RECORD NUMBER
     87	000106	005301 				DEC	R1		; MAKE IT START AT 0.
     88	000110	042701 	177740 			BIC	#177740,R1	; R1=RECORD NO. IN BLOCK
     92		000004 				.REPT	4
     93						ASL	R1		; FORM OFFSET BY SINGLE SHIFTS
     94						.ENDR
     96	000124	062701 	000000G			ADD	#.DRBUF,R1	; R1=ADDRESS OF RECORD, C=0
     97	000130	012600 			30$:	MOV	(SP)+,R0	; RESTORE R0=RECORD NUMBER
     98	000132					RETURN
     99					;
    100					;
    101	000134					$END	DRGET
    102					;
    103					;
    104		000001 				.END
DRGET	D0200, GET DIRECTORY RE	MACRO M1108  05-DEC-77 17:03  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.EFN   000013   	M.ERVN= 000001   	V.SBSZ  000022
AC.LCK= 000001   	F.NLCK  000037   	I.EXDT= 000046   	M.ESQN= 000000   	V.STAT  000054
BITFNU= 000002   	F.NWAC  000040   	I.EXTD  000030   	M.LBSZ= 000007   	V.STD   000004
EX.AC1= 000001   	F.RVN   000012   	I.FCN   000014   	M.MAX = 000011   	V.TRCT  000000
EX.AC2= 000002   	F.SCHA  000021   	I.FIDP  000024   	M.RTRV= 000012   	V.WISZ  000020
EX.ADF= 000010   	F.SIZE  000032   	I.FNAM= 000000   	M.USE = 000010   	WI.BPS= 100000
EX.ENA= 000200   	F.STAT  000040   	I.FNBP  000036   	QIOEFN= 000002   	WI.DLK= 010000
EX.FCO= 000004   	F.STD   000004   	I.FTYP= 000006   	R$$10F= 000001   	WI.EXT= 002000
E$$MSG= 000001   	F.UCHA  000020   	I.FVER= 000010   	R$$11D= 000001   	WI.LCK= 004000
E$$TRP= 000001   	F11PR$= 000000   	I.IOSB  000016   	SC.BAD= 000100   	WI.RDV= 000400
FCPLUN= 000001   	HIFCN = 000030   	I.LGTH  000040   	SC.MDL= 000200   	WI.WRV= 001000
FC.CEF= 020000   	H.CKSM= 000776   	I.LNK   000000   	S.HDHD= 000056   	W.CTL   000000
FC.DIR= 040000   	H.FCHA= 000014   	I.LUN   000012   	S.IDHD= 000056   	W.FCB   000002
FC.FCO= 010000   	H.FLEV= 000006   	I.PRI   000010   	S.MPHD= 000012   	W.RTRV  000012
FC.WAC= 100000   	H.FNUM= 000002   	I.PRM   000024   	S.STBK= 000012   	W.STD   000004
FP.DEL= 000010   	H.FOWN= 000010   	I.RTRV  000034   	UC.CON= 000200   	W.VBN   000006
FP.EXT= 000004   	H.FPRO= 000012   	I.RVDT= 000014   	UC.DLK= 000100   	W.WISZ  000007
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVNO= 000012   	VC.BMW= 000002   	$$    = 000067
FP.RDV= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	VC.IFW= 000001   	.DFEXT= 000005
FP.WRV= 000002   	H.MPOF= 000001   	I.RWAD= 000024   	V.FCB   000006   	.DFPRO= 164000
F$$LVL= 000001   	H.PROG= 000010   	I.RWAT  000026   	V.FFNU  000055   	.DRBUF= ****** GX
F.DREF  000042   	H.PROJ= 000011   	I.RWCT= 000026   	V.FIEX  000025   	.DRGET  000000RG
F.DRNM  000044   	H.SCHA= 000015   	I.RWVB= 000032   	V.FMAX  000016   	.DRUCB= ****** GX
F.FEXT  000002   	H.UCHA= 000014   	I.STD   000004   	V.FPRO  000030   	.DRVLB= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.TISZ= 000006   	V.FRBK  000034   	.FCBAD= ****** GX
F.FOWN  000014   	IDXFNU= 000001   	I.UIC   000022   	V.IBLB  000012   	.PRFIL= 000004
F.FPRO  000016   	ID$$$ = 000200   	LEV11M= 000401   	V.IBSZ  000013   	.RD1LB= ****** GX
F.FSEQ  000010   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002   	.RTPTF= 001401
F.FSQN  000013   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040   	.SYUIC= 000010
F.FVBN  000046   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056   	.UCBAD= ****** GX
F.HDLB  000022   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035   	.VBSIZ= 001000
F.LBN   000026   	I.CRTI= 000040   	M.CTSZ= 000006   	V.SBCL  000021   	...GBL= 000000
F.LGTH  000052   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBLB  000024   	...TPC= 000012
F.LINK  000000   	I.DPB   000011   	M.EFSQ= 000004

. ABS.	000056	   000
      	000134	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2522 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:16
[40,10]DRGET,[40,20]DRGET/-SP=[40,30]RSXDC,F11PRE,DRGET
RSXDC	MACRO M1108  05-DEC-77 17:03  PAGE 3


      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.
DRINI	D0206, INIT FOR DIRECTO	MACRO M1108  05-DEC-77 17:03  PAGE 6


      1						.TITLE	DRINI	D0206, INIT FOR DIRECTORY OPERATION
						.IDENT	"D0206"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D206, ASSEMBLED FOR RSX-11D
					;
     22
     23					; ANDREW C. GOLDSTEIN  22 NOV 74  0:31
     24					; PETER H. LIPMAN	7-JUN-74
     25					;
     26					; INITIALIZE FOR DIRECTORY OPERATION
     27					;
     28					;+
     29					; **-.DRINI-INITIALIZE FOR DIRECTORY OPERATION
     30					;
     31					; THIS ROUTINE VALIDATES THE I/O PACKET, MOVES THE USER'S FNB INTO THE SCRATCH
     32					; FNB, AND CONVERTS THE DIRECTORY ID OF (-1,-1) TO THE MFD ID OF (4,4).
     33					;
     34					; INPUTS:
     35					;
     36					; 	R4=VOLUME CONTROL BLOCK
     37					; 	R5=I/O PACKET ADDRESS
     38					;
     39					; OUTPUTS:
     40					;
     41					; 	R5=FNB ADDRESS
     42					; 	R0-R3 ALTERED
     43					; 	R4 PRESERVED
     44					; 	.FILNO, .ILSQ SET TO DIRECTORY ID
     45					;-
     46
     47	000000				.DRINI::
     48	000000	010500 				MOV	R5,R0		; VALIDATE THE I/O PACKET
     49	000002	062700 	000024 			ADD	#I.FIDP,R0
     50	000006	012001 				MOV	(R0)+,R1	; NO FID POINTER ALLOWED
     54	000010	052001 				BIS	(R0)+,R1	; NO ATTRIBUTE CONTROL BLOCK ALLOWED
     55	000012	052001 				BIS	(R0)+,R1	; NO EXTEND PARAMETERS (2 WORDS)
     56	000014	052001 				BIS	(R0)+,R1	;
     57	000016	001004 				BNE	10$		; BRANCH IF BAD PARAMETERS
DRINI	D0206, INIT FOR DIRECTO	MACRO M1108  05-DEC-77 17:03  PAGE 6-1


     58	000020	005720 				TST	(R0)+
     59	000022	100402 				BMI	10$		; NO ACCESS ALLOWED
     63	000024	005710 				TST	(R0)		; REQUIRE FNB ADDRESS
     64	000026	001001 				BNE	20$
     65	000030				10$:	ERRX	IE.BAD,<ILLEGAL PARAMETERS TO DIRECTORY PRIMITIVES>
	000030	   000C	   211 			TRAP	-IE.BAD		; ILLEGAL PARAMETERS TO DIRECTORY PRIMITIVES
     66
     67	000032				20$:
     71	000032	012701 	000000G			MOV	#.DRFNB,R1	; R1=ADDRESS TO MOVE FNB
     72	000036	012702 	000000G			MOV	#S.DRFN,R2	; R2=NO. OF BYTES TO MOVE
     73	000042					CALL	.BLXI		; MOVE THE FNB INTO LOCAL STORAGE
     75
     76	000046	012700 	000000G			MOV	#.DRFNB,R0	; POINT TO FNB AGAIN
     77	000052	010501 				MOV	R5,R1
     78	000054	062701 	000036 			ADD	#I.FNBP,R1	; POINT TO CALLER'S FNB POINTER
     79	000060	010005 				MOV	R0,R5		; SET R5 TO FNB ADDRESS
     80	000062	012702 	000000G			MOV	#S.DRFN,R2	; SET BYTE COUNT
     81	000066					CALL	.BLXO		; WRITE FNB BACK TO MAKE SURE NEW ONE
     82									; CAN BE WRITTEN LATER
     84					;
     85					; CONVERT (-1,-1) DIRECTORY ID TO THE MFD
     86					;
     87	000072	012700 	000000C			MOV	#.DRFNB+N.DID,R0
     88	000076	010001 				MOV	R0,R1
     89	000100	022720 	177777 			CMP	#-1,(R0)+	; IS THIS DIRECTORY ID (-1,-1)
     90	000104	001007 				BNE	30$		; BRANCH IF NO
     91	000106	022710 	177777 			CMP	#-1,(R0)
     92	000112	001004 				BNE	30$
     93	000114	012710 	000004 			MOV	#MFDFSQ,(R0)	; SET MFD FILE SEQUENCE NO.
     94	000120	012740 	000004 			MOV	#MFDFNO,-(R0)	; SET MFD FILE NUMBER
     95	000124	012167 	000000G		30$:	MOV	(R1)+,.FILNO
     96	000130	011167 	000000G			MOV	(R1),.FILSQ
     97	000134					RETURN
     98					;
     99					;
    100	000136					$END	DRINI
    101					;
    102					;
    103		000001 				.END
DRINI	D0206, INIT FOR DIRECTO	MACRO M1108  05-DEC-77 17:03  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.DPB   000011   	M.EFSQ= 000004   	V.SBCL  000021
AC.LCK= 000001   	F.NLCK  000037   	I.EFN   000013   	M.ERVN= 000001   	V.SBLB  000024
BITFNU= 000002   	F.NWAC  000040   	I.EXDT= 000046   	M.ESQN= 000000   	V.SBSZ  000022
EX.AC1= 000001   	F.RVN   000012   	I.EXTD  000030   	M.LBSZ= 000007   	V.STAT  000054
EX.AC2= 000002   	F.SCHA  000021   	I.FCN   000014   	M.MAX = 000011   	V.STD   000004
EX.ADF= 000010   	F.SIZE  000032   	I.FIDP  000024   	M.RTRV= 000012   	V.TRCT  000000
EX.ENA= 000200   	F.STAT  000040   	I.FNAM= 000000   	M.USE = 000010   	V.WISZ  000020
EX.FCO= 000004   	F.STD   000004   	I.FNBP  000036   	N.DID = ****** GX	WI.BPS= 100000
E$$MSG= 000001   	F.UCHA  000020   	I.FTYP= 000006   	QIOEFN= 000002   	WI.DLK= 010000
E$$TRP= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$10F= 000001   	WI.EXT= 002000
FCPLUN= 000001   	HIFCN = 000030   	I.IOSB  000016   	R$$11D= 000001   	WI.LCK= 004000
FC.CEF= 020000   	H.CKSM= 000776   	I.LGTH  000040   	SC.BAD= 000100   	WI.RDV= 000400
FC.DIR= 040000   	H.FCHA= 000014   	I.LNK   000000   	SC.MDL= 000200   	WI.WRV= 001000
FC.FCO= 010000   	H.FLEV= 000006   	I.LUN   000012   	S.DRFN= ****** GX	W.CTL   000000
FC.WAC= 100000   	H.FNUM= 000002   	I.PRI   000010   	S.HDHD= 000056   	W.FCB   000002
FP.DEL= 000010   	H.FOWN= 000010   	I.PRM   000024   	S.IDHD= 000056   	W.RTRV  000012
FP.EXT= 000004   	H.FPRO= 000012   	I.RTRV  000034   	S.MPHD= 000012   	W.STD   000004
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	S.STBK= 000012   	W.VBN   000006
FP.RDV= 000001   	H.IDOF= 000000   	I.RVNO= 000012   	UC.CON= 000200   	W.WISZ  000007
FP.WRV= 000002   	H.MPOF= 000001   	I.RVTI= 000023   	UC.DLK= 000100   	$$    = 000067
F$$LVL= 000001   	H.PROG= 000010   	I.RWAD= 000024   	VC.BMW= 000002   	.BLXI = ****** GX
F.DREF  000042   	H.PROJ= 000011   	I.RWAT  000026   	VC.IFW= 000001   	.BLXO = ****** GX
F.DRNM  000044   	H.SCHA= 000015   	I.RWCT= 000026   	V.FCB   000006   	.DFEXT= 000005
F.FEXT  000002   	H.UCHA= 000014   	I.RWVB= 000032   	V.FFNU  000055   	.DFPRO= 164000
F.FNUM  000006   	H.UFAT= 000016   	I.STD   000004   	V.FIEX  000025   	.DRFNB= ****** GX
F.FOWN  000014   	IDXFNU= 000001   	I.TISZ= 000006   	V.FMAX  000016   	.DRINI  000000RG
F.FPRO  000016   	ID$$$ = 000206   	I.UIC   000022   	V.FPRO  000030   	.FILNO= ****** GX
F.FSEQ  000010   	IE.BAD= ****** GX	LEV11M= 000401   	V.FRBK  000034   	.FILSQ= ****** GX
F.FSQN  000013   	I.ACTL  000035   	LOWFCN= 000011   	V.IBLB  000012   	.PRFIL= 000004
F.FVBN  000046   	I.AST   000020   	MFDFNO= 000004   	V.IBSZ  000013   	.RTPTF= 001401
F.HDLB  000022   	I.ATL   000006   	MFDFSQ= 000004   	V.IFWI  000002   	.SYUIC= 000010
F.LBN   000026   	I.CRDT= 000031   	M$$HDR= 000001   	V.LABL  000040   	.VBSIZ= 001000
F.LGTH  000052   	I.CRTI= 000040   	M.CTSZ= 000006   	V.LGTH  000056   	...GBL= 000000
F.LINK  000000   	I.DASZ= 000007   	M.EFNU= 000002   	V.LRUC  000035   	...TPC= 000012

. ABS.	000056	   000
      	000136	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2557 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[40,10]DRINI,[40,20]DRINI/-SP=[40,30]RSXDC,F11PRE,DRINI
RSXDC	MACRO M1108  05-DEC-77 17:03  PAGE 3


      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.
DRPAC	D0200, CHECK IF DIRECTO	MACRO M1108  05-DEC-77 17:03  PAGE 6


      1						.TITLE	DRPAC	D0200, CHECK IF DIRECTORY IS PREACCESSED
						.IDENT	"D0200"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D200, ASSEMBLED FOR RSX-11D
					;
     22
     23					; ANDREW C. GOLDSTEIN  14 AUG 1974
     24					; PETER H. LIPMAN	7-JUN-74
     25					;
     26					; CHECK TO SEE IF DIRECTORY IS PRE ACCESSED
     27					;
     28					;+
     29					; **-.DRPAC-IS DIRECTORY ALREADY "ACCESSED"
     30					;
     31					; THIS ROUTINE SCANS THE FCB LIST TO SEE IF THE DESIRED DIRECTORY ID IS
     32					; ALREADY "ACCESSED".
     33					;
     34					; INPUTS:
     35					;
     36					; 	R4=VCB ADDRESS
     37					;
     38					; OUTPUTS:
     39					;
     40					; 	C=0 IF DIRECTORY IS PREACCESSED
     41					; 		.FCBAD SET WITH FCB ADDRESS
     42					; 	C=1 IF DIRECTORY WAS NOT FOUND IN FCB LIST
     43					; 	IN EITHER CASE:
     44					; 	R2-R3 ALTERED
     45					; 	R0,R1,R4,R5 PRESERVED
     46					;
     47					;-
     48
     49	000000				.DRPAC::
     50	000000	005767 	000000G			TST	.FCBAD		; IS FCB ALL SET?
     51	000004	001021 				BNE	20$		; BRANCH IF YES, C=0
     52	000006					CALL	.SCFCB
     53	000012	001417 				BEQ	30$
     54					;
DRPAC	D0200, CHECK IF DIRECTO	MACRO M1108  05-DEC-77 17:03  PAGE 6-1


     55					; R2=PREVIOUS FCB, R3=DESIRED FCB
     56					; MOVE DESIRED FCB TO END OF FCB CHAIN
     57					;
     58	000014	032763 	040000 	000040 		BIT	#FC.DIR,F.STAT(R3) ; IF DIRECTORY BIT ISN'T SET
     59	000022	001413 				BEQ	30$		; THEN LET FCB SCAN FAIL
     60	000024	005713 				TST	(R3)		; IS THIS FCB AT END OF LIST?
     61	000026	001406 				BEQ	10$		; BRANCH IF YES, C=0
     62	000030	011312 				MOV	(R3),(R2)	; OTHERWISE REMOVE FCB FROM LIST
     63	000032	005013 				CLR	(R3)		; ZERO THE FORWARD POINTER
     64	000034	010374 	000010 			MOV	R3,@V.FCB+2(R4) ; ADD FCB TO END OF LIST
     65	000040	010364 	000010 			MOV	R3,V.FCB+2(R4)	; MAKING IT MOST RECENTLY USED
     66	000044	010367 	000000G		10$:	MOV	R3,.FCBAD	; C=0 AT THIS POINT
     67	000050				20$:	RETURN
     68	000052	000261 			30$:	SEC
     69	000054					RETURN
     70					;
     71					;
     72	000056					$END	DRPAC
     73					;
     74					;
     75		000001 				.END
DRPAC	D0200, CHECK IF DIRECTO	MACRO M1108  05-DEC-77 17:03  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.DASZ= 000007   	M.CTSZ= 000006   	V.LRUC  000035
AC.LCK= 000001   	F.NACS  000036   	I.DPB   000011   	M.EFNU= 000002   	V.SBCL  000021
BITFNU= 000002   	F.NLCK  000037   	I.EFN   000013   	M.EFSQ= 000004   	V.SBLB  000024
EX.AC1= 000001   	F.NWAC  000040   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBSZ  000022
EX.AC2= 000002   	F.RVN   000012   	I.EXTD  000030   	M.ESQN= 000000   	V.STAT  000054
EX.ADF= 000010   	F.SCHA  000021   	I.FCN   000014   	M.LBSZ= 000007   	V.STD   000004
EX.ENA= 000200   	F.SIZE  000032   	I.FIDP  000024   	M.MAX = 000011   	V.TRCT  000000
EX.FCO= 000004   	F.STAT  000040   	I.FNAM= 000000   	M.RTRV= 000012   	V.WISZ  000020
E$$MSG= 000001   	F.STD   000004   	I.FNBP  000036   	M.USE = 000010   	WI.BPS= 100000
E$$TRP= 000001   	F.UCHA  000020   	I.FTYP= 000006   	QIOEFN= 000002   	WI.DLK= 010000
FCPLUN= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$10F= 000001   	WI.EXT= 002000
FC.CEF= 020000   	HIFCN = 000030   	I.IOSB  000016   	R$$11D= 000001   	WI.LCK= 004000
FC.DIR= 040000   	H.CKSM= 000776   	I.LGTH  000040   	SC.BAD= 000100   	WI.RDV= 000400
FC.FCO= 010000   	H.FCHA= 000014   	I.LNK   000000   	SC.MDL= 000200   	WI.WRV= 001000
FC.WAC= 100000   	H.FLEV= 000006   	I.LUN   000012   	S.HDHD= 000056   	W.CTL   000000
FP.DEL= 000010   	H.FNUM= 000002   	I.PRI   000010   	S.IDHD= 000056   	W.FCB   000002
FP.EXT= 000004   	H.FOWN= 000010   	I.PRM   000024   	S.MPHD= 000012   	W.RTRV  000012
FP.RAT= 000001   	H.FPRO= 000012   	I.RTRV  000034   	S.STBK= 000012   	W.STD   000004
FP.RDV= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	UC.CON= 000200   	W.VBN   000006
FP.WRV= 000002   	H.IDOF= 000000   	I.RVNO= 000012   	UC.DLK= 000100   	W.WISZ  000007
F$$LVL= 000001   	H.MPOF= 000001   	I.RVTI= 000023   	VC.BMW= 000002   	$$    = 000067
F.DREF  000042   	H.PROG= 000010   	I.RWAD= 000024   	VC.IFW= 000001   	.DFEXT= 000005
F.DRNM  000044   	H.PROJ= 000011   	I.RWAT  000026   	V.FCB   000006   	.DFPRO= 164000
F.FEXT  000002   	H.SCHA= 000015   	I.RWCT= 000026   	V.FFNU  000055   	.DRPAC  000000RG
F.FNUM  000006   	H.UCHA= 000014   	I.RWVB= 000032   	V.FIEX  000025   	.FCBAD= ****** GX
F.FOWN  000014   	H.UFAT= 000016   	I.STD   000004   	V.FMAX  000016   	.PRFIL= 000004
F.FPRO  000016   	IDXFNU= 000001   	I.TISZ= 000006   	V.FPRO  000030   	.RTPTF= 001401
F.FSEQ  000010   	ID$$$ = 000200   	I.UIC   000022   	V.FRBK  000034   	.SCFCB= ****** GX
F.FSQN  000013   	I.ACTL  000035   	LEV11M= 000401   	V.IBLB  000012   	.SYUIC= 000010
F.FVBN  000046   	I.AST   000020   	LOWFCN= 000011   	V.IBSZ  000013   	.VBSIZ= 001000
F.HDLB  000022   	I.ATL   000006   	MFDFNO= 000004   	V.IFWI  000002   	...GBL= 000000
F.LBN   000026   	I.CRDT= 000031   	MFDFSQ= 000004   	V.LABL  000040   	...TPC= 000012
F.LGTH  000052   	I.CRTI= 000040   	M$$HDR= 000001   	V.LGTH  000056

. ABS.	000056	   000
      	000056	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2507 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:16
[40,10]DRPAC,[40,20]DRPAC/-SP=[40,30]RSXDC,F11PRE,DRPAC
RSXDC	MACRO M1108  05-DEC-77 17:04  PAGE 3


      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.
DRVLB	D0200, CONVERT DIRECTOR	MACRO M1108  05-DEC-77 17:04  PAGE 6


      1						.TITLE	DRVLB	D0200, CONVERT DIRECTORY VBN TO LBN
						.IDENT	"D0200"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D200, ASSEMBLED FOR RSX-11D
					;
     22
     23					; ANDREW C. GOLDSTEIN  25 JUL 1974
     24					; PETER H. LIPMAN	20-MAR-74
     25					;
     26					; CONVERT DIRECTORY FILE VBN TO CORRESPONDING LBN
     27					;
     28					;+
     29					; **-.DRVLB-CONVERT DIRECTORY VBN TO CORRESPONDING LBN
     30					;
     31					; THIS ROUTINE ACCEPTS A DIRECTORY VIRTUAL BLOCK NUMBER AND RETURNS THE
     32					; LBN AND SETS UP FOR A READ OR WRITE LOGICAL.
     33					;
     34					; INPUTS:
     35					;
     36					; 	R0=DIRECTORY VIRTUAL BLOCK NUMBER
     37					; 	R3=FCB ADDRESS
     38					; 	R4=VCB ADDRESS
     39					; 	.WNDOW CONTAINS WINDOW FOR THE FILE
     40					;
     41					; OUTPUTS:
     42					;
     43					; 	C=0 IF SUCCESSFUL, C=1 IF BLOCK BEYOND EOF
     44					; 	R0 PRESERVED
     45					; 	R2,R3=DIRECTORY LBN
     46					; 	R4,R5 PRESERVED
     47					;-
     48
     49	000000				.DRVLB::
     50	000000	026300 	000042 			CMP	F.DREF(R3),R0	; VBN BEYOND EOF?
     51	000004	103413 				BLO	10$		; BRANCH IF YES, C=1
     52	000006					ASSUME	UC.CON,200
     53	000006	105763 	000020 			TSTB	F.UCHA(R3)	; IS DIRECTORY CONTIGUOUS
     54	000012	100011 				BPL	20$		; BRANCH IF NO
DRVLB	D0200, CONVERT DIRECTOR	MACRO M1108  05-DEC-77 17:04  PAGE 6-1


     55	000014	016302 	000026 			MOV	F.LBN(R3),R2	; LBN OF VBN 1
     56	000020	016303 	000030 			MOV	F.LBN+2(R3),R3
     57	000024	010001 				MOV	R0,R1
     58	000026	005301 				DEC	R1		; R1=VBN -1
     59	000030	060103 				ADD	R1,R3		; R2,R3 = LBN OF DESIRED VBN
     60	000032	005502 				ADC	R2
     61	000034				10$:	RETURN			; C=0
     62
     63	000036	010546 			20$:	MOV	R5,-(SP)	; SAVE R5
     64	000040	010046 				MOV	R0,-(SP)	; AND R0
     65	000042	016705 	000000G			MOV	.IOPKT,R5	; R5=I/O PACKET ADDRESS
     66	000046	011603 			30$:	MOV	(SP),R3		; R2,R3=DESIRED VBN
     67	000050	005002 				CLR	R2
     68	000052	012700 	001000 			MOV	#.VBSIZ,R0	; R0=1 BLOCK'S WORTH
     69	000056	016701 	000000G			MOV	.WNDOW,R1	; R1=WINDOW ADDRESS
     70	000062					CALL	.MPVBN		; FORM R2,R3=LBN
     71	000066	103003 				BCC	40$		; BRANCH IF SUCCESSFUL
     72	000070					CALL	.WITRN		; OTHERWISE TURN THE WINDOW
     73	000074	103364 				BCC	30$		; BRANCH IF OK, TRY TO MAP AGAIN
     74	000076	012600 			40$:	MOV	(SP)+,R0	; RESTORE SAVED R0 AND R5
     75	000100	012605 				MOV	(SP)+,R5
     76	000102					RETURN
     77					;
     78					;
     79	000104					$END	DRVLB
     80					;
     81					;
     82		000001 				.END
DRVLB	D0200, CONVERT DIRECTOR	MACRO M1108  05-DEC-77 17:04  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.DPB   000011   	M.EFNU= 000002   	V.SBCL  000021
AC.LCK= 000001   	F.NLCK  000037   	I.EFN   000013   	M.EFSQ= 000004   	V.SBLB  000024
BITFNU= 000002   	F.NWAC  000040   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBSZ  000022
EX.AC1= 000001   	F.RVN   000012   	I.EXTD  000030   	M.ESQN= 000000   	V.STAT  000054
EX.AC2= 000002   	F.SCHA  000021   	I.FCN   000014   	M.LBSZ= 000007   	V.STD   000004
EX.ADF= 000010   	F.SIZE  000032   	I.FIDP  000024   	M.MAX = 000011   	V.TRCT  000000
EX.ENA= 000200   	F.STAT  000040   	I.FNAM= 000000   	M.RTRV= 000012   	V.WISZ  000020
EX.FCO= 000004   	F.STD   000004   	I.FNBP  000036   	M.USE = 000010   	WI.BPS= 100000
E$$MSG= 000001   	F.UCHA  000020   	I.FTYP= 000006   	QIOEFN= 000002   	WI.DLK= 010000
E$$TRP= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$10F= 000001   	WI.EXT= 002000
FCPLUN= 000001   	HIFCN = 000030   	I.IOSB  000016   	R$$11D= 000001   	WI.LCK= 004000
FC.CEF= 020000   	H.CKSM= 000776   	I.LGTH  000040   	SC.BAD= 000100   	WI.RDV= 000400
FC.DIR= 040000   	H.FCHA= 000014   	I.LNK   000000   	SC.MDL= 000200   	WI.WRV= 001000
FC.FCO= 010000   	H.FLEV= 000006   	I.LUN   000012   	S.HDHD= 000056   	W.CTL   000000
FC.WAC= 100000   	H.FNUM= 000002   	I.PRI   000010   	S.IDHD= 000056   	W.FCB   000002
FP.DEL= 000010   	H.FOWN= 000010   	I.PRM   000024   	S.MPHD= 000012   	W.RTRV  000012
FP.EXT= 000004   	H.FPRO= 000012   	I.RTRV  000034   	S.STBK= 000012   	W.STD   000004
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	UC.CON= 000200   	W.VBN   000006
FP.RDV= 000001   	H.IDOF= 000000   	I.RVNO= 000012   	UC.DLK= 000100   	W.WISZ  000007
FP.WRV= 000002   	H.MPOF= 000001   	I.RVTI= 000023   	VC.BMW= 000002   	$$    = 000067
F$$LVL= 000001   	H.PROG= 000010   	I.RWAD= 000024   	VC.IFW= 000001   	.DFEXT= 000005
F.DREF  000042   	H.PROJ= 000011   	I.RWAT  000026   	V.FCB   000006   	.DFPRO= 164000
F.DRNM  000044   	H.SCHA= 000015   	I.RWCT= 000026   	V.FFNU  000055   	.DRVLB  000000RG
F.FEXT  000002   	H.UCHA= 000014   	I.RWVB= 000032   	V.FIEX  000025   	.IOPKT= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.STD   000004   	V.FMAX  000016   	.MPVBN= ****** GX
F.FOWN  000014   	IDXFNU= 000001   	I.TISZ= 000006   	V.FPRO  000030   	.PRFIL= 000004
F.FPRO  000016   	ID$$$ = 000200   	I.UIC   000022   	V.FRBK  000034   	.RTPTF= 001401
F.FSEQ  000010   	I.ACTL  000035   	LEV11M= 000401   	V.IBLB  000012   	.SYUIC= 000010
F.FSQN  000013   	I.AST   000020   	LOWFCN= 000011   	V.IBSZ  000013   	.VBSIZ= 001000
F.FVBN  000046   	I.ATL   000006   	MFDFNO= 000004   	V.IFWI  000002   	.WITRN= ****** GX
F.HDLB  000022   	I.CRDT= 000031   	MFDFSQ= 000004   	V.LABL  000040   	.WNDOW= ****** GX
F.LBN   000026   	I.CRTI= 000040   	M$$HDR= 000001   	V.LGTH  000056   	...GBL= 000000
F.LGTH  000052   	I.DASZ= 000007   	M.CTSZ= 000006   	V.LRUC  000035   	...TPC= 000012
F.LINK  000000

. ABS.	000056	   000
      	000104	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2522 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:16
[40,10]DRVLB,[40,20]DRVLB/-SP=[40,30]RSXDC,F11PRE,DRVLB
RSXDC	MACRO M1108  05-DEC-77 17:04  PAGE 3


      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.
DRWRT	D0200, WRITE A DIRECTOR	MACRO M1108  05-DEC-77 17:04  PAGE 6


      1						.TITLE	DRWRT	D0200, WRITE A DIRECTORY BLOCK
						.IDENT	"D0200"
      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					;
					; VERSION D200, ASSEMBLED FOR RSX-11D
					;
     20
     21					; ANDREW C. GOLDSTEIN  13 AUG 1974
     22					; PETER H. LIPMAN	12-JUN-74
     23					;
     24					; WRITE A DIRECTORY BLOCK, AND EXIT FROM DIRECTORY WRITE SUBROUTINES
     25					;
     26					;+
     27					; **-.DRWRT-WRITE THE CURRENT DIRECTORY BLOCK
     28					;
     29					; THIS ROUTINE WRITES THE CURRENT DIRECTORY BLOCK BACK TO THE VOLUME
     30					;
     31					; INPUTS:
     32					;
     33					; 	NONE
     34					;
     35					; OUTPUTS:
     36					;
     37					; 	R0-R1, R4-R5 PRESERVED
     38					; 	R2-R3 ALTERED
     39					;-
     40
     41	000000				.DRWRT::
     42	000000	010046 				MOV	R0,-(SP)	; SAVE R0
     43	000002	010146 				MOV	R1,-(SP)	; SAVE R1
     44	000004	012701 	000000G			MOV	#.DRLBN,R1	; R1=ADDRESS OF LBN
     45	000010	012102 				MOV	(R1)+,R2	; R2=HIGH LBN
     46	000012	012103 				MOV	(R1)+,R3	; R3=LOW LBN
     47	000014					CALL	.WR1LB		; R1=.DRBUF
     48	000020	012601 				MOV	(SP)+,R1
     49	000022	012600 				MOV	(SP)+,R0
     50	000024					RETURN
     51					;
     52					;+
     53					; **-.DRWEX-EXIT FROM A DIRECTORY WRITE OPERATION (ENTER, REMOVE)
     54					;
DRWRT	D0200, WRITE A DIRECTOR	MACRO M1108  05-DEC-77 17:04  PAGE 6-1


     55					; THIS ROUTINE CALLS THE STANDARD DIRECTORY EXIT ROUTINE TO WRITE
     56					; THE FILE NAME BLOCK BACK INTO USER MEMORY AND THEN IT CHECKS TO SEE IF THE
     57					; DIRECTORY END OF FILE NEEDS TO BE UPDATED.  IF IT DOES, IT EXITS THROUGH
     58					; THE DREOF (UPDATE DIRECTORY EOF) ROUTINE.
     59					;
     60					; INPUTS:
     61					;
     62					; 	R2=NO. OF BYTES OF FNB TO RETURN TO USER
     63					; 	R4=VOLUME CONTROL BLOCK ADDRESS
     64					; 	R5=FILE NAME BLOCK ADDRESS
     65					;
     66					; OUTPUTS:
     67					;
     68					; 	THIS ROUTINE EITHER EXITS THROUGH CLDIR OR DREOF WITH REGISTER
     69					; 	R4=VOLUME CONTROL BLOCK
     70					; 	R5=I/O PACKET ADDRESS
     71					;
     72					;-
     73
     74	000026				.DRWEX::
     75	000026					CALL	.DRX1		; RETURN FNB TO USER SPACE
     76	000032	016700 	000000G			MOV	.FCBAD,R0
     77	000036	032760 	020000 	000040 		BIT	#FC.CEF,F.STAT(R0) ; EOF UPDATE NECESSARY?
     78	000044	001402 				BEQ	10$		; BRANCH IF NO
     79	000046	000177 	000000G			JMP	@.DREF1		; YES, GO UPDATE THE DIRECTORY END OF FILE
     80	000052				10$:	CALLR	.CLDIR		; NO, CLEAN UP AND EXIT FORM DIRECTORY OPERATION
     81					;
     82					;
     83	000056					$END	DRWRT
     84					;
     85					;
     86		000001 				.END
DRWRT	D0200, WRITE A DIRECTOR	MACRO M1108  05-DEC-77 17:04  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.EFN   000013   	M.ERVN= 000001   	V.STAT  000054
AC.LCK= 000001   	F.NLCK  000037   	I.EXDT= 000046   	M.ESQN= 000000   	V.STD   000004
BITFNU= 000002   	F.NWAC  000040   	I.EXTD  000030   	M.LBSZ= 000007   	V.TRCT  000000
EX.AC1= 000001   	F.RVN   000012   	I.FCN   000014   	M.MAX = 000011   	V.WISZ  000020
EX.AC2= 000002   	F.SCHA  000021   	I.FIDP  000024   	M.RTRV= 000012   	WI.BPS= 100000
EX.ADF= 000010   	F.SIZE  000032   	I.FNAM= 000000   	M.USE = 000010   	WI.DLK= 010000
EX.ENA= 000200   	F.STAT  000040   	I.FNBP  000036   	QIOEFN= 000002   	WI.EXT= 002000
EX.FCO= 000004   	F.STD   000004   	I.FTYP= 000006   	R$$10F= 000001   	WI.LCK= 004000
E$$MSG= 000001   	F.UCHA  000020   	I.FVER= 000010   	R$$11D= 000001   	WI.RDV= 000400
E$$TRP= 000001   	F11PR$= 000000   	I.IOSB  000016   	SC.BAD= 000100   	WI.WRV= 001000
FCPLUN= 000001   	HIFCN = 000030   	I.LGTH  000040   	SC.MDL= 000200   	W.CTL   000000
FC.CEF= 020000   	H.CKSM= 000776   	I.LNK   000000   	S.HDHD= 000056   	W.FCB   000002
FC.DIR= 040000   	H.FCHA= 000014   	I.LUN   000012   	S.IDHD= 000056   	W.RTRV  000012
FC.FCO= 010000   	H.FLEV= 000006   	I.PRI   000010   	S.MPHD= 000012   	W.STD   000004
FC.WAC= 100000   	H.FNUM= 000002   	I.PRM   000024   	S.STBK= 000012   	W.VBN   000006
FP.DEL= 000010   	H.FOWN= 000010   	I.RTRV  000034   	UC.CON= 000200   	W.WISZ  000007
FP.EXT= 000004   	H.FPRO= 000012   	I.RVDT= 000014   	UC.DLK= 000100   	$$    = 000067
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVNO= 000012   	VC.BMW= 000002   	.CLDIR= ****** GX
FP.RDV= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	VC.IFW= 000001   	.DFEXT= 000005
FP.WRV= 000002   	H.MPOF= 000001   	I.RWAD= 000024   	V.FCB   000006   	.DFPRO= 164000
F$$LVL= 000001   	H.PROG= 000010   	I.RWAT  000026   	V.FFNU  000055   	.DREF1= ****** GX
F.DREF  000042   	H.PROJ= 000011   	I.RWCT= 000026   	V.FIEX  000025   	.DRLBN= ****** GX
F.DRNM  000044   	H.SCHA= 000015   	I.RWVB= 000032   	V.FMAX  000016   	.DRWEX  000026RG
F.FEXT  000002   	H.UCHA= 000014   	I.STD   000004   	V.FPRO  000030   	.DRWRT  000000RG
F.FNUM  000006   	H.UFAT= 000016   	I.TISZ= 000006   	V.FRBK  000034   	.DRX1 = ****** GX
F.FOWN  000014   	IDXFNU= 000001   	I.UIC   000022   	V.IBLB  000012   	.FCBAD= ****** GX
F.FPRO  000016   	ID$$$ = 000200   	LEV11M= 000401   	V.IBSZ  000013   	.PRFIL= 000004
F.FSEQ  000010   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002   	.RTPTF= 001401
F.FSQN  000013   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040   	.SYUIC= 000010
F.FVBN  000046   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056   	.VBSIZ= 001000
F.HDLB  000022   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035   	.WR1LB= ****** GX
F.LBN   000026   	I.CRTI= 000040   	M.CTSZ= 000006   	V.SBCL  000021   	...GBL= 000000
F.LGTH  000052   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBLB  000024   	...TPC= 000012
F.LINK  000000   	I.DPB   000011   	M.EFSQ= 000004   	V.SBSZ  000022

. ABS.	000056	   000
      	000056	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2517 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:16
[40,10]DRWRT,[40,20]DRWRT/-SP=[40,30]RSXDC,F11PRE,DRWRT
RSXDC	MACRO M1108  05-DEC-77 17:04  PAGE 3


      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.
ENTNM	D0202, ENTER NAME QI/O	MACRO M1108  05-DEC-77 17:04  PAGE 6


      1						.TITLE	ENTNM	D0202, ENTER NAME QI/O
						.IDENT	"D0202"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D202, ASSEMBLED FOR RSX-11D
					;
     22
     23					; ANDREW C. GOLDSTEIN  10 SEP 74  12:40:17
     24					; PETER H. LIPMAN	7-JUN-74
     25					;
     26					; ENTER NAME QI/O
     27					;
     28					;+
     29					; **-.ENTNM-ENTER FILE NAME
     30					;
     31					; THIS ROUTINE FIRST ACCESSES THE DIRECTORY (SEE FNDNM FOR DISCUSSION OF
     32					; PRE-ACCESSED DIRECTORIES). THEN IT CHECKS TO SEE IF THE DIRECTORY IS
     33					; CONTIGUOUS, AND IF IT ISN'T, ATTEMPTS TO MAKE IT CONTIGUOUS. THEN IT SCANS
     34					; THE DIRECTORY TO MAKE SURE THE DESIRED NAME IS NOT ALREADY PRESENT AND TO
     35					; FIND A FREE SLOT TO PUT THE NEW NAME. ASSUMING THE NAME ISN'T ALREADY
     36					; PRESENT, AND AN EMPTY SLOT WAS FOUND TO PUT THE NAME IN, THE NAME IS
     37					; ENTERED, THE DIRECTORY BLOCK IS WRITTEN AND THE ENTER IS COMPLETE. JUST
     38					; BEFORE EXITING, THE ENTER ROUTINE CHECKS TO SEE IF THE DIRECTORY END OF
     39					; FILE NEEDS TO BE UPDATED.
     40					; IF FOR INSTANCE THE LAST DIRECTORY BLOCK CONTAINS ALL EMPTY ENTRIES THEN
     41					; TO AVOID SCANNING THAT EMPTY BLOCK THE DIRECTORY EOF IS SET BACK ONE BLOCK.
     42					; 	IN THE CASE THAT NO FREE ENTRY WAS FOUND, THE DIRECTORY IS EXTENDED.
     43					; IF THERE IS A BLOCK ALREADY ALLOCATED BUT BEYOND THE DIRECTORY EOF, THEN
     44					; THIS BLOCK MAY BE USED AND THE EOF UPDATED. THE BLOCK IS ZEROED AND THE
     45					; ENTRY INSERTED. IF THE DIRECTORY ACTUALLY NEEDS TO BE EXTENDED, THE EXTEND
     46					; ROUTINE IS CALLED (SEE .DREXT FOR DOCUMENTATION).
     47					;-
     48
     49	000000				.ENTNM::
     50	000000					CALL	.DRINI		; INITIALIZE FOR DIRECTORY OPERATION
     51	000004	005715 				TST	(R5)		; WAS FILE ID SPECIFIED
     52	000006	001562 				BEQ	140$		; BRANCH IF NO, ERROR
     53	000010					CALL	.DRPAC		; OTHERWISE SEE IF DIRECTORY PRE ACCESSED
     54	000014	103002 				BCC	10$		; BRANCH IF YES
ENTNM	D0202, ENTER NAME QI/O	MACRO M1108  05-DEC-77 17:04  PAGE 6-1


     55	000016	000177 	000000G			JMP	@.DRAC1		; NO, GO ACCESS IT
     56	000022	016701 	000000G		10$:	MOV	.FCBAD,R1
     57	000026	032761 	010000 	000040 		BIT	#FC.FCO,F.STAT(R1) ; ONLY TRY TO MAKE IT CONTIG ONCE
     58	000034	001003 				BNE	20$
     59	000036					ASSUME	UC.CON,200
     60	000036	105761 	000020 			TSTB	F.UCHA(R1)	; IS FILE CONTIGUOUS
     61	000042	100136 				BPL	110$		; BRANCH IF NO, MAKE IT CONTIGUOUS
     62	000044	012700 	000004 		20$:	MOV	#FP.EXT,R0	; CHECK FILE ACCESS FOR EXTEND
     63	000050	016102 	000014 			MOV	F.FOWN(R1),R2
     64	000054	016103 	000016 			MOV	F.FPRO(R1),R3
     65	000060	016705 	000000G			MOV	.IOPKT,R5	; GET I/O PACKET ADDRESS
     66	000064					CALL	.PRCK3		; SEE IF USER HAS DESIRED ACCESS PRIVILEGE
     67	000070	012705 	000000G			MOV	#.DRFNB,R5	; POINT TO FILE NAME BLOCK AGAIN
     68	000074	042765 	000000C	000000G		BIC	#NB.SVR!NB.STP!NB.SNM,N.STAT(R5) ; NO WILD CARDS
     69	000102	005065 	000000G			CLR	N.NEXT(R5)	; START SEARCH FROM BEGINNING
     70	000106					CALL	.LOCAT		; SEE IF ENTRY ALREADY EXISTS
     71	000112	103402 				BCS	30$		; BRANCH IF IT DOESN'T
     72	000114					ERR	IE.DUP,<DUPLICATE ENTRY FOUND>
	000114	   000G	   211 			TRAP	IE.DUP		; DUPLICATE ENTRY FOUND
     73	000116	000504 				BR	100$
     74
     75	000120	016700 	000000G		30$:	MOV	.DRFRE,R0	; R0=RECORD NO. OF FREE SLOT
     76	000124					CALL	.DRGET		; POSITION TO IT
     77	000130	103034 				BCC	50$		; BRANCH IF SUCCESSFUL
     78					;
     79					; RECORD IS BEYOND EOF
     80					;
     81	000132	016703 	000000G			MOV	.FCBAD,R3
     82	000136	026363 	000034 	000042 		CMP	F.SIZE+2(R3),F.DREF(R3) ; ANY MORE ROOM IN FILE
     83	000144	101500 				BLOS	120$		; BRANCH IF NO, MUST EXTEND IT
     84	000146	005263 	000042 			INC	F.DREF(R3)	; YES, RESET LOCAL EOF
     85	000152	052763 	020000 	000040 		BIS	#FC.CEF,F.STAT(R3) ; MUST CHANGE HEADER LATER
     86	000160	016300 	000042 			MOV	F.DREF(R3),R0
     87	000164					CALL	.DRVLB		; FORM LBN OF NEW BLOCK
     88	000170	103466 				BCS	120$		; BRANCH IF EOF FOUL UP, EXTEND FILE
     89	000172	012701 	000000G			MOV	#.DRUCB,R1
     90	000176	016721 	000000G			MOV	.UCBAD,(R1)+
     91	000202	010221 				MOV	R2,(R1)+	; SET BUFFER AS IF DESIRED
     92	000204	010321 				MOV	R3,(R1)+	; LBN IS IN IT
     93	000206	010102 				MOV	R1,R2		; R2=ADDRESS OF 1ST RECORD
     94	000210	012703 	000400 			MOV	#.VBSIZ/2,R3
     95	000214	005022 			40$:	CLR	(R2)+		; AND ZERO THE NEW BLOCK
     96	000216	077302 				SOB	R3,40$
     97	000220	000417 				BR	60$
     98					;
     99					; R1=RECORD ADDRESS, R2=VBN OF THIS RECORD
    100					;
    101	000222	016700 	000000G		50$:	MOV	.DRLVB,R0	; R0=LAST VBN WITH A DIRECTORY ENTRY
    102	000226	001414 				BEQ	60$		; BRANCH IF LAST VBN IN USE IS INVALID
    103	000230	020002 				CMP	R0,R2		; ABOUT TO USE AN EMPTY BLOCK?
    104	000232	103412 				BLO	60$		; BRANCH IF YES
    105	000234	016703 	000000G			MOV	.FCBAD,R3
    106	000240	020063 	000042 			CMP	R0,F.DREF(R3)	; IS THIS BLOCK BEFORE CURRENT EOF?
    107	000244	103005 				BHIS	60$		; BRANCH IF NO
    108	000246	010063 	000042 			MOV	R0,F.DREF(R3)	; YES, RESET DIRECTORY EOF (IN FCB)
    109	000252	052763 	020000 	000040 		BIS	#FC.CEF,F.STAT(R3) ; AND NOTE THAT HEADER MUST ALSO BE CHANGED
    110	000260	016503 	000000G		60$:	MOV	N.FVER(R5),R3	; R3=USER SPECIFIED VERSION
ENTNM	D0202, ENTER NAME QI/O	MACRO M1108  05-DEC-77 17:04  PAGE 6-2


    111	000264	001003 				BNE	70$		; BRANCH IF NOT DEFAULT
    112	000266	016703 	000000G			MOV	.DRHVR,R3	; USE HIGHEST EXISTING VERSION
    113	000272	005203 				INC	R3		; PLUS ONE
    114	000274	010365 	000000G		70$:	MOV	R3,N.FVER(R5)	; RETURN VERSION TO USER
    115	000300	020327 	177770 			CMP	R3,#177770	; IS VERSION LEGAL?
    116	000304	101402 				BLOS	80$		; BRANCH IF OK
    117	000306					ERR	IE.BVR,<BAD VERSION NUMBER>
	000306	   000G	   211 			TRAP	IE.BVR		; BAD VERSION NUMBER
    118	000310	000407 				BR	100$
    119	000312				80$:
    120	000312	012702 	000000C			MOV	#S.NFEN/2,R2
    121	000316	010503 				MOV	R5,R3
    122	000320	012321 			90$:	MOV	(R3)+,(R1)+	; MOVE THE ENTRY INTO THE DIRECTORY
    123	000322	077202 				SOB	R2,90$
    124	000324					CALL	.DRWRT		; WRITE THE DIRECTORY BLOCK
    125					;
    126					; RETURN FILE NAME BLOCK TO USER AND EXIT FROM DIRECTORY WRITE OPERATION
    127					; IN ORDER TO LEAVE N.STAT AND N.NEXT INTACT IN USER FNB, RETURN ONLY
    128					; THE FILE NAME, TYPE, AND VERSION (I.E. THE DIRECTORY ENTRY PROPER)
    129					; THIS HAS THE EFFECT OF NOT RETURNING (4,4) FOR
    130					; FOR (-1,-1) IF THE ENTER IS IN THE MFD. NO ONE SHOULD BE SENSITIVE
    131					; TO THIS DIFFERENCE BETWEEN RSX11M AND RSX11D.
    132					;
    133	000330	012702 	000000G		100$:	MOV	#S.NFEN,R2	; NO. OF BYTES IN FILE NAME ENTRY
    134	000334					CALLR	.DRWEX		; EXIT FROM DIRECTORY WRITE OPERATION.
    135					;
    136					; EXIT THROUGH THE DIRECTORY EXTEND LOGIC.  WILL CAUSE THE ENTER TO BE
    137					; RE-EXECUTED, WHEN THE EXTEND IS COMPLETED.
    138					;
    139	000340	016100 	000034 		110$:	MOV	F.SIZE+2(R1),R0	; R0=DESIRED SIZE
    140	000344	000401 				BR	130$		;
    141
    142	000346	005000 			120$:	CLR	R0		; EXTEND BY DEFAULT AMOUNT
    143	000350	000177 	000000G		130$:	JMP	@.DREX1		; GO EXTEND THE DIRECTORY
    144
    145	000354				140$:	ERRX	IE.BAD,<ILLEGAL PARAMETER TO ENTER>
	000354	   000C	   211 			TRAP	-IE.BAD		; ILLEGAL PARAMETER TO ENTER
    146
    147					;
    148					;
    149	000356					$END	ENTNM
    150					;
    151					;
    152		000001 				.END
ENTNM	D0202, ENTER NAME QI/O	MACRO M1108  05-DEC-77 17:04  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.SCHA  000021   	I.FNAM= 000000   	N.FVER= ****** GX	WI.EXT= 002000
AC.LCK= 000001   	F.SIZE  000032   	I.FNBP  000036   	N.NEXT= ****** GX	WI.LCK= 004000
BITFNU= 000002   	F.STAT  000040   	I.FTYP= 000006   	N.STAT= ****** GX	WI.RDV= 000400
EX.AC1= 000001   	F.STD   000004   	I.FVER= 000010   	QIOEFN= 000002   	WI.WRV= 001000
EX.AC2= 000002   	F.UCHA  000020   	I.IOSB  000016   	R$$10F= 000001   	W.CTL   000000
EX.ADF= 000010   	F11PR$= 000000   	I.LGTH  000040   	R$$11D= 000001   	W.FCB   000002
EX.ENA= 000200   	HIFCN = 000030   	I.LNK   000000   	SC.BAD= 000100   	W.RTRV  000012
EX.FCO= 000004   	H.CKSM= 000776   	I.LUN   000012   	SC.MDL= 000200   	W.STD   000004
E$$MSG= 000001   	H.FCHA= 000014   	I.PRI   000010   	S.HDHD= 000056   	W.VBN   000006
E$$TRP= 000001   	H.FLEV= 000006   	I.PRM   000024   	S.IDHD= 000056   	W.WISZ  000007
FCPLUN= 000001   	H.FNUM= 000002   	I.RTRV  000034   	S.MPHD= 000012   	$$    = 000067
FC.CEF= 020000   	H.FOWN= 000010   	I.RVDT= 000014   	S.NFEN= ****** GX	.DFEXT= 000005
FC.DIR= 040000   	H.FPRO= 000012   	I.RVNO= 000012   	S.STBK= 000012   	.DFPRO= 164000
FC.FCO= 010000   	H.FSEQ= 000004   	I.RVTI= 000023   	UC.CON= 000200   	.DRAC1= ****** GX
FC.WAC= 100000   	H.IDOF= 000000   	I.RWAD= 000024   	UC.DLK= 000100   	.DREX1= ****** GX
FP.DEL= 000010   	H.MPOF= 000001   	I.RWAT  000026   	VC.BMW= 000002   	.DRFNB= ****** GX
FP.EXT= 000004   	H.PROG= 000010   	I.RWCT= 000026   	VC.IFW= 000001   	.DRFRE= ****** GX
FP.RAT= 000001   	H.PROJ= 000011   	I.RWVB= 000032   	V.FCB   000006   	.DRGET= ****** GX
FP.RDV= 000001   	H.SCHA= 000015   	I.STD   000004   	V.FFNU  000055   	.DRHVR= ****** GX
FP.WRV= 000002   	H.UCHA= 000014   	I.TISZ= 000006   	V.FIEX  000025   	.DRINI= ****** GX
F$$LVL= 000001   	H.UFAT= 000016   	I.UIC   000022   	V.FMAX  000016   	.DRLVB= ****** GX
F.DREF  000042   	IDXFNU= 000001   	LEV11M= 000401   	V.FPRO  000030   	.DRPAC= ****** GX
F.DRNM  000044   	ID$$$ = 000202   	LOWFCN= 000011   	V.FRBK  000034   	.DRUCB= ****** GX
F.FEXT  000002   	IE.BAD= ****** GX	MFDFNO= 000004   	V.IBLB  000012   	.DRVLB= ****** GX
F.FNUM  000006   	IE.BVR= ****** GX	MFDFSQ= 000004   	V.IBSZ  000013   	.DRWEX= ****** GX
F.FOWN  000014   	IE.DUP= ****** GX	M$$HDR= 000001   	V.IFWI  000002   	.DRWRT= ****** GX
F.FPRO  000016   	I.ACTL  000035   	M.CTSZ= 000006   	V.LABL  000040   	.ENTNM  000000RG
F.FSEQ  000010   	I.AST   000020   	M.EFNU= 000002   	V.LGTH  000056   	.FCBAD= ****** GX
F.FSQN  000013   	I.ATL   000006   	M.EFSQ= 000004   	V.LRUC  000035   	.IOPKT= ****** GX
F.FVBN  000046   	I.CRDT= 000031   	M.ERVN= 000001   	V.SBCL  000021   	.LOCAT= ****** GX
F.HDLB  000022   	I.CRTI= 000040   	M.ESQN= 000000   	V.SBLB  000024   	.PRCK3= ****** GX
F.LBN   000026   	I.DASZ= 000007   	M.LBSZ= 000007   	V.SBSZ  000022   	.PRFIL= 000004
F.LGTH  000052   	I.DPB   000011   	M.MAX = 000011   	V.STAT  000054   	.RTPTF= 001401
F.LINK  000000   	I.EFN   000013   	M.RTRV= 000012   	V.STD   000004   	.SYUIC= 000010
F.NACS  000036   	I.EXDT= 000046   	M.USE = 000010   	V.TRCT  000000   	.UCBAD= ****** GX
F.NLCK  000037   	I.EXTD  000030   	NB.SNM= ****** GX	V.WISZ  000020   	.VBSIZ= 001000
F.NWAC  000040   	I.FCN   000014   	NB.STP= ****** GX	WI.BPS= 100000   	...GBL= 000000
F.RVN   000012   	I.FIDP  000024   	NB.SVR= ****** GX	WI.DLK= 010000   	...TPC= 000012

. ABS.	000056	   000
      	000356	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2735 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:23
[40,10]ENTNM,[40,20]ENTNM/-SP=[40,30]RSXDC,F11PRE,ENTNM
RSXDC	MACRO M1108  05-DEC-77 17:05  PAGE 3


      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.
ERRMSG	D0210, ERROR MESSAGE MO	MACRO M1108  05-DEC-77 17:05  PAGE 6


      1						.TITLE	ERRMSG	D0210, ERROR MESSAGE MODULE
						.IDENT	"D0210"
      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					;
					; VERSION D210, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  6 DEC 74  12:00
     23					;
     24					; COMMON ERROR MESSAGE MODULE
     25
     26					; THIS ROUTINE SENDS ERROR MESSAGE REQUESTS TO THE FILES-11 ERROR
     27					; MESSAGE TASK WHEN CALLED FOR BY AN ERRP OR FATAL TRAP. THE MESSAGE,
     28					; WITH APPROPRIATE PARAMETERS, IS BUILT ON THE STACK.
     29
     30						.MCALL	SDRQ$S
     31					;
     32					; TASK NAME FOR SEND/REQUEST TO MESSAGE PRINTER
     33					;
     34	000000	025167 	052077 		MSGTSK:	.RAD50	"F11MSG"
     35
     36						.ENABL	LSB
     37
     38					;+
     39					;
     40					; **-.ABORT - FCP CRASH MESSAGE
     41					;
     42					; THIS ROUTINE IS ENTERED WHEN FCP DETECTS AN INTERNAL ERROR OF SOME
     43					; SORT AND CONCLUDES THAT FURTHER PROCESSING WOULD ONLY MAKE THINGS
     44					; WORSE. THE CURRENT REQUEST IS TERMINATED WITH AN "IE.ABO" STATUS AND
     45					; THE FATAL ERROR MESSAGE IS REQUESTED.
     46					;
     47					;-
     48
     49	000004				.ABORT::
     50	000004	016705 	000000G			MOV	.IOPKT,R5	; RESTORE R5
     51	000010	012603 				MOV	(SP)+,R3	; GET PC OF ABORT
     52	000012	012706 	000000G			MOV	#.STACK,SP	; RESET THE STACK
     53	000016	012746 	000000G			MOV	#.EXIT,-(SP)	; SET UP TO RETURN TO EXIT
     54									; SET ERROR STATUS
ERRMSG	D0210, ERROR MESSAGE MO	MACRO M1108  05-DEC-77 17:05  PAGE 6-1


     55	000022					ERR	IE.ABO,<INTERNAL ERROR, REQUEST ABORTED>
	000022	   000G	   211 			TRAP	IE.ABO		; INTERNAL ERROR, REQUEST ABORTED
     56
     57	000024	162706 	000010 			SUB	#8.,SP		; ALLOCATE UNUSED PARAMETERS
     58	000030	016500 	000004 			MOV	I.STD(R5),R0	; GET USER'S STD
     59	000034	016046 	000002 			MOV	2(R0),-(SP)	; STORE USER'S TASK NAME
     60	000040	011046 				MOV	(R0),-(SP)
     61	000042	010346 				MOV	R3,-(SP)	; STORE CRASH ADDRESS
     62	000044	012703 	000000G			MOV	#E.FATL,R3	; GET CODE FOR MESSAGE
     63	000050	000421 				BR	20$		; USE COMMON CODE FOR REST OF MESSAGE
     64
     65					;+
     66					;
     67					; **.ERRMG - OUTPUT ERROR MESSAGE
     68					;
     69					; THIS ROUTINE IS CALLED (VIA EMT) WHEN FCP DETECTS AN ERROR CONDITION
     70					; SERIOUS ENOUGH TO WARRANT INFORMING THE WORLD AT LARGE. IT OUTPUTS
     71					; THE MESSAGE REQUEST AND RETURNS TO THE CALLING ROUTINE.
     72					;
     73					; INPUTS:
     74					;
     75					;	R3 = ERROR CODE * 2
     76					;
     77					;-
     78
     79	000052				.ERRMG::
     80	000052	016705 	000000G			MOV	.IOPKT,R5	; RESTORE R5
     81	000056	006203 				ASR	R3		; RESTORE MESSAGE CODE
     82					;
     83					; BUILD THE PARAMETERS OF THE MESSAGE ON THE STACK
     84					;
     85	000060	005000 				CLR	R0
     86	000062	156700 	000000G			BISB	.HDBUF+H.IDOF,R0	; FIND IDENT AREA OFFSET
     87	000066	006300 				ASL	R0
     88	000070	062700 	000012G			ADD	#.HDBUF+I.FVER+2,R0	; END OF NAME, TYPE, VERSION AREA
     89	000074	012701 	000005 			MOV	#5,R1
     90	000100					ASSUME	I.FTYP,I.FNAM+6
     91	000100					ASSUME	I.FVER,I.FTYP+2
     92	000100	014046 			10$:	MOV	-(R0),-(SP)		; FILE NAME, TYPE, AND VERSION
     93	000102	077102 				SOB	R1,10$
     94	000104	016746 	000004G			MOV	.HDBUF+H.FSEQ,-(SP)	; FILE SEQUENCE NUMBER
     95	000110	016746 	000002G			MOV	.HDBUF+H.FNUM,-(SP)	; FILE NUMBER
     96					;
     97					; BUILD THE STANDARD MESSAGE PREFIX
     98					;
     99	000114	016700 	000000G		20$:	MOV	.UCBAD,R0	; POINT TO PUD
    100	000120	112001 				MOVB	(R0)+,R1	; GET DEVICE NAME
    101	000122	042701 	177700 			BIC	#^C77,R1	; AND CONVERT TO RAD-50
    102	000126					MUL	#50,R1		; USING THE LAST TWO CHARACTER POSITIONS
    103	000136	112002 				MOVB	(R0)+,R2
    104	000140	042702 	177700 			BIC	#^C77,R2
    105	000144	060201 				ADD	R2,R1
    106	000146	005046 				CLR	-(SP)
    107	000150	111016 				MOVB	(R0),(SP)	; UNIT NUMBER IS NEXT BYTE
    108	000152	010146 				MOV	R1,-(SP)	; DEVICE NAME
    109	000154	016500 	000006 			MOV	I.ATL(R5),R0	; GET CALLER'S ATL
    110	000160	016000 	000000G			MOV	A.TI(R0),R0	; GET HIS TI PUD
ERRMSG	D0210, ERROR MESSAGE MO	MACRO M1108  05-DEC-77 17:05  PAGE 6-2


    111	000164	005046 				CLR	-(SP)
    112	000166	116016 	000000G			MOVB	U.UN(R0),(SP)	; TI UNIT NUMBER
    113	000172	011046 				MOV	(R0),-(SP)	; TI DEVICE NAME
    114	000174	010346 				MOV	R3,-(SP)	; MESSAGE CODE (REMEMBER THE MESSAGE CODE?)
    115	000176	052716 	000000C			BIS	#<FM.CO*400>,(SP) ; CONTROL BIT FOR OUTPUT TO CO
    116	000202	010600 				MOV	SP,R0		; ADDRESS OF MESSAGE
    117	000204					SDRQ$S	#MSGTSK,,,,,R0	; SEND IT ALREADY
    118									; SUCCESS OR NOT, WE DON'T CARE
    119	000254	062706 	000030 			ADD	#24.,SP		; CLEAN MESSAGE OFF THE STACK
    120	000260					RETURN
    121
    122						.DSABL	LSB
    123					;
    124					;
    125	000262					$END	ERRMSG
    126					;
    127					;
    128		000001 				.END
ERRMSG	D0210, ERROR MESSAGE MO	MACRO M1108  05-DEC-77 17:05  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.EFN   000013   	M.ESQN= 000000   	V.STAT  000054
AC.LCK= 000001   	F.NACS  000036   	I.EXDT= 000046   	M.LBSZ= 000007   	V.STD   000004
A.TI  = ****** GX	F.NLCK  000037   	I.EXTD  000030   	M.MAX = 000011   	V.TRCT  000000
BITFNU= 000002   	F.NWAC  000040   	I.FCN   000014   	M.RTRV= 000012   	V.WISZ  000020
EX.AC1= 000001   	F.RVN   000012   	I.FIDP  000024   	M.USE = 000010   	WI.BPS= 100000
EX.AC2= 000002   	F.SCHA  000021   	I.FNAM= 000000   	PR    = ****** GX	WI.DLK= 010000
EX.ADF= 000010   	F.SIZE  000032   	I.FNBP  000036   	QIOEFN= 000002   	WI.EXT= 002000
EX.ENA= 000200   	F.STAT  000040   	I.FTYP= 000006   	R$$10F= 000001   	WI.LCK= 004000
EX.FCO= 000004   	F.STD   000004   	I.FVER= 000010   	R$$11D= 000001   	WI.RDV= 000400
E$$MSG= 000001   	F.UCHA  000020   	I.IOSB  000016   	SC.BAD= 000100   	WI.WRV= 001000
E$$TRP= 000001   	F11PR$= 000000   	I.LGTH  000040   	SC.MDL= 000200   	W.CTL   000000
E.FATL= ****** GX	HIFCN = 000030   	I.LNK   000000   	S.HDHD= 000056   	W.FCB   000002
FCPLUN= 000001   	H.CKSM= 000776   	I.LUN   000012   	S.IDHD= 000056   	W.RTRV  000012
FC.CEF= 020000   	H.FCHA= 000014   	I.PRI   000010   	S.MPHD= 000012   	W.STD   000004
FC.DIR= 040000   	H.FLEV= 000006   	I.PRM   000024   	S.STBK= 000012   	W.VBN   000006
FC.FCO= 010000   	H.FNUM= 000002   	I.RTRV  000034   	UC.CON= 000200   	W.WISZ  000007
FC.WAC= 100000   	H.FOWN= 000010   	I.RVDT= 000014   	UC.DLK= 000100   	$MUL  = ****** GX
FM.CO = ****** GX	H.FPRO= 000012   	I.RVNO= 000012   	U.UN  = ****** GX	$$    = 000067
FP.DEL= 000010   	H.FSEQ= 000004   	I.RVTI= 000023   	VC.BMW= 000002   	$$$T1 = 000011
FP.EXT= 000004   	H.IDOF= 000000   	I.RWAD= 000024   	VC.IFW= 000001   	$$$T2 = 000027
FP.RAT= 000001   	H.MPOF= 000001   	I.RWAT  000026   	V.FCB   000006   	.ABORT  000004RG
FP.RDV= 000001   	H.PROG= 000010   	I.RWCT= 000026   	V.FFNU  000055   	.DFEXT= 000005
FP.WRV= 000002   	H.PROJ= 000011   	I.RWVB= 000032   	V.FIEX  000025   	.DFPRO= 164000
F$$LVL= 000001   	H.SCHA= 000015   	I.STD   000004   	V.FMAX  000016   	.ERRMG  000052RG
F.DREF  000042   	H.UCHA= 000014   	I.TISZ= 000006   	V.FPRO  000030   	.EXIT = ****** GX
F.DRNM  000044   	H.UFAT= 000016   	I.UIC   000022   	V.FRBK  000034   	.HDBUF= ****** GX
F.FEXT  000002   	IDXFNU= 000001   	LEV11M= 000401   	V.IBLB  000012   	.IOPKT= ****** GX
F.FNUM  000006   	ID$$$ = 000210   	LOWFCN= 000011   	V.IBSZ  000013   	.PRFIL= 000004
F.FOWN  000014   	IE.ABO= ****** GX	MFDFNO= 000004   	V.IFWI  000002   	.RTPTF= 001401
F.FPRO  000016   	I.ACTL  000035   	MFDFSQ= 000004   	V.LABL  000040   	.STACK= ****** GX
F.FSEQ  000010   	I.AST   000020   	MSGTSK  000000R  	V.LGTH  000056   	.SYUIC= 000010
F.FSQN  000013   	I.ATL   000006   	M$$HDR= 000001   	V.LRUC  000035   	.UCBAD= ****** GX
F.FVBN  000046   	I.CRDT= 000031   	M.CTSZ= 000006   	V.SBCL  000021   	.VBSIZ= 001000
F.HDLB  000022   	I.CRTI= 000040   	M.EFNU= 000002   	V.SBLB  000024   	...GBL= 000000
F.LBN   000026   	I.DASZ= 000007   	M.EFSQ= 000004   	V.SBSZ  000022   	...TPC= 000012
F.LGTH  000052   	I.DPB   000011   	M.ERVN= 000001

. ABS.	000056	   000
      	000262	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2775 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:27
[40,10]ERRMSG,[40,20]ERRMSG/-SP=[40,30]RSXDC,F11PRE,ERRMSG
RSXDC	MACRO M1108  05-DEC-77 17:05  PAGE 3


      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.
EXCOM	D0215, EXTEND FILE COMM	MACRO M1108  05-DEC-77 17:05  PAGE 6


      1						.TITLE	EXCOM	D0215, EXTEND FILE COMMON CODE
						.IDENT	"D0215"
      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					;
					; VERSION D215, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  12 FEB 75  16:46
     23					; PETER H. LIPMAN	25-FEB-74
     24					;
     25					; EXTEND THE FILE COMMON CODE
     26
     27					;
     28					;+
     29					; **.EXCOM-EXTEND FILE COMMON CODE
     30					;
     31					; THIS ROUTINE ASSUMES THE FOLLOWING:
     32					;
     33					; 	THE FILE HEADER IS IN .HDBUF
     34					; 	.FILNO, .FILSQ ARE SET UP
     35					; 	.FCBAD IS SET UP IF FILE IS ACCESSED BY ANYONE
     36					;
     37					; 	EX.AC1 - BIT 0 - SET IF ALLOCATE CONTIGUOUS CHUNK
     38					; 	EX.AC2 - BIT 1 - SET IF ALLOCATE LARGEST AVAILABLE
     39					; 			 CONTIGUOUS CHUNK IF CAN'T ALLOCATE
     40					; 			 DESIRED SIZE.
     41					; 	EX.FCO - BIT 2 - SET IF FILE IS TO BECOME CONTIGUOUS
     42					; 	EX.ADF - BIT 3 - SET IF ALLOCATE DEFAULT NO. OF BLOCKS
     43					; 	EX.ENA - BIT 7 - SET IF HEADER EXTENSION IS ENABLED
     44					;
     45					; THE FILE IS EXTENDED AND THE FCB IS UPDATED.
     46					;
     47					; INPUTS:
     48					;
     49					; 	HIGH BYTE OF R0 = THE EXTEND CONTROL BITS AS ABOVE
     50					; 	LOW BYTE OF R0 = HIGH ORDER BYTE OF EXTEND SIZE
     51					; 	R1 = LOW ORDER WORD OF EXTEND SIZE
     52					; 	R4=UCB
     53					; 	R5=I/O PACKET
     54					;
EXCOM	D0215, EXTEND FILE COMM	MACRO M1108  05-DEC-77 17:05  PAGE 6-1


     55					; OUTPUTS:
     56					;
     57					; 	R0-R3 ALTERED R4, R5 PRESERVED
     58					;
     59					; EFFECTS:
     60					;
     61					; 	STORAGE MAP ALTERED AND CONTENTS OF THE STORAGE MAP BUFFER MAY
     62					; BE A DIFFERENT BLOCK OF THE MAP. ALTERED BLOCKS OF THE STORAGE MAP HAVE
     63					; BEEN WRITTEN.
     64					; 	FILE HEADER ALTERED AND WRITTEN.
     65					; 	.FCB UPDATED TO REFLECT NEW SIZE AND POSSIBLY NEW CONTIGUOUS ATTRIBUTE.
     66					; 	.IOSTS, .IOSTS+2 HAS THE AMOUNT EXTENDED ADDED TO IT
     67					;
     68					;-
     69
     70						.ENABL	LSB
     71
     72	000000				.EXCOM::
     74	000000	016767 	000000G	000000G		MOV	.FCBAD,.EXFCB	; SET UP STARTING FCB ADDRESS
     76	000006	032700 	000400 			BIT	#EX.AC1*400,R0	; IF NON CONTIGUOUS EXTEND
     77	000012	001003 				BNE	10$
     78	000014	032700 	002000 			BIT	#EX.FCO*400,R0	; AND FILE IS TO BE CONTIGUOUS, THEN BAD PARAM
     79	000020	001030 				BNE	40$
     80	000022	032700 	004000 		10$:	BIT	#EX.ADF*400,R0	; EXTEND BY DEFAULT SIZE?
     81	000026	001404 				BEQ	20$		; BRANCH IF NO
     82	000030	105000 				CLRB	R0
     83	000032	005001 				CLR	R1
     84	000034	156401 	000025 			BISB	V.FIEX(R4),R1	; USE DEFAULT SIZE FROM VCB
     85	000040	010067 	000000G		20$:	MOV	R0,.SMEXT
     86	000044	010167 	000002G			MOV	R1,.SMEXT+2
     87					;
     88					; FORM R1= POINTER TO NUMBER OF WORDS OF RETRIEVAL POINTERS IN USE.
     89					;
     90	000050				30$:	CALL	.GTMAP		; POINT TO MAP AREA
     91	000054	062701 	000010 			ADD	#M.USE,R1
     95	000060	010167 	000000G			MOV	R1,.USEPT	; SAVE POINTER TO M.USE
     96	000064	005002 				CLR	R2
     97	000066	151102 				BISB	(R1),R2		; R2=WORDS IN USE IN MAP
     98	000070	001414 				BEQ	60$		; BRANCH IF FILE IS EMPTY
     99					;
    100					; FILE HAS SOME SPACE ALLOCATED NO MATTER WHAT KIND OF EXTEND THIS IS,
    101					; THE FILE CANNOT END UP CONTIGUOUS
    102					;
    103	000072	132767 	000004 	000000G		BITB	#EX.FCO,.SMCTL
    104	000100	001401 				BEQ	50$		;
    105	000102				40$:	ERRX	IE.BAD,<ILLEGAL EXTEND PARAMETERS>
	000102	   000C	   211 			TRAP	-IE.BAD		; ILLEGAL EXTEND PARAMETERS
    106					;
    107					; .SMEXT NOW CONTAINS DESIRED EXTEND SIZE, R1 POINTS TO M.USE
    108					;
    109	000104	060201 			50$:	ADD	R2,R1		; FORM ADR OF 2ND WORD OF LAST RTRV PNTR
    110	000106	060201 				ADD	R2,R1		; PRESERVING R2
    111	000110	016167 	177776 	000000G		MOV	-2(R1),.EXTSV	; SAVE BLOCK COUNT OF THIS POINTER
    112	000116	110267 	000000G			MOVB	R2,.EXTSV	; AND WORDS IN USE FOR CLEANUP
    113	000122	005721 			60$:	TST	(R1)+		; POINT TO FIRST FREE RETRIEVAL POINTER
    114	000124	010167 	000000G			MOV	R1,.FREPT	; SAVE ADDRESS OF FREE RETRIEVAL POINTER
    116					;
EXCOM	D0215, EXTEND FILE COMM	MACRO M1108  05-DEC-77 17:05  PAGE 6-2


    117					; MAKE SURE WE HAVE THE LAST HEADER OF THE FILE IN CORE. CHAIN
    118					; THROUGH HEADERS UNTIL WE DO.
    119					;
    120	000130					CALL	.NXHDR		; READ NEXT HEADER
    121	000134	103407 				BCS	70$		; BRANCH IF NONE
    122	000136	016700 	000000G			MOV	.EXFCB,R0	; GET FCB ADDRESS
    123	000142	001742 				BEQ	30$		; NO FCB - FILE IS NOT ACCESSED
    124	000144	016067 	000002 	000000G		MOV	F.FEXT(R0),.EXFCB ; POINT TO NEXT EXTENSION
    125	000152	000736 				BR	30$		; SET UP THIS HEADER
    126
    127	000154	016767 	000002G	000000G	70$:	MOV	.HDBUF+H.FNUM,.EXHDR ; SAVE FILE NO. OF STARTING HEADER
    128	000162	105267 	000000G			INCB	.EXSTS		; INDICATE THAT SERIOUS THINGS ARE ABOUT TO HAPPEN
    130					;
    131					; ALLOCATE FIRST OR NEXT CHUNK OF DESIRED BLOCKS
    132					;
    133	000166	005001 			80$:	CLR	R1
    134	000170	156701 	000000G			BISB	.SMEXT,R1	; R1,R2=DESIRED NUMBER OF BLOCKS
    135	000174	016702 	000002G			MOV	.SMEXT+2,R2
    136	000200	010146 				MOV	R1,-(SP)
    137	000202	050226 				BIS	R2,(SP)+
    138	000204	001563 				BEQ	140$		; BRANCH IF ALL BLOCKS HAVE BEEN ALLOCATED
    139	000206					CALL	.SMALC		; ALLOCATE THE DESIRED SPACE
    140	000212	010067 	000000G			MOV	R0,.SVLBN	; SAVE THE STARTING LOGICAL BLOCK NO.
    141	000216	010167 	000002G			MOV	R1,.SVLBN+2
    142					;
    143					; KEEP RUNNING TOTAL OF BLOCKS ALLOCATED IN .IOSTS
    144					;
    145	000222	012702 	000000G			MOV	#.SM1BT,R2
    146	000226	012703 	000001G			MOV	#.IOSTS+1,R3
    147	000232	005000 				CLR	R0
    148	000234	152300 				BISB	(R3)+,R0
    149	000236	062200 				ADD	(R2)+,R0	; ADD HIGH ORDER BITS
    150	000240	061213 				ADD	(R2),(R3)	; ADD LOW ORDER BITS
    151	000242	005500 				ADC	R0
    152	000244	110043 				MOVB	R0,-(R3)
    153					;
    154					; IN THE CASE OF A FAILURE TO ALLOCATE A CONTIGUOUS CHUNK THE ERROR
    155					; BYTE WILL BE SET IN .IOSTS .EXIT NOW IF IT IS.
    156					;
    157	000246	105743 				TSTB	-(R3)
    158	000250	002005 				BGE	90$
    159	000252	005067 	000000G			CLR	.SM1BT		; CLEAN OUT BLOCK COUNT RETURNED
    160	000256	005067 	000002G			CLR	.SM1BT+2	; TO AVOID CONFUSING THE DAYLIGHTS OUT
    161									; OF THE CLEANUP
    162	000262					ERRX
	000262	104400 				TRAP	0		;
    163
    164					;
    165					; SUBTRACT BLOCKS ALLOCATED FROM DESIRED BLOCKS IN I/O PACKET
    166					;
    167	000264	005000 			90$:	CLR	R0
    168	000266	156700 	000000G			BISB	.SMEXT,R0
    169	000272	161267 	000002G			SUB	(R2),.SMEXT+2	; SUBTRACT LOW ORDER COUNT
    170	000276	005600 				SBC	R0
    171	000300	164200 				SUB	-(R2),R0	; SUBTRACT HIGH ORDER BITS
    172	000302	002003 				BGE	100$
    173	000304	005000 				CLR	R0		; ALLOCATED MORE THAN ASKED FOR
EXCOM	D0215, EXTEND FILE COMM	MACRO M1108  05-DEC-77 17:05  PAGE 6-3


    174	000306	005067 	000002G			CLR	.SMEXT+2	; ZERO THE DESIRED BLOCK COUNT
    175	000312	110067 	000000G		100$:	MOVB	R0,.SMEXT
    176	000316	016703 	000000G			MOV	.FREPT,R3
    177	000322	105777 	000000G			TSTB	@.USEPT		; IS FILE EMPTY?
    178	000326	001436 				BEQ	110$		; BRANCH IF YES
    179	000330	024343 				CMP	-(R3),-(R3)	; POINT TO PREVIOUS RETRIEVAL POINTER
    180					;
    181					; SEE IF STARTING LBN OF NEW CHUNK STARTS AT END OF LAST RETRIEVAL
    182					; POINTER. IF SO, CAN TACK IT ON.
    183					;
    184	000332	005000 				CLR	R0
    185	000334	152300 				BISB	(R3)+,R0
    186	000336	005002 				CLR	R2
    187	000340	152302 				BISB	(R3)+,R2
    188	000342	005202 				INC	R2		; SIZE OF THIS RETRIEVAL POINTER
    189	000344	012301 				MOV	(R3)+,R1	; R0,R1=STARTING LBN
    190	000346	060201 				ADD	R2,R1		;
    191	000350	005500 				ADC	R0		; R0,R1=ENDING LBN+1
    192	000352	020067 	000000G			CMP	R0,.SVLBN	; DOES NEW CHUNK START AT THIS LBN
    193	000356	001022 				BNE	110$		; BRANCH IF NO
    194	000360	020167 	000002G			CMP	R1,.SVLBN+2
    195	000364	001017 				BNE	110$
    196					;
    197					; ADD THE NEWLY ALLOCATED CHUNK IN TO THE LAST RETRIEVAL POINTER.
    198					; RELEASE THE LAST RETRIEVAL POINTER AND MAKE NEW CHUNK LOOK
    199					; LIKE BIGGER PIECE STARTING AT THE STARTING LBN.
    200					;
    201	000366	024343 				CMP	-(R3),-(R3)	; BACK TO LAST RETRIEVAL POINTER
    202	000370	010367 	000000G			MOV	R3,.FREPT	; THIS ONE FREE
    203	000374	162777 	000002 	000000G		SUB	#2,@.USEPT	; FIX WORDS IN USE
    204	000402	060267 	000002G			ADD	R2,.SM1BT+2	; ADD THIS RETRIEVAL POINTER SIZE
    205	000406	005567 	000000G			ADC	.SM1BT		; TO NEW ALLOCATION SIZE
    206	000412	111367 	000000G			MOVB	(R3),.SVLBN	; USE THIS RETRIEVAL POINTER LBN
    207	000416	016367 	000002 	000002G		MOV	2(R3),.SVLBN+2	; FOR STARTING LBN
    208					;
    209					; FORM NEW RETRIEVAL POINTER(S) FROM THE NEWLY ALLOCATED PIECE
    210					;
    211	000424	016700 	000000G		110$:	MOV	.SM1BT,R0	; R0,R1=NUMBER OF BLOCKS TO ADD
    212	000430	016701 	000002G			MOV	.SM1BT+2,R1
    213	000434	016702 	000000G			MOV	.USEPT,R2	; R2 POINTS TO .BYTE M.USE, M.MAX
    214	000440	126212 	000001 		120$:	CMPB	1(R2),(R2)
    215	000444	101541 				BLOS	200$		; BRANCH IF HEADER FULL
    216	000446	012746 	000400 			MOV	#400,-(SP)	; MAX NO. OF BLOCKS PER RETRIEVAL POINTER
    217	000452	016723 	000000G			MOV	.SVLBN,(R3)+	; STORE LBN IN RETRIEVAL POINTER
    218	000456	016723 	000002G			MOV	.SVLBN+2,(R3)+
    219	000462	005700 				TST	R0		; MORE BLOCKS TO ADD THAN MAX?
    220	000464	001003 				BNE	130$		; BRANCH IF YES
    221	000466	020116 				CMP	R1,(SP)
    222	000470	101001 				BHI	130$		; BRANCH IF YES
    223	000472	010116 				MOV	R1,(SP)		; NO, USE WHAT'S LEFT
    224	000474	161601 			130$:	SUB	(SP),R1		; SUBTRACT FROM BLOCK COUNT
    225	000476	005600 				SBC	R0
    226	000500	061667 	000002G			ADD	(SP),.SVLBN+2	; ADD TO LBN
    227	000504	005567 	000000G			ADC	.SVLBN
    228	000510	005316 				DEC	(SP)
    229	000512	112663 	177775 			MOVB	(SP)+,-3(R3)	; SET SIZE OF THE RETRIEVAL POINTER
    230	000516	062712 	000002 			ADD	#2,(R2)		; SET TO NEXT RETRIEVAL POINTER
EXCOM	D0215, EXTEND FILE COMM	MACRO M1108  05-DEC-77 17:05  PAGE 6-4


    231	000522	010367 	000000G			MOV	R3,.FREPT
    232	000526	010046 				MOV	R0,-(SP)	; NEED ANOTHER RETRIEVAL POINTER?
    233	000530	050126 				BIS	R1,(SP)+
    234	000532	001342 				BNE	120$		; BRANCH IF YES
    235	000534	005067 	000000G			CLR	.SM1BT		; ALLOCATED SPACE IS RECORDED
    236	000540	005067 	000002G			CLR	.SM1BT+2	; SO CLEAR HOLDING CELLS
    237					;
    238					; RETRIEVAL POINTER(S) ALL SET FOR THIS ALLOCATED CHUNK. HAVE WE
    239					; ALLOCATED ENOUGH? IF CONTIGUOUS ALLOCATION, THEN YES
    240					;
    241	000544	132767 	000001 	000000G		BITB	#EX.AC1,.SMCTL	; IF NONCONTIGUOUS ALLOCATION
    242	000552	001605 				BEQ	80$		; GO ALLOCATE MORE IF NEEDED
    243					;
    244					; DESIRED BLOCKS SUCCESSFULLY ALLOCATED
    245					;
    246	000554	005003 			140$:	CLR	R3
    247	000556					CALL	.SMRVB		; WRITE THE DIRTY BIT MAP BLOCK
    254	000562	016700 	000000G		150$:	MOV	.FCBAD,R0	; IF AN FCB EXISTS FOR THIS FILE
    255	000566	001413 				BEQ	160$
    256	000570	016701 	000000G			MOV	.WNDOW,R1	; R1 = WINDOW ADDRESS
    257	000574	001410 				BEQ	160$		; BRANCH IF NO WINDOW
    258	000576	016002 	000032 			MOV	F.SIZE(R0),R2	; GET R2,R3 = LAST VBN BEFORE EXTEND
    259	000602	016003 	000034 			MOV	F.SIZE+2(R0),R3
    261	000606	016700 	000000G			MOV	.EXFCB,R0	; GET CURRENT FCB ADDRESS
    263	000612					CALL	.WTRN1		; TURN WINDOW TO INCLUDE NEW BLOCKS
    264	000616				160$:
    266	000616	026767 	000002G	000000G		CMP	.HDBUF+H.FNUM,.FILNO ; SEE IF WE HAVE THE PRIMARY HEADER
    267	000624	001411 				BEQ	170$		; YES
    268	000626	016700 	000000G			MOV	.EXFCB,R0	; RESTORE FCB ADDRESS
    269	000632	001406 				BEQ	170$		; NO FCB
    273	000634					CALL	.INFCB		; REINIT THE FCB
    275	000640					CALL	.WRHDR		; WRITE OUT THE LAST HEADER
    276	000644					CALL	.RDFHD		; READ THE PRIMARY FILE HEADER
    277	000650	142767 	000200 	000014G	170$:	BICB	#UC.CON,.HDBUF+H.UCHA ; SET PROPER CONTIGUOUS CHARACTERISTIC
    278	000656	132767 	000004 	000000G		BITB	#EX.FCO,.SMCTL
    279	000664	001403 				BEQ	180$
    280	000666	152767 	000200 	000014G		BISB	#UC.CON,.HDBUF+H.UCHA
    281	000674	016700 	000000G		180$:	MOV	.FCBAD,R0	; GET PRIMARY FCB ADDRESS
    282	000700	001421 				BEQ	190$		; NONE
    283	000702	005046 				CLR	-(SP)
    284	000704	156716 	000001G			BISB	.IOSTS+1,(SP)	; GET HIGH ORDER ALLOCATION COUNT
    285	000710	066016 	000032 			ADD	F.SIZE(R0),(SP)	; ADD TO FILE SIZE
    286	000714	016746 	000002G			MOV	.IOSTS+2,-(SP)	; GET LOW ORDER
    287	000720	066016 	000034 			ADD	F.SIZE+2(R0),(SP)
    288	000724	005566 	000002 			ADC	2(SP)
    289	000730					CALL	.INFCB		; RE-INIT PRIMARY FCB
    290	000734	012660 	000034 			MOV	(SP)+,F.SIZE+2(R0) ; PUT IN NEW TOTAL SIZE
    291	000740	012660 	000032 			MOV	(SP)+,F.SIZE(R0)
    293	000744				190$:	CALLR	.WRHDR		; RE-WRITE PRIMARY HEADER
    294					;
    295					; EXCEPTIONS
    296					;
    298					; THE HEADER IS FULL - CREATE A NEW ONE AND PROCEED.
    299					;
    301	000750				200$:
    303	000750	001024 				BNE	210$		; BRANCH IF WE HAVE BLOWN THE HEADER
    304	000752	105767 	000000G			TSTB	.SMCTL		; CHECK IF HEADER EXTENSION IS ALLOWED
EXCOM	D0215, EXTEND FILE COMM	MACRO M1108  05-DEC-77 17:05  PAGE 6-5


    305	000756	100022 				BPL	220$		; BRANCH IF NOT
    306	000760	010067 	000000G			MOV	R0,.SM1BT	; SAVE UNRECORDED ALLOCATED BLOCKS
    307	000764	010167 	000002G			MOV	R1,.SM1BT+2
    308	000770	000177 	000000G			JMP	@.EXTH1		; CREATE AN EXTENSION HEADER
    309					;
    310					; EXTEND HEADER RETURNS HERE BY JMP, DUE TO OVERLAY CROCKERY.
    311					;
    312	000774				.EXCMH::CALL	.GTMAP		; POINT TO MAP AREA
    313	001000	062701 	000010 			ADD	#M.USE,R1	; POINT TO RETRIEVAL POINTER COUNTS
    314	001004	010167 	000000G			MOV	R1,.USEPT	; SAVE ADDRESS
    315	001010	005721 				TST	(R1)+		; BUMP TO FIRST RETRIEVAL POINTER
    316	001012	010167 	000000G			MOV	R1,.FREPT	; SINCE THIS HEADER IS OBVIOUSLY EMPTY
    317	001016	010103 				MOV	R1,R3
    318	001020	000601 				BR	110$		; PROCEED WITH THE EXTEND
    319
    320	001022				210$:	FATAL	<HEADER MAP OUT OF SYNC>
	001022	000004 				IOT			; *** FATAL ERROR HEADER MAP OUT OF SYNC
    321
    322	001024				220$:
    324	001024					ERRX	IE.HFU,<HEADER FULL>
	001024	   000C	   211 			TRAP	-IE.HFU		; HEADER FULL
    326
    327						.DSABL	LSB
    328					;
    329					;
    330	001026					$END	EXCOM
    331					;
    332					;
    333		000001 				.END
EXCOM	D0215, EXTEND FILE COMM	MACRO M1108  05-DEC-77 17:05  PAGE 6-6
SYMBOL TABLE

AC.DLK= 000002   	F.SCHA  000021   	I.FNBP  000036   	SC.MDL= 000200   	W.VBN   000006
AC.LCK= 000001   	F.SIZE  000032   	I.FTYP= 000006   	S.HDHD= 000056   	W.WISZ  000007
BITFNU= 000002   	F.STAT  000040   	I.FVER= 000010   	S.IDHD= 000056   	$$    = 000067
EX.AC1= 000001   	F.STD   000004   	I.IOSB  000016   	S.MPHD= 000012   	.DFEXT= 000005
EX.AC2= 000002   	F.UCHA  000020   	I.LGTH  000040   	S.STBK= 000012   	.DFPRO= 164000
EX.ADF= 000010   	F11PR$= 000000   	I.LNK   000000   	UC.CON= 000200   	.EXCMH  000774RG
EX.ENA= 000200   	HIFCN = 000030   	I.LUN   000012   	UC.DLK= 000100   	.EXCOM  000000RG
EX.FCO= 000004   	H.CKSM= 000776   	I.PRI   000010   	VC.BMW= 000002   	.EXFCB= ****** GX
E$$MSG= 000001   	H.FCHA= 000014   	I.PRM   000024   	VC.IFW= 000001   	.EXHDR= ****** GX
E$$TRP= 000001   	H.FLEV= 000006   	I.RTRV  000034   	V.FCB   000006   	.EXSTS= ****** GX
FCPLUN= 000001   	H.FNUM= 000002   	I.RVDT= 000014   	V.FFNU  000055   	.EXTH1= ****** GX
FC.CEF= 020000   	H.FOWN= 000010   	I.RVNO= 000012   	V.FIEX  000025   	.EXTSV= ****** GX
FC.DIR= 040000   	H.FPRO= 000012   	I.RVTI= 000023   	V.FMAX  000016   	.FCBAD= ****** GX
FC.FCO= 010000   	H.FSEQ= 000004   	I.RWAD= 000024   	V.FPRO  000030   	.FILNO= ****** GX
FC.WAC= 100000   	H.IDOF= 000000   	I.RWAT  000026   	V.FRBK  000034   	.FREPT= ****** GX
FP.DEL= 000010   	H.MPOF= 000001   	I.RWCT= 000026   	V.IBLB  000012   	.GTMAP= ****** GX
FP.EXT= 000004   	H.PROG= 000010   	I.RWVB= 000032   	V.IBSZ  000013   	.HDBUF= ****** GX
FP.RAT= 000001   	H.PROJ= 000011   	I.STD   000004   	V.IFWI  000002   	.INFCB= ****** GX
FP.RDV= 000001   	H.SCHA= 000015   	I.TISZ= 000006   	V.LABL  000040   	.IOSTS= ****** GX
FP.WRV= 000002   	H.UCHA= 000014   	I.UIC   000022   	V.LGTH  000056   	.NXHDR= ****** GX
F$$LVL= 000001   	H.UFAT= 000016   	LEV11M= 000401   	V.LRUC  000035   	.PRFIL= 000004
F.DREF  000042   	IDXFNU= 000001   	LOWFCN= 000011   	V.SBCL  000021   	.RDFHD= ****** GX
F.DRNM  000044   	ID$$$ = 000215   	MFDFNO= 000004   	V.SBLB  000024   	.RTPTF= 001401
F.FEXT  000002   	IE.BAD= ****** GX	MFDFSQ= 000004   	V.SBSZ  000022   	.SMALC= ****** GX
F.FNUM  000006   	IE.HFU= ****** GX	M$$HDR= 000001   	V.STAT  000054   	.SMCTL= ****** GX
F.FOWN  000014   	I.ACTL  000035   	M.CTSZ= 000006   	V.STD   000004   	.SMEXT= ****** GX
F.FPRO  000016   	I.AST   000020   	M.EFNU= 000002   	V.TRCT  000000   	.SMRVB= ****** GX
F.FSEQ  000010   	I.ATL   000006   	M.EFSQ= 000004   	V.WISZ  000020   	.SM1BT= ****** GX
F.FSQN  000013   	I.CRDT= 000031   	M.ERVN= 000001   	WI.BPS= 100000   	.SVLBN= ****** GX
F.FVBN  000046   	I.CRTI= 000040   	M.ESQN= 000000   	WI.DLK= 010000   	.SYUIC= 000010
F.HDLB  000022   	I.DASZ= 000007   	M.LBSZ= 000007   	WI.EXT= 002000   	.USEPT= ****** GX
F.LBN   000026   	I.DPB   000011   	M.MAX = 000011   	WI.LCK= 004000   	.VBSIZ= 001000
F.LGTH  000052   	I.EFN   000013   	M.RTRV= 000012   	WI.RDV= 000400   	.WNDOW= ****** GX
F.LINK  000000   	I.EXDT= 000046   	M.USE = 000010   	WI.WRV= 001000   	.WRHDR= ****** GX
F.NACS  000036   	I.EXTD  000030   	QIOEFN= 000002   	W.CTL   000000   	.WTRN1= ****** GX
F.NLCK  000037   	I.FCN   000014   	R$$10F= 000001   	W.FCB   000002   	...GBL= 000000
F.NWAC  000040   	I.FIDP  000024   	R$$11D= 000001   	W.RTRV  000012   	...TPC= 000012
F.RVN   000012   	I.FNAM= 000000   	SC.BAD= 000100   	W.STD   000004

. ABS.	000056	   000
      	001026	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2735 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:26
[40,10]EXCOM,[40,20]EXCOM/-SP=[40,30]RSXDC,F11PRE,EXCOM
RSXDC	MACRO M1108  05-DEC-77 17:06  PAGE 3


      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.
EXTEN	D0203, EXTEND QI/O	MACRO M1108  05-DEC-77 17:06  PAGE 6


      1						.TITLE	EXTEN	D0203, EXTEND QI/O
						.IDENT	"D0203"
      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					;
					; VERSION D203, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  11 JAN 75  20:24
     23					; PETER H. LIPMAN	5-MAR-74
     24					;
     25					; EXTEND QI/O
     26
     27						.MCALL	IOERR$
     28	000000					IOERR$			; DEFINE I/O ERROR CODES LOCALLY
     29					;
     30					;+
     31					; **-.EXTEN-EXTEND A FILE
     32					;
     33					; THIS ROUTINE INITIALIZES FOR FILE EXTENSION BY SETTING UP THE FILE ID,
     34					; WINDOW ADDRESS IF ACCESSED BY CALLER, AND FCB ADDRESS IF ACCESSED BY
     35					; ANYONE.  IT READS THE FILE HEADER AND CHECKS FILE PROTECTION.
     36					; THEN IT INVOKES THE FILE EXTENSION ROUTINE.
     37					;
     38					; INPUTS:
     39					;
     40					; 	R4=VOLUME CONTROL BLOCK
     41					; 	R5=I/O PACKET
     42					;
     43					; OUTPUTS:
     44					;
     45					; 	R0-R3 ALTERED R4-R5 PRESERVED
     46					; 	RETURNS IN LINE IF AND ONLY IF SUCCESSFUL
     47					;-
     48
     49	000000				.EXTEN::
     50	000000	010500 				MOV	R5,R0
     51	000002	062700 	000026 			ADD	#I.RWAT,R0
     52	000006	012001 				MOV	(R0)+,R1	; NO. READ ATTRIBUTES
     53	000010	005720 				TST	(R0)+		; EXTEND MUST BE ENABLED
     54	000012	100035 				BPL	40$		;
EXTEN	D0203, EXTEND QI/O	MACRO M1108  05-DEC-77 17:06  PAGE 6-1


     55	000014	005720 				TST	(R0)+
     56	000016	052001 				BIS	(R0)+,R1	; NO ACCESS
     57	000020	052001 				BIS	(R0)+,R1	; NO FILE NAME BLOCK ADDRESS
     61	000022	001031 				BNE	40$
     62	000024					CALL	.GTFID		; SET UP FILE NO. AND FILE SEQUENCE NO.
     63	000030					CALL	.SCFAC		; SEE IF FILE IS ACCESSED BY ANYONE
     64	000034					CALL	.RDFHD		; READ THE FILE HEADER
     65	000040	016700 	000000G			MOV	.WNDOW,R0	; DOES THIS USER HAVE FILE ACCESSED?
     66	000044	001404 				BEQ	10$		; BRANCH IF NO.
     67	000046	032710 	002000 			BIT	#WI.EXT,(R0)	; ACCESSED FOR EXTEND?
     68	000052	001007 				BNE	20$		; YES, ACCESS IS ALLOWED
     69	000054					ERRX	IE.PRI,<USER DOES NOT HAVE FILE ACCESSED FOR EXTEND>
	000054	104420 				TRAP	-IE.PRI		; USER DOES NOT HAVE FILE ACCESSED FOR EXTEND
     70	000056				10$:	CALL	.WACCK		; SEE IF FILE COULD BE WRITE ACCESSED
     71	000062	012700 	000004 			MOV	#FP.EXT,R0	; AND THEN CHECK EXTEND PRIVILEGE
     72	000066					CALL	.PROCK		;
     73	000072	016500 	000030 		20$:	MOV	I.EXTD(R5),R0	; R0,R1 =EXTEND PARAMETERS
     74	000076	016501 	000032 			MOV	I.EXTD+2(R5),R1
     75	000102	000177 	000000G		30$:	JMP	@.EXCM1		; GO DO THE EXTEND OPERATION
     76
     77	000106				40$:	ERRX	IE.BAD,<ILLEGAL PARAMETERS TO EXTEND QI/O>
	000106	104401 				TRAP	-IE.BAD		; ILLEGAL PARAMETERS TO EXTEND QI/O
     78					;
     79					;
     80	000110					$END	EXTEN
     81					;
     82					;
     83		000001 				.END
EXTEN	D0203, EXTEND QI/O	MACRO M1108  05-DEC-77 17:06  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	H.FOWN= 000010   	IE.LCK= 177745   	I.FIDP  000024   	V.FCB   000006
AC.LCK= 000001   	H.FPRO= 000012   	IE.MBK= 177721   	I.FNAM= 000000   	V.FFNU  000055
BITFNU= 000002   	H.FSEQ= 000004   	IE.MOD= 177753   	I.FNBP  000036   	V.FIEX  000025
EX.AC1= 000001   	H.IDOF= 000000   	IE.NBF= 177731   	I.FTYP= 000006   	V.FMAX  000016
EX.AC2= 000002   	H.MPOF= 000001   	IE.NBK= 177727   	I.FVER= 000010   	V.FPRO  000030
EX.ADF= 000010   	H.PROG= 000010   	IE.NFI= 177704   	I.IOSB  000016   	V.FRBK  000034
EX.ENA= 000200   	H.PROJ= 000011   	IE.NLN= 177733   	I.LGTH  000040   	V.IBLB  000012
EX.FCO= 000004   	H.SCHA= 000015   	IE.NNC= 177674   	I.LNK   000000   	V.IBSZ  000013
E$$MSG= 000001   	H.UCHA= 000014   	IE.NOD= 177751   	I.LUN   000012   	V.IFWI  000002
E$$TRP= 000001   	H.UFAT= 000016   	IE.NSF= 177746   	I.PRI   000010   	V.LABL  000040
FCPLUN= 000001   	IDXFNU= 000001   	IE.OFL= 177677   	I.PRM   000024   	V.LGTH  000056
FC.CEF= 020000   	ID$$$ = 000203   	IE.ONP= 177773   	I.RTRV  000034   	V.LRUC  000035
FC.DIR= 040000   	IE.ABO= 177761   	IE.OVR= 177756   	I.RVDT= 000014   	V.SBCL  000021
FC.FCO= 010000   	IE.ALN= 177736   	IE.PRI= 177760   	I.RVNO= 000012   	V.SBLB  000024
FC.WAC= 100000   	IE.BAD= 177777   	IE.RAC= 177724   	I.RVTI= 000023   	V.SBSZ  000022
FP.DEL= 000010   	IE.BBE= 177710   	IE.RAT= 177723   	I.RWAD= 000024   	V.STAT  000054
FP.EXT= 000004   	IE.BDI= 177714   	IE.RBG= 177730   	I.RWAT  000026   	V.STD   000004
FP.RAT= 000001   	IE.BDR= 177716   	IE.RCN= 177722   	I.RWCT= 000026   	V.TRCT  000000
FP.RDV= 000001   	IE.BDV= 177711   	IE.RER= 177740   	I.RWVB= 000032   	V.WISZ  000020
FP.WRV= 000002   	IE.BHD= 177700   	IE.RNM= 177715   	I.STD   000004   	WI.BPS= 100000
F$$LVL= 000001   	IE.BLK= 177754   	IE.RSU= 177757   	I.TISZ= 000006   	WI.DLK= 010000
F.DREF  000042   	IE.BNM= 177712   	IE.SNC= 177735   	I.UIC   000022   	WI.EXT= 002000
F.DRNM  000044   	IE.BTF= 177675   	IE.SPC= 177772   	LEV11M= 000401   	WI.LCK= 004000
F.FEXT  000002   	IE.BTP= 177725   	IE.SQC= 177734   	LOWFCN= 000011   	WI.RDV= 000400
F.FNUM  000006   	IE.BVR= 177701   	IE.SRE= 177762   	MFDFNO= 000004   	WI.WRV= 001000
F.FOWN  000014   	IE.BYT= 177755   	IE.STK= 177706   	MFDFSQ= 000004   	W.CTL   000000
F.FPRO  000016   	IE.CKS= 177742   	IE.VER= 177774   	M$$HDR= 000001   	W.FCB   000002
F.FSEQ  000010   	IE.CLO= 177732   	IE.WAC= 177743   	M.CTSZ= 000006   	W.RTRV  000012
F.FSQN  000013   	IE.CON= 177752   	IE.WAT= 177741   	M.EFNU= 000002   	W.STD   000004
F.FVBN  000046   	IE.DAA= 177770   	IE.WER= 177737   	M.EFSQ= 000004   	W.VBN   000006
F.HDLB  000022   	IE.DAO= 177763   	IE.WLK= 177764   	M.ERVN= 000001   	W.WISZ  000007
F.LBN   000026   	IE.DFU= 177750   	IE.2DV= 177720   	M.ESQN= 000000   	$$    = 000067
F.LGTH  000052   	IE.DNA= 177771   	IS.BV = 000005   	M.LBSZ= 000007   	$$MSG = 000000
F.LINK  000000   	IE.DNR= 177775   	IS.CR = 006401   	M.MAX = 000011   	.DFEXT= 000005
F.NACS  000036   	IE.DUN= 177767   	IS.ESC= 015401   	M.RTRV= 000012   	.DFPRO= 164000
F.NLCK  000037   	IE.DUP= 177707   	IS.PND= 000000   	M.USE = 000010   	.EXCM1= ****** GX
F.NWAC  000040   	IE.EBX= 177776   	IS.RDD= 000002   	QIOEFN= 000002   	.EXTEN  000000RG
F.RVN   000012   	IE.EOF= 177766   	IS.SUC= 000001   	R$$10F= 000001   	.GTFID= ****** GX
F.SCHA  000021   	IE.EOT= 177702   	I.ACTL  000035   	R$$11D= 000001   	.PRFIL= 000004
F.SIZE  000032   	IE.EOV= 177765   	I.AST   000020   	SC.BAD= 000100   	.PROCK= ****** GX
F.STAT  000040   	IE.EXP= 177676   	I.ATL   000006   	SC.MDL= 000200   	.RDFHD= ****** GX
F.STD   000004   	IE.FEX= 177717   	I.CRDT= 000031   	S.HDHD= 000056   	.RTPTF= 001401
F.UCHA  000020   	IE.FHE= 177705   	I.CRTI= 000040   	S.IDHD= 000056   	.SCFAC= ****** GX
F11PR$= 000000   	IE.FOP= 177713   	I.DASZ= 000007   	S.MPHD= 000012   	.SYUIC= 000010
HIFCN = 000030   	IE.HFU= 177744   	I.DPB   000011   	S.STBK= 000012   	.VBSIZ= 001000
H.CKSM= 000776   	IE.IFC= 177776   	I.EFN   000013   	UC.CON= 000200   	.WACCK= ****** GX
H.FCHA= 000014   	IE.IFU= 177747   	I.EXDT= 000046   	UC.DLK= 000100   	.WNDOW= ****** GX
H.FLEV= 000006   	IE.ILL= 177726   	I.EXTD  000030   	VC.BMW= 000002   	...GBL= 000000
H.FNUM= 000002   	IE.ISQ= 177703   	I.FCN   000014   	VC.IFW= 000001   	...TPC= 000012

. ABS.	000056	   000
      	000110	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  4452 WORDS  ( 18 PAGES)
DYNAMIC MEMORY:  5216 WORDS  ( 20 PAGES)
ELAPSED TIME:  00:00:35
[40,10]EXTEN,[40,20]EXTEN/-SP=[40,30]RSXDC,F11PRE,EXTEN
RSXDC	MACRO M1108  05-DEC-77 17:06  PAGE 3


      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.
EXTHD	D0213, CREATE AN EXTENS	MACRO M1108  05-DEC-77 17:06  PAGE 6


      1						.TITLE	EXTHD	D0213, CREATE AN EXTENSION FILE HEADER
						.IDENT	"D0213"
      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					;
     20					;
					; VERSION D213, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  3 MAR 75  14:49
     23					;
     24					; CREATE AN EXTENSION FILE HEADER
     25
     26					;+
     27					;
     28					; **.EXTHD - CREATE AN EXTENSION FILE HEADER
     29					;
     30					; THIS ROUTINE ALLOCATES A NEW FILE HEADER FROM THE INDEX FILE BITMAP,
     31					; LINKS THE NEW HEADER INTO THE EXTENSION DATA IN THE OLD HEADER,
     32					; AND INITIALIZES THE HEADER IMAGE IN THE BUFFER. THE EXTENSION
     33					; HEADER CONTAINS THE SAME ATTRIBUTES AS THE OLD ONE.
     34					; IF THE INDEX FILE IS FULL, THIS ROUTINE CLEANS UP ANY EXTEND DONE
     35					; SO FAR AND CALLS THE INDEX FILE EXTEND ROUTINE. THE ENTIRE EXTEND
     36					; CALL IS THEN RE-TRIED.
     37					;
     38					; NOTE: DUE TO OVERLAY RANDOMNESS, THIS IS AN OPEN ROUTINE. IT IS
     39					; JUMPED TO BY EXCOM, AND IT JUMPS BACK. BOTH JUMPS ARE THROUGH
     40					; TRANSFER VECTORS IN THE ROOT, WHICH ALLOW OVERLAY SWITCHING TO OCCURR.
     41					;
     42					; INPUTS:
     43					;
     44					;	FILE HEADER IN .HDBUF
     45					;	R4 = VCB ADDRESS
     46					;
     47					; OUTPUTS:
     48					;
     49					;	NEW FILE HEADER IN .HDBUF
     50					;	R0 - R3 ALTERED
     51					;	R4 - R5 PRESERVED
     52					;	INDEX FILE BITMAP ALTERED
     53					;	OLD HEADER WRITTEN OUT
     54					;
EXTHD	D0213, CREATE AN EXTENS	MACRO M1108  05-DEC-77 17:06  PAGE 6-1


     55					;-
     56
     57	000000				.EXTHD::
     58	000000	016700 	000000G			MOV	.EXFCB,R0	; POINT TO CURRENT FCB
     59	000004	001422 				BEQ	20$		; IS NONE
     60	000006	020067 	000000G			CMP	R0,.FCBAD	; IS THIS THE PRIMARY FCB?
     61	000012	001402 				BEQ	10$		; IF SO, WE'LL GET IT LATER
     62	000014					CALL	.INFCB		; SET UP CORRECT FILE SIZE
     63	000020	016700 	000000G		10$:	MOV	.FCBAD,R0	; GET FCB ADDRESS, IF ANY
     64	000024	016002 	000032 			MOV	F.SIZE(R0),R2	; GET OLD FILE SIZE
     65	000030	016003 	000034 			MOV	F.SIZE+2(R0),R3
     66	000034	016700 	000000G			MOV	.EXFCB,R0	; POINT TO CURRENT FCB
     67	000040	016701 	000000G			MOV	.WNDOW,R1	; GET WINDOW ADDRESS
     68	000044	001402 				BEQ	20$		; IS NONE
     69	000046					CALL	.WTRN1		; TURN WINDOW TO INCLUDE EXTEND SO FAR
     70	000052				20$:	CALL	.WRHDR		; WRITE OUT THIS HEADER
     71	000056	105267 	000000G			INCB	.EXSTS		; INDICATE HEADER WRITTEN
     72					;
     73					; ALLOCATE A NEW FILE NUMBER
     74					;
     75	000062	016746 	000002G			MOV	.HDBUF+H.FNUM,-(SP) ; SAVE FILE NO. OF OLD HEADER
     76	000066					CALL	.CRFID		; CREATE A NEW HEADER
     77	000072	103540 				BCS	60$		; INDEX FILE FULL
     78	000074	105267 	000000G			INCB	.EXSTS		; INDICATE NEW HEADER BEING CREATED
     79	000100	010067 	000000G			MOV	R0,.EXFNU	; SAVE NEW FILE NUMBER
     80	000104					CALL	.MPHDR		; FIND LBN OF NEW HEADER
     81	000110	103001 				BCC	30$
     82	000112					FATAL	<FAILED TO MAP FILE HEADER>
	000112	000004 				IOT			; *** FATAL ERROR FAILED TO MAP FILE HEADER
     83
     84	000114	012701 	000000G		30$:	MOV	#.HDBUF,R1
     85	000120					CALL	.RD1LB		; READ IN THE OLD FILE HEADER
     86	000124	012600 				MOV	(SP)+,R0	; GET BACK OLD FILE NUMBER
     87	000126	016746 	000004G			MOV	.HDBUF+H.FSEQ,-(SP) ; SAVE THE FILE SEQUENCE NUMBER
     88	000132	005216 				INC	(SP)		; MAKE IT PLUS 1
     89	000134	005067 	000000G			CLR	.HDUCB		; INVALIDATE THE HEADER BUFFER
     90	000140	010346 				MOV	R3,-(SP)	; SAVE NEW HEADER LBN
     91	000142	010246 				MOV	R2,-(SP)	; HIGH ORDER
     92					;
     93					; LINK THE NEW FILE ID INTO THE OLD HEADER
     94					;
     95	000144					CALL	.RHDFN		; READ BACK THE OLD HEADER
     96	000150					CALL	.GTMAP		; POINT TO MAP AREA
     97	000154					ASSUME	M.ESQN,0
     98	000154					ASSUME	M.EFNU,M.ESQN+2
     99	000154					ASSUME	M.EFSQ,M.EFNU+2
    100	000154	005721 				TST	(R1)+		; SAVE FILE SEGMENT NUMBER
    101	000156	016721 	000000G			MOV	.EXFNU,(R1)+	; PUT NEW FILE NUMBER IN HEADER
    102	000162	016611 	000004 			MOV	4(SP),(R1)	; PUT IN FILE SEQUENCE NUMBER
    103	000166					CALL	.WRHDR		; WRITE OUT THE HEADER
    104					;
    105					; NOW INIT THE NEW HEADER
    106					;
    107	000172	012701 	000000G			MOV	#.HDLBN,R1	; POINT TO BUFFER PARAMETERS
    108	000176	012621 				MOV	(SP)+,(R1)+	; SET UP BUFFER LBN
    109	000200	012621 				MOV	(SP)+,(R1)+
    110	000202	005721 				TST	(R1)+		; SKIP OVER OFFSET BYTES
EXTHD	D0213, CREATE AN EXTENS	MACRO M1108  05-DEC-77 17:06  PAGE 6-2


    111	000204					ASSUME	H.FNUM,2
    112	000204					ASSUME	H.FSEQ,H.FNUM+2
    113	000204	016721 	000000G			MOV	.EXFNU,(R1)+	; PUT FILE NUMBER IN HEADER
    114	000210	012611 				MOV	(SP)+,(R1)	; PUT IN FILE SEQUENCE NUMBER
    115
    116	000212					CALL	.GTMAP		; POINT TO MAP AREA
    117	000216					ASSUME	M.ESQN,0
    118	000216					ASSUME	M.EFNU,M.ESQN+2
    119	000216					ASSUME	M.EFSQ,M.EFNU+2
    120	000216					ASSUME	M.USE,M.EFSQ+4
    121	000216					ASSUME	M.MAX,M.USE+1
    122	000216					ASSUME	M.RTRV,M.MAX+1
    123	000216	005221 				INC	(R1)+		; BUMP SEGMENT NUMBER BY 1
    124	000220	005021 				CLR	(R1)+		; CLEAN OUT EXTENSION FID
    125	000222	005021 				CLR	(R1)+
    126	000224	005721 				TST	(R1)+		; SKIP POINTER FORMAT WORD
    127	000226	105021 				CLRB	(R1)+		; ZERO USED POINTER COUNT
    128	000230	005002 				CLR	R2
    129	000232	152102 				BISB	(R1)+,R2	; GET SIZE OF MAP AREA
    130	000234	005021 			40$:	CLR	(R1)+		; CLEAR REST OF MAP AREA
    131	000236	077202 				SOB	R2,40$
    132	000240	105367 	000000G			DECB	.EXSTS		; INDICATE HEADER CREATION COMPLETE
    133	000244	105367 	000000G			DECB	.EXSTS
    134	000250	005267 	000000G			INC	.EXNHD		; COUNT THE NEW HEADER
    135					;
    136					; CREATE A NEW FCB FOR THIS HEADER IF FCB'S EXIST FOR THIS FILE
    137					;
    138	000254	005767 	000000G			TST	.FCBAD		; SEE IF FCB'S EXIST
    139	000260	001443 				BEQ	50$		; NO
    140	000262					CALL	.CRFCB		; YES - CREATE A NEW ONE
    141	000266	010074 	000010 			MOV	R0,@V.FCB+2(R4)	; LINK INTO FCB CHAIN
    142	000272	010064 	000010 			MOV	R0,V.FCB+2(R4)
    143	000276	016701 	000000G			MOV	.EXFCB,R1	; GET ADDR OF CURRENT FCB FOR THIS FILE
    144	000302	010061 	000002 			MOV	R0,F.FEXT(R1)	; PUT NEW FCB INTO EXTENSION LINKAGE
    145	000306	005002 				CLR	R2
    146	000310	156702 	000001G			BISB	.IOSTS+1,R2	; GET NUMBER OF BLOCKS ALLOCATED SO FAR
    147	000314	016703 	000002G			MOV	.IOSTS+2,R3
    148	000320	016701 	000000G			MOV	.FCBAD,R1	; GET PRIMARY FCB
    149	000324	066102 	000032 			ADD	F.SIZE(R1),R2	; COMPUTE CURRENT FILE SIZE
    150	000330	066103 	000034 			ADD	F.SIZE+2(R1),R3
    151	000334	005502 				ADC	R2
    152	000336	166702 	000000G			SUB	.SM1BT,R2	; DEDUCT BLOCKS ALLOCATED BUT NOT YET MAPPED
    153	000342	166703 	000002G			SUB	.SM1BT+2,R3	; TO GET FILE SIZE UP TO THIS HEADER
    154	000346	005602 				SBC	R2
    155	000350	060260 	000046 			ADD	R2,F.FVBN(R0)	; AND USE TO SET UP STARTING VBN
    156	000354	060360 	000050 			ADD	R3,F.FVBN+2(R0)	; FOR THE NEW FCB
    157	000360	005560 	000046 			ADC	F.FVBN(R0)
    158	000364	010067 	000000G			MOV	R0,.EXFCB	; MAKE NEW FCB CURRENT
    159	000370	000177 	000000G		50$:	JMP	@.EXCM2		; RETURN TO THE EXTEND
    160					;
    161					; THERE IS NO SPACE IN THE INDEX FILE FOR ANOTHER HEADER. WE MUST (SHUDDER)
    162					; UNWIND THE ENTIRE EXTEND DONE SO FAR, EXTEND THE INDEX FILE, AND THEN
    163					; RETRY THE OPERATION.
    164					;
    165	000374				60$:	PUSH	R0		; SAVE THE DESIRED FILE NUMBER
    166	000376	000177 	000000G			JMP	@.CLEX2		; CALL CLEAN UP ROUTINE
    167									; AFTER WHICH THE CALL IS RE-DISPATCHED
EXTHD	D0213, CREATE AN EXTENS	MACRO M1108  05-DEC-77 17:06  PAGE 6-3


    168					;
    169					;
    170	000402					$END	EXTHD
    171					;
    172					;
    173		000001 				.END
EXTHD	D0213, CREATE AN EXTENS	MACRO M1108  05-DEC-77 17:06  PAGE 6-4
SYMBOL TABLE

AC.DLK= 000002   	F.RVN   000012   	I.FNBP  000036   	SC.BAD= 000100   	W.RTRV  000012
AC.LCK= 000001   	F.SCHA  000021   	I.FTYP= 000006   	SC.MDL= 000200   	W.STD   000004
BITFNU= 000002   	F.SIZE  000032   	I.FVER= 000010   	S.HDHD= 000056   	W.VBN   000006
EX.AC1= 000001   	F.STAT  000040   	I.IOSB  000016   	S.IDHD= 000056   	W.WISZ  000007
EX.AC2= 000002   	F.STD   000004   	I.LGTH  000040   	S.MPHD= 000012   	$$    = 000067
EX.ADF= 000010   	F.UCHA  000020   	I.LNK   000000   	S.STBK= 000012   	.CLEX2= ****** GX
EX.ENA= 000200   	F11PR$= 000000   	I.LUN   000012   	UC.CON= 000200   	.CRFCB= ****** GX
EX.FCO= 000004   	HIFCN = 000030   	I.PRI   000010   	UC.DLK= 000100   	.CRFID= ****** GX
E$$MSG= 000001   	H.CKSM= 000776   	I.PRM   000024   	VC.BMW= 000002   	.DFEXT= 000005
E$$TRP= 000001   	H.FCHA= 000014   	I.RTRV  000034   	VC.IFW= 000001   	.DFPRO= 164000
FCPLUN= 000001   	H.FLEV= 000006   	I.RVDT= 000014   	V.FCB   000006   	.EXCM2= ****** GX
FC.CEF= 020000   	H.FNUM= 000002   	I.RVNO= 000012   	V.FFNU  000055   	.EXFCB= ****** GX
FC.DIR= 040000   	H.FOWN= 000010   	I.RVTI= 000023   	V.FIEX  000025   	.EXFNU= ****** GX
FC.FCO= 010000   	H.FPRO= 000012   	I.RWAD= 000024   	V.FMAX  000016   	.EXNHD= ****** GX
FC.WAC= 100000   	H.FSEQ= 000004   	I.RWAT  000026   	V.FPRO  000030   	.EXSTS= ****** GX
FP.DEL= 000010   	H.IDOF= 000000   	I.RWCT= 000026   	V.FRBK  000034   	.EXTHD  000000RG
FP.EXT= 000004   	H.MPOF= 000001   	I.RWVB= 000032   	V.IBLB  000012   	.FCBAD= ****** GX
FP.RAT= 000001   	H.PROG= 000010   	I.STD   000004   	V.IBSZ  000013   	.GTMAP= ****** GX
FP.RDV= 000001   	H.PROJ= 000011   	I.TISZ= 000006   	V.IFWI  000002   	.HDBUF= ****** GX
FP.WRV= 000002   	H.SCHA= 000015   	I.UIC   000022   	V.LABL  000040   	.HDLBN= ****** GX
F$$LVL= 000001   	H.UCHA= 000014   	LEV11M= 000401   	V.LGTH  000056   	.HDUCB= ****** GX
F.DREF  000042   	H.UFAT= 000016   	LOWFCN= 000011   	V.LRUC  000035   	.INFCB= ****** GX
F.DRNM  000044   	IDXFNU= 000001   	MFDFNO= 000004   	V.SBCL  000021   	.IOSTS= ****** GX
F.FEXT  000002   	ID$$$ = 000213   	MFDFSQ= 000004   	V.SBLB  000024   	.MPHDR= ****** GX
F.FNUM  000006   	I.ACTL  000035   	M$$HDR= 000001   	V.SBSZ  000022   	.PRFIL= 000004
F.FOWN  000014   	I.AST   000020   	M.CTSZ= 000006   	V.STAT  000054   	.RD1LB= ****** GX
F.FPRO  000016   	I.ATL   000006   	M.EFNU= 000002   	V.STD   000004   	.RHDFN= ****** GX
F.FSEQ  000010   	I.CRDT= 000031   	M.EFSQ= 000004   	V.TRCT  000000   	.RTPTF= 001401
F.FSQN  000013   	I.CRTI= 000040   	M.ERVN= 000001   	V.WISZ  000020   	.SM1BT= ****** GX
F.FVBN  000046   	I.DASZ= 000007   	M.ESQN= 000000   	WI.BPS= 100000   	.SYUIC= 000010
F.HDLB  000022   	I.DPB   000011   	M.LBSZ= 000007   	WI.DLK= 010000   	.VBSIZ= 001000
F.LBN   000026   	I.EFN   000013   	M.MAX = 000011   	WI.EXT= 002000   	.WNDOW= ****** GX
F.LGTH  000052   	I.EXDT= 000046   	M.RTRV= 000012   	WI.LCK= 004000   	.WRHDR= ****** GX
F.LINK  000000   	I.EXTD  000030   	M.USE = 000010   	WI.RDV= 000400   	.WTRN1= ****** GX
F.NACS  000036   	I.FCN   000014   	QIOEFN= 000002   	WI.WRV= 001000   	...GBL= 000000
F.NLCK  000037   	I.FIDP  000024   	R$$10F= 000001   	W.CTL   000000   	...TPC= 000012
F.NWAC  000040   	I.FNAM= 000000   	R$$11D= 000001   	W.FCB   000002

. ABS.	000056	   000
      	000402	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2625 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:23
[40,10]EXTHD,[40,20]EXTHD/-SP=[40,30]RSXDC,F11PRE,EXTHD
RSXDC	MACRO M1108  05-DEC-77 17:07  PAGE 3


      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.
FDRMV	D0201, FIND/REMOVE DIRE	MACRO M1108  05-DEC-77 17:07  PAGE 6


      1						.TITLE	FDRMV	D0201, FIND/REMOVE DIRECTORY ENTRY
						.IDENT	"D0201"
      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					;
					; VERSION D201, ASSEMBLED FOR RSX-11D
					;
     22
     23					; ANDREW C. GOLDSTEIN  10 SEP 74  12:44:15
     24					; PETER H. LIPMAN	7-JUN-74
     25					;
     26					; COMMON CODE TO FIND OR REMOVE A DIRECTORY ENTRY
     27					;
     28					;
     29					;+
     30					; **-.FDRMV-FIND/REMOVE DIRECTORY ENTRY
     31					;
     32					; THIS ROUTINE CHECKS TO SEE THAT THE CALLER MAY ACCESS THE DIRECTORY AS
     33					; DESIRED, PERFORMS THE LOCATE OPERATION ON THE FILE NAME BLOCK, AND IF
     34					; SUCCESSFUL RETURNS THE INFORMATION IN THE FILE NAME BLOCK.
     35					;
     36					; INPUTS:
     37					;
     38					; 	R0=ACCESS CODE 1=R, 2=RW
     39					; 	R4=VOLUME CONTROL BLOCK
     40					; 	R5=SCRATCH FILE NAME BLOCK.
     41					;
     42					; OUTPUTS:
     43					;
     44					; 	C=0 IF SUCCESSFUL, C=1 IF ENTRY NOT FOUND
     45					; 	IF C=0, THEN
     46					; 		R0=RECORD NUMBER FOUND
     47					; 		R1=ADDRESS IN BUFFER OF DIRECTORY ENTRY
     48					; 		R2,R3 ALTERED
     49					; 		R4,R5 PRESERVED
     50					; 	IF C=1, THEN
     51					; 		R0-R3 ALTERED
     52					; 		R4,R5 PRESERVED
     53					;
     54					;-
FDRMV	D0201, FIND/REMOVE DIRE	MACRO M1108  05-DEC-77 17:07  PAGE 6-1


     55
     56	000000				.FDRMV::
     57	000000	016701 	000000G			MOV	.FCBAD,R1	; R1=FCB ADDRESS
     58	000004	016103 	000016 			MOV	F.FPRO(R1),R3	; R3=PROTECTION WORD
     59	000010	016102 	000014 			MOV	F.FOWN(R1),R2	; R2=OWNER'S UIC
     60	000014	016705 	000000G			MOV	.IOPKT,R5	; GET I/O PACKET ADDRESS
     61	000020					CALL	.PRCK3		; CHECK FILE PROTECTION
     62	000024	012705 	000000G			MOV	#.DRFNB,R5	; POINT TO FNB AGAIN
     63	000030	005015 				CLR	(R5)		; FORCE NO. TO ZERO (NOT FOUND)
     64	000032					CALL	.LOCAT
     65	000036	016702 	000000G			MOV	.DRLVB,R2	; CHANGE THE DIRECTORY EOF?
     66	000042	001414 				BEQ	20$		;
     67	000044	006046 				ROR	-(SP)		; SAVE CARRY
     68	000046	016703 	000000G			MOV	.FCBAD,R3	;
     69	000052	020263 	000042 			CMP	R2,F.DREF(R3)
     70	000056	103005 				BHIS	10$
     71	000060	010263 	000042 			MOV	R2,F.DREF(R3)
     72	000064	052763 	020000 	000040 		BIS	#FC.CEF,F.STAT(R3) ; NOTE EOF CHANGED
     73	000072	006126 			10$:	ROL	(SP)+		; RESTORE CARRY
     74	000074	103004 			20$:	BCC	30$		; BRANCH IF LOCATE SUCCEEDED
     75					;
     76					; LOCATE FAILED, INDICATE FILE NOT FOUND
     77					;
     78	000076	005065 	000000G			CLR	N.NEXT(R5)	; ZERO THE FIND/REMOVE NEXT CONTEXT
     79	000102					ERR	IE.NSF,<FILE NOT FOUND> ; SETS CARRY TOO!
	000102	   000G	   211 			TRAP	IE.NSF		; FILE NOT FOUND
     80	000104					RETURN
     81					;
     82					; R0=RECORD #, R1=RECORD ADDRESS, R5=SCRATCH FNB
     83					;
     84	000106	010102 			30$:	MOV	R1,R2		; R2=ADDRESS TO MOVE FROM
     85	000110	012703 	000000C			MOV	#S.NFEN/2,R3	; R3=SIZE IN WORDS OF DIRECTORY ENTRY
     86	000114	010546 				MOV	R5,-(SP)	; SAVE FNB ADDRESS
     87	000116	012225 			40$:	MOV	(R2)+,(R5)+	; MOVE DIRECTORY ENTRY TO FNB
     88	000120	077302 				SOB	R3,40$		;
     89	000122	032725 	000000C			BIT	#NB.SVR!NB.STP!NB.SNM,(R5)+ ; ANY WILD CARDS
     90	000126	001401 				BEQ	50$		; BRANCH IF NO, N.NEXT =0
     91	000130	010003 				MOV	R0,R3		; R3=RECORD NO. TO START NEXT SEARCH
     92	000132	010315 			50$:	MOV	R3,(R5)		; SET FIND/REMOVE NEXT CONTEXT
     93	000134	012605 				MOV	(SP)+,R5	; RESTORE R5
     94	000136	000241 				CLC
     95	000140					RETURN
     96
     97					;
     98					;
     99	000142					$END	FDRMV
    100					;
    101					;
    102		000001 				.END
FDRMV	D0201, FIND/REMOVE DIRE	MACRO M1108  05-DEC-77 17:07  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NLCK  000037   	I.EXDT= 000046   	M.LBSZ= 000007   	V.SBLB  000024
AC.LCK= 000001   	F.NWAC  000040   	I.EXTD  000030   	M.MAX = 000011   	V.SBSZ  000022
BITFNU= 000002   	F.RVN   000012   	I.FCN   000014   	M.RTRV= 000012   	V.STAT  000054
EX.AC1= 000001   	F.SCHA  000021   	I.FIDP  000024   	M.USE = 000010   	V.STD   000004
EX.AC2= 000002   	F.SIZE  000032   	I.FNAM= 000000   	NB.SNM= ****** GX	V.TRCT  000000
EX.ADF= 000010   	F.STAT  000040   	I.FNBP  000036   	NB.STP= ****** GX	V.WISZ  000020
EX.ENA= 000200   	F.STD   000004   	I.FTYP= 000006   	NB.SVR= ****** GX	WI.BPS= 100000
EX.FCO= 000004   	F.UCHA  000020   	I.FVER= 000010   	N.NEXT= ****** GX	WI.DLK= 010000
E$$MSG= 000001   	F11PR$= 000000   	I.IOSB  000016   	QIOEFN= 000002   	WI.EXT= 002000
E$$TRP= 000001   	HIFCN = 000030   	I.LGTH  000040   	R$$10F= 000001   	WI.LCK= 004000
FCPLUN= 000001   	H.CKSM= 000776   	I.LNK   000000   	R$$11D= 000001   	WI.RDV= 000400
FC.CEF= 020000   	H.FCHA= 000014   	I.LUN   000012   	SC.BAD= 000100   	WI.WRV= 001000
FC.DIR= 040000   	H.FLEV= 000006   	I.PRI   000010   	SC.MDL= 000200   	W.CTL   000000
FC.FCO= 010000   	H.FNUM= 000002   	I.PRM   000024   	S.HDHD= 000056   	W.FCB   000002
FC.WAC= 100000   	H.FOWN= 000010   	I.RTRV  000034   	S.IDHD= 000056   	W.RTRV  000012
FP.DEL= 000010   	H.FPRO= 000012   	I.RVDT= 000014   	S.MPHD= 000012   	W.STD   000004
FP.EXT= 000004   	H.FSEQ= 000004   	I.RVNO= 000012   	S.NFEN= ****** GX	W.VBN   000006
FP.RAT= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	S.STBK= 000012   	W.WISZ  000007
FP.RDV= 000001   	H.MPOF= 000001   	I.RWAD= 000024   	UC.CON= 000200   	$$    = 000067
FP.WRV= 000002   	H.PROG= 000010   	I.RWAT  000026   	UC.DLK= 000100   	.DFEXT= 000005
F$$LVL= 000001   	H.PROJ= 000011   	I.RWCT= 000026   	VC.BMW= 000002   	.DFPRO= 164000
F.DREF  000042   	H.SCHA= 000015   	I.RWVB= 000032   	VC.IFW= 000001   	.DRFNB= ****** GX
F.DRNM  000044   	H.UCHA= 000014   	I.STD   000004   	V.FCB   000006   	.DRLVB= ****** GX
F.FEXT  000002   	H.UFAT= 000016   	I.TISZ= 000006   	V.FFNU  000055   	.FCBAD= ****** GX
F.FNUM  000006   	IDXFNU= 000001   	I.UIC   000022   	V.FIEX  000025   	.FDRMV  000000RG
F.FOWN  000014   	ID$$$ = 000201   	LEV11M= 000401   	V.FMAX  000016   	.IOPKT= ****** GX
F.FPRO  000016   	IE.NSF= ****** GX	LOWFCN= 000011   	V.FPRO  000030   	.LOCAT= ****** GX
F.FSEQ  000010   	I.ACTL  000035   	MFDFNO= 000004   	V.FRBK  000034   	.PRCK3= ****** GX
F.FSQN  000013   	I.AST   000020   	MFDFSQ= 000004   	V.IBLB  000012   	.PRFIL= 000004
F.FVBN  000046   	I.ATL   000006   	M$$HDR= 000001   	V.IBSZ  000013   	.RTPTF= 001401
F.HDLB  000022   	I.CRDT= 000031   	M.CTSZ= 000006   	V.IFWI  000002   	.SYUIC= 000010
F.LBN   000026   	I.CRTI= 000040   	M.EFNU= 000002   	V.LABL  000040   	.VBSIZ= 001000
F.LGTH  000052   	I.DASZ= 000007   	M.EFSQ= 000004   	V.LGTH  000056   	...GBL= 000000
F.LINK  000000   	I.DPB   000011   	M.ERVN= 000001   	V.LRUC  000035   	...TPC= 000012
F.NACS  000036   	I.EFN   000013   	M.ESQN= 000000   	V.SBCL  000021

. ABS.	000056	   000
      	000142	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2605 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:20
[40,10]FDRMV,[40,20]FDRMV/-SP=[40,30]RSXDC,F11PRE,FDRMV
RSXDC	MACRO M1108  05-DEC-77 17:07  PAGE 3


      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.
FNDNM	D0201, FIND NAME QI/O	MACRO M1108  05-DEC-77 17:07  PAGE 6


      1						.TITLE	FNDNM	D0201, FIND NAME QI/O
						.IDENT	"D0201"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D201, ASSEMBLED FOR RSX-11D
					;
     22
     23					; ANDREW C. GOLDSTEIN  10 SEP 74  12:45:19
     24					; PETER H. LIPMAN	7-JUN-74
     25					;
     26					; FIND FILE NAME IN DIRECTORY
     27					;
     28
     29					;+
     30					; **-.FNDNM-FIND NAME QI/O
     31					;
     32					; THIS ROUTINE IMPLEMENTS THE FIND NAME QI/O. THE I/O PACKET CONTAINS ONLY
     33					; A FILENAME BLOCK ADDRESS, ALL OTHER WORDS IN THE FUNCTION DEPENDENT
     34					; PARAMETERS MUST BE ZERO.
     35					; 	IF THE DIRECTORY TO BE SEARCHED IS THE MFD ((-1,-1)=(4,4)) THEN
     36					; THIS ROUTINE PERFORMS A SPECIAL SCAN OF THE FCB LIST TO SEE IF A "PRE-
     37					; ACCESSED" DIRECTORY CAN BE FOUND THE OWNER OF WHICH MATCHES THE OWNER
     38					; SPECIFIED IN THE THIRD WORD OF THE DIRECTORY ID. IF THIS IS FOUND THE
     39					; FILE ID IS RETURNED AND THE MFD SCAN WAS AVOIDED.
     40					; 	IN A NORMAL SCAN OF A DIRECTORY TO FIND A SPECIFIED NAME, THE FIRST
     41					; OPERATION IS TO "ACCESS" THE DIRECTORY. FIRST A CHECK IS MADE TO SEE IF THE
     42					; DIRECTORY IS "PRE-ACCESSED" (I.E. IS AN FCB IN THE FCB LIST WITH THE
     43					; CORRESPONDING FILE ID AND THE FC.DIR BIT SET IN F.STAT). IF IT IS PRE-
     44					; ACCESSED, THEN IT IS UNNECESSARY TO READ THE DIRECTORY FILE HEADER. IF
     45					; THE DIRECTORY WAS NOT PREACCESSED A ROUTINE IS CALLED TO ACCESS IT. IF THE
     46					; DIRECTORY IS CONTIGUOUS IT IS THEN SET UP AS PREACCESSED SO THAT FUTURE
     47					; OPERATIONS WILL BE FASTER.
     48					; 	FINALLY THE DIRECTORY IS READ AND SEARCHED, SEE .LOCAT FOR DOCUMENTATION.
     49					;-
     50
     51	000000				.FNDNM::
     52	000000					CALL	.DRINI		; INITIALIZE FOR DIRECTORY OPERATION
     53	000004	005767 	000000G			TST	.FCBAD		; IF THE FCB IS ALREADY SET UP
     54	000010	001047 				BNE	50$		; THEN SKIP THIS
FNDNM	D0201, FIND NAME QI/O	MACRO M1108  05-DEC-77 17:07  PAGE 6-1


     55	000012	022767 	000004 	000000G		CMP	#MFDFNO,.FILNO	; IF DESIRED DIRECTORY IS MFD
     56	000020	001036 				BNE	40$
     57	000022	022767 	000004 	000000G		CMP	#MFDFSQ,.FILSQ
     58	000030	001032 				BNE	40$
     59					;
     60					; SCAN THE FCB LIST FOR A DIRECTORY FILE OWNED BY THE SPECIFIED UIC. IF THIS
     61					; SCAN SUCCEEDS THEN THE MFD SEARCH FOR A UFD WILL BE COMPLETE.
     62					;
     63	000032	016403 	000006 			MOV	V.FCB(R4),R3	; R3=1ST FCB IN LIST
     64	000036	001427 			10$:	BEQ	40$		; BRANCH IF END OF FCB LIST
     65	000040	032763 	040000 	000040 		BIT	#FC.DIR,F.STAT(R3) ; IS THIS A DIRECTORY
     66	000046	001412 				BEQ	20$		; BRANCH IF NO
     67	000050	026563 	000004G	000014 		CMP	N.DID+4(R5),F.FOWN(R3) ; OWNER SAME AS SPECIFIED
     68	000056	001006 				BNE	20$		; BRANCH IF NO
     69	000060	016300 	000044 			MOV	F.DRNM(R3),R0	; IF 1ST WORD OF DIRECTORY FILE NAME NOT 0
     70	000064	001403 				BEQ	20$
     71	000066	020065 	000000G			CMP	R0,N.FNAM(R5)	; AND IT EQUALS DESIRED FILE NAME
     72	000072	001402 				BEQ	30$		; THEN UFD IS FOUND
     73	000074	011303 			20$:	MOV	(R3),R3		;
     74	000076	000757 				BR	10$
     75					;
     76					; R3=FCB OF DESIRED UFD, STORE FILE ID
     77					;
     78	000100	010500 			30$:	MOV	R5,R0		; R0=FNB ADDRESS
     84	000102	062703 	000006 			ADD	#F.FNUM,R3	; BUMP TO FILE NUMBER
     86	000106	012320 				MOV	(R3)+,(R0)+	; MOVE FILE NUMBER
     87	000110	011320 				MOV	(R3),(R0)+	; MOVE FILE SEQUENCE NUMBER
     88	000112	005010 				CLR	(R0)
     89	000114	000411 				BR	60$
     90	000116				40$:	CALL	.DRPAC		; SEE IF DIRECTORY IS PREACCESSED
     91	000122	103002 				BCC	50$		; BRANCH IF ITS
     92	000124	000177 	000000G			JMP	@.DRAC1		; GO ACCESS IT
     93	000130	012700 	000001 		50$:	MOV	#FP.RDV,R0	; ACCESS CHECK FOR READ ONLY
     94	000134					CALL	.FDRMV		; COMMON CODE FOR FIND/REMOVE
     95	000140				60$:	CALL	.DREX		; PERFORM COMMON EXIT CODE
     96	000144					CALLR	.CLDIR		; AND "DEACCESS" THE DIRECTORY
     97					;
     98					;
     99	000150					$END	FNDNM
    100					;
    101					;
    102		000001 				.END
FNDNM	D0201, FIND NAME QI/O	MACRO M1108  05-DEC-77 17:07  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NLCK  000037   	I.EXTD  000030   	M.MAX = 000011   	V.STD   000004
AC.LCK= 000001   	F.NWAC  000040   	I.FCN   000014   	M.RTRV= 000012   	V.TRCT  000000
BITFNU= 000002   	F.RVN   000012   	I.FIDP  000024   	M.USE = 000010   	V.WISZ  000020
EX.AC1= 000001   	F.SCHA  000021   	I.FNAM= 000000   	N.DID = ****** GX	WI.BPS= 100000
EX.AC2= 000002   	F.SIZE  000032   	I.FNBP  000036   	N.FNAM= ****** GX	WI.DLK= 010000
EX.ADF= 000010   	F.STAT  000040   	I.FTYP= 000006   	QIOEFN= 000002   	WI.EXT= 002000
EX.ENA= 000200   	F.STD   000004   	I.FVER= 000010   	R$$10F= 000001   	WI.LCK= 004000
EX.FCO= 000004   	F.UCHA  000020   	I.IOSB  000016   	R$$11D= 000001   	WI.RDV= 000400
E$$MSG= 000001   	F11PR$= 000000   	I.LGTH  000040   	SC.BAD= 000100   	WI.WRV= 001000
E$$TRP= 000001   	HIFCN = 000030   	I.LNK   000000   	SC.MDL= 000200   	W.CTL   000000
FCPLUN= 000001   	H.CKSM= 000776   	I.LUN   000012   	S.HDHD= 000056   	W.FCB   000002
FC.CEF= 020000   	H.FCHA= 000014   	I.PRI   000010   	S.IDHD= 000056   	W.RTRV  000012
FC.DIR= 040000   	H.FLEV= 000006   	I.PRM   000024   	S.MPHD= 000012   	W.STD   000004
FC.FCO= 010000   	H.FNUM= 000002   	I.RTRV  000034   	S.STBK= 000012   	W.VBN   000006
FC.WAC= 100000   	H.FOWN= 000010   	I.RVDT= 000014   	UC.CON= 000200   	W.WISZ  000007
FP.DEL= 000010   	H.FPRO= 000012   	I.RVNO= 000012   	UC.DLK= 000100   	$$    = 000067
FP.EXT= 000004   	H.FSEQ= 000004   	I.RVTI= 000023   	VC.BMW= 000002   	.CLDIR= ****** GX
FP.RAT= 000001   	H.IDOF= 000000   	I.RWAD= 000024   	VC.IFW= 000001   	.DFEXT= 000005
FP.RDV= 000001   	H.MPOF= 000001   	I.RWAT  000026   	V.FCB   000006   	.DFPRO= 164000
FP.WRV= 000002   	H.PROG= 000010   	I.RWCT= 000026   	V.FFNU  000055   	.DRAC1= ****** GX
F$$LVL= 000001   	H.PROJ= 000011   	I.RWVB= 000032   	V.FIEX  000025   	.DREX = ****** GX
F.DREF  000042   	H.SCHA= 000015   	I.STD   000004   	V.FMAX  000016   	.DRINI= ****** GX
F.DRNM  000044   	H.UCHA= 000014   	I.TISZ= 000006   	V.FPRO  000030   	.DRPAC= ****** GX
F.FEXT  000002   	H.UFAT= 000016   	I.UIC   000022   	V.FRBK  000034   	.FCBAD= ****** GX
F.FNUM  000006   	IDXFNU= 000001   	LEV11M= 000401   	V.IBLB  000012   	.FDRMV= ****** GX
F.FOWN  000014   	ID$$$ = 000201   	LOWFCN= 000011   	V.IBSZ  000013   	.FILNO= ****** GX
F.FPRO  000016   	I.ACTL  000035   	MFDFNO= 000004   	V.IFWI  000002   	.FILSQ= ****** GX
F.FSEQ  000010   	I.AST   000020   	MFDFSQ= 000004   	V.LABL  000040   	.FNDNM  000000RG
F.FSQN  000013   	I.ATL   000006   	M$$HDR= 000001   	V.LGTH  000056   	.PRFIL= 000004
F.FVBN  000046   	I.CRDT= 000031   	M.CTSZ= 000006   	V.LRUC  000035   	.RTPTF= 001401
F.HDLB  000022   	I.CRTI= 000040   	M.EFNU= 000002   	V.SBCL  000021   	.SYUIC= 000010
F.LBN   000026   	I.DASZ= 000007   	M.EFSQ= 000004   	V.SBLB  000024   	.VBSIZ= 001000
F.LGTH  000052   	I.DPB   000011   	M.ERVN= 000001   	V.SBSZ  000022   	...GBL= 000000
F.LINK  000000   	I.EFN   000013   	M.ESQN= 000000   	V.STAT  000054   	...TPC= 000012
F.NACS  000036   	I.EXDT= 000046   	M.LBSZ= 000007

. ABS.	000056	   000
      	000150	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2570 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:20
[40,10]FNDNM,[40,20]FNDNM/-SP=[40,30]RSXDC,F11PRE,FNDNM
RSXDC	MACRO M1108  05-DEC-77 16:53  PAGE 3


      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.
F11CM	D0211, F11ACP COMMON DA	MACRO M1108  05-DEC-77 16:53  PAGE 6


      1						.TITLE	F11CM	D0211, F11ACP COMMON DATA AREA
						.IDENT	"D0211"
      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					;
					; VERSION D211, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  6 DEC 74  11:37
     23					; PETER H. LIPMAN	17-JAN-74
     24					;
     25					; COMMON DATA USED THROUGHOUT F11ACP
     26					;
     27	000000				.STACK::			; STACK STARTS HERE
     28
     29					; I/O BUFFERS
     30					; FILE HEADER BUFFER AND DIRECTORY BLOCK BUFFER ARE OVERLAPPED BY
     31					; DEFAULT. TO ALLOCATE SEPARATE BUFFERS, EXTEND PSECT $$BUF1 BY 259 WORDS.
     32
     33					;
     34					; STORAGE MAP BUFFER AND ASSOCIATED STORAGE
     35					;
     36	000000					.PSECT	$$BUF1,RW,D,LCL,REL,CON
     37
     38	000000				.SMUCB::.BLKW	1		; UCB OF STORAGE BIT MAP BUFFER
     39	000002				.SMVBN::.BLKW	1		; CURRENT VBN OR 0 IF BUFFER EMPTY
     40		100000 				.SMFLG==100000		; SIGN BIT OF .SMVBN=DIRTY BIT
     41	000004				.SMBUF::.BLKB	.VBSIZ		; STORAGE MAP BUFFER
     42
     43					; FILE HEADER BUFFER - MAY OVERLAP DIRECTORY BUFFER BELOW
     44
     45		001004'			.HDUCB==.			; UCB OF HEADER BUFFER - 0 IF EMPTY
     46		001006'			.HDLBN==.HDUCB+2		; LBN OF BLOCK IN BUFFER
     47		001012'			.HDBUF==.HDLBN+4		; HEADER BUFFER
     48
     49					; DIRECTORY BLOCK BUFFER
     50
     51	000000					.PSECT	$$BUF2,RW,D,LCL,REL,CON
     52
     53	000000				.DRUCB::.BLKW	1		; UCB OF DIRECTORY BUFFER
     54	000002				.DRLBN::.BLKW	2		; LBN OF DIRECTORY BLOCK
F11CM	D0211, F11ACP COMMON DA	MACRO M1108  05-DEC-77 16:53  PAGE 6-1


     55	000006				.DRBUF::.BLKB	.VBSIZ		; DIRECTORY BUFFER
     56
     57	000000					.CSECT
     58
     60					; RECEIVE BUFFER FOR SEND/REQUEST MESSAGES FROM I/O DRIVERS FOLLOWS
     61
     62	000000				.RCVBF::.BLKW	2		; SENDING TASK'S NAME
     63		000000'				.PTM0==	.RCVBF		; TEMPS FOR FILE PURGE
     64		000002'				.PTM1==	.RCVBF+2
     66	000004				.IOPKT::.BLKW	1		; I/O PACKET ADDRESS (ATL FOR I/O RUNDOWN)
     67	000006				.UCBAD::.BLKW	1		; UNIT CONTROL BLOCK ADDRESS
     69	000010				.IOFC::	.BLKW	1		; I/O FUNCTION CODE
     70
     71	000012				.ATLAD::.BLKW	1		; USER ATL ADDRESS FOR I/O RUNDOWN
     72	000014				.LUTN2::.BLKW	1		; IMAGE OF CONTENTS OF USER'S 2ND LUT WORD
     74	000016				.QIOST::.BLKW	2		; I/O STATUS BLOCK FOR QI/O
     75
     76					;
     77					; THE FOLLOWING LOCATIONS STARTING AT .IOSTS+2 ARE ZEROED BY
     78					; THE I/O FUNCTION DISPATCHER.
     79					;
     80
     81	000022				.IOSTS::.BLKW	2		; I/O STATUS WORDS, RETURN TO USER
     82	000026				.ERMSG::.BLKW	1		; ERROR MESSAGE CODE FOR TKTN MESSAGE
     83	000030				.FILNO::.BLKW	1		; CURRENT FILE NUMBER
     84	000032				.FILSQ::.BLKW	1		; CURRENT FILE SEQUENCE NUMBER
     85	000034				.WNDOW::.BLKW	1		; WINDOW ADDRESS
     86	000036				.FCBAD::.BLKW	1		; FILE CONTROL BLOCK ADDRESS
     87	000040				.EXDSP::.BLKB	1		; ERROR EXIT DISPATCH CODE
     88	000041				.EXSTS::.BLKB	1		; ERROR EXIT STATUS
     89	000042				.EXTSV::.BLKW	1		; SAVED CONTEXT FOR EXTEND.
     91	000044				.EXHDR::.BLKW	1		; FILE NUMBER OF STARTING HEADER
     92	000046				.EXNHD::.BLKW	1		; NUMBER OF EXTENSION HEADERS CREATED
     93	000050				.EXFNU::.BLKW	1		; FILE NUMBER OF CURRENT EXTENSION HEADER
     94	000052				.EXFCB::.BLKW	1		; FCB OF CURRENT HEADER IN EXTEND
     96		000014 				.ZERCT==<.-.IOSTS-2>/2	; NO. OF WORDS TO ZERO
F11CM	D0211, F11ACP COMMON DA	MACRO M1108  05-DEC-77 16:53  PAGE 7


     99
    100					;
    101					; SYNCHRONOUS TRAP LOGIC FOR F11ACP.  USES THE TRAP INSTRUCTION AND THE EMT
    102					; INSTRUCTION LESS THAN EMT 376
    103					;
    104	000054				.SSTVC::
    105	000054	000000 				.WORD	0		; ODD ADDRESS ERROR
    106	000056	000000 				.WORD	0		; MEMORY PROTECTION VIOLATION
    107	000060	000000 				.WORD	0		; T BIT OR BPT INSTRUCTION
    109	000062	000000G				.WORD	.ABORT		; IOT INSTRUCTION
    113	000064	000000 				.WORD	0		; RESERVED INSTRUCTION
    114	000066	000120'				.WORD	ERRMSG		; NON RSX EMT - ERRP
    115	000070	000072'				.WORD	ERRTRP		; TRAP INSTRUCTION - ERR, ERRX
    116		000007 				.SSTSZ==.-.SSTVC/2
    117					;
    118					; ERR AND ERRX COME HERE, ERR TAKES A NEGATIVE PARAMETER AND
    119					; SETS .IOSTS AND SETS C BIT AND RETURNS
    120					; THE ERRX CALL TAKES A POSITIVE PARAMETER, AND EXITS THROUGH CLEANUP
    121					;
    122	000072	006216 			ERRTRP:	ASR	(SP)		; TRAP LOGIC DOUBLED THE OFFSET
    123	000074	001407 				BEQ	20$		; 0 MEANS ERRX WITH NO ARGUMENT
    124	000076	112667 	177720 			MOVB	(SP)+,.IOSTS	; SET STATUS BYTE
    125	000102	003004 				BGT	20$		; BRANCH IF ERRX CALL
    126	000104	052766 	000001 	000002 		BIS	#1,2(SP)	; SET CARRY IN PS ON STACK
    127	000112	000002 				RTI
    128	000114	000167 	000000G		20$:	JMP	.CLNUP		; GO TO THE CLEANUP LOGIC
    129					;
    130					; ERRP COMES HERE, PARAMETER IS AN ERROR MESSAGE  NUMBER TO MESSAGE TASK
    131					;
    132	000120	012667 	177702 		ERRMSG:	MOV	(SP)+,.ERMSG	; SET ERROR MESSAGE CODE
    133	000124	000002 				RTI			; AND RETURN TO CALLER
    134
    138					;
    139					;
    140	000126					$END	F11CM
    141					;
    142					;
    143		000001 				.END
F11CM	D0211, F11ACP COMMON DA	MACRO M1108  05-DEC-77 16:53  PAGE 7-1
SYMBOL TABLE

AC.DLK= 000002   	F.SCHA  000021   	I.LGTH  000040   	UC.DLK= 000100   	.DRLBN  000002RG    003
AC.LCK= 000001   	F.SIZE  000032   	I.LNK   000000   	VC.BMW= 000002   	.DRUCB  000000RG    003
BITFNU= 000002   	F.STAT  000040   	I.LUN   000012   	VC.IFW= 000001   	.ERMSG  000026RG
ERRMSG  000120R  	F.STD   000004   	I.PRI   000010   	V.FCB   000006   	.EXDSP  000040RG
ERRTRP  000072R  	F.UCHA  000020   	I.PRM   000024   	V.FFNU  000055   	.EXFCB  000052RG
EX.AC1= 000001   	F11PR$= 000000   	I.RTRV  000034   	V.FIEX  000025   	.EXFNU  000050RG
EX.AC2= 000002   	HIFCN = 000030   	I.RVDT= 000014   	V.FMAX  000016   	.EXHDR  000044RG
EX.ADF= 000010   	H.CKSM= 000776   	I.RVNO= 000012   	V.FPRO  000030   	.EXNHD  000046RG
EX.ENA= 000200   	H.FCHA= 000014   	I.RVTI= 000023   	V.FRBK  000034   	.EXSTS  000041RG
EX.FCO= 000004   	H.FLEV= 000006   	I.RWAD= 000024   	V.IBLB  000012   	.EXTSV  000042RG
E$$MSG= 000001   	H.FNUM= 000002   	I.RWAT  000026   	V.IBSZ  000013   	.FCBAD  000036RG
E$$TRP= 000001   	H.FOWN= 000010   	I.RWCT= 000026   	V.IFWI  000002   	.FILNO  000030RG
FCPLUN= 000001   	H.FPRO= 000012   	I.RWVB= 000032   	V.LABL  000040   	.FILSQ  000032RG
FC.CEF= 020000   	H.FSEQ= 000004   	I.STD   000004   	V.LGTH  000056   	.HDBUF= 001012RG    002
FC.DIR= 040000   	H.IDOF= 000000   	I.TISZ= 000006   	V.LRUC  000035   	.HDLBN= 001006RG    002
FC.FCO= 010000   	H.MPOF= 000001   	I.UIC   000022   	V.SBCL  000021   	.HDUCB= 001004RG    002
FC.WAC= 100000   	H.PROG= 000010   	LEV11M= 000401   	V.SBLB  000024   	.IOFC   000010RG
FP.DEL= 000010   	H.PROJ= 000011   	LOWFCN= 000011   	V.SBSZ  000022   	.IOPKT  000004RG
FP.EXT= 000004   	H.SCHA= 000015   	MFDFNO= 000004   	V.STAT  000054   	.IOSTS  000022RG
FP.RAT= 000001   	H.UCHA= 000014   	MFDFSQ= 000004   	V.STD   000004   	.LUTN2  000014RG
FP.RDV= 000001   	H.UFAT= 000016   	M$$HDR= 000001   	V.TRCT  000000   	.PRFIL= 000004
FP.WRV= 000002   	IDXFNU= 000001   	M.CTSZ= 000006   	V.WISZ  000020   	.PTM0 = 000000RG
F$$LVL= 000001   	ID$$$ = 000211   	M.EFNU= 000002   	WI.BPS= 100000   	.PTM1 = 000002RG
F.DREF  000042   	I.ACTL  000035   	M.EFSQ= 000004   	WI.DLK= 010000   	.QIOST  000016RG
F.DRNM  000044   	I.AST   000020   	M.ERVN= 000001   	WI.EXT= 002000   	.RCVBF  000000RG
F.FEXT  000002   	I.ATL   000006   	M.ESQN= 000000   	WI.LCK= 004000   	.RTPTF= 001401
F.FNUM  000006   	I.CRDT= 000031   	M.LBSZ= 000007   	WI.RDV= 000400   	.SMBUF  000004RG    002
F.FOWN  000014   	I.CRTI= 000040   	M.MAX = 000011   	WI.WRV= 001000   	.SMFLG= 100000 G
F.FPRO  000016   	I.DASZ= 000007   	M.RTRV= 000012   	W.CTL   000000   	.SMUCB  000000RG    002
F.FSEQ  000010   	I.DPB   000011   	M.USE = 000010   	W.FCB   000002   	.SMVBN  000002RG    002
F.FSQN  000013   	I.EFN   000013   	QIOEFN= 000002   	W.RTRV  000012   	.SSTSZ= 000007 G
F.FVBN  000046   	I.EXDT= 000046   	R$$10F= 000001   	W.STD   000004   	.SSTVC  000054RG
F.HDLB  000022   	I.EXTD  000030   	R$$11D= 000001   	W.VBN   000006   	.STACK  000000RG
F.LBN   000026   	I.FCN   000014   	SC.BAD= 000100   	W.WISZ  000007   	.SYUIC= 000010
F.LGTH  000052   	I.FIDP  000024   	SC.MDL= 000200   	.ABORT= ****** GX	.UCBAD  000006RG
F.LINK  000000   	I.FNAM= 000000   	S.HDHD= 000056   	.ATLAD  000012RG 	.VBSIZ= 001000
F.NACS  000036   	I.FNBP  000036   	S.IDHD= 000056   	.CLNUP= ****** GX	.WNDOW  000034RG
F.NLCK  000037   	I.FTYP= 000006   	S.MPHD= 000012   	.DFEXT= 000005   	.ZERCT= 000014 G
F.NWAC  000040   	I.FVER= 000010   	S.STBK= 000012   	.DFPRO= 164000   	...GBL= 000000
F.RVN   000012   	I.IOSB  000016   	UC.CON= 000200   	.DRBUF  000006RG    003	...TPC= 000012

. ABS.	000056	   000
      	000126	   001
$$BUF1	001004	   002
$$BUF2	001006	   003
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2695 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[40,10]F11CM,[40,20]F11CM/-SP=[40,30]RSXDC,F11PRE,F11CM
F11ERM	MACRO M1108  05-DEC-77 16:53  PAGE 1


      1						.TITLE	F11ERM
      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					;	F11ACP COMMON FATAL ERROR MESSAGES DEFINITIONS
     20					;	AND OTHER JUNK TO KEEP OUT UNDEFINED SYMBOLS FROM F11ACP
     21					;	THIS IS ONLY NECESSARY WITH RSX20F.  THESE ROUTINES
     22					;	THAT ARE DEFINED HERE CAN'T BE REACHED.
     23					;
     24		000000 			E.FATL==0
     25		000002 			E.DMO==2
     26		000004 			E.BDHD==4
     27		000000 			SF.PRG==0
     28		000000 			A.IN==0
     29		000001 			..REDT==1
     30		000001 			..SPD3==1
     31		000000 			A.TI==0
     32		000000 			FM.CO==0
     33		000000 			PR==0
     34		000001 				.END
F11ERM	MACRO M1108  05-DEC-77 16:53  PAGE 1-1
SYMBOL TABLE

A.IN  = 000000 G 	E.BDHD= 000004 G 	E.FATL= 000000 G 	PR    = 000000 G 	..REDT= 000001 G
A.TI  = 000000 G 	E.DMO = 000002 G 	FM.CO = 000000 G 	SF.PRG= 000000 G 	..SPD3= 000001 G

. ABS.	000000	   000
      	000000	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  74 WORDS  ( 1 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:01
[40,10]F11ERM,[40,20]F11ERM/-SP=[40,30]F11ERM
RSXDC	MACRO M1108  05-DEC-77 17:07  PAGE 3


      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.
GTFID	D0203, GET A FILE ID	MACRO M1108  05-DEC-77 17:07  PAGE 6


      1						.TITLE	GTFID	D0203, GET A FILE ID
						.IDENT	"D0203"
      2					;
      3					;
      4					;                             COPYRIGHT (C) 1974, 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
     22					;
					; VERSION D203, ASSEMBLED FOR RSX-11D
					;
     23
     24					; ANDREW C. GOLDSTEIN  30 OCT 74  10:42
     25					; PETER H. LIPMAN	17-JAN-74
     26					;
     27					; MOVE THE FILE ID FROM THE I/O PACKET OR FILE CONTROL BLOCK TO .FILNO
     28
     29					;
     30					;+
     31					; **-.GTFID-GET A FILE ID
     32					;
     33					; THIS ROUTINE GETS A FILE ID FROM THE I/O PACKET IF SPECIFIED OR FROM THE FILE
     34					; CONTROL BLOCK IF A WINDOW IS ASSOCIATED WITH THE LUN (2ND WORD OF LOGICAL UNIT
     35					; TABLE). IF BOTH ARE SPECIFIED, THE FILE ID'S ARE COMPARED TO MAKE SURE
     36					; THEY AGREE. IF NO FILE ID WAS SPECIFIED OR TWO CONFLICTING FILE ID'S
     37					; WERE GIVEN, THIS ROUTINE INVOKES ERRX WITH THE ERROR CODE IE.BAD.
     38					;
     39					; INPUTS:
     40					;
     41					; 	R5=I/O PACKET
     42					;
     43					; OUTPUTS:
     44					;
     45					; 	R0-R2 ALTERED
     46					; 	R3-R5 PRESERVED
     47					; 	.FILNO .FILSQ SET TO FILE ID (FILE NUMBER NON ZERO)
     48					; 	.WNDOW, .FCBAD SET IF FILE IS ACCESSED
     49					; 	RETURNS IN LINE IF AND ONLY IF SUCCESSFUL
     50					;
     51					;-
     52
     53	000000				.GTFID::
     54	000000	012701 	000000G			MOV	#.FILNO,R1	; R1=ADDRESS TO STORE FID
GTFID	D0203, GET A FILE ID	MACRO M1108  05-DEC-77 17:07  PAGE 6-1


     59	000004	005705 				TST	R5		; SEE IF I/O PACKET EXISTS
     60	000006	001002 				BNE	10$		; YES
     61	000010	005046 				CLR	-(SP)		; INDICATE NO FID BLOCK
     62	000012	000414 				BR	20$		; AND SKIP GETTING FID FROM USER
     63
     64	000014	016546 	000024 		10$:	MOV	I.FIDP(R5),-(SP) ; SAVE FID ADDRESS
     66	000020	001411 				BEQ	20$		; BRANCH IF NO FILE ID SPECIFIED
     67	000022	010500 				MOV	R5,R0		; I/O PACKET ADDRESS
     68	000024	062700 	000024 			ADD	#I.FIDP,R0	; R0=ADDRESS OF FID DOUBLE WORD ADDRESS
     69	000030	012702 	000004 			MOV	#4,R2		; R2=NO. OF BYTES TO MOVE
     70	000034					CALL	.BLXI		; MOVE THE FILE ID
     71	000040	012701 	000000G			MOV	#.FILNO,R1	;
     72					;
     73					; SEE IF THIS LUN POINTS AT A WINDOW
     74					;
     75	000044				20$:	GETLUN	R0
     76	000050	042700 	000001 			BIC	#1,R0		; R0=WINDOW ADDRESS
     77	000054	001422 				BEQ	60$		; BRANCH IF NO WINDOW
     78	000056	010067 	000000G			MOV	R0,.WNDOW	; STORE WINDOW ADDRESS
     79	000062	016000 	000002 			MOV	W.FCB(R0),R0	;
     80	000066	010067 	000000G			MOV	R0,.FCBAD	; AND STORE FCB ADDRESS
     81					;
     82					; GET FID FROM FILE CONTROL BLOCK.
     83					;
     84
     90	000072	062700 	000006 			ADD	#F.FNUM,R0	; POINT TO FID IN FCB
     92	000076	005726 				TST	(SP)+		; FILE ID SPECIFIED IN DPB TOO?
     93	000100	001405 				BEQ	40$		; BRANCH IF NO
     94					;
     95					; FILE ID SPECIFIED BOTH IN QI/O DPB AND IN THE WINDOW
     96					; THEY MUST AGREE-CHECK THE REDUNDANT ID
     97					;
     98
     99	000102	022021 				CMP	(R0)+,(R1)+
    100	000104	001002 				BNE	30$
    101	000106	021011 				CMP	(R0),(R1)
    102	000110	001403 				BEQ	50$
    103	000112				30$:	ERRX	IE.BAD,<CONFLICTING OR UNSPECIFIED FID>
	000112	   000C	   211 			TRAP	-IE.BAD		; CONFLICTING OR UNSPECIFIED FID
    104					;
    105					; MOVE FILE ID FROM FCB
    106					;
    107	000114	012021 			40$:	MOV	(R0)+,(R1)+
    108	000116	011011 				MOV	(R0),(R1)
    109	000120				50$:	RETURN
    110
    111					;
    112					; NO WINDOW PRESENT IN LUTN2, IF FILE NUMBER =0, THEN ERROR
    113					;
    114
    115	000122	005726 			60$:	TST	(SP)+		; CHECK IF THERE WAS A FID POINTER
    116	000124	001403 				BEQ	70$		; BRANCH IF NO FID POINTER
    117	000126	005711 				TST	(R1)		; NO ZERO FILE NUMBER?
    118	000130	001770 				BEQ	30$		; BRANCH IF BAD PARAMETER
    119	000132					RETURN
    120
    121	000134				70$:	ERRX	IE.NLN,<NO FID POINTER AND NO FILE ACCESSED ON LUN>
GTFID	D0203, GET A FILE ID	MACRO M1108  05-DEC-77 17:07  PAGE 6-2


	000134	   000C	   211 			TRAP	-IE.NLN		; NO FID POINTER AND NO FILE ACCESSED ON LUN
    122
    123					;
    124					;
    125	000136					$END	GTFID
    126					;
    127					;
    128		000001 				.END
GTFID	D0203, GET A FILE ID	MACRO M1108  05-DEC-77 17:07  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBLB  000024
AC.LCK= 000001   	F.NLCK  000037   	I.DPB   000011   	M.EFSQ= 000004   	V.SBSZ  000022
BITFNU= 000002   	F.NWAC  000040   	I.EFN   000013   	M.ERVN= 000001   	V.STAT  000054
EX.AC1= 000001   	F.RVN   000012   	I.EXDT= 000046   	M.ESQN= 000000   	V.STD   000004
EX.AC2= 000002   	F.SCHA  000021   	I.EXTD  000030   	M.LBSZ= 000007   	V.TRCT  000000
EX.ADF= 000010   	F.SIZE  000032   	I.FCN   000014   	M.MAX = 000011   	V.WISZ  000020
EX.ENA= 000200   	F.STAT  000040   	I.FIDP  000024   	M.RTRV= 000012   	WI.BPS= 100000
EX.FCO= 000004   	F.STD   000004   	I.FNAM= 000000   	M.USE = 000010   	WI.DLK= 010000
E$$MSG= 000001   	F.UCHA  000020   	I.FNBP  000036   	QIOEFN= 000002   	WI.EXT= 002000
E$$TRP= 000001   	F11PR$= 000000   	I.FTYP= 000006   	R$$10F= 000001   	WI.LCK= 004000
FCPLUN= 000001   	HIFCN = 000030   	I.FVER= 000010   	R$$11D= 000001   	WI.RDV= 000400
FC.CEF= 020000   	H.CKSM= 000776   	I.IOSB  000016   	SC.BAD= 000100   	WI.WRV= 001000
FC.DIR= 040000   	H.FCHA= 000014   	I.LGTH  000040   	SC.MDL= 000200   	W.CTL   000000
FC.FCO= 010000   	H.FLEV= 000006   	I.LNK   000000   	S.HDHD= 000056   	W.FCB   000002
FC.WAC= 100000   	H.FNUM= 000002   	I.LUN   000012   	S.IDHD= 000056   	W.RTRV  000012
FP.DEL= 000010   	H.FOWN= 000010   	I.PRI   000010   	S.MPHD= 000012   	W.STD   000004
FP.EXT= 000004   	H.FPRO= 000012   	I.PRM   000024   	S.STBK= 000012   	W.VBN   000006
FP.RAT= 000001   	H.FSEQ= 000004   	I.RTRV  000034   	UC.CON= 000200   	W.WISZ  000007
FP.RDV= 000001   	H.IDOF= 000000   	I.RVDT= 000014   	UC.DLK= 000100   	$$    = 000067
FP.WRV= 000002   	H.MPOF= 000001   	I.RVNO= 000012   	VC.BMW= 000002   	.BLXI = ****** GX
F$$LVL= 000001   	H.PROG= 000010   	I.RVTI= 000023   	VC.IFW= 000001   	.DFEXT= 000005
F.DREF  000042   	H.PROJ= 000011   	I.RWAD= 000024   	V.FCB   000006   	.DFPRO= 164000
F.DRNM  000044   	H.SCHA= 000015   	I.RWAT  000026   	V.FFNU  000055   	.FCBAD= ****** GX
F.FEXT  000002   	H.UCHA= 000014   	I.RWCT= 000026   	V.FIEX  000025   	.FILNO= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.RWVB= 000032   	V.FMAX  000016   	.GTFID  000000RG
F.FOWN  000014   	IDXFNU= 000001   	I.STD   000004   	V.FPRO  000030   	.LUTN2= ****** GX
F.FPRO  000016   	ID$$$ = 000203   	I.TISZ= 000006   	V.FRBK  000034   	.PRFIL= 000004
F.FSEQ  000010   	IE.BAD= ****** GX	I.UIC   000022   	V.IBLB  000012   	.RTPTF= 001401
F.FSQN  000013   	IE.NLN= ****** GX	LEV11M= 000401   	V.IBSZ  000013   	.SYUIC= 000010
F.FVBN  000046   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002   	.VBSIZ= 001000
F.HDLB  000022   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040   	.WNDOW= ****** GX
F.LBN   000026   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056   	...GBL= 000000
F.LGTH  000052   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035   	...TPC= 000012
F.LINK  000000   	I.CRTI= 000040   	M.CTSZ= 000006   	V.SBCL  000021

. ABS.	000056	   000
      	000136	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2557 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:18
[40,10]GTFID,[40,20]GTFID/-SP=[40,30]RSXDC,F11PRE,GTFID
RSXDC	MACRO M1108  05-DEC-77 17:08  PAGE 3


      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.
GTMAP	D0201, FIND FILE HEADER	MACRO M1108  05-DEC-77 17:08  PAGE 6


      1						.TITLE	GTMAP	D0201, FIND FILE HEADER MAP AREA
						.IDENT	"D0201"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D201, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  29 OCT 74  13:37
     23					;
     24					; FIND FILE HEADER MAP AREA
     25
     26					;+
     27					;
     28					; **.GTMAP - FIND FILE HEADER MAP AREA
     29					;
     30					; THIS ROUTINE FOLLOWS THE MAP AREA OFFSET IN THE HEADER BUFFER
     31					; AND PRODUCES A POINTER TO THE MAP AREA.
     32					;
     33					; INPUTS:
     34					;
     35					;	HEADER IN .HDBUF
     36					;
     37					; OUTPUTS:
     38					;
     39					;	R1 = POINTER TO MAP AREA
     40					;	ALL OTHER REGISTERS ARE PRESERVED
     41					;
     42					;-
     43
     44	000000				.GTMAP::
     45	000000	005001 				CLR	R1
     46	000002	156701 	000001G			BISB	.HDBUF+H.MPOF,R1 ; GET OFFSET IN WORDS
     47	000006	006301 				ASL	R1		; COMVERT TO BYTE OFFSET
     48	000010	062701 	000000G			ADD	#.HDBUF,R1	; FORM POINTER
     49	000014					RETURN
     50					;
     51					;
     52	000016					$END	GTMAP
     53					;
     54					;
GTMAP	D0201, FIND FILE HEADER	MACRO M1108  05-DEC-77 17:08  PAGE 6-1


     55		000001 				.END
GTMAP	D0201, FIND FILE HEADER	MACRO M1108  05-DEC-77 17:08  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.DASZ= 000007   	M$$HDR= 000001   	V.LABL  000040
AC.LCK= 000001   	F.NACS  000036   	I.DPB   000011   	M.CTSZ= 000006   	V.LGTH  000056
BITFNU= 000002   	F.NLCK  000037   	I.EFN   000013   	M.EFNU= 000002   	V.LRUC  000035
EX.AC1= 000001   	F.NWAC  000040   	I.EXDT= 000046   	M.EFSQ= 000004   	V.SBCL  000021
EX.AC2= 000002   	F.RVN   000012   	I.EXTD  000030   	M.ERVN= 000001   	V.SBLB  000024
EX.ADF= 000010   	F.SCHA  000021   	I.FCN   000014   	M.ESQN= 000000   	V.SBSZ  000022
EX.ENA= 000200   	F.SIZE  000032   	I.FIDP  000024   	M.LBSZ= 000007   	V.STAT  000054
EX.FCO= 000004   	F.STAT  000040   	I.FNAM= 000000   	M.MAX = 000011   	V.STD   000004
E$$MSG= 000001   	F.STD   000004   	I.FNBP  000036   	M.RTRV= 000012   	V.TRCT  000000
E$$TRP= 000001   	F.UCHA  000020   	I.FTYP= 000006   	M.USE = 000010   	V.WISZ  000020
FCPLUN= 000001   	F11PR$= 000000   	I.FVER= 000010   	QIOEFN= 000002   	WI.BPS= 100000
FC.CEF= 020000   	HIFCN = 000030   	I.IOSB  000016   	R$$10F= 000001   	WI.DLK= 010000
FC.DIR= 040000   	H.CKSM= 000776   	I.LGTH  000040   	R$$11D= 000001   	WI.EXT= 002000
FC.FCO= 010000   	H.FCHA= 000014   	I.LNK   000000   	SC.BAD= 000100   	WI.LCK= 004000
FC.WAC= 100000   	H.FLEV= 000006   	I.LUN   000012   	SC.MDL= 000200   	WI.RDV= 000400
FP.DEL= 000010   	H.FNUM= 000002   	I.PRI   000010   	S.HDHD= 000056   	WI.WRV= 001000
FP.EXT= 000004   	H.FOWN= 000010   	I.PRM   000024   	S.IDHD= 000056   	W.CTL   000000
FP.RAT= 000001   	H.FPRO= 000012   	I.RTRV  000034   	S.MPHD= 000012   	W.FCB   000002
FP.RDV= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	S.STBK= 000012   	W.RTRV  000012
FP.WRV= 000002   	H.IDOF= 000000   	I.RVNO= 000012   	UC.CON= 000200   	W.STD   000004
F$$LVL= 000001   	H.MPOF= 000001   	I.RVTI= 000023   	UC.DLK= 000100   	W.VBN   000006
F.DREF  000042   	H.PROG= 000010   	I.RWAD= 000024   	VC.BMW= 000002   	W.WISZ  000007
F.DRNM  000044   	H.PROJ= 000011   	I.RWAT  000026   	VC.IFW= 000001   	.DFEXT= 000005
F.FEXT  000002   	H.SCHA= 000015   	I.RWCT= 000026   	V.FCB   000006   	.DFPRO= 164000
F.FNUM  000006   	H.UCHA= 000014   	I.RWVB= 000032   	V.FFNU  000055   	.GTMAP  000000RG
F.FOWN  000014   	H.UFAT= 000016   	I.STD   000004   	V.FIEX  000025   	.HDBUF= ****** GX
F.FPRO  000016   	IDXFNU= 000001   	I.TISZ= 000006   	V.FMAX  000016   	.PRFIL= 000004
F.FSEQ  000010   	ID$$$ = 000201   	I.UIC   000022   	V.FPRO  000030   	.RTPTF= 001401
F.FSQN  000013   	I.ACTL  000035   	LEV11M= 000401   	V.FRBK  000034   	.SYUIC= 000010
F.FVBN  000046   	I.AST   000020   	LOWFCN= 000011   	V.IBLB  000012   	.VBSIZ= 001000
F.HDLB  000022   	I.ATL   000006   	MFDFNO= 000004   	V.IBSZ  000013   	...GBL= 000000
F.LBN   000026   	I.CRDT= 000031   	MFDFSQ= 000004   	V.IFWI  000002   	...TPC= 000012
F.LGTH  000052   	I.CRTI= 000040

. ABS.	000056	   000
      	000016	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2477 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:16
[40,10]GTMAP,[40,20]GTMAP/-SP=[40,30]RSXDC,F11PRE,GTMAP
RSXDC	MACRO M1108  05-DEC-77 17:08  PAGE 3


      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.
INFCB	D0205, INITIALIZE A NEW	MACRO M1108  05-DEC-77 17:08  PAGE 6


      1						.TITLE	INFCB	D0205, INITIALIZE A NEW FCB
						.IDENT	"D0205"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D205, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  11 NOV 74  11:05
     23					; PETER H. LIPMAN	22-JAN-74
     24					;
     25					; CREATE AND INITIALIZE A FILE CONTROL BLOCK
     26					;
     27					;+
     28					; **.-CRFCB-CREATE AND INTI AN FCB
     29					;
     30					; THIS ROUTINE ALLOCATES AN FCB, AND INITIATES
     31					; IT FROM THE HEADER IN .HDBUF.
     32					;
     33					; INPUTS:
     34					;
     35					; 	.HDBUF CONTAINS THE FILE HEADER TO BE USED
     36					; 	R4=VOLUME CONTROL BLOCK ADR
     37					; 	R5=I/O PACKET ADDRESS
     38					;
     39					; OUTPUTS:
     40					;
     41					; 	R0=FCB ADDRESS
     42					; 	R1-R3 ALTERED, R4-R5 PRESERVED
     43					;-
     44
     45	000000				.CRFCB::
     46	000000	012701 	000052 			MOV	#F.LGTH,R1	; R1=SIZE OF FCB
     48	000004	016702 	000000G			MOV	.CRTSK,R2	; GET OUR ATL POINTER
     49	000010	016202 	000000G			MOV	A.TD(R2),R2	; GET STD POINTER
     51	000014					CALL	.ALLOC		; ALLOCATE IT
     53	000020	012760 	000001 	000050 		MOV	#1,F.FVBN+2(R0)	; INIT STARTING VBN
     55
     56					;+
     57					; **.INFCB-INITIALIZE A FILE CONTROL BLOCK
     58					;
INFCB	D0205, INITIALIZE A NEW	MACRO M1108  05-DEC-77 17:08  PAGE 6-1


     59					; THIS ROUTINE ACCEPTS THE ADDRESS OF A ZEROED FILE CONTROL BLOCK IN R0
     60					; AND A FILE HEADER IN .HDBUF AND INITIALIZES THE FCB FROM THE FILE HEADER.
     61					;
     62					; INPUTS:
     63					;
     64					; 	R0=FCB ADDRESS
     65					; 	.HDBUF CONTAINS THE FILE HEADER TO USE
     66					;
     67					; OUTPUTS:
     68					;
     69					; 	R0 PRESERVED
     70					; 	R1-R3 ALTERED
     71					; 	R4-R5 PRESERVED
     72					;
     73					;-
     74	000026					ASSUME 	F.LINK,0
     75	000026				.INFCB::
     76	000026	010046 				MOV	R0,-(SP)	; SAVE FCB ADDRESS
     82	000030	062700 	000006 			ADD	#F.FNUM,R0	; POINT TO FILE NUMBER
     84	000034	012701 	000002G			MOV	#.HDBUF+H.FNUM,R1 ; MOVE WORDS FROM H.FNUM
     85	000040	012702 	000006 			MOV	#<<F.SCHA+1>-F.FNUM>/2,R2 ; THROUGH H.SCHA
     86	000044	012120 			10$:	MOV	(R1)+,(R0)+
     87	000046	077202 				SOB	R2,10$
     88	000050					ASSUME	F.HDLB,F.SCHA+1
     89	000050	012701 	000000G			MOV	#.HDLBN,R1
     90	000054	012120 				MOV	(R1)+,(R0)+	; STORE LBN OF HEADER
     91	000056	012120 				MOV	(R1)+,(R0)+
     92	000060					CALL	.GTMAP		; POINT TO MAP AREA
     94	000064					ASSUME	M.ESQN,0
     95	000064	111160 	177765 			MOVB	(R1),F.FSQN-F.LBN(R0) ; SET UP FILE SEGMENT NUMBER
     96	000070	105060 	177764 			CLRB	F.RVN-F.LBN(R0)	; CLEAN OUT REL VOL NUMBER
     98	000074	062701 	000010 			ADD	#M.USE,R1	; TO MAP USE COUNTER
     99					;
    100					; NOW INITIALIZE THE STATISTICS BLOCK PORTION OF THE FCB
    101					;
    102	000100					ASSUME	F.LBN,F.HDLB+4
    103	000100					ASSUME	F.SIZE,F.LBN+4
    104	000100	005020 				CLR	(R0)+		; ZERO 2 WORD OF FIRST LBN
    105	000102	005020 				CLR	(R0)+
    106	000104	005020 				CLR	(R0)+		; AND ZERO 2 WORDS OF SIZE
    107	000106	005010 				CLR	(R0)		; LEAVING R0 POINTING AT 2ND WORD
    108	000110	005002 				CLR	R2
    109	000112	151102 				BISB	(R1),R2		; R2=NO. OF WORDS OF RTRV PTRS IN USE
    110	000114	001424 				BEQ	30$		; BRANCH IF FILE IS EMPTY
    111	000116	006202 				ASR	R2		; R2=NO. OF RETRIEVAL POINTERS IN USE
    112	000120	005721 				TST	(R1)+		; POINT AT FIRST RETRIEVAL POINTER
    113	000122					ASSUME	M.RTRV,M.USE+2
    114	000122	132767 	000200 	000014G		BITB	#UC.CON,.HDBUF+H.UCHA ; IS FILE CONTIGUOUS?
    115	000130	001405 				BEQ	20$		; BRANCH IF NOT
    116	000132	111160 	177772 			MOVB	(R1),-6(R0)	; MOVE HIGH ORDER BITS OF FIRST LBN
    117	000136	016160 	000002 	177774 		MOV	2(R1),-4(R0)	; LOW ORDER WORD OF FIRST LBN
    118	000144	005003 			20$:	CLR	R3
    119	000146	156103 	000001 			BISB	1(R1),R3
    120	000152	005203 				INC	R3		; R3=NO. OF BLOCK IN THIS RETRIEVAL POINTER
    121	000154	060310 				ADD	R3,(R0)		; ADD INTO F.SIZE IN FCB
    122	000156	005560 	177776 			ADC	-2(R0)		;
    123	000162	022121 				CMP	(R1)+,(R1)+	; POINT TO NEXT RETRIEVAL POINTER
INFCB	D0205, INITIALIZE A NEW	MACRO M1108  05-DEC-77 17:08  PAGE 6-2


    124	000164	077211 				SOB	R2,20$		; GET SIZE OF NEXT ONE IF ANY MORE
    125	000166	012600 			30$:	MOV	(SP)+,R0	; RESTORE FCB ADDRESS
    126	000170					RETURN
    127					;
    128					;
    129	000172					$END	INFCB
    130					;
    131					;
    132		000001 				.END
INFCB	D0205, INITIALIZE A NEW	MACRO M1108  05-DEC-77 17:08  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.DPB   000011   	M.EFSQ= 000004   	V.SBSZ  000022
AC.LCK= 000001   	F.NACS  000036   	I.EFN   000013   	M.ERVN= 000001   	V.STAT  000054
A.TD  = ****** GX	F.NLCK  000037   	I.EXDT= 000046   	M.ESQN= 000000   	V.STD   000004
BITFNU= 000002   	F.NWAC  000040   	I.EXTD  000030   	M.LBSZ= 000007   	V.TRCT  000000
EX.AC1= 000001   	F.RVN   000012   	I.FCN   000014   	M.MAX = 000011   	V.WISZ  000020
EX.AC2= 000002   	F.SCHA  000021   	I.FIDP  000024   	M.RTRV= 000012   	WI.BPS= 100000
EX.ADF= 000010   	F.SIZE  000032   	I.FNAM= 000000   	M.USE = 000010   	WI.DLK= 010000
EX.ENA= 000200   	F.STAT  000040   	I.FNBP  000036   	QIOEFN= 000002   	WI.EXT= 002000
EX.FCO= 000004   	F.STD   000004   	I.FTYP= 000006   	R$$10F= 000001   	WI.LCK= 004000
E$$MSG= 000001   	F.UCHA  000020   	I.FVER= 000010   	R$$11D= 000001   	WI.RDV= 000400
E$$TRP= 000001   	F11PR$= 000000   	I.IOSB  000016   	SC.BAD= 000100   	WI.WRV= 001000
FCPLUN= 000001   	HIFCN = 000030   	I.LGTH  000040   	SC.MDL= 000200   	W.CTL   000000
FC.CEF= 020000   	H.CKSM= 000776   	I.LNK   000000   	S.HDHD= 000056   	W.FCB   000002
FC.DIR= 040000   	H.FCHA= 000014   	I.LUN   000012   	S.IDHD= 000056   	W.RTRV  000012
FC.FCO= 010000   	H.FLEV= 000006   	I.PRI   000010   	S.MPHD= 000012   	W.STD   000004
FC.WAC= 100000   	H.FNUM= 000002   	I.PRM   000024   	S.STBK= 000012   	W.VBN   000006
FP.DEL= 000010   	H.FOWN= 000010   	I.RTRV  000034   	UC.CON= 000200   	W.WISZ  000007
FP.EXT= 000004   	H.FPRO= 000012   	I.RVDT= 000014   	UC.DLK= 000100   	$$    = 000067
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVNO= 000012   	VC.BMW= 000002   	.ALLOC= ****** GX
FP.RDV= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	VC.IFW= 000001   	.CRFCB  000000RG
FP.WRV= 000002   	H.MPOF= 000001   	I.RWAD= 000024   	V.FCB   000006   	.CRTSK= ****** GX
F$$LVL= 000001   	H.PROG= 000010   	I.RWAT  000026   	V.FFNU  000055   	.DFEXT= 000005
F.DREF  000042   	H.PROJ= 000011   	I.RWCT= 000026   	V.FIEX  000025   	.DFPRO= 164000
F.DRNM  000044   	H.SCHA= 000015   	I.RWVB= 000032   	V.FMAX  000016   	.GTMAP= ****** GX
F.FEXT  000002   	H.UCHA= 000014   	I.STD   000004   	V.FPRO  000030   	.HDBUF= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.TISZ= 000006   	V.FRBK  000034   	.HDLBN= ****** GX
F.FOWN  000014   	IDXFNU= 000001   	I.UIC   000022   	V.IBLB  000012   	.INFCB  000026RG
F.FPRO  000016   	ID$$$ = 000205   	LEV11M= 000401   	V.IBSZ  000013   	.PRFIL= 000004
F.FSEQ  000010   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002   	.RTPTF= 001401
F.FSQN  000013   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040   	.SYUIC= 000010
F.FVBN  000046   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056   	.VBSIZ= 001000
F.HDLB  000022   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035   	...GBL= 000000
F.LBN   000026   	I.CRTI= 000040   	M.CTSZ= 000006   	V.SBCL  000021   	...TPC= 000012
F.LGTH  000052   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBLB  000024

. ABS.	000056	   000
      	000172	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2552 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:18
[40,10]INFCB,[40,20]INFCB/-SP=[40,30]RSXDC,F11PRE,INFCB
RSXDC	MACRO M1108  05-DEC-77 17:08  PAGE 3


      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.
INWIN	D0204, ALLOCATE AND INI	MACRO M1108  05-DEC-77 17:08  PAGE 6


      1						.TITLE	INWIN	D0204, ALLOCATE AND INITIALIZE WINDOW
						.IDENT	"D0204"
      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					;
					; VERSION D204, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  20 JAN 75  23:47
     23					; PETER H. LIPMAN	22-JAN-74
     24					;
     25					; ALLOCATE AND INITIALIZE A WINDOW
     26					;
     27					;
     28					; TABLE TO MAP ACCESS QI/O FUNCTION CODE TO ACCESS CONTROL BITS IN THE WINDOW
     29					;
     30	000000	   001 			ACALOW:	.BYTE	WI.RDV/256.	; READ ACCESS
     31	000001	   003 				.BYTE	<WI.RDV!WI.WRV>/256. ; READ WRITE ACCESS
     32	000002	   007 				.BYTE	<WI.RDV!WI.WRV!WI.EXT>/256. ; READ, WRITE, EXTEND
     33						.EVEN
     34					;+
     35					; **.INWIN-ALLOCATE AND INITIALIZE WINDOW
     36					;
     37					; THIS ROUTINE ALLOCATES A WINDOW BLOCK AND INITIALIZES IT TO MAP
     38					; VBN 1. THE SIZE OF THE WINDOW IS DETERMINED FROM EITHER
     39					; THE OPTIONAL PARAMETER IN THE ACCESS QI/O DPB WHICH SPECIFIES THE DESIRED
     40					; NUMBER OF RETRIEVAL POINTERS, OR THE WINDOW SIZE VALUE IN THE
     41					; VCB. THE FILE HEADER IS ASSUMED TO BE IN .HDBUF
     42					;
     43					; INPUTS:
     44					;
     45					; 	R0=ACCESS CODE, 0=R, 1=RW, 2=RWE
     46					; 	R4=VOLUME CONTROL BLOCK
     47					; 	R5=I/O PACKET FOR ACCESS QI/O
     48					; 	.FCBAD=FILE CONTROL BLOCK ADDRESS
     49					;
     50					; OUTPUTS:
     51					;
     52					; 	R0=WINDOW ADDRESS
     53					; 	.WNDOW=WINDOW ADDRESS
     54					; 	RETURNS IN LINE IF AND ONLY IF SUCCESSFUL
INWIN	D0204, ALLOCATE AND INI	MACRO M1108  05-DEC-77 17:08  PAGE 6-1


     55					;
     56					;-
     57
     58	000004				.INWIN::
     59	000004	010046 				MOV	R0,-(SP)	; SAVE ACCESS CODE
     60	000006	116501 	000034 			MOVB	I.RTRV(R5),R1	; R1=DESIRED NO. OF RTRV PTRS (7 BITS)
     61	000012	001002 				BNE	10$		; BRANCH IF SPECIFIED
     62	000014	116401 	000020 			MOVB	V.WISZ(R4),R1	; OTHERWISE USE DEFAULT FROM VCB
     63	000020	120127 	000177 		10$:	CMPB	R1,#127.	; SEE IF WINDOW SIZE IF LEGAL
     64	000024	101401 				BLOS	20$
     65	000026					ERRX	IE.BAD,<SPECIFIED WINDOW SIZE IS TOO LARGE>
	000026	   000C	   211 			TRAP	-IE.BAD		; SPECIFIED WINDOW SIZE IS TOO LARGE
     66
     67	000030	010103 			20$:	MOV	R1,R3		; SAVE NO. OF RETRIEVAL POINTERS
     72	000032	006301 				ASL	R1
     73	000034	010146 				MOV	R1,-(SP)
     74	000036	006301 				ASL	R1
     75	000040	062601 				ADD	(SP)+,R1
     77	000042	062701 	000012 			ADD	#W.RTRV,R1	; FORM R1=SIZE IN BYTES OF WINDOW
     78	000046					CALL	.ALLOC		; ALLOCATE THE WINDOW
     79	000052	010067 	000000G			MOV	R0,.WNDOW	; SAVE ITS ADDRESS
     80	000056	110360 	000007 			MOVB	R3,W.WISZ(R0)	; SET WINDOW SIZE BYTE
     81	000062	016760 	000000G	000002 		MOV	.FCBAD,W.FCB(R0) ; SET FCB ADDRESS
     82					;
     83					; SET ACCESS ALLOWED BITS
     84					;
     85	000070	012601 				MOV	(SP)+,R1	; RECOVER ACCESS CODE (INPUT PARAM)
     86	000072	116102 	000000'			MOVB	ACALOW(R1),R2
     87					;
     88					; SET USER DESIRED ACCESS LOCK AND DEACCESS LOCK ENABLE BITS
     89					;
     90	000076	116501 	000035 			MOVB	I.ACTL(R5),R1	;
     91	000102	042701 	177774 			BIC	#^C<AC.LCK!AC.DLK>,R1 ;
     92	000106					ASSUME	AC.LCK,1	; AC.LCK IS BIT 0
     93	000106					ASSUME	AC.DLK,2	; AC.DLK IS BIT 1
     94	000106					ASSUME	WI.LCK,10*400	; WI.LCK IS BIT 3 (HIGH BYTE)
     95	000106					ASSUME	WI.DLK,20*400	; WI.DLK IS BIT 4 (HIGH BYTE)
     96	000106	006301 				ASL	R1		; SHIFT ACCESS LOCK BITS 3 BITS
     97	000110	006301 				ASL	R1
     98	000112	006301 				ASL	R1
     99	000114	050102 				BIS	R1,R2
    100	000116	110260 	000001 			MOVB	R2,W.CTL+1(R0)	; SET ACCESS CONTROL BYTE IN WINDOW
    101					;
    102					; INITIALIZE THE RETRIEVAL POINTERS IN THE WINDOW
    103					; TURN WINDOW TO VBN 1
    104					;
    105	000122	010001 				MOV	R0,R1		; R1=WINDOW ADDRESS
    106	000124	005002 				CLR	R2		;
    107	000126	012703 	000001 			MOV	#1,R3
    108	000132					CALLR	.WITRN		; IGNORE EOF ERROR FOR EMPTY FILE
    109					;
    110					;
    111	000136					$END	INWIN
    112					;
    113					;
    114		000001 				.END
INWIN	D0204, ALLOCATE AND INI	MACRO M1108  05-DEC-77 17:08  PAGE 6-2
SYMBOL TABLE

ACALOW  000000R  	F.LINK  000000   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBCL  000021
AC.DLK= 000002   	F.NACS  000036   	I.DPB   000011   	M.EFSQ= 000004   	V.SBLB  000024
AC.LCK= 000001   	F.NLCK  000037   	I.EFN   000013   	M.ERVN= 000001   	V.SBSZ  000022
BITFNU= 000002   	F.NWAC  000040   	I.EXDT= 000046   	M.ESQN= 000000   	V.STAT  000054
EX.AC1= 000001   	F.RVN   000012   	I.EXTD  000030   	M.LBSZ= 000007   	V.STD   000004
EX.AC2= 000002   	F.SCHA  000021   	I.FCN   000014   	M.MAX = 000011   	V.TRCT  000000
EX.ADF= 000010   	F.SIZE  000032   	I.FIDP  000024   	M.RTRV= 000012   	V.WISZ  000020
EX.ENA= 000200   	F.STAT  000040   	I.FNAM= 000000   	M.USE = 000010   	WI.BPS= 100000
EX.FCO= 000004   	F.STD   000004   	I.FNBP  000036   	QIOEFN= 000002   	WI.DLK= 010000
E$$MSG= 000001   	F.UCHA  000020   	I.FTYP= 000006   	R$$10F= 000001   	WI.EXT= 002000
E$$TRP= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$11D= 000001   	WI.LCK= 004000
FCPLUN= 000001   	HIFCN = 000030   	I.IOSB  000016   	SC.BAD= 000100   	WI.RDV= 000400
FC.CEF= 020000   	H.CKSM= 000776   	I.LGTH  000040   	SC.MDL= 000200   	WI.WRV= 001000
FC.DIR= 040000   	H.FCHA= 000014   	I.LNK   000000   	S.HDHD= 000056   	W.CTL   000000
FC.FCO= 010000   	H.FLEV= 000006   	I.LUN   000012   	S.IDHD= 000056   	W.FCB   000002
FC.WAC= 100000   	H.FNUM= 000002   	I.PRI   000010   	S.MPHD= 000012   	W.RTRV  000012
FP.DEL= 000010   	H.FOWN= 000010   	I.PRM   000024   	S.STBK= 000012   	W.STD   000004
FP.EXT= 000004   	H.FPRO= 000012   	I.RTRV  000034   	UC.CON= 000200   	W.VBN   000006
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	UC.DLK= 000100   	W.WISZ  000007
FP.RDV= 000001   	H.IDOF= 000000   	I.RVNO= 000012   	VC.BMW= 000002   	$$    = 000067
FP.WRV= 000002   	H.MPOF= 000001   	I.RVTI= 000023   	VC.IFW= 000001   	.ALLOC= ****** GX
F$$LVL= 000001   	H.PROG= 000010   	I.RWAD= 000024   	V.FCB   000006   	.DFEXT= 000005
F.DREF  000042   	H.PROJ= 000011   	I.RWAT  000026   	V.FFNU  000055   	.DFPRO= 164000
F.DRNM  000044   	H.SCHA= 000015   	I.RWCT= 000026   	V.FIEX  000025   	.FCBAD= ****** GX
F.FEXT  000002   	H.UCHA= 000014   	I.RWVB= 000032   	V.FMAX  000016   	.INWIN  000004RG
F.FNUM  000006   	H.UFAT= 000016   	I.STD   000004   	V.FPRO  000030   	.PRFIL= 000004
F.FOWN  000014   	IDXFNU= 000001   	I.TISZ= 000006   	V.FRBK  000034   	.RTPTF= 001401
F.FPRO  000016   	ID$$$ = 000204   	I.UIC   000022   	V.IBLB  000012   	.SYUIC= 000010
F.FSEQ  000010   	IE.BAD= ****** GX	LEV11M= 000401   	V.IBSZ  000013   	.VBSIZ= 001000
F.FSQN  000013   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002   	.WITRN= ****** GX
F.FVBN  000046   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040   	.WNDOW= ****** GX
F.HDLB  000022   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056   	...GBL= 000000
F.LBN   000026   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035   	...TPC= 000012
F.LGTH  000052   	I.CRTI= 000040   	M.CTSZ= 000006

. ABS.	000056	   000
      	000136	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2532 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[40,10]INWIN,[40,20]INWIN/-SP=[40,30]RSXDC,F11PRE,INWIN
RSXDC	MACRO M1108  05-DEC-77 17:09  PAGE 3


      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.
IXEXT	D0204, INDEX FILE EXTEN	MACRO M1108  05-DEC-77 17:09  PAGE 6


      1						.TITLE	IXEXT	D0204, INDEX FILE EXTEND LOGIC
						.IDENT	"D0204"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D204, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  21 FEB 75  17:52
     23					; PETER H. LIPMAN	2-APR-74
     24					;
     25					; EXTEND THE INDEX FILE
     26
     27					;
     28					;
     29					;+
     30					; **-.IXEXT-INDEX FILE EXTENSION ROUTINE
     31					;
     32					; THIS ROUTINE SETS UP THE CONTEXT NECESSARY TO EXTEND THE INDEX FILE
     33					; AND THEN INVOKES EXCOM TO DO THE JOB.  IT CALCULATES THE DESIRED
     34					; EXTEND SIZE BASED ON THE AVAILABLE POINTERS IN THE INDEX FILE
     35					; WINDOW, AND THE AVAILABLE SPACE ON THE VOLUME AS WELL AS THE MAX
     36					; NUMBER OF FILES ALLOWED ON THE VOLUME.
     37					;
     38					; THIS IS AN OPEN SUBROUTINE. IT MUST BE CALLED WITH A JMP AND IT
     39					; EXITS THROUGH THE DISPATCHER TO RE-EXECUTE WHATEVER FUNCTION
     40					; WAS IN PROGRESS.
     41					;
     42					; INPUTS:
     43					;
     44					;	(SP) = NEXT FILE NUMBER TO BE ALLOCATED
     45					; 	R4=VOLUME CONTROL BLOCK ADDRESS
     46					; 	R5=I/O PACKET FROM THE CREATE QI/O
     47					; 	.FILNO CONTAINS THE FILE NUMBER FOR THE NEXT HEADER TO BE ADDED
     48					; 		TO THE INDEX FILE
     49					;-
     50
     51	000000				.IXEXT::
     52	000000	016401 	000002 			MOV	V.IFWI(R4),R1	; R1=INDEX FILE WINDOW ADDREESS
     53	000004	010167 	000000G			MOV	R1,.WNDOW	; STORE WINDOW ADDRESS
     54	000010	016167 	000002 	000000G		MOV	W.FCB(R1),.FCBAD ; AND FCB ADDRESS
IXEXT	D0204, INDEX FILE EXTEN	MACRO M1108  05-DEC-77 17:09  PAGE 6-1


     55	000016	005002 				CLR	R2
     56	000020	012703 	000001 			MOV	#1,R3		; R2,R3 =DESIRED VBN (VBN 1)
     57	000024	010367 	000000G			MOV	R3,.FILNO	; SET UP .FILNO, AND .FILSQ
     58	000030	010367 	000000G			MOV	R3,.FILSQ
     59	000034					CALL	.WITRN		; TURN INDEX FILE WINDOW TO VBN 1
     60	000040	103001 				BCC	10$
     61	000042					FATAL	<FAILED TO TURN IDX FILE WINDOW TO BLK 1>
	000042	000004 				IOT			; *** FATAL ERROR FAILED TO TURN IDX FILE WINDOW TO BLK 1
     62					;
     63					; CALCULATE NO. OF RETRIEVAL POINTERS AVAILABLE FOR EXTENDING THE INDEX
     64					; FILE AND STILL REMAIN WITHIN ONE WINDOW.
     65					;
     66	000044	005000 			10$:	CLR	R0
     67	000046	156700 	000001G			BISB	.HDBUF+H.MPOF,R0 ; R0=WORD OFFSET TO MAP AREA
     68	000052	006300 				ASL	R0		; R0=BYTE OFFSET TO MAP AREA
     69	000054	062700 	000010G			ADD	#.HDBUF+M.USE,R0 ; R0=ADDRESS OF M.USE BYTE IN MAP AREA
     70	000060	116103 	000007 			MOVB	W.WISZ(R1),R3	; R3=SIZE OF WINDOW IN RETRIEVAL POINTERS
     71	000064	005002 				CLR	R2
     72	000066	151002 				BISB	(R0),R2		; R2=NO. OF WORDS OF RETRIEVAL POINTERS IN USE
     73	000070	006202 				ASR	R2		; R2=NO. OF RETRIEVAL POINTERS IN USE
     74	000072	160203 				SUB	R2,R3		; R3=NO. OF RETRIEVAL POINTERS AVAILABLE
     75					;
     76					; IF EITHER VBN 1 OR 2 ARE MAPPED BY SINGLE BLOCK RETRIEVAL POINTERS,
     77					; MAKE BELIEVE THEY ARE AVAILABLE SINCE WINDOW WOULD NORMALLY POINT TO
     78					; THE LAST N POINTERS ANYWAY.
     79					;
     80	000074					ASSUME	M.RTRV,M.USE+2
     81	000074	126027 	000003 	000001 		CMPB	3(R0),#1	; IS FIRST COUNT 0 OR 1
     82	000102	101006 				BHI	30$		; BRANCH IF NO
     83	000104	001404 				BEQ	20$		; BRANCH IF VBN 1 AND 2 IN FIRST PTR ALONE
     84	000106	005203 				INC	R3		; 1 MORE FREE RETRIEVAL POINTER
     85	000110	105760 	000007 			TSTB	7(R0)		; IS 2ND POINTER ALSO SIZE 1 (=0)
     86	000114	001001 				BNE	30$		; BRANCH IF NO
     87	000116	005203 			20$:	INC	R3		; ANOTHER FREE RETRIEVAL POINTER
     88					;
     89					; AT THIS POINT, R3 = NO. OF RETRIEVAL POINTERS AVAILABLE FOR EXTENDING
     90					; THE INDEX FILE AND STILL MAPPING EVERYTHING USEFUL IN ONE WINDOW.
     91					; R3 IS NEGATIVE OR 0 IF THE WINDOWS WORTH IS ALREADY USED
     92					;
     93	000120	016400 	000016 		30$:	MOV	V.FMAX(R4),R0	; R0=MAX NO. OF FILES ON VOLUME
     94	000124	005200 				INC	R0		; R0=MAX+1
     95	000126	162600 				SUB	(SP)+,R0	; R0=MAX NO. OF FILES TO BE ADDED TO INDEX
     96					;
     97					; SEE IF FREE SPACE ON VOLUME INDICATES THAT FEWER FILES SHOULD BE ADDED
     98					;
     99	000130	105764 	000034 			TSTB	V.FRBK(R4)	; IF HIGH BYTE OF COUNT IS NON ZERO
    100	000134	001007 				BNE	40$		; THERE'S PLENTY OF SPACE
    101	000136	016402 	000036 			MOV	V.FRBK+2(R4),R2 ; R2=BLOCKS FREE ON VOLUME,  C=0
    102	000142	006002 				ROR	R2		; DIVIDE BY 2 - MINIMUM OF 2 BLOCKS PER FILE
    103	000144	006202 				ASR	R2		; ASSUME MIN OF 3 DATA BLOCKS 1 HEADER
    104					;
    105					; R2 = A WORST CASE NO. OF FILES THAT COULD FIT GIVEN AVAILABLE BLOCKS
    106					;
    107	000146	020200 				CMP	R2,R0		; IF SPACE IS LOW, AND FEWER FILES WILL FIT
    108	000150	103001 				BHIS	40$
    109	000152	010200 				MOV	R2,R0		; USE THE SMALLER NUMBER
    110	000154				40$:
IXEXT	D0204, INDEX FILE EXTEN	MACRO M1108  05-DEC-77 17:09  PAGE 6-2


    118	000154	010301 				MOV	R3,R1		; R1=RETRIEVAL POINTER COUNT
    119	000156	003405 				BLE	50$		; BRANCH IF NONE LEFT
    120	000160					CALL	$DIV		; SPLIT NO. OF FILES ACROSS AVAILABLE POINTERS
    122	000164	005701 				TST	R1		; AND ROUND UP IF REMAINDER IS NON ZERO
    123	000166	001401 				BEQ	50$
    124	000170	005200 				INC	R0
    125					;
    126					; R0= NO. OF BLOCKS TO EXTEND INDEX FILE BY
    127					;
    128	000172				50$:
    133	000172	120064 	000025 			CMPB	R0,V.FIEX(R4)	; AND BY MINIMUM OF VOLUME DEFAULT
    134	000176	103003 				BHIS	70$
    135	000200	005000 				CLR	R0
    136	000202	156400 	000025 			BISB	V.FIEX(R4),R0	; USE DEFAULT
    142	000206	010001 			70$:	MOV	R0,R1		; R1 = NO. OF BLOCKS TO EXTEND FILE
    143					;
    144					; ASK FOR A CONTIGUOUS PIECE THE DESIRED SIZE, BUT SETTLE FOR LESS
    145					; IF DESIRED SPACE IS NOT AVAILABLE.
    146					;
    147	000210	012700 	001400 			MOV	#<EX.AC1!EX.AC2>*400,R0
    148	000214	012767 	000000C	000000G		MOV	#<<IO.EXT/256.>-LOWFCN+1>*2,.EXDSP ; SET UP EXTEND CLEANUP
    149					;
    150					; SET UP SO THAT A SUCCESSFUL EXTEND WILL REEXECUTE THE CREATE QI/O
    151					;
    152	000222	012716 	000000G			MOV	#.AGAIN,(SP)
    153					;
    154					; NOW JUMP INTO THE ROOT TO CALL THE EXTEND COMMON CODE.
    155					;
    156	000226	000177 	000000G			JMP	@.EXCM1
    157					;
    158					;
    159	000232					$END	IXEXT
    160					;
    161					;
    162		000001 				.END
IXEXT	D0204, INDEX FILE EXTEN	MACRO M1108  05-DEC-77 17:09  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.NLCK  000037   	I.EXDT= 000046   	M.LBSZ= 000007   	V.TRCT  000000
AC.LCK= 000001   	F.NWAC  000040   	I.EXTD  000030   	M.MAX = 000011   	V.WISZ  000020
BITFNU= 000002   	F.RVN   000012   	I.FCN   000014   	M.RTRV= 000012   	WI.BPS= 100000
EX.AC1= 000001   	F.SCHA  000021   	I.FIDP  000024   	M.USE = 000010   	WI.DLK= 010000
EX.AC2= 000002   	F.SIZE  000032   	I.FNAM= 000000   	QIOEFN= 000002   	WI.EXT= 002000
EX.ADF= 000010   	F.STAT  000040   	I.FNBP  000036   	R$$10F= 000001   	WI.LCK= 004000
EX.ENA= 000200   	F.STD   000004   	I.FTYP= 000006   	R$$11D= 000001   	WI.RDV= 000400
EX.FCO= 000004   	F.UCHA  000020   	I.FVER= 000010   	SC.BAD= 000100   	WI.WRV= 001000
E$$MSG= 000001   	F11PR$= 000000   	I.IOSB  000016   	SC.MDL= 000200   	W.CTL   000000
E$$TRP= 000001   	HIFCN = 000030   	I.LGTH  000040   	S.HDHD= 000056   	W.FCB   000002
FCPLUN= 000001   	H.CKSM= 000776   	I.LNK   000000   	S.IDHD= 000056   	W.RTRV  000012
FC.CEF= 020000   	H.FCHA= 000014   	I.LUN   000012   	S.MPHD= 000012   	W.STD   000004
FC.DIR= 040000   	H.FLEV= 000006   	I.PRI   000010   	S.STBK= 000012   	W.VBN   000006
FC.FCO= 010000   	H.FNUM= 000002   	I.PRM   000024   	UC.CON= 000200   	W.WISZ  000007
FC.WAC= 100000   	H.FOWN= 000010   	I.RTRV  000034   	UC.DLK= 000100   	$DIV  = ****** GX
FP.DEL= 000010   	H.FPRO= 000012   	I.RVDT= 000014   	VC.BMW= 000002   	$$    = 000067
FP.EXT= 000004   	H.FSEQ= 000004   	I.RVNO= 000012   	VC.IFW= 000001   	.AGAIN= ****** GX
FP.RAT= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	V.FCB   000006   	.DFEXT= 000005
FP.RDV= 000001   	H.MPOF= 000001   	I.RWAD= 000024   	V.FFNU  000055   	.DFPRO= 164000
FP.WRV= 000002   	H.PROG= 000010   	I.RWAT  000026   	V.FIEX  000025   	.EXCM1= ****** GX
F$$LVL= 000001   	H.PROJ= 000011   	I.RWCT= 000026   	V.FMAX  000016   	.EXDSP= ****** GX
F.DREF  000042   	H.SCHA= 000015   	I.RWVB= 000032   	V.FPRO  000030   	.FCBAD= ****** GX
F.DRNM  000044   	H.UCHA= 000014   	I.STD   000004   	V.FRBK  000034   	.FILNO= ****** GX
F.FEXT  000002   	H.UFAT= 000016   	I.TISZ= 000006   	V.IBLB  000012   	.FILSQ= ****** GX
F.FNUM  000006   	IDXFNU= 000001   	I.UIC   000022   	V.IBSZ  000013   	.HDBUF= ****** GX
F.FOWN  000014   	ID$$$ = 000204   	LEV11M= 000401   	V.IFWI  000002   	.IXEXT  000000RG
F.FPRO  000016   	IO.EXT= ****** GX	LOWFCN= 000011   	V.LABL  000040   	.PRFIL= 000004
F.FSEQ  000010   	I.ACTL  000035   	MFDFNO= 000004   	V.LGTH  000056   	.RTPTF= 001401
F.FSQN  000013   	I.AST   000020   	MFDFSQ= 000004   	V.LRUC  000035   	.SYUIC= 000010
F.FVBN  000046   	I.ATL   000006   	M$$HDR= 000001   	V.SBCL  000021   	.VBSIZ= 001000
F.HDLB  000022   	I.CRDT= 000031   	M.CTSZ= 000006   	V.SBLB  000024   	.WITRN= ****** GX
F.LBN   000026   	I.CRTI= 000040   	M.EFNU= 000002   	V.SBSZ  000022   	.WNDOW= ****** GX
F.LGTH  000052   	I.DASZ= 000007   	M.EFSQ= 000004   	V.STAT  000054   	...GBL= 000000
F.LINK  000000   	I.DPB   000011   	M.ERVN= 000001   	V.STD   000004   	...TPC= 000012
F.NACS  000036   	I.EFN   000013   	M.ESQN= 000000

. ABS.	000056	   000
      	000232	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2650 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:20
[40,10]IXEXT,[40,20]IXEXT/-SP=[40,30]RSXDC,F11PRE,IXEXT
RSXDC	MACRO M1108  05-DEC-77 17:09  PAGE 3


      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.
LOCAT	D0202, LOCATE DESIRED D	MACRO M1108  05-DEC-77 17:09  PAGE 6


      1						.TITLE	LOCAT	D0202, LOCATE DESIRED DIRECTORY ENTRY
						.IDENT	"D0202"
      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					;
					; VERSION D202, ASSEMBLED FOR RSX-11D
					;
     22
     23					; ANDREW C. GOLDSTEIN  5 MAR 75  20:27
     24					; PETER H. LIPMAN	20-MAR-74
     25					;
     26					; LOCATE THE DIRECTORY ENTRY CORRESPONDING TO THE USER SPECIFIED FILE
     27					; NAME BLOCK.
     28					;
     29						.MCALL	NBOFF$
     30	000000					NBOFF$	DEF$L		; DEFINE NAME BLOCK OFFSETS
     31	000000				.DRHRC::.BLKW	1		; HIGHEST/LOWEST VERSION RECORD NUMBER
     32	000002				.DRHVR::.BLKW	1		; HIGHEST/LOWEST VERSION NUMBER
     33	000004				.DRFRE::.BLKW	1		; RECORD NO. OF FREE ENTRY FOUND
     34	000006				.DRLVB::.BLKW	1		; LAST VBN WITH DIRECTORY ENTRY
     35	000010				.DRFNB::.BLKB	N.DID+6		; BUFFER FOR FILE NAME BLOCK
     36		000032 				S.DRFN==.-.DRFNB
LOCAT	D0202, LOCATE DESIRED D	MACRO M1108  05-DEC-77 17:09  PAGE 7


     38					;+
     39					; **-.LOCAT-LOCATE A DIRECTORY ENTRY
     40					;
     41					; THIS ROUTINE SCANS A DIRECTORY FOR THE SPECIFIED FILE. IT HANDLES STARTING
     42					; THE SEARCH AT A SPECIFIED RECORD NUMBER INSTEAD OF JUST AT THE BEGINNING
     43					; (IMPLEMENTING FIND AND REMOVE NEXT). IT HANDLES WILD CARDS IN NAME, TYPE,
     44					; AND VERSION. IT HANDLES DEFAULT NEWEST VERSION (0) AND DEFAULT OLDEST VERSION
     45					; (-1). ALSO IT SAVES THE RECORD NUMBER OF THE FIRST AVAILABLE ENTRY IF IT
     46					; FOUND ONE. (0 IF IT DIDN'T).
     47					;
     48					; INPUTS:
     49					;
     50					; 	R4=VOLUME CONTROL BLOCK
     51					; 	R5=FILE NAME BLOCK
     52					;
     53					; OUTPUTS:
     54					;
     55					; 	C=0 IF FOUND C=1 IF NOT
     56					; 	R0=RECORD NUMBER FOUND
     57					; 	R1=ADDRESS IN BUFFER OF DIRECTORY ENTRY
     58					; 	R2-R3 ALTERED
     59					; 	R4-R5 PRESERVED
     60					; 	.DRFRE CONTAINS RECORD NUMBER OF FREE ENTRY OR 0
     61					; 	.DRHVR CONTAINS THE HIGHEST/LOWEST VERSION FOUND IF DEFAULT SPECIFIED
     62					; 	.DRLVB CONTAINS THE LAST VBN WITH NON ZERO DIRECTORY ENTRY
     63					; 		OR ZERO IF ENTIRE DIRECTORY WASN'T SCANNED.
     64					;-
     65
     66	000042				.LOCAT::
     67	000042	012703 	000000'			MOV	#.DRHRC,R3
     68	000046	005023 				CLR	(R3)+		; NO HIGHEST/LOWEST VERSION RECORD NUMBER
     69	000050	016523 	000016 			MOV	N.FVER(R5),(R3)+ ; INIT HIGHEST/LOWEST VERSION NUMBER
     70	000054	005023 				CLR	(R3)+		; INIT RECORD NUMBER OF FREE ENTRY
     71	000056	005013 				CLR	(R3)		; INIT LAST VBN WITH AN ENTRY
     72	000060	016500 	000022 			MOV	N.NEXT(R5),R0	; START SEARCH AT SPECIFIED RECORD +1
     73	000064	005200 			10$:	INC	R0		; OR AT RECORD 1 IF NONE SPECIFIED
     74	000066					CALL	.DRGET		; POSITION TO DESIRED RECORD
     75	000072	103507 				BCS	90$		; BRANCH IF END OF FILE
     76	000074	005711 				TST	(R1)		; IS THIS ENTRY EMPTY
     77	000076	001006 				BNE	20$		; BRANCH IF NO, ITS IN USE
     78	000100	005767 	177700 			TST	.DRFRE		; ALREADY NOTED A FREE ENTRY
     79	000104	001367 				BNE	10$		; BRANCH IF YES, GO TO NEXT
     80	000106	010067 	177672 			MOV	R0,.DRFRE	; NO, RECORD THIS ONE AS FIRST FREE ENTRY
     81	000112	000764 				BR	10$		; AND GO GET NEXT RECORD
     82
     83	000114	010267 	177666 		20$:	MOV	R2,.DRLVB	; SAVE VBN OF THIS DIRECTORY ENTRY
     84	000120	032765 	000000G	000020 		BIT	#NB.SNM,N.STAT(R5) ; IF WILD CARD NAME
     85	000126	001014 				BNE	30$		; THEN CONSIDER MATCHED
     86	000130	026165 	000006 	000006 		CMP	N.FNAM(R1),N.FNAM(R5) ; OTHERWISE CHECK
     87	000136	001352 				BNE	10$
     88	000140	026165 	000010 	000010 		CMP	N.FNAM+2(R1),N.FNAM+2(R5) ; 3 WORDS
     89	000146	001346 				BNE	10$
     90	000150	026165 	000012 	000012 		CMP	N.FNAM+4(R1),N.FNAM+4(R5) ; OF FILE NAME
     91	000156	001342 				BNE	10$
     92	000160	032765 	000000G	000020 	30$:	BIT	#NB.STP,N.STAT(R5) ; IF WILD CARD TYPE
     93	000166	001004 				BNE	40$		; THEN IT MATCHES
     94	000170	026165 	000014 	000014 		CMP	N.FTYP(R1),N.FTYP(R5) ; OTHERWISE COMPARE TYPES
LOCAT	D0202, LOCATE DESIRED D	MACRO M1108  05-DEC-77 17:09  PAGE 7-1


     95	000176	001332 				BNE	10$		;
     96	000200	032765 	000000G	000020 	40$:	BIT	#NB.SVR,N.STAT(R5) ; IF WILD VERSION
     97	000206	001036 				BNE	80$		; THEN VERSION MATCHES, FILE FOUND, C=0
     98	000210	016502 	000016 			MOV	N.FVER(R5),R2	; IS REQUESTED VERSION EXPLICIT?
     99	000214	003030 				BGT	70$		; BRANCH IF YES, SEE IF IT MATCHES
    100	000216	032765 	000000C	000020 		BIT	#NB.SNM!NB.STP,N.STAT(R5) ; IF WILD NAME OR TYPE
    101	000224	001045 				BNE	120$		; THEN NO DEFAULT VERSION ALLOWED
    102	000226	005202 				INC	R2		; R2 IS .LE.0
    103	000230	001406 				BEQ	50$		; BRANCH IF WAS -1
    104	000232	100714 				BMI	10$		; BRANCH IF WAS -2 OR SMALLER, NOT FOUND
    105	000234	026167 	000016 	177540 		CMP	N.FVER(R1),.DRHVR ; IS THIS HIGHER THAN CURRENT HIGHEST VERSION
    106	000242	101005 				BHI	60$		; BRANCH IF YES, SAVE VERSION AND RECORD NO.
    107	000244	000707 				BR	10$		; NO, IGNORE THIS RECORD
    108
    109	000246	026167 	000016 	177526 	50$:	CMP	N.FVER(R1),.DRHVR ; IS THIS LOWER THAN CURRENT LOWEST VERSION
    110	000254	103303 				BHIS	10$		; BRANCH IF NO
    111	000256	016167 	000016 	177516 	60$:	MOV	N.FVER(R1),.DRHVR ; SAVE THIS VERSION NUMBER
    112	000264	005715 				TST	(R5)		; IF THIS IS AN ENTER (FILE # NON ZERO)
    113	000266	001276 				BNE	10$		; DON'T SAVE THE RECORD NO.
    114	000270	010067 	177504 			MOV	R0,.DRHRC	; SAVE THIS RECORD NUMBER
    115	000274	000673 				BR	10$		; GO LOOK AT NEXT DIRECTORY ENTRY
    116
    117	000276	026102 	000016 		70$:	CMP	N.FVER(R1),R2
    118	000302	001270 				BNE	10$		; BRANCH IF NO MATCH
    119	000304	005067 	177476 		80$:	CLR	.DRLVB		; FULL SCAN NOT TAKEN, THIS VBN NOT VALID
    120	000310	000412 				BR	110$		; BRANCH IF MATCH, C=0, FILE FOUND
    121					;
    122					; END OF FILE ON DIRECTORY -C=1
    123					;
    124	000312	016702 	177466 		90$:	MOV	.DRFRE,R2	; ANY FREE SLOT DISCOVERED?
    125	000316	001002 				BNE	100$		; BRANCH IF YES
    126	000320	010067 	177460 			MOV	R0,.DRFRE	; RECORD THE EOF RECORD NO. AS FREE
    127	000324	016700 	177450 		100$:	MOV	.DRHRC,R0	; WAS A LATEST/OLDEST VERSION FOUND
    128	000330	001402 				BEQ	110$		; BRANCH IF NO, FILE NOT FOUND, C=1
    129	000332					CALL	.DRGET		; MAKE SURE THIS ENTRY IS IN BUFFER
    130	000336				110$:	RETURN
    131
    132	000340				120$:	ERRX	IE.BAD,<BAD PARAMETERS - WILD CARD NAME/DEFAULT VERSION>
	000340	   000C	   211 			TRAP	-IE.BAD		; BAD PARAMETERS - WILD CARD NAME/DEFAULT VERSION
    133					;
    134					;
    135	000342					$END	LOCAT
    136					;
    137					;
    138		000001 				.END
LOCAT	D0202, LOCATE DESIRED D	MACRO M1108  05-DEC-77 17:09  PAGE 7-2
SYMBOL TABLE

AC.DLK= 000002   	F.SCHA  000021   	I.FTYP= 000006   	N.FID = 000000   	V.LGTH  000056
AC.LCK= 000001   	F.SIZE  000032   	I.FVER= 000010   	N.FNAM= 000006   	V.LRUC  000035
BITFNU= 000002   	F.STAT  000040   	I.IOSB  000016   	N.FTYP= 000014   	V.SBCL  000021
EX.AC1= 000001   	F.STD   000004   	I.LGTH  000040   	N.FVER= 000016   	V.SBLB  000024
EX.AC2= 000002   	F.UCHA  000020   	I.LNK   000000   	N.NEXT= 000022   	V.SBSZ  000022
EX.ADF= 000010   	F11PR$= 000000   	I.LUN   000012   	N.STAT= 000020   	V.STAT  000054
EX.ENA= 000200   	HIFCN = 000030   	I.PRI   000010   	N.UNIT= 000034   	V.STD   000004
EX.FCO= 000004   	H.CKSM= 000776   	I.PRM   000024   	QIOEFN= 000002   	V.TRCT  000000
E$$MSG= 000001   	H.FCHA= 000014   	I.RTRV  000034   	R$$10F= 000001   	V.WISZ  000020
E$$TRP= 000001   	H.FLEV= 000006   	I.RVDT= 000014   	R$$11D= 000001   	WI.BPS= 100000
FCPLUN= 000001   	H.FNUM= 000002   	I.RVNO= 000012   	SC.BAD= 000100   	WI.DLK= 010000
FC.CEF= 020000   	H.FOWN= 000010   	I.RVTI= 000023   	SC.MDL= 000200   	WI.EXT= 002000
FC.DIR= 040000   	H.FPRO= 000012   	I.RWAD= 000024   	S.DRFN= 000032 G 	WI.LCK= 004000
FC.FCO= 010000   	H.FSEQ= 000004   	I.RWAT  000026   	S.FNAM= 000006   	WI.RDV= 000400
FC.WAC= 100000   	H.IDOF= 000000   	I.RWCT= 000026   	S.FNB = 000036   	WI.WRV= 001000
FP.DEL= 000010   	H.MPOF= 000001   	I.RWVB= 000032   	S.FNBW= 000017   	W.CTL   000000
FP.EXT= 000004   	H.PROG= 000010   	I.STD   000004   	S.FNTY= 000004   	W.FCB   000002
FP.RAT= 000001   	H.PROJ= 000011   	I.TISZ= 000006   	S.FTYP= 000002   	W.RTRV  000012
FP.RDV= 000001   	H.SCHA= 000015   	I.UIC   000022   	S.HDHD= 000056   	W.STD   000004
FP.WRV= 000002   	H.UCHA= 000014   	LEV11M= 000401   	S.IDHD= 000056   	W.VBN   000006
F$$LVL= 000001   	H.UFAT= 000016   	LOWFCN= 000011   	S.MPHD= 000012   	W.WISZ  000007
F.DREF  000042   	IDXFNU= 000001   	MFDFNO= 000004   	S.NFEN= 000020   	$$    = 000067
F.DRNM  000044   	ID$$$ = 000202   	MFDFSQ= 000004   	S.STBK= 000012   	.DFEXT= 000005
F.FEXT  000002   	IE.BAD= ****** GX	M$$HDR= 000001   	UC.CON= 000200   	.DFPRO= 164000
F.FNUM  000006   	I.ACTL  000035   	M.CTSZ= 000006   	UC.DLK= 000100   	.DRFNB  000010RG
F.FOWN  000014   	I.AST   000020   	M.EFNU= 000002   	VC.BMW= 000002   	.DRFRE  000004RG
F.FPRO  000016   	I.ATL   000006   	M.EFSQ= 000004   	VC.IFW= 000001   	.DRGET= ****** GX
F.FSEQ  000010   	I.CRDT= 000031   	M.ERVN= 000001   	V.FCB   000006   	.DRHRC  000000RG
F.FSQN  000013   	I.CRTI= 000040   	M.ESQN= 000000   	V.FFNU  000055   	.DRHVR  000002RG
F.FVBN  000046   	I.DASZ= 000007   	M.LBSZ= 000007   	V.FIEX  000025   	.DRLVB  000006RG
F.HDLB  000022   	I.DPB   000011   	M.MAX = 000011   	V.FMAX  000016   	.LOCAT  000042RG
F.LBN   000026   	I.EFN   000013   	M.RTRV= 000012   	V.FPRO  000030   	.PRFIL= 000004
F.LGTH  000052   	I.EXDT= 000046   	M.USE = 000010   	V.FRBK  000034   	.RTPTF= 001401
F.LINK  000000   	I.EXTD  000030   	NB.SNM= ****** GX	V.IBLB  000012   	.SYUIC= 000010
F.NACS  000036   	I.FCN   000014   	NB.STP= ****** GX	V.IBSZ  000013   	.VBSIZ= 001000
F.NLCK  000037   	I.FIDP  000024   	NB.SVR= ****** GX	V.IFWI  000002   	...GBL= 000000
F.NWAC  000040   	I.FNAM= 000000   	N.DID = 000024   	V.LABL  000040   	...TPC= 000036
F.RVN   000012   	I.FNBP  000036   	N.DVNM= 000032

. ABS.	000056	   000
      	000342	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2700 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:21
[40,10]LOCAT,[40,20]LOCAT/-SP=[40,30]RSXDC,F11PRE,LOCAT
RSXDC	MACRO M1108  05-DEC-77 17:09  PAGE 3


      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.
MOUNT	D0222, MOUNT VOLUME	MACRO M1108  05-DEC-77 17:09  PAGE 6


      1						.TITLE	MOUNT	D0222, MOUNT VOLUME
						.IDENT	"D0222"
      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					;
					; VERSION D222, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  11 DEC 74  14:34
     23					;
     24					; THIS ROUTINE MOUNTS A VOLUME FOR FILE PROCESSING.
     25
     26						.MCALL	QIOW$,FHDOF$,HMBOF$
     27	000000					FHDOF$			; DEFINE FILE HEADER AND HOME BLOCK OFFSETS
     28	000000					HMBOF$
     29
     30					; MACRO TO CALL QIO SUBROUTINE
     31
     32					.MACRO	QIO	DPB
     33						JSR	R5,.MXQIO
     34						.WORD	DPB
     35					.ENDM	QIO
     36
     37					; MACRO TO SIGNAL ERRORS
     38
     39					.MACRO	ERROR	CODE
     40						.IF	NB,CODE
     41						MOV	#CODE,.IOSTS+2
     42						ERRX	IE.ABO
     43						.IFF
     44						MOVB	.QIOST,.IOSTS
     45						ERRX
     46						.ENDC
     47					.ENDM	ERROR
     48
     49					; ERROR CODES RETURNED TO THE MOUNT TASK WITH AN "IE.ABO" ERROR.
     50					; THESE CODES INDEX INTO A TABLE AND THE VALUES ARE CRITICAL. SORRY.
     51
     52		000007 			ME.SYN = 7.			; SYNTAX ERROR
     53		000012 			ME.NHM = 10.			; HOME BLOCK NOT FOUND
     54		000013 			ME.WRV = 11.			; WRONG VOLUME
MOUNT	D0222, MOUNT VOLUME	MACRO M1108  05-DEC-77 17:09  PAGE 6-1


     55
     56					; LOCALLY USED DPB'S
     57
     58					; SET CHARACTERISTICS
     59
     60	000000				SETCHA:	QIOW$	IO.STC,FCPLUN,QIOEFN,,.QIOST,,<0>
     61
     62					; READ LOGICAL BLOCK
     63
     64	000016				RLB:	QIOW$	IO.RLB,FCPLUN,QIOEFN,,.QIOST,,<.HDBUF,.VBSIZ,,0,0>
     65		000040'			LBNH=	RLB+Q.IOPL+6		; HIGH ORDER BLOCK NUMBER
     66		000042'			LBNL=	RLB+Q.IOPL+10		; LOW ORDER BLOCK NUMBER
     67
     68					; BUFFER TO RECEIVE MOUNT COMMAND
     69
     70		001000 			CMDBFL = 512.			; SIZE OF BUFFER
     71
     72					; VALUES RETURNED FROM THE COMMAND STRING PARSER
     73
     74	000044				$VNML::	.BLKW	1		; STRING DESCRIPTOR OF VOLUME LABEL
     75	000046				$VNAM::	.BLKW	1		; IN COMMAND STRING
     76	000050				$UIC::	.BLKW	1		; VOLUME OWNER
     77	000052				$CHAR::	.BLKW	1		; VOLUME CHARACTERISTICS
     78	000054				$PRO::	.BLKW	1		; VOLUME PROTECTION
     79	000056				$EXT::	.BLKW	1		; DEFAULT FILE EXTEND
     80	000060				$FPRO::	.BLKW	1		; DEFAULT FILE PROTECTION
     81	000062				$WIN::	.BLKB	1		; DEFAULT WINDOW SIZE
     82	000063				$LRU::	.BLKB	1		; MAX ENTRIES IN DIRECTORY LRU
     83	000064				$FLAGS::.BLKW	1		; FLAG WORD FROM PARSER
     84
     85					; THE FOLLOWING FLAGS ARE RETURNED:
     86
     87		000001 			MO.UIC==1			; EXPLICIT UIC
     88		000002 			MO.CHA==2			; EXPLICIT CHARACTERISTICS
     89		000004 			MO.PRO==4			; EXPLICIT PROTECTION
     90		000010 			MO.UNL==10			; UNLOCK INDEX FILE
     91		000020 			MO.EXT==20			; DEFAULT FILE EXTEND SPECIFIED
     92		000040 			MO.FPR==40			; DEFAULT FILE PROTECTION SPECIFIED
     93		000100 			MO.WIN==100			; DEFAULT WINDOW SIZE SPECIFIED
     94		000200 			MO.OVR==200			; OVERRIDE VOLUME LABEL CHECK
     95		000400 			MO.SWL==400			; SOFTWARE WRITE LOCK
     96		001000 			MO.LRU==1000			; DIRECTORY LRU LIMIT SPECIFIED
MOUNT	D0222, MOUNT VOLUME	MACRO M1108  05-DEC-77 17:09  PAGE 7


     98					;+
     99					;
    100					; **.MOUNT - MOUNT VOLUME
    101					;
    102					; THIS ROUTINE ESTABLISHES THAT A VOLUME IS OF LEGAL FILES-11 FORMAT
    103					; AND CREATES THE IN CORE DATA STRUCTURES NEEDED FOR SUBSEQUENT
    104					; FILE OPERATIONS ON THAT VOLUME. IT FINDS THE VOLUME'S HOME BLOCK,
    105					; VERIFIES THE VOLUME LABEL, AND CONSTRUCTS THE VCB AND THE FCB AND
    106					; WINDOW FOR THE INDEX FILE. FINALLY OPTIONS AS SPECIFIED IN THE
    107					; COMMAND STRING ARE APPLIED TO THE VCB.
    108					;
    109					; INPUTS:
    110					;
    111					;	R0=ADDRESS OF USER STRING POINTER
    112					;	R2=BYTE COUNT OF COMMAND STRING
    113					;	R5=ADDRESS OF MOUNT I/O PACKET
    114					;
    115					; OUTPUTS:
    116					;
    117					;	R4=VCB ADDRESS
    118					;	R5=I/O PACKET ADDRESS
    119					;
    120					; OTHER REGISTERS ARE CLOBBERED.
    121					;
    122					;-
    123
    124	000066				.MOUNT::
    125	000066	005067 	177772 			CLR	$FLAGS		; CLEAN OUT FLAGS WORD
    126	000072	005067 	000000G			CLR	.SMUCB		; INVALIDATE BIT MAP BUFFER
    127	000076	010203 				MOV	R2,R3		; SAVE STRING COUNT
    128	000100	012701 	000000G			MOV	#.SMBUF,R1	; POINT TO COMMAND BUFFER
    129	000104	010104 				MOV	R1,R4		; SAVE STRING ADDRESS
    130	000106					CALL	.BLXI		; TRANSFER IN COMMAND STRING
    131	000112	005001 				CLR	R1		; SET SPACE FLUSH OPTION
    132	000114	012702 	000000G			MOV	#.MOKTB,R2	; POINT TO KEYWORD TABLE
    133	000120	012705 	000000G			MOV	#.MOPRS,R5	; POINT TO STARTING STATE
    134	000124					CALL	.TPARS		; AND PARSE THE COMMAND STRING
    135	000130	103004 				BCC	10$
    136	000132					ERROR	ME.SYN		; SYNTAX ERROR
	000140	   000C	   211 			TRAP	-IE.ABO		;
    137
    138	000142	016704 	000000G		10$:	MOV	.UCBAD,R4	; GET PUD ADDRESS AGAIN
    139	000146	005764 	000000G			TST	U.VA(R4)		;VOLUME ALREADY MOUNTED?
    140	000152	001404 				BEQ	12$		;NO -- CONTINUE
    141	000154					ERROR	12.
	000162	   000C	   211 			TRAP	-IE.ABO		;
    142	000164	016705 	000000G		12$:	MOV	.IOPKT,R5	; AND I/O PACKET ADDRESS
    143	000170					QIO	SETCHA		; DO SET CHARACTERISTICS TO SET VOLUME VALID (ON RP04)
    144	000176	103010 				BCC	20$
    145	000200	126727 	000000G	000000G		CMPB	.QIOST,#IE.IFC	; CHECK FOR ILLEGAL FUNCTION
    146	000206	001404 				BEQ	20$		; YES, IGNORE (MUST NOT BE AN RP04)
    147	000210					ERROR			; SOME OTHER TYPE OF ERROR
	000216	104400 				TRAP	0		;
    148
    149					; FIRST SEARCH FOR THE HOME BLOCK
    150
    151	000220	012767 	000001 	177614 	20$:	MOV	#1,LBNL		; SET UP FIRST CHOICE LOCATION
MOUNT	D0222, MOUNT VOLUME	MACRO M1108  05-DEC-77 17:09  PAGE 7-1


    152	000226	005067 	177606 			CLR	LBNH		; I.E., LBN = 1
    153	000232				30$:	QIO	RLB		; READ THE BLOCK
    154	000240	103430 				BCS	40$		; CHECK ON I/O ERROR
    155	000242	012701 	000000G			MOV	#.HDBUF,R1	; POINT TO BLOCK BUFFER
    156	000246	012702 	000034 			MOV	#H.CHK1/2-1,R2	; GET WORD COUNT TO FIRST CHECKSUM
    157	000252					CALL	.CKSM1		; CHECK THE CHECKSUM
    158	000256	103431 				BCS	50$		; NO GOOD - PUNT THIS BLOCK
    159	000260	012701 	000000G			MOV	#.HDBUF,R1	; POINT TO BUFFER AGAIN
    160	000264					CALL	.CKSUM		; COMPUTE SECOND CHECKSUM
    161	000270	103424 				BCS	50$		; OUT ON ERROR
    162	000272	005767 	000000G			TST	.HDBUF+H.IBSZ	; CHECK INDEX FILE BITMAP SIZE
    163	000276	001421 				BEQ	50$		; MUST BE NON-ZERO
    164	000300	016700 	000002G			MOV	.HDBUF+H.IBLB,R0 ; CHECK INDEX FILE BITMAP LBN
    165	000304	056700 	000004G			BIS	.HDBUF+H.IBLB+2,R0
    166	000310	001414 				BEQ	50$		; MUST BE NON-ZERO
    167	000312	005767 	000006G			TST	.HDBUF+H.FMAX	; CHECK MAX NUMBER OF FILES
    168	000316	001411 				BEQ	50$		; MUST BE NON-ZERO
    169	000320	000441 				BR	HOMEBL		; YES - A REAL LIVE HOME BLOCK!
    170
    171					; WE GET HERE ON ANY I/O ERROR READING THE HOME BLOCK
    172
    173	000322	126727 	000000G	000000G	40$:	CMPB	.QIOST,#IE.VER	; TEST FOR PARITY ERROR
    174	000330	001404 				BEQ	50$
    175	000332					ERROR			; GIVE UP ON ANYTHING ELSE
	000340	104400 				TRAP	0		;
    176
    177					; THIS BLOCK IS NOT A HOME BLOCK, EITHER BECAUSE IT HAS BAD PARITY
    178					; OR THE CHECKSUMS ARE NOT THERE.
    179
    180	000342	042767 	000001 	177472 	50$:	BIC	#1,LBNL		; TRY THE NEXT BLOCK IN SEQUENCE
    181	000350	062767 	000400 	177464 		ADD	#400,LBNL	; OF 1, 400, 1000, 1400, 2000, 2400 ....
    182	000356	005567 	177456 			ADC	LBNH
    183	000362	026764 	177452 	000000G		CMP	LBNH,U.LBH(R4)	; CHECK LBN AGAINST VOLUME SIZE
    184	000370	103720 				BLO	30$		; OK - TRY IT
    185	000372	001404 				BEQ	60$
    186	000374					ERROR	ME.NHM		; IF WE'RE OVER THERE IS NO HOME BLOCK
	000402	   000C	   211 			TRAP	-IE.ABO		;
    187	000404	026764 	177432 	000000G	60$:	CMP	LBNL,U.LBN(R4)	; CHECK LOW ORDER
    188	000412	103707 				BLO	30$
    189	000414					ERROR	ME.NHM		; OVER THE TOP - OUT
	000422	   000C	   211 			TRAP	-IE.ABO		;
MOUNT	D0222, MOUNT VOLUME	MACRO M1108  05-DEC-77 17:09  PAGE 8


    191					; WE HAVE FOUND THE HOME BLOCK. FILL IN THE RELEVANT INFORMATION IN THE
    192					; PUD FROM THE VOLUME.
    193
    194	000424	036727 	177434 	000200 	HOMEBL:	BIT	$FLAGS,#MO.OVR	; CHECK FOR OVERRIDE BIT
    195	000432	001034 				BNE	50$		; YES - SKIP LABEL CHECK
    196	000434	016700 	177406 			MOV	$VNAM,R0	; POINT TO LABEL IN COMMAND LINE
    197	000440	012702 	000016G			MOV	#.HDBUF+H.VNAM,R2 ; POINT TO VOLUME LABEL IN HOME BLOCK
    198	000444	016701 	177374 			MOV	$VNML,R1	; GET LENGTH OF VOL LABEL IN COMMAND LINE
    199	000450	001417 				BEQ	40$		; SKIP CHECK IF NONE GIVEN
    200	000452	122022 			10$:	CMPB	(R0)+,(R2)+	; COMPARE VOLUME LABELS
    201	000454	001404 				BEQ	20$
    202	000456					ERROR	ME.WRV		; OUT ON MISMATCH
	000464	   000C	   211 			TRAP	-IE.ABO		;
    203	000466	077107 			20$:	SOB	R1,10$
    204
    205	000470	020227 	000032G			CMP	R2,#.HDBUF+H.VNAM+12. ; SEE IF LABEL WAS 12 CHARS LONG
    206	000474	101404 				BLOS	30$
    207	000476					ERROR	ME.WRV		; OVER 12 - CAN'T BE RIGHT
	000504	   000C	   211 			TRAP	-IE.ABO		;
    208	000506	001406 			30$:	BEQ	50$		; EQUAL - SKIP END CHECK
    209	000510	105712 			40$:	TSTB	(R2)		; CHECK NEXT BYTE IN HOME BLOCK
    210	000512	001404 				BEQ	50$
    211	000514					ERROR	ME.WRV		; NONZERO MEANS LABEL STRING WAS TOO SHORT
	000522	   000C	   211 			TRAP	-IE.ABO		;
    212
    213	000524	005064 	000000G		50$:	CLR	U.AR(R4)		; INIT VOLUME PROTECTION
    214	000530	016764 	000036G	000000G		MOV	.HDBUF+H.VOWN,U.UI(R4)	; VOLUME OWNER UIC
    215	000536	001403 				BEQ	60$			; VOLUME IS UNOWNED
    216	000540	016764 	000040G	000000G		MOV	.HDBUF+H.VPRO,U.AR(R4)	; VOLUME PROTECTION
    217	000546	116764 	000042G	000000G	60$:	MOVB	.HDBUF+H.VCHA,U.CH(R4)	; VOLUME CHARACTERISTICS
    218
    219	000554	042764 	000000G	000000G		BIC	#UC.SWL,U.C1(R4)	; CLEAR SOFTWARE WRITE LOCK BIT
    220	000562	036727 	177276 	000400 		BIT	$FLAGS,#MO.SWL		; SEE IF WRITE LOCK IS REQUESTED
    221	000570	001403 				BEQ	70$			; NO
    222	000572	052764 	000000G	000000G		BIS	#UC.SWL,U.C1(R4)	; YES - SET IT
    223
    224					; NOW ALLOCATE A VCB, CHARGING IT TO THE FILES TASK.
    225
    226	000600	016702 	000000G		70$:	MOV	.CRTSK,R2	; GET OUR ATL ADDR
    227	000604	016202 	000000G			MOV	A.TD(R2),R2	; GET STD ADDR
    228	000610	012701 	000056 			MOV	#V.LGTH,R1	; GET LENGTH OF VCB
    229	000614					CALL	.ALLOC		; AND ALLOCATE IT
    230	000620	010064 	000000G			MOV	R0,U.VA(R4)	; PUT VCB POINTER IN PUD
    231	000624	010004 				MOV	R0,R4		; SET STANDARD VCB POINTER
    232
    233					; FILL IN INFORMATION FROM THE VOLUME'S HOME BLOCK
    234
    235	000626	012701 	000016G			MOV	#.HDBUF+H.VNAM,R1 ; POINT TO VOLUME NAME AGAIN
    236	000632	062700 	000040 			ADD	#V.LABL,R0	; POINT TO LABEL SPACE IN VCB
    237	000636	012702 	000014 			MOV	#12.,R2		; BYTE COUNT
    238	000642	112120 			80$:	MOVB	(R1)+,(R0)+	; COPY VOLUME LABEL TO VCB
    239	000644	077202 				SOB	R2,80$
    240
    241	000646					ASSUME	V.IBSZ,V.IBLB+1
    242	000646					ASSUME	V.FMAX,V.IBLB+4
    243	000646					ASSUME	V.WISZ,V.FMAX+2
    244	000646					ASSUME	V.SBCL,V.WISZ+1
MOUNT	D0222, MOUNT VOLUME	MACRO M1108  05-DEC-77 17:09  PAGE 8-1


    245
    246	000646	010400 				MOV	R4,R0		; COPY VCB POINTER
    247	000650	062700 	000012 			ADD	#V.IBLB,R0	; POINT INTO VCB
    248	000654	116720 	000002G			MOVB	.HDBUF+H.IBLB,(R0)+	; STARTING LBN OF INDEX FILE BIT MAP, HIGH
    249	000660	116720 	000000G			MOVB	.HDBUF+H.IBSZ,(R0)+	; NUMBER OF BLOCKS IN INDEX FILE BITMAP
    250	000664	016720 	000004G			MOV	.HDBUF+H.IBLB+2,(R0)+	; LBN OF INDEX FILE BIT MAP, LOW ORDER
    251	000670	016720 	000006G			MOV	.HDBUF+H.FMAX,(R0)+	; MAXIMUM NUMBER OF FILES ON VOLUME
    252	000674	116710 	000054G			MOVB	.HDBUF+H.WISZ,(R0)	; DEFAULT WINDOW SIZE
    253	000700	001010 				BNE	90$			; BRANCH IF OK
    254	000702	112710 	000011 			MOVB	#9.,(R0)		; OLD VOLUME - USE DEFAULT
    255	000706	112767 	000005 	000055G		MOVB	#.DFEXT,.HDBUF+H.FIEX	; STUFF VOLUME'S DEFAULT FILE EXTEND
    256	000714	112767 	164000 	000044G		MOVB	#.DFPRO,.HDBUF+H.FPRO	; AND DEFAULT FILE PROTECTION
    257	000722	036727 	177136 	000100 	90$:	BIT	$FLAGS,#MO.WIN		; CHECK FOR EXPLICIT WINDOW SIZE
    258	000730	001402 				BEQ	100$			; NO
    259	000732	116710 	177124 			MOVB	$WIN,(R0)		; YES - PUT IN VCB
    260	000736	005200 			100$:	INC	R0
    261	000740	116720 	000010G			MOVB	.HDBUF+H.SBCL,(R0)+	; STORAGE BIT MAP CLUSTER FACTOR
    262	000744	116764 	000055G	000025 		MOVB	.HDBUF+H.FIEX,V.FIEX(R4) ; DEFAULT FILE EXTEND INCREMENT
    263	000752	016764 	000044G	000030 	 	MOV	.HDBUF+H.FPRO,V.FPRO(R4) ; DEFAULT FILE PROTECTION
    264	000760	116764 	000056G	000035 		MOVB	.HDBUF+H.LRUC,V.LRUC(R4) ; COUNT OF ENTRIES IN DIRECTORY LRU
    265	000766	001003 				BNE	110$
    266	000770	112764 	000003 	000035 		MOVB	#3,V.LRUC(R4)	; DEFAULT OLD VOLUMES TO 3
    267
    268					; NOW READ THE INDEX FILE HEADER AND "ACCESS" THE INDEX FILE, BUILDING
    269					; AN FCB AND WINDOW.
    270
    271	000776	116403 	000013 		110$:	MOVB	V.IBSZ(R4),R3	; GET NUMBER OF BLOCKS IN INDEX FILE BITMAP
    272	001002	005002 				CLR	R2
    273	001004	156402 	000012 			BISB	V.IBLB(R4),R2	; ADD IN START OF BITMAP
    274	001010	066403 	000014 			ADD	V.IBLB+2(R4),R3
    275	001014	005502 				ADC	R2		; TO COMPUTE INDEX FILE HEADER LBN
    276	001016	012700 	000001 			MOV	#1,R0		; SET FILE NUMBER = 1
    277	001022	010067 	000000G			MOV	R0,.FILNO
    278	001026	010067 	000000G			MOV	R0,.FILSQ
    279	001032					CALL	.RHDLB		; READ THE HEADER
    280
    281	001036					CALL	.CRFCB		; GET AN FCB FOR INDEX FILE
    282	001042	010067 	000000G			MOV	R0,.FCBAD	; STORE FCB ADDRESS
    283	001046	005000 				CLR	R0		; INDICATE READ ACCESS
    284	001050					CALL	.INWIN		; AND SET UP A WINDOW
    285	001054	016700 	000000G			MOV	.FCBAD,R0	; GET FCB ADDRESS
    286	001060	036727 	177000 	000010 		BIT	$FLAGS,#MO.UNL	; SEE IF UNLOCK REQUESTED
    287	001066	001005 				BNE	120$		; YES
    288	001070					ASSUME	W.CTL,0
    289	001070	052777 	004000 	000000G		BIS	#WI.LCK,@.WNDOW	; ELSE SET LOCK BIT
    290	001076	105260 	000037 			INCB	F.NLCK(R0)	; AND BUMP LOCK COUNT IN FCB
    291	001102	105260 	000036 		120$:	INCB	F.NACS(R0)	; BUMP ACCESS COUNT IN FCB
    292
    293	001106	010064 	000006 			MOV	R0,V.FCB(R4)	; INIT VOLUME'S FCB CHAIN
    294	001112	010064 	000010 			MOV	R0,V.FCB+2(R4)
    295	001116	016764 	000000G	000002 		MOV	.WNDOW,V.IFWI(R4) ; SET INDEX FILE WINDOW ADDR IN VCB
    296	001124					ASSUME	V.TRCT,0
    297	001124	005214 				INC	(R4)		; BUMP TRANSACTION COUNT TO 1
    298
    299					; NOW READ THE STORAGE BITMAP FILE HEADER AND INIT ITS PARAMETERS IN THE
    300					; VCB.
    301
MOUNT	D0222, MOUNT VOLUME	MACRO M1108  05-DEC-77 17:09  PAGE 8-2


    302	001126	005067 	000000G			CLR	.FCBAD		; CLEAN OUT CONTEXT
    303	001132	005067 	000000G			CLR	.WNDOW
    304	001136	012700 	000002 			MOV	#2,R0		; INDICATE FILE NUMBER 2
    305	001142					CALL	.RHDFN		; READ HEADER BY FILE NUMBER
    306	001146	005000 				CLR	R0
    307	001150	156700 	000001G			BISB	.HDBUF+H.MPOF,R0 ; GET MAP AREA OFFSET
    308	001154	006300 				ASL	R0
    309	001156	062700 	000012G			ADD	#.HDBUF+M.RTRV,R0 ; POINT TO RETRIEVAL POINTERS
    310	001162	112064 	000024 			MOVB	(R0)+,V.SBLB(R4) ; GET HIGH ORDER LBN
    311	001166	112001 				MOVB	(R0)+,R1	; GET BLOCK COUNT
    312	001170	001003 				BNE	130$		; IF NON-ZERO, COUNT IS GOOD
    313	001172	116001 	000003 			MOVB	3(R0),R1	; ELSE GET COUNT FROM NEXT POINTER
    314	001176	105201 				INCB	R1		; MAKE TRUE BLOCK COUNT
    315	001200	110164 	000022 		130$:	MOVB	R1,V.SBSZ(R4)	; PUT BLOCK COUNT IN VCB
    316	001204	012064 	000026 			MOV	(R0)+,V.SBLB+2(R4) ; GET LOW ORDER LBN
    317
    318					; SCAN THE STORAGE BITMAP TO DETERMINE THE NUMBER OF FREE BLOCKS ON THE VOLUME
    319
    320	001210	010146 				MOV	R1,-(SP)	; GET BLOCK COUNT
    321	001212	005003 				CLR	R3		; INIT VBN
    322	001214	005203 			140$:	INC	R3		; BUMP TO NEXT VBN
    323	001216					CALL	.SMRVB		; READ NEXT BITMAP BLOCK
    324	001222	012702 	000400 			MOV	#256.,R2	; COUNT 256 WORDS
    325	001226	012703 	000020 		150$:	MOV	#16.,R3		; COUNT 16 BITS PER WORD
    326	001232	012100 				MOV	(R1)+,R0	; GET NEXT MAP WORD
    327	001234	006000 			160$:	ROR	R0		; LOOK AT A BIT
    328	001236	005564 	000036 			ADC	V.FRBK+2(R4)	; COUNT IT IF ON
    329	001242	105564 	000034 			ADCB	V.FRBK(R4)
    330	001246	077306 				SOB	R3,160$		; LOOP FOR BITS
    331	001250	077212 				SOB	R2,150$		; LOOP FOR WORDS
    332	001252	016703 	000000G			MOV	.SMVBN,R3	; GET CURRENT VBN
    333	001256	005316 				DEC	(SP)		; COUNT BLOCKS
    334	001260	001355 				BNE	140$		; AND LOOP FOR BLOCKS
    335	001262	005726 				TST	(SP)+		; CLEAN THE STACK
    336	001264	005067 	000000G			CLR	.SMUCB		; INVALIDATE BITMAP BUFFER SO ALLOCATIONS
    337									; WILL START AT BEGINNING OF VOLUME
    338
    339					; APPLY OPTIONS FROM THE COMMAND STRING
    340
    341	001270	016703 	000000G			MOV	.UCBAD,R3	; GET PUD ADDRESS
    342	001274	036727 	176564 	000002 		BIT	$FLAGS,#MO.CHA	; CHECK FOR EXPLICIT CHARACTERISTICS
    343	001302	001403 				BEQ	170$		; NONE
    344	001304	116763 	176542 	000000G		MOVB	$CHAR,U.CH(R3)	; PUT CHARACTERISTICS INTO PUD
    345	001312	036727 	176546 	000001 	170$:	BIT	$FLAGS,#MO.UIC	; CHECK FOR EXPLICIT UIC
    346	001320	001403 				BEQ	180$		; NO
    347	001322	016763 	176522 	000000G		MOV	$UIC,U.UI(R3)	; SET UIC IN PUD
    348
    349	001330	036727 	176530 	000004 	180$:	BIT	$FLAGS,#MO.PRO	; CHECK FOR EXPLICIT PROTECTION
    350	001336	001403 				BEQ	190$		; NO
    351	001340	016763 	176510 	000000G		MOV	$PRO,U.AR(R3)	; SET PROTECTION WORD IN PUD
    352
    353	001346	036727 	176512 	000020 	190$:	BIT	$FLAGS,#MO.EXT	; CHECK FOR EXPLICIT DEFAULT EXTEND
    354	001354	001403 				BEQ	200$		; NO
    355	001356	116764 	176474 	000025 		MOVB	$EXT,V.FIEX(R4)	; YES - SET IN VCB
    356
    357	001364	036727 	176474 	000040 	200$:	BIT	$FLAGS,#MO.FPR	; CHECK FOR EXPLICIT DEFAULT FILE PROTECTION
    358	001372	001403 				BEQ	210$		; NO
MOUNT	D0222, MOUNT VOLUME	MACRO M1108  05-DEC-77 17:09  PAGE 8-3


    359	001374	016764 	176460 	000030 		MOV	$FPRO,V.FPRO(R4) ; YES - SET IN VCB
    360
    361	001402	036727 	176456 	001000 	210$:	BIT	$FLAGS,#MO.LRU	; CHECK FOR EXPLICIT LRU SPEC
    362	001410	001403 				BEQ	220$		; NO
    363	001412	116764 	176445 	000035 		MOVB	$LRU,V.LRUC(R4) ; YES - SET IN VCB
    364
    365	001420				220$:	RETURN
    366					;
    367					;
    368	001422					$END	MOUNT
    369					;
    370					;
    371		000001 				.END
MOUNT	D0222, MOUNT VOLUME	MACRO M1108  05-DEC-77 17:09  PAGE 8-4
SYMBOL TABLE

AC.DLK= 000002   	H.FCHA= 000014   	I.IOSB  000016   	Q.IOPR= 000007   	W.STD   000004
AC.LCK= 000001   	H.FIEX= 000055   	I.LGTH  000040   	Q.IOSB= 000010   	W.VBN   000006
A.TD  = ****** GX	H.FLEV= 000006   	I.LNK   000000   	RLB     000016R  	W.WISZ  000007
BITFNU= 000002   	H.FMAX= 000006   	I.LUN   000012   	R$$10F= 000001   	$CHAR   000052RG
CMDBFL= 001000   	H.FNUM= 000002   	I.PRI   000010   	R$$11D= 000001   	$EXT    000056RG
EX.AC1= 000001   	H.FOWN= 000010   	I.PRM   000024   	SC.BAD= 000100   	$FLAGS  000064RG
EX.AC2= 000002   	H.FPRO= 000044   	I.RTRV  000034   	SC.MDL= 000200   	$FPRO   000060RG
EX.ADF= 000010   	H.FSEQ= 000004   	I.RVDT= 000014   	SETCHA  000000R  	$LRU    000063RG
EX.ENA= 000200   	H.IBLB= 000002   	I.RVNO= 000012   	S.HDHD= 000056   	$PRO    000054RG
EX.FCO= 000004   	H.IBSZ= 000000   	I.RVTI= 000023   	S.IDHD= 000056   	$UIC    000050RG
E$$MSG= 000001   	H.IDOF= 000000   	I.RWAD= 000024   	S.MPHD= 000012   	$VNAM   000046RG
E$$TRP= 000001   	H.INDF= 000760   	I.RWAT  000026   	S.STBK= 000012   	$VNML   000044RG
FCPLUN= 000001   	H.INDN= 000730   	I.RWCT= 000026   	UC.CON= 000200   	$WIN    000062RG
FC.CEF= 020000   	H.INDO= 000744   	I.RWVB= 000032   	UC.DLK= 000100   	$$    = 000067
FC.DIR= 040000   	H.LRUC= 000056   	I.STD   000004   	UC.SWL= ****** GX	$$$ARG= 000013
FC.FCO= 010000   	H.MPOF= 000001   	I.TISZ= 000006   	U.AR  = ****** GX	$$$OST= 000014
FC.WAC= 100000   	H.PROG= 000010   	I.UIC   000022   	U.CH  = ****** GX	.ALLOC= ****** GX
FP.DEL= 000010   	H.PROJ= 000011   	LBNH  = 000040R  	U.C1  = ****** GX	.BLXI = ****** GX
FP.EXT= 000004   	H.SBCL= 000010   	LBNL  = 000042R  	U.LBH = ****** GX	.CKSM1= ****** GX
FP.RAT= 000001   	H.SCHA= 000015   	LEV11M= 000401   	U.LBN = ****** GX	.CKSUM= ****** GX
FP.RDV= 000001   	H.UCHA= 000014   	LOWFCN= 000011   	U.UI  = ****** GX	.CRFCB= ****** GX
FP.WRV= 000002   	H.UFAT= 000016   	ME.NHM= 000012   	U.VA  = ****** GX	.CRTSK= ****** GX
F$$LVL= 000001   	H.VCHA= 000042   	ME.SYN= 000007   	VC.BMW= 000002   	.DFEXT= 000005
F.DREF  000042   	H.VDAT= 000074   	ME.WRV= 000013   	VC.IFW= 000001   	.DFPRO= 164000
F.DRNM  000044   	H.VLEV= 000014   	MFDFNO= 000004   	V.FCB   000006   	.FCBAD= ****** GX
F.FEXT  000002   	H.VNAM= 000016   	MFDFSQ= 000004   	V.FFNU  000055   	.FILNO= ****** GX
F.FNUM  000006   	H.VOWN= 000036   	MO.CHA= 000002 G 	V.FIEX  000025   	.FILSQ= ****** GX
F.FOWN  000014   	H.VPRO= 000040   	MO.EXT= 000020 G 	V.FMAX  000016   	.HDBUF= ****** GX
F.FPRO  000016   	H.WISZ= 000054   	MO.FPR= 000040 G 	V.FPRO  000030   	.INWIN= ****** GX
F.FSEQ  000010   	IDXFNU= 000001   	MO.LRU= 001000 G 	V.FRBK  000034   	.IOPKT= ****** GX
F.FSQN  000013   	ID$$$ = 000222   	MO.OVR= 000200 G 	V.IBLB  000012   	.IOSTS= ****** GX
F.FVBN  000046   	IE.ABO= ****** GX	MO.PRO= 000004 G 	V.IBSZ  000013   	.MOKTB= ****** GX
F.HDLB  000022   	IE.IFC= ****** GX	MO.SWL= 000400 G 	V.IFWI  000002   	.MOPRS= ****** GX
F.LBN   000026   	IE.VER= ****** GX	MO.UIC= 000001 G 	V.LABL  000040   	.MOUNT  000066RG
F.LGTH  000052   	IO.RLB= ****** GX	MO.UNL= 000010 G 	V.LGTH  000056   	.MXQIO= ****** GX
F.LINK  000000   	IO.STC= ****** GX	MO.WIN= 000100 G 	V.LRUC  000035   	.PRFIL= 000004
F.NACS  000036   	I.ACTL  000035   	M$$HDR= 000001   	V.SBCL  000021   	.QIOST= ****** GX
F.NLCK  000037   	I.AST   000020   	M.CTSZ= 000006   	V.SBLB  000024   	.RHDFN= ****** GX
F.NWAC  000040   	I.ATL   000006   	M.EFNU= 000002   	V.SBSZ  000022   	.RHDLB= ****** GX
F.RVN   000012   	I.CRDT= 000031   	M.EFSQ= 000004   	V.STAT  000054   	.RTPTF= 001401
F.SCHA  000021   	I.CRTI= 000040   	M.ERVN= 000001   	V.STD   000004   	.SMBUF= ****** GX
F.SIZE  000032   	I.DASZ= 000007   	M.ESQN= 000000   	V.TRCT  000000   	.SMRVB= ****** GX
F.STAT  000040   	I.DPB   000011   	M.LBSZ= 000007   	V.WISZ  000020   	.SMUCB= ****** GX
F.STD   000004   	I.EFN   000013   	M.MAX = 000011   	WI.BPS= 100000   	.SMVBN= ****** GX
F.UCHA  000020   	I.EXDT= 000046   	M.RTRV= 000012   	WI.DLK= 010000   	.SYUIC= 000010
F11PR$= 000000   	I.EXTD  000030   	M.USE = 000010   	WI.EXT= 002000   	.TPARS= ****** GX
HIFCN = 000030   	I.FCN   000014   	QIOEFN= 000002   	WI.LCK= 004000   	.UCBAD= ****** GX
HOMEBL  000424R  	I.FIDP  000024   	Q.IOAE= 000012   	WI.RDV= 000400   	.VBSIZ= 001000
H.CHK1= 000072   	I.FNAM= 000000   	Q.IOEF= 000006   	WI.WRV= 001000   	.WNDOW= ****** GX
H.CHK2= 000776   	I.FNBP  000036   	Q.IOFN= 000002   	W.CTL   000000   	...GBL= 000000
H.CKSM= 000776   	I.FTYP= 000006   	Q.IOLU= 000004   	W.FCB   000002   	...TPC= 001000
H.DVTY= 000012   	I.FVER= 000010   	Q.IOPL= 000014   	W.RTRV  000012

. ABS.	000056	   000
      	001422	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  3152 WORDS  ( 13 PAGES)
MOUNT	D0222, MOUNT VOLUME	MACRO M1108  05-DEC-77 17:09  PAGE 8-5
SYMBOL TABLE

DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:00:40
[40,10]MOUNT,[40,20]MOUNT/-SP=[40,30]RSXDC,F11PRE,MOUNT
RSXDC	MACRO M1108  05-DEC-77 17:10  PAGE 3


      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.
MOUPAR	D0214, MOUNT COMMAND LI	MACRO M1108  05-DEC-77 17:10  PAGE 6


      1						.TITLE	MOUPAR	D0214, MOUNT COMMAND LINE PARSER
						.IDENT	"D0214"
      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					;
     20					;
					; VERSION D214, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  4 FEB 75  18:36
     23
     24					;+
     25					;
     26					; THIS MODULE CONTAINS THE STATE TABLE AND ACTION ROUTINES USED TO PARSE
     27					; THE MOUNT COMMAND STRING, OF THE FORM
     28					;
     29					;	MOUNT DK0:LABEL /UNL /UIC=[200,200] /PRO=[RWED,RWE,R,R]
     30					;			/CHA=[FOR,DFA,ATCH,DCF] /ACP=FOOBAR
     31					;			/EXT=20 /WIN=5 /FPRO=[RWE,RWED,R,R] /OVR
     32					;
     33					; THE FOLLOWING VARIABLES ARE FILLED IN:
     34					;
     35					;	$VNML	LENGTH AND
     36					;	$VNAM	ADDRESS OF VOLUME LABEL STRING
     37					;	$UIC	VOLUME OWNER
     38					;	$CHAR	VOLUME CHARACTERISTICS
     39					;	$PRO	VOLUME PROTECTION
     40					;	$EXT	DEFAULT FILE EXTEND
     41					;	$FPRO	DEFAULT FILE PROTECTION
     42					;	$WIN	DEFAULT WINDOW SIZE
     43					;	$FLAGS	FLAG WORD, CONTAINING THE FOLLOWING:
     44					;	MO.UIC	EXPLICIT UIC
     45					;	MO.CHA	EXPLICIT CHARACTERISTICS
     46					;	MO.PRO	EXPLICIT PROTECTION
     47					;	MO.UNL	UNLOCK INDEX FILE
     48					;	MO.EXT	EXPLICIT FILE EXTEND
     49					;	MO.FPR	EXPLICIT FILE PROTECTION
     50					;	MO.WIN	EXPLICIT WINDOW SIZE
     51					;	MO.OVR	OVERRIDE VOLUME LABEL CHECK
     52					;	MO.SWL	SOFTWARE WRITE LOCK
     53					;	MO.LRU	EXPLICIT DIRECTORY LRU LIMIT
     54					;
MOUPAR	D0214, MOUNT COMMAND LI	MACRO M1108  05-DEC-77 17:10  PAGE 6-1


     55					;-
     56
     57
     58						.NLIST	ME		; HONEST TO GOD,
     59						.NLIST	MEB		; YOU WOULDN'T WANT TO SEE IT!
     60
     61						.MCALL	ISTAT$,STATE$,TRAN$
     62
     63					; MACRO TO SIGNAL ERRORS
     64
     65					.MACRO	ERROR	CODE
     66						.IF	NB,CODE
     67						MOV	#CODE,.IOSTS+2
     68						ERRX	IE.ABO
     69						.IFF
     70						MOVB	.QIOST,.IOSTS
     71						ERRX
     72						.ENDC
     73					.ENDM	ERROR
     74
     75		000007 			ME.SYN = 7.			; CODE FOR SYNTAX ERROR
     76
     77	000000					ISTAT$	.MOSTB,.MOKTB
     78
     79						.GLOBL	.MOPRS
     80
     81					; SKIP OVER DEVICE AND UNIT NUMBER
     82
     83	000000					STATE$	.MOPRS
     84	000000					TRAN$	':,LABL
     85	000000					TRAN$	$ANY,.MOPRS
     86
     87					; READ VOLUME LABEL
     88
     89	000000					STATE$	LABL
     90	000000					TRAN$	$STRNG,,SETLAB
     91
     92					; SCAN FOR OPTIONS AND END OF LINE
     93
     94	000000					STATE$	OPTS
     95	000000					TRAN$	'/,OPTS1
     96	000000					TRAN$	$EOS,$EXIT
     97	000000					TRAN$	0,$EXIT
     98
     99	000000					STATE$	OPTS1
    100	000000					TRAN$	"UIC",UIC
    101	000000					TRAN$	"PRO",PRO
    102	000000					TRAN$	"CHA",CHA
    103	000000					TRAN$	"UNL",OPTS,SETUNL
    104	000000					TRAN$	"ACP",ACP
    105	000000					TRAN$	"EXT",EXT
    106	000000					TRAN$	"FPRO",FPRO
    107	000000					TRAN$	"WIN",WIN
    108	000000					TRAN$	"OVR",OPTS,SETOVR
    109	000000					TRAN$	"WLK",OPTS,SETWLK
    110	000000					TRAN$	"LRU",LRU
    111
MOUPAR	D0214, MOUNT COMMAND LI	MACRO M1108  05-DEC-77 17:10  PAGE 6-2


    112					; READ UIC
    113
    114	000000					STATE$	UIC
    115	000000					TRAN$	'=
    116
    117	000000					STATE$
    118	000000					TRAN$	'[
    119
    120	000000					STATE$
    121	000000					TRAN$	$NUMBR,,SETGN
    122
    123	000000					STATE$
    124	000000					TRAN$	<',>
    125
    126	000000					STATE$
    127	000000					TRAN$	$NUMBR,,SETPN
    128
    129	000000					STATE$
    130	000000					TRAN$	'],OPTS
    131
    132					; VOLUME PROTECTION
    133
    134	000000					STATE$	PRO
    135	000000					TRAN$	!PROCOM,OPTS,SETPRO
    136
    137					; DEFAULT FILE PROTECTION
    138
    139	000000					STATE$	FPRO
    140	000000					TRAN$	!PROCOM,OPTS,SETFPR
    141
    142					; COMMON PROTECTION READER
    143
    144	000000					STATE$	PROCOM
    145	000000					TRAN$	'=
    146
    147	000000					STATE$
    148	000000					TRAN$	'[,,IGROUP
    149
    150	000000					STATE$	SPRO
    151	000000					TRAN$	'],$EXIT,ENDGRP
    152	000000					TRAN$	<',>,SPRO,NXGRP
    153	000000					TRAN$	'R,SPRO,SETRP
    154	000000					TRAN$	'W,SPRO,SETWP
    155	000000					TRAN$	'E,SPRO,SETEP
    156	000000					TRAN$	'D,SPRO,SETDP
    157
    158					; SET CHARACTERISTICS
    159
    160	000000					STATE$	CHA
    161	000000					TRAN$	'=
    162
    163	000000					STATE$
    164	000000					TRAN$	'[,,SETCHR
    165
    166	000000					STATE$	CHA1
    167	000000					TRAN$	"FOR",CHA2,SETFOR
    168	000000					TRAN$	"ATCH",CHA2,SETATC
MOUPAR	D0214, MOUNT COMMAND LI	MACRO M1108  05-DEC-77 17:10  PAGE 6-3


    169	000000					TRAN$	"DCF",CHA2,SETDCF
    170	000000					TRAN$	$LAMDA
    171
    172	000000					STATE$	CHA2
    173	000000					TRAN$	<',>,CHA1
    174	000000					TRAN$	'],OPTS
    175
    176					; FLUSH ACP SWITCH
    177
    178	000000					STATE$	ACP
    179	000000					TRAN$	'=
    180
    181	000000					STATE$
    182	000000					TRAN$	$RAD50,OPTS
    183
    184					; DEFAULT FILE EXTEND
    185
    186	000000					STATE$	EXT
    187	000000					TRAN$	'=
    188
    189	000000					STATE$
    190	000000					TRAN$	$NUMBR,OPTS,SETEXT
    191
    192					; DEFAULT WINDOW SIZE
    193
    194	000000					STATE$	WIN
    195	000000					TRAN$	'=
    196
    197	000000					STATE$
    198	000000					TRAN$	$NUMBR,OPTS,SETWIN
    199
    200					; DIRECTORY LRU LIMIT
    201
    202	000000					STATE$	LRU
    203	000000					TRAN$	'=
    204
    205	000000					STATE$
    206	000000					TRAN$	$NUMBR,OPTS,SETLRU
    207
    208	000000					STATE$
    209
    210	000000					.CSECT
MOUPAR	D0214, MOUNT COMMAND LI	MACRO M1108  05-DEC-77 17:10  PAGE 7


    212					; ACTION ROUTINES FOR THE PARSER
    213					;
    214					; VOLUME LABEL
    215
    216	000000	016767 	000000G	000000G	SETLAB:	MOV	.PSTCN,$VNML
    217	000006	016767 	000000G	000000G		MOV	.PSTPT,$VNAM
    218	000014					RETURN
    219
    220
    221					; PPN - GROUP NUMBER
    222
    223	000016	116767 	000000G	000001G	SETGN:	MOVB	.PNUMB,$UIC+1
    224	000024	052767 	000000G	000000G		BIS	#MO.UIC,$FLAGS	; EXPLICIT UIC
    225	000032	000403 				BR	TSPPN
    226
    227					; PPN - PROGRAMMER NUMBER
    228
    229	000034	116767 	000000G	000000G	SETPN:	MOVB	.PNUMB,$UIC
    230	000042	105767 	000001G		TSPPN:	TSTB	.PNUMB+1	; CHECK IF NUMBER IS IN RANGE
    231	000046	001152 				BNE	SYNTAX		; GREATER THAN 377 - OUT
    232	000050					RETURN
    233
    234					; SET CHARACTERISTICS
    235
    236	000052	052767 	000000G	000000G	SETCHR:	BIS	#MO.CHA,$FLAGS	; EXPLICIT CHARACTERISTICS
    237	000060	112767 	000000C	000000G		MOVB	#CH.NDC!CH.NAT,$CHAR ; INIT CHARACTERISTICS
    238	000066					RETURN
    239
    240	000070	152767 	000000G	000000G	SETFOR:	BISB	#CH.FOR,$CHAR	; FOREIGN VOLUME
    241
    242	000076	142767 	000000G	000000G	SETDCF:	BICB	#CH.NDC,$CHAR	; DEVICE CONTROL FUNCTIONS
    243	000104					RETURN
    244
    245	000106	142767 	000000G	000000G	SETATC:	BICB	#CH.NAT,$CHAR	; ALLOW ATTACH/DETACH
    246	000114					RETURN
    247
    248					; SET VOLUME PROTECTION
    249
    250	000116	016767 	000000G	000000G	SETPRO:	MOV	.PNUMB,$PRO
    251	000124	052767 	000000G	000000G		BIS	#MO.PRO,$FLAGS	; EXPLICIT PERMISSIONS
    252	000132					RETURN
    253
    254					; SET DEFAULT FILE PROTECTION
    255
    256	000134	016767 	000000G	000000G	SETFPR:	MOV	.PNUMB,$FPRO
    257	000142	052767 	000000G	000000G		BIS	#MO.FPR,$FLAGS
    258	000150					RETURN
    259
    260					; SET PERMISSIONS
    261					; INITIALIZE
    262
    263	000152	012767 	000004 	000000G	IGROUP:	MOV	#4,.PNUMH
    264
    265					; MOVE TO NEXT PERMISSIONS CATEGORY
    266
    267	000160	000261 			NXGRP:	SEC			; FORCE ONES
    268	000162	006067 	000000G			ROR	.PNUMB
MOUPAR	D0214, MOUNT COMMAND LI	MACRO M1108  05-DEC-77 17:10  PAGE 7-1


    269	000166	006267 	000000G			ASR	.PNUMB		; SHIFT TO NEXT GROUP
    270	000172	006267 	000000G			ASR	.PNUMB
    271	000176	006267 	000000G			ASR	.PNUMB
    272	000202	005367 	000000G			DEC	.PNUMH		; COUNT GROUPS
    273	000206	002472 				BLT	SYNTAX		; TOO MANY IS AN ERROR
    274	000210					RETURN
    275
    276					; SET READ PERMIT
    277
    278	000212	042767 	010000 	000000G	SETRP:	BIC	#FP.RDV*10000,.PNUMB
    279	000220					RETURN
    280
    281					; SET WRITE PERMIT
    282
    283	000222	042767 	020000 	000000G	SETWP:	BIC	#FP.WRV*10000,.PNUMB
    284	000230					RETURN
    285
    286					; SET EXTEND PERMIT
    287
    288	000232	042767 	040000 	000000G	SETEP:	BIC	#FP.EXT*10000,.PNUMB
    289	000240					RETURN
    290
    291					; SET DELETE PERMIT
    292
    293	000242	042767 	100000 	000000G	SETDP:	BIC	#FP.DEL*10000,.PNUMB
    294	000250					RETURN
    295
    296					; END OF PROTECTION SPEC
    297
    298	000252	005767 	000000G		ENDGRP:	TST	.PNUMH		; CHECK THE GROUP COUNT
    299	000256	001046 				BNE	SYNTAX		; MUST HAVE 4
    300	000260					RETURN
    301
    302					; SET UNLOCK FLAG FOR INDEX FILE
    303
    304	000262	052767 	000000G	000000G	SETUNL:	BIS	#MO.UNL,$FLAGS
    305	000270					RETURN
    306
    307					; SET SOFTWARE WRITE LOCK
    308
    309	000272	052767 	000000G	000000G	SETWLK:	BIS	#MO.SWL,$FLAGS
    310	000300					RETURN
    311
    312					; SET OVERRIDE BIT
    313
    314	000302	052767 	000000G	000000G	SETOVR:	BIS	#MO.OVR,$FLAGS
    315	000310					RETURN
    316
    317					; SET WINDOW SIZE
    318
    319	000312	116767 	000000G	000000G	SETWIN:	MOVB	.PNUMB,$WIN
    320	000320	026727 	000000G	000177 		CMP	$WIN,#127.
    321	000326	101022 				BHI	SYNTAX
    322	000330	052767 	000000G	000000G		BIS	#MO.WIN,$FLAGS
    323	000336					RETURN
    324
    325					; SET DIRECTORY LRU LIMIT
MOUPAR	D0214, MOUNT COMMAND LI	MACRO M1108  05-DEC-77 17:10  PAGE 7-2


    326
    327	000340	116767 	000000G	000000G	SETLRU:	MOVB	.PNUMB,$LRU
    328	000346	052767 	000000G	000000G		BIS	#MO.LRU,$FLAGS
    329	000354					RETURN
    330
    331					; SET DEFAULT FILE EXTEND
    332
    333	000356	016767 	000000G	000000G	SETEXT:	MOV	.PNUMB,$EXT
    334	000364	052767 	000000G	000000G		BIS	#MO.EXT,$FLAGS
    335	000372					RETURN
    336
    337					; TO HERE FOR SYNTAX ERRORS DETECTED BY ACTION ROUTINES
    338
    339	000374				SYNTAX:	ERROR	ME.SYN		; GO TO SYNTAX ERROR EXIT
	000402	   000C	   211 			TRAP	-IE.ABO		;
    340					;
    341					;
    342	000404					$END	MOUPAR
    343					;
    344					;
    345		000001 				.END
MOUPAR	D0214, MOUNT COMMAND LI	MACRO M1108  05-DEC-77 17:10  PAGE 7-3
SYMBOL TABLE

ACP     000270R     002	F.STAT  000040   	I.RWAD= 000024   	SETEXT  000356R  	WI.LCK= 004000
AC.DLK= 000002   	F.STD   000004   	I.RWAT  000026   	SETFOR  000070R  	WI.RDV= 000400
AC.LCK= 000001   	F.UCHA  000020   	I.RWCT= 000026   	SETFPR  000134R  	WI.WRV= 001000
BITFNU= 000002   	F11PR$= 000000   	I.RWVB= 000032   	SETGN   000016R  	W.CTL   000000
CHA     000226R     002	HIFCN = 000030   	I.STD   000004   	SETLAB  000000R  	W.FCB   000002
CHA1    000234R     002	H.CKSM= 000776   	I.TISZ= 000006   	SETLRU  000340R  	W.RTRV  000012
CHA2    000260R     002	H.FCHA= 000014   	I.UIC   000022   	SETOVR  000302R  	W.STD   000004
CH.FOR= ****** GX	H.FLEV= 000006   	LABL    000010R     002	SETPN   000034R  	W.VBN   000006
CH.NAT= ****** GX	H.FNUM= 000002   	LEV11M= 000401   	SETPRO  000116R  	W.WISZ  000007
CH.NDC= ****** GX	H.FOWN= 000010   	LOWFCN= 000011   	SETRP   000212R  	$ANY  = 000320
ENDGRP  000252R  	H.FPRO= 000012   	LRU     000316R     002	SETUNL  000262R  	$BLANK= 000306
EXT     000276R     002	H.FSEQ= 000004   	ME.SYN= 000007   	SETWIN  000312R  	$CHAR = ****** GX
EX.AC1= 000001   	H.IDOF= 000000   	MFDFNO= 000004   	SETWLK  000272R  	$DNUMB= 000314
EX.AC2= 000002   	H.MPOF= 000001   	MFDFSQ= 000004   	SETWP   000222R  	$EOS  = 000312
EX.ADF= 000010   	H.PROG= 000010   	MO.CHA= ****** GX	SPRO    000162R     002	$EXIT = 000000
EX.ENA= 000200   	H.PROJ= 000011   	MO.EXT= ****** GX	SYNTAX  000374R  	$EXT  = ****** GX
EX.FCO= 000004   	H.SCHA= 000015   	MO.FPR= ****** GX	S.HDHD= 000056   	$FLAGS= ****** GX
E$$MSG= 000001   	H.UCHA= 000014   	MO.LRU= ****** GX	S.IDHD= 000056   	$FPRO = ****** GX
E$$TRP= 000001   	H.UFAT= 000016   	MO.OVR= ****** GX	S.MPHD= 000012   	$LAMDA= 000300
FCPLUN= 000001   	IDXFNU= 000001   	MO.PRO= ****** GX	S.STBK= 000012   	$LRU  = ****** GX
FC.CEF= 020000   	ID$$$ = 000214   	MO.SWL= ****** GX	TSPPN   000042R  	$NUMBR= 000302
FC.DIR= 040000   	IE.ABO= ****** GX	MO.UIC= ****** GX	UC.CON= 000200   	$PRO  = ****** GX
FC.FCO= 010000   	IGROUP  000152R  	MO.UNL= ****** GX	UC.DLK= 000100   	$RAD50= 000316
FC.WAC= 100000   	I.ACTL  000035   	MO.WIN= ****** GX	UIC     000112R     002	$STRNG= 000304
FPRO    000144R     002	I.AST   000020   	M$$HDR= 000001   	VC.BMW= 000002   	$SUBXP= 000310
FP.DEL= 000010   	I.ATL   000006   	M.CTSZ= 000006   	VC.IFW= 000001   	$UIC  = ****** GX
FP.EXT= 000004   	I.CRDT= 000031   	M.EFNU= 000002   	V.FCB   000006   	$VNAM = ****** GX
FP.RAT= 000001   	I.CRTI= 000040   	M.EFSQ= 000004   	V.FFNU  000055   	$VNML = ****** GX
FP.RDV= 000001   	I.DASZ= 000007   	M.ERVN= 000001   	V.FIEX  000025   	$WIN  = ****** GX
FP.WRV= 000002   	I.DPB   000011   	M.ESQN= 000000   	V.FMAX  000016   	$$$FLG= 177777
F$$LVL= 000001   	I.EFN   000013   	M.LBSZ= 000007   	V.FPRO  000030   	$$$KEY= 000015
F.DREF  000042   	I.EXDT= 000046   	M.MAX = 000011   	V.FRBK  000034   	$$$STA= 000014R     002
F.DRNM  000044   	I.EXTD  000030   	M.RTRV= 000012   	V.IBLB  000012   	$$$TMP= 000150R     003
F.FEXT  000002   	I.FCN   000014   	M.USE = 000010   	V.IBSZ  000013   	.DFEXT= 000005
F.FNUM  000006   	I.FIDP  000024   	NXGRP   000160R  	V.IFWI  000002   	.DFPRO= 164000
F.FOWN  000014   	I.FNAM= 000000   	OPTS    000014R     002	V.LABL  000040   	.IOSTS= ****** GX
F.FPRO  000016   	I.FNBP  000036   	OPTS1   000030R     002	V.LGTH  000056   	.MOKTB  000000RG    003
F.FSEQ  000010   	I.FTYP= 000006   	PRO     000134R     002	V.LRUC  000035   	.MOPRS  000000RG    002
F.FSQN  000013   	I.FVER= 000010   	PROCOM  000154R     002	V.SBCL  000021   	.MOSTB  000000RG    002
F.FVBN  000046   	I.IOSB  000016   	QIOEFN= 000002   	V.SBLB  000024   	.PNUMB= ****** GX
F.HDLB  000022   	I.LGTH  000040   	R$$10F= 000001   	V.SBSZ  000022   	.PNUMH= ****** GX
F.LBN   000026   	I.LNK   000000   	R$$11D= 000001   	V.STAT  000054   	.PRFIL= 000004
F.LGTH  000052   	I.LUN   000012   	SC.BAD= 000100   	V.STD   000004   	.PSTCN= ****** GX
F.LINK  000000   	I.PRI   000010   	SC.MDL= 000200   	V.TRCT  000000   	.PSTPT= ****** GX
F.NACS  000036   	I.PRM   000024   	SETATC  000106R  	V.WISZ  000020   	.RTPTF= 001401
F.NLCK  000037   	I.RTRV  000034   	SETCHR  000052R  	WIN     000306R     002	.SYUIC= 000010
F.NWAC  000040   	I.RVDT= 000014   	SETDCF  000076R  	WI.BPS= 100000   	.VBSIZ= 001000
F.RVN   000012   	I.RVNO= 000012   	SETDP   000242R  	WI.DLK= 010000   	...GBL= 000000
F.SCHA  000021   	I.RVTI= 000023   	SETEP   000232R  	WI.EXT= 002000   	...TPC= 000012
F.SIZE  000032

. ABS.	000056	   000
      	000404	   001
$STATE	000326	   002
$KTAB 	000160	   003
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  3543 WORDS  ( 14 PAGES)
MOUPAR	D0214, MOUNT COMMAND LI	MACRO M1108  05-DEC-77 17:10  PAGE 7-4
SYMBOL TABLE

DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:02:24
[40,10]MOUPAR,[40,20]MOUPAR/-SP=[40,30]RSXDC,F11PRE,MOUPAR
RSXDC	MACRO M1108  05-DEC-77 17:13  PAGE 3


      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.
MPHDR	D0204, MAP FILE # TO HE	MACRO M1108  05-DEC-77 17:13  PAGE 6


      1						.TITLE	MPHDR	D0204, MAP FILE # TO HEADER LBN
						.IDENT	"D0204"
      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					;
					; VERSION D204, ASSEMBLED FOR RSX-11D
					;
     20
     21					; ANDREW C. GOLDSTEIN  2 OCT 74  11:09:40
     22					; PETER H. LIPMAN	17-JAN-74
     23					;
     24					; FIND THE LOGICAL BLOCK NUMBER FOR A FILE HEADER.
     25					;
     26					;+
     27					; **-.MPHDR-MAP FILE NUMBER TO LBN OF HEADER
     28					;
     29					; THIS ROUTINE ACCEPTS A FILE NUMBER AND CONVERTS
     30					; IT TO THE LBN OF THE FILE HEADER IN THE
     31					; INDEX FILE, TURNING THE INDEX FILE WINDOW IF
     32					; NECESSARY. THE ONLY ERROR RETURN IS IF THE
     33					; FILE NUMBER IS BEYOND THE END OF FILE IN THE INDEX
     34					; FILE.(END OF FILE CONDITION IS NOT SET IN .IOSTS)
     35					; OTHER ERRORS GO THROUGH ERRX.
     36					;
     37					; INPUTS:
     38					;
     39					; 	R0=FILE NUMBER
     40					; 	R4=VOLUME CONTROL BLOCK ADDRESS
     41					;
     42					; OUTPUTS:
     43					;
     44					; 	C=0 IF OK, C=1 IF FILE # BEYOND END OF INDEX FILE
     45					; 	R0=FILE NUMBER UNCHANGED
     46					; 	R1=INDEX FILE WINDOW ADDRESS
     47					; 	R2,R3 = LBN OF HEADER IF C=0
     48					;             = VBN OF HEADER IF C=1
     49					; 	R4,R5 PRESERVED
     50					;
     51					;-
     52
     53	000000				.MPHDR::
     54	000000	010046 				MOV	R0,-(SP)	; SAVE THE FILE NUMBER
MPHDR	D0204, MAP FILE # TO HE	MACRO M1108  05-DEC-77 17:13  PAGE 6-1


     55	000002	116403 	000013 		10$:	MOVB	V.IBSZ(R4),R3	; SIZE OF INDEX BIT MAP < 128.
     56	000006	122323 				CMPB	(R3)+,(R3)+	; ADD 2 FOR BOOT AND HOME BLOCKS
     57	000010	005002 				CLR	R2		; FORM R2,R3 = VBN IN INDEX FILE
     58	000012	060003 				ADD	R0,R3
     59	000014	005502 				ADC	R2		; CLEARS CARRY TOO
     60	000016	016401 	000002 			MOV	V.IFWI(R4),R1	; R1=INDEX FILE WINDOW
     61	000022					CALL	.MPVBN		; MAP THE VBN TO ITS LBN
     62	000026	103004 				BCC	20$		; BRANCH IF VBN SUCCESSFULLY MAPPED
     63
     64					;
     65					; FAILED TO MAP VBN TO LBN - TURN INDEX FILE WINDOW
     66					; R1=WINDOW, R2,R3 = VBN
     67					;
     68	000030					CALL	.WITRN
     69	000034	011600 				MOV	(SP),R0		; RETRIEVE FILE NUMBER
     70	000036	103361 				BCC	10$		; TRY TO MAP IT AGAIN
     71	000040	012600 			20$:	MOV	(SP)+,R0	;
     72	000042					RETURN
     73
     74					;
     75					;
     76	000044					$END	MPHDR
     77					;
     78					;
     79		000001 				.END
MPHDR	D0204, MAP FILE # TO HE	MACRO M1108  05-DEC-77 17:13  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.DASZ= 000007   	M.CTSZ= 000006   	V.LRUC  000035
AC.LCK= 000001   	F.NACS  000036   	I.DPB   000011   	M.EFNU= 000002   	V.SBCL  000021
BITFNU= 000002   	F.NLCK  000037   	I.EFN   000013   	M.EFSQ= 000004   	V.SBLB  000024
EX.AC1= 000001   	F.NWAC  000040   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBSZ  000022
EX.AC2= 000002   	F.RVN   000012   	I.EXTD  000030   	M.ESQN= 000000   	V.STAT  000054
EX.ADF= 000010   	F.SCHA  000021   	I.FCN   000014   	M.LBSZ= 000007   	V.STD   000004
EX.ENA= 000200   	F.SIZE  000032   	I.FIDP  000024   	M.MAX = 000011   	V.TRCT  000000
EX.FCO= 000004   	F.STAT  000040   	I.FNAM= 000000   	M.RTRV= 000012   	V.WISZ  000020
E$$MSG= 000001   	F.STD   000004   	I.FNBP  000036   	M.USE = 000010   	WI.BPS= 100000
E$$TRP= 000001   	F.UCHA  000020   	I.FTYP= 000006   	QIOEFN= 000002   	WI.DLK= 010000
FCPLUN= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$10F= 000001   	WI.EXT= 002000
FC.CEF= 020000   	HIFCN = 000030   	I.IOSB  000016   	R$$11D= 000001   	WI.LCK= 004000
FC.DIR= 040000   	H.CKSM= 000776   	I.LGTH  000040   	SC.BAD= 000100   	WI.RDV= 000400
FC.FCO= 010000   	H.FCHA= 000014   	I.LNK   000000   	SC.MDL= 000200   	WI.WRV= 001000
FC.WAC= 100000   	H.FLEV= 000006   	I.LUN   000012   	S.HDHD= 000056   	W.CTL   000000
FP.DEL= 000010   	H.FNUM= 000002   	I.PRI   000010   	S.IDHD= 000056   	W.FCB   000002
FP.EXT= 000004   	H.FOWN= 000010   	I.PRM   000024   	S.MPHD= 000012   	W.RTRV  000012
FP.RAT= 000001   	H.FPRO= 000012   	I.RTRV  000034   	S.STBK= 000012   	W.STD   000004
FP.RDV= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	UC.CON= 000200   	W.VBN   000006
FP.WRV= 000002   	H.IDOF= 000000   	I.RVNO= 000012   	UC.DLK= 000100   	W.WISZ  000007
F$$LVL= 000001   	H.MPOF= 000001   	I.RVTI= 000023   	VC.BMW= 000002   	$$    = 000067
F.DREF  000042   	H.PROG= 000010   	I.RWAD= 000024   	VC.IFW= 000001   	.DFEXT= 000005
F.DRNM  000044   	H.PROJ= 000011   	I.RWAT  000026   	V.FCB   000006   	.DFPRO= 164000
F.FEXT  000002   	H.SCHA= 000015   	I.RWCT= 000026   	V.FFNU  000055   	.MPHDR  000000RG
F.FNUM  000006   	H.UCHA= 000014   	I.RWVB= 000032   	V.FIEX  000025   	.MPVBN= ****** GX
F.FOWN  000014   	H.UFAT= 000016   	I.STD   000004   	V.FMAX  000016   	.PRFIL= 000004
F.FPRO  000016   	IDXFNU= 000001   	I.TISZ= 000006   	V.FPRO  000030   	.RTPTF= 001401
F.FSEQ  000010   	ID$$$ = 000204   	I.UIC   000022   	V.FRBK  000034   	.SYUIC= 000010
F.FSQN  000013   	I.ACTL  000035   	LEV11M= 000401   	V.IBLB  000012   	.VBSIZ= 001000
F.FVBN  000046   	I.AST   000020   	LOWFCN= 000011   	V.IBSZ  000013   	.WITRN= ****** GX
F.HDLB  000022   	I.ATL   000006   	MFDFNO= 000004   	V.IFWI  000002   	...GBL= 000000
F.LBN   000026   	I.CRDT= 000031   	MFDFSQ= 000004   	V.LABL  000040   	...TPC= 000012
F.LGTH  000052   	I.CRTI= 000040   	M$$HDR= 000001   	V.LGTH  000056

. ABS.	000056	   000
      	000044	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2497 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:18
[40,10]MPHDR,[40,20]MPHDR/-SP=[40,30]RSXDC,F11PRE,MPHDR
RSXDC	MACRO M1108  05-DEC-77 17:13  PAGE 3


      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.
MPVBN	D0201, MAP VBN TO LBN	MACRO M1108  05-DEC-77 17:13  PAGE 6


      1						.TITLE	MPVBN	D0201, MAP VBN TO LBN
						.IDENT	"D0201"
      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					;
					; VERSION D201, ASSEMBLED FOR RSX-11D
					;
     20
     21					; ANDREW C. GOLDSTEIN  10 SEP 74  17:59:21
     22					; PETER H. LIPMAN	25-MAR-74
     23					;
     24					; MAP A VIRTUAL BLOCK NUMBER TO IT'S CORRESPONDING LOGICAL BLOCK NUMBER
     25					;
     26					;+
     27					; **-.MPVBN - MAP A VIRTUAL BLOCK NUMBER TO A LOGICAL BLOCK NO.
     28					;
     29					; THIS ROUTINE CONVERTS THE SPECIFIED VBN TO IT'S CORRESPONDING LBN
     30					; VIA THE SPECIFIED WINDOW.
     31					;
     32					; INPUTS:
     33					;
     34					; 	C=0
     35					; 	R1=WINDOW ADDRESS
     36					; 	R2, R3 = DESIRED VBN
     37					;
     38					; OUTPUTS:
     39					;
     40					; 	C=0 IF MAPPED, C=1 IF NOT
     41					; 	R2,R3 =DESIRED LBN IF C=0, OTHERWISE PRESERVED AS VBN
     42					; 	R1, R4-R5 PRESERVED, R0 ALTERED
     43					;
     44					;-
     45
     76	000000				.MPVBN::
     77	000000					PUSH	<R2,R3>		; SAVE THE VBN
     78	000004	012700 	001000 			MOV	#.VBSIZ,R0	; GET BYTE COUNT FOR 1 BLOCK
     79	000010					CALL	..VVLL		; AND MAP IT
     80	000014	103402 				BCS	30$
     81	000016	022626 				CMP	(SP)+,(SP)+	; GOOD MAP, THROW AWAY VBN
     82	000020					RETURN
     83
     84	000022				30$:	POP	<R3,R2>		; NO MAP, RESTORE VBN
MPVBN	D0201, MAP VBN TO LBN	MACRO M1108  05-DEC-77 17:13  PAGE 6-1


     85	000026					RETURN
     87					;
     88					;
     89	000030					$END	MPVBN
     90					;
     91					;
     92		000001 				.END
MPVBN	D0201, MAP VBN TO LBN	MACRO M1108  05-DEC-77 17:13  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.DASZ= 000007   	M.CTSZ= 000006   	V.LGTH  000056
AC.LCK= 000001   	F.NACS  000036   	I.DPB   000011   	M.EFNU= 000002   	V.LRUC  000035
BITFNU= 000002   	F.NLCK  000037   	I.EFN   000013   	M.EFSQ= 000004   	V.SBCL  000021
EX.AC1= 000001   	F.NWAC  000040   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBLB  000024
EX.AC2= 000002   	F.RVN   000012   	I.EXTD  000030   	M.ESQN= 000000   	V.SBSZ  000022
EX.ADF= 000010   	F.SCHA  000021   	I.FCN   000014   	M.LBSZ= 000007   	V.STAT  000054
EX.ENA= 000200   	F.SIZE  000032   	I.FIDP  000024   	M.MAX = 000011   	V.STD   000004
EX.FCO= 000004   	F.STAT  000040   	I.FNAM= 000000   	M.RTRV= 000012   	V.TRCT  000000
E$$MSG= 000001   	F.STD   000004   	I.FNBP  000036   	M.USE = 000010   	V.WISZ  000020
E$$TRP= 000001   	F.UCHA  000020   	I.FTYP= 000006   	QIOEFN= 000002   	WI.BPS= 100000
FCPLUN= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$10F= 000001   	WI.DLK= 010000
FC.CEF= 020000   	HIFCN = 000030   	I.IOSB  000016   	R$$11D= 000001   	WI.EXT= 002000
FC.DIR= 040000   	H.CKSM= 000776   	I.LGTH  000040   	SC.BAD= 000100   	WI.LCK= 004000
FC.FCO= 010000   	H.FCHA= 000014   	I.LNK   000000   	SC.MDL= 000200   	WI.RDV= 000400
FC.WAC= 100000   	H.FLEV= 000006   	I.LUN   000012   	S.HDHD= 000056   	WI.WRV= 001000
FP.DEL= 000010   	H.FNUM= 000002   	I.PRI   000010   	S.IDHD= 000056   	W.CTL   000000
FP.EXT= 000004   	H.FOWN= 000010   	I.PRM   000024   	S.MPHD= 000012   	W.FCB   000002
FP.RAT= 000001   	H.FPRO= 000012   	I.RTRV  000034   	S.STBK= 000012   	W.RTRV  000012
FP.RDV= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	UC.CON= 000200   	W.STD   000004
FP.WRV= 000002   	H.IDOF= 000000   	I.RVNO= 000012   	UC.DLK= 000100   	W.VBN   000006
F$$LVL= 000001   	H.MPOF= 000001   	I.RVTI= 000023   	VC.BMW= 000002   	W.WISZ  000007
F.DREF  000042   	H.PROG= 000010   	I.RWAD= 000024   	VC.IFW= 000001   	$$    = 000067
F.DRNM  000044   	H.PROJ= 000011   	I.RWAT  000026   	V.FCB   000006   	.DFEXT= 000005
F.FEXT  000002   	H.SCHA= 000015   	I.RWCT= 000026   	V.FFNU  000055   	.DFPRO= 164000
F.FNUM  000006   	H.UCHA= 000014   	I.RWVB= 000032   	V.FIEX  000025   	.MPVBN  000000RG
F.FOWN  000014   	H.UFAT= 000016   	I.STD   000004   	V.FMAX  000016   	.PRFIL= 000004
F.FPRO  000016   	IDXFNU= 000001   	I.TISZ= 000006   	V.FPRO  000030   	.RTPTF= 001401
F.FSEQ  000010   	ID$$$ = 000201   	I.UIC   000022   	V.FRBK  000034   	.SYUIC= 000010
F.FSQN  000013   	I.ACTL  000035   	LEV11M= 000401   	V.IBLB  000012   	.VBSIZ= 001000
F.FVBN  000046   	I.AST   000020   	LOWFCN= 000011   	V.IBSZ  000013   	..VVLL= ****** GX
F.HDLB  000022   	I.ATL   000006   	MFDFNO= 000004   	V.IFWI  000002   	...GBL= 000000
F.LBN   000026   	I.CRDT= 000031   	MFDFSQ= 000004   	V.LABL  000040   	...TPC= 000012
F.LGTH  000052   	I.CRTI= 000040   	M$$HDR= 000001

. ABS.	000056	   000
      	000030	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2487 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:18
[40,10]MPVBN,[40,20]MPVBN/-SP=[40,30]RSXDC,F11PRE,MPVBN
RSXDC	MACRO M1108  05-DEC-77 17:13  PAGE 3


      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.
MXQIO	D0201, EXECUTE QIO FOR 	MACRO M1108  05-DEC-77 17:13  PAGE 6


      1						.TITLE	MXQIO	D0201, EXECUTE QIO FOR MOUNT
						.IDENT	"D0201"
      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					;
					; VERSION D201, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  10 SEP 74  18:00:08
     23
     24						.MCALL	DIR$,WSIG$S
     25
     26					;+
     27					;
     28					; *** .MXQIO - QIO CALL ROUTINE
     29					;
     30					; THIS ROUTINE EXECUTES THE SPECIFIED DPB (ASSUMED TO BE A QIO AND
     31					; WAIT) AND TESTS FOR ERRORS.
     32					;
     33					; CALL:	JSR	R5,XQIO
     34					;	.WORD	DPB ADDRESS
     35					;
     36					; REGISTERS ARE PRESERVED.
     37					;
     38					;-
     39
     40	000000				.MXQIO::
     41	000000					DIR$	(R5)+		; DO IT
     42	000004	103014 				BCC	20$		; DIRECTIVE OK
     43	000006	026727 	000000G	000000G		CMP	$DSW,#IE.UPN	; CHECK FOR NO NODES
     44	000014	001005 				BNE	10$		; SOMETHING ELSE - GIVE UP
     45	000016					WSIG$S			; WAIT A BIT
     46	000024	005745 				TST	-(R5)		; BACK UP R5
     47	000026	000764 				BR	.MXQIO		; AND TRY AGAIN
     48
     49	000030	016767 	000000G	000000G	10$:	MOV	$DSW,.QIOST	; PUT ERROR CODE IN STANDARD PLACE
     50	000036	105767 	000000G		20$:	TSTB	.QIOST		; CHECK FOR I/O ERROR
     51	000042	003001 				BGT	30$		; OK
     52	000044	000261 				SEC			; MINUS MEANS ERROR
     53	000046	000205 			30$:	RTS	R5
     54					;
MXQIO	D0201, EXECUTE QIO FOR 	MACRO M1108  05-DEC-77 17:13  PAGE 6-1


     55					;
     56	000050					$END	MXQIO
     57					;
     58					;
     59		000001 				.END
MXQIO	D0201, EXECUTE QIO FOR 	MACRO M1108  05-DEC-77 17:13  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.CRTI= 000040   	M$$HDR= 000001   	V.LGTH  000056
AC.LCK= 000001   	F.NACS  000036   	I.DASZ= 000007   	M.CTSZ= 000006   	V.LRUC  000035
BITFNU= 000002   	F.NLCK  000037   	I.DPB   000011   	M.EFNU= 000002   	V.SBCL  000021
EX.AC1= 000001   	F.NWAC  000040   	I.EFN   000013   	M.EFSQ= 000004   	V.SBLB  000024
EX.AC2= 000002   	F.RVN   000012   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBSZ  000022
EX.ADF= 000010   	F.SCHA  000021   	I.EXTD  000030   	M.ESQN= 000000   	V.STAT  000054
EX.ENA= 000200   	F.SIZE  000032   	I.FCN   000014   	M.LBSZ= 000007   	V.STD   000004
EX.FCO= 000004   	F.STAT  000040   	I.FIDP  000024   	M.MAX = 000011   	V.TRCT  000000
E$$MSG= 000001   	F.STD   000004   	I.FNAM= 000000   	M.RTRV= 000012   	V.WISZ  000020
E$$TRP= 000001   	F.UCHA  000020   	I.FNBP  000036   	M.USE = 000010   	WI.BPS= 100000
FCPLUN= 000001   	F11PR$= 000000   	I.FTYP= 000006   	QIOEFN= 000002   	WI.DLK= 010000
FC.CEF= 020000   	HIFCN = 000030   	I.FVER= 000010   	R$$10F= 000001   	WI.EXT= 002000
FC.DIR= 040000   	H.CKSM= 000776   	I.IOSB  000016   	R$$11D= 000001   	WI.LCK= 004000
FC.FCO= 010000   	H.FCHA= 000014   	I.LGTH  000040   	SC.BAD= 000100   	WI.RDV= 000400
FC.WAC= 100000   	H.FLEV= 000006   	I.LNK   000000   	SC.MDL= 000200   	WI.WRV= 001000
FP.DEL= 000010   	H.FNUM= 000002   	I.LUN   000012   	S.HDHD= 000056   	W.CTL   000000
FP.EXT= 000004   	H.FOWN= 000010   	I.PRI   000010   	S.IDHD= 000056   	W.FCB   000002
FP.RAT= 000001   	H.FPRO= 000012   	I.PRM   000024   	S.MPHD= 000012   	W.RTRV  000012
FP.RDV= 000001   	H.FSEQ= 000004   	I.RTRV  000034   	S.STBK= 000012   	W.STD   000004
FP.WRV= 000002   	H.IDOF= 000000   	I.RVDT= 000014   	UC.CON= 000200   	W.VBN   000006
F$$LVL= 000001   	H.MPOF= 000001   	I.RVNO= 000012   	UC.DLK= 000100   	W.WISZ  000007
F.DREF  000042   	H.PROG= 000010   	I.RVTI= 000023   	VC.BMW= 000002   	$DSW  = ****** GX
F.DRNM  000044   	H.PROJ= 000011   	I.RWAD= 000024   	VC.IFW= 000001   	.DFEXT= 000005
F.FEXT  000002   	H.SCHA= 000015   	I.RWAT  000026   	V.FCB   000006   	.DFPRO= 164000
F.FNUM  000006   	H.UCHA= 000014   	I.RWCT= 000026   	V.FFNU  000055   	.MXQIO  000000RG
F.FOWN  000014   	H.UFAT= 000016   	I.RWVB= 000032   	V.FIEX  000025   	.PRFIL= 000004
F.FPRO  000016   	IDXFNU= 000001   	I.STD   000004   	V.FMAX  000016   	.QIOST= ****** GX
F.FSEQ  000010   	ID$$$ = 000201   	I.TISZ= 000006   	V.FPRO  000030   	.RTPTF= 001401
F.FSQN  000013   	IE.UPN= ****** GX	I.UIC   000022   	V.FRBK  000034   	.SYUIC= 000010
F.FVBN  000046   	I.ACTL  000035   	LEV11M= 000401   	V.IBLB  000012   	.VBSIZ= 001000
F.HDLB  000022   	I.AST   000020   	LOWFCN= 000011   	V.IBSZ  000013   	...GBL= 000000
F.LBN   000026   	I.ATL   000006   	MFDFNO= 000004   	V.IFWI  000002   	...TPC= 000012
F.LGTH  000052   	I.CRDT= 000031   	MFDFSQ= 000004   	V.LABL  000040

. ABS.	000056	   000
      	000050	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2514 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[40,10]MXQIO,[40,20]MXQIO/-SP=[40,30]RSXDC,F11PRE,MXQIO
RSXDC	MACRO M1108  05-DEC-77 17:14  PAGE 3


      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.
NXHDR	D0203, READ NEXT EXTENS	MACRO M1108  05-DEC-77 17:14  PAGE 6


      1						.TITLE	NXHDR	D0203, READ NEXT EXTENSION FILE HEADER
						.IDENT	"D0203"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D203, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  6 NOV 74  22:25
     23					;
     24					; READ NEXT EXTENSION FILE HEADER
     25
     26					;+
     27					;
     28					; **.NXHDR - READ NEXT EXTENSION FILE HEADER
     29					;
     30					; THIS ROUTINE EXAMINES THE HEADER EXTENSION INFORMATION IN THE
     31					; MAP AREA OF THE HEADER CURRENTLY IN CORE AND READS THE NEXT HEADER
     32					; IF ONE EXISTS. THE FILE SEQUENCE NUMBER AND SEGMENT NUMBER OF THE
     33					; NEW HEADER ARE CHECKED.
     34					;
     35					; INPUTS:
     36					;
     37					;	FILE HEADER IN .HDBUF
     38					;
     39					; OUTPUTS:
     40					;
     41					;	C = 0 - SUCCESSFUL
     42					;	R0 - R3 ALTERED
     43					;	R4 - R5 PRESERVED
     44					;	NEW FILE HEADER IN .HDBUF
     45					;
     46					;	C = 1 - NO EXTENSION HEADER EXISTS
     47					;	R0 - R1 ALTERED
     48					;	R2 - R5 PRESERVED
     49					;	.HDBUF PRESERVED
     50					;
     51					;-
     52
     53						.ENABL	LSB
     54
NXHDR	D0203, READ NEXT EXTENS	MACRO M1108  05-DEC-77 17:14  PAGE 6-1


     55	000000					ASSUME	M.ESQN,0
     56	000000					ASSUME	M.EFNU,M.ESQN+2
     57	000000					ASSUME	M.EFSQ,M.EFNU+2
     58
     59	000000				.NXHDR::
     60	000000					CALL	.GTMAP		; POINT TO MAP AREA
     61	000004	012146 				MOV	(R1)+,-(SP)	; PUSH EXTENSION SEGMENT NUMBER
     62	000006	012100 				MOV	(R1)+,R0	; GET EXTENSION FILE NUMBER
     63	000010	001423 				BEQ	30$		; BRANCH IF NONE
     64	000012	012146 				MOV	(R1)+,-(SP)	; SAVE EXTENSION FILE SEQUENCE NUMBER
     65	000014	000404 				BR	10$
     66
     67					;+
     68					;
     69					; **.NXHD1 - READ EXTENSION FILE HEADER
     70					;
     71					; ALTERNATE ENTRY TO READ THE EXTENSION HEADER DESCRIBED BY THE
     72					; ARGUMENTS IN THE REGISTERS. THE FILE SEQUENCE NUMBER AND SEGMENT NUMBER OF THE
     73					; NEW HEADER ARE CHECKED.
     74					;
     75					; INPUTS:
     76					;
     77					;	R0 = FILE NUMBER
     78					;	R1 = FILE SEQUENCE NUMBER
     79					;	R2 = FILE SEGMENT NUMBER OF PREVIOUS HEADER
     80					;
     81					; OUTPUTS:
     82					;
     83					;	C = 0 - SUCCESSFUL
     84					;	R0 - R3 ALTERED
     85					;	R4 - R5 PRESERVED
     86					;	NEW FILE HEADER IN .HDBUF
     87					;
     88					;	C = 1 - NO EXTENSION HEADER EXISTS
     89					;	R0 - R1 ALTERED
     90					;	R2 - R5 PRESERVED
     91					;	.HDBUF PRESERVED
     92					;
     93					;-
     94
     95	000016				.NXHD1::
     96	000016	005700 				TST	R0		; CHECK THE FILE NUMBER
     97	000020	001420 				BEQ	40$		; ZERO MEANS NO EXTENSION
     98	000022					PUSH	<R2,R1>		; SAVE AWAY SEGMENT AND SEQUENCE NUMBERS
     99
    100	000026				10$:	CALL	.RHDFN		; READ THE HEADER
    101	000032	022667 	000004G			CMP	(SP)+,.HDBUF+H.FSEQ ; CHECK THE FILE SEQUENCE NUMBER
    102	000036	001401 				BEQ	20$
    103	000040					ERRX	IE.SQC,<FILE SEQUENCE NUMBER CHECK>
	000040	   000C	   211 			TRAP	-IE.SQC		; FILE SEQUENCE NUMBER CHECK
    104
    105	000042				20$:	CALL	.GTMAP		; POINT TO MAP AREA OF NEW HEADER
    106	000046	005216 				INC	(SP)		; BUMP THE SAVED SEGMENT NUMBER
    107	000050	122611 				CMPB	(SP)+,(R1)	; CHECK THE SEGMENT NUMBER
    108	000052	000241 				CLC
    109	000054	001403 				BEQ	50$
    110	000056					ERRX	IE.BHD,<BAD FILE HEADER>
NXHDR	D0203, READ NEXT EXTENS	MACRO M1108  05-DEC-77 17:14  PAGE 6-2


	000056	   000C	   211 			TRAP	-IE.BHD		; BAD FILE HEADER
    111
    112	000060	005726 			30$:	TST	(SP)+		; CLEAN THE STACK
    113	000062	000261 			40$:	SEC			; NO EXTENSION HEADER
    114	000064				50$:	RETURN
    115
    116						.DSABL	LSB
    117					;
    118					;
    119	000066					$END	NXHDR
    120					;
    121					;
    122		000001 				.END
NXHDR	D0203, READ NEXT EXTENS	MACRO M1108  05-DEC-77 17:14  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBCL  000021
AC.LCK= 000001   	F.NLCK  000037   	I.DPB   000011   	M.EFSQ= 000004   	V.SBLB  000024
BITFNU= 000002   	F.NWAC  000040   	I.EFN   000013   	M.ERVN= 000001   	V.SBSZ  000022
EX.AC1= 000001   	F.RVN   000012   	I.EXDT= 000046   	M.ESQN= 000000   	V.STAT  000054
EX.AC2= 000002   	F.SCHA  000021   	I.EXTD  000030   	M.LBSZ= 000007   	V.STD   000004
EX.ADF= 000010   	F.SIZE  000032   	I.FCN   000014   	M.MAX = 000011   	V.TRCT  000000
EX.ENA= 000200   	F.STAT  000040   	I.FIDP  000024   	M.RTRV= 000012   	V.WISZ  000020
EX.FCO= 000004   	F.STD   000004   	I.FNAM= 000000   	M.USE = 000010   	WI.BPS= 100000
E$$MSG= 000001   	F.UCHA  000020   	I.FNBP  000036   	QIOEFN= 000002   	WI.DLK= 010000
E$$TRP= 000001   	F11PR$= 000000   	I.FTYP= 000006   	R$$10F= 000001   	WI.EXT= 002000
FCPLUN= 000001   	HIFCN = 000030   	I.FVER= 000010   	R$$11D= 000001   	WI.LCK= 004000
FC.CEF= 020000   	H.CKSM= 000776   	I.IOSB  000016   	SC.BAD= 000100   	WI.RDV= 000400
FC.DIR= 040000   	H.FCHA= 000014   	I.LGTH  000040   	SC.MDL= 000200   	WI.WRV= 001000
FC.FCO= 010000   	H.FLEV= 000006   	I.LNK   000000   	S.HDHD= 000056   	W.CTL   000000
FC.WAC= 100000   	H.FNUM= 000002   	I.LUN   000012   	S.IDHD= 000056   	W.FCB   000002
FP.DEL= 000010   	H.FOWN= 000010   	I.PRI   000010   	S.MPHD= 000012   	W.RTRV  000012
FP.EXT= 000004   	H.FPRO= 000012   	I.PRM   000024   	S.STBK= 000012   	W.STD   000004
FP.RAT= 000001   	H.FSEQ= 000004   	I.RTRV  000034   	UC.CON= 000200   	W.VBN   000006
FP.RDV= 000001   	H.IDOF= 000000   	I.RVDT= 000014   	UC.DLK= 000100   	W.WISZ  000007
FP.WRV= 000002   	H.MPOF= 000001   	I.RVNO= 000012   	VC.BMW= 000002   	$$    = 000067
F$$LVL= 000001   	H.PROG= 000010   	I.RVTI= 000023   	VC.IFW= 000001   	.DFEXT= 000005
F.DREF  000042   	H.PROJ= 000011   	I.RWAD= 000024   	V.FCB   000006   	.DFPRO= 164000
F.DRNM  000044   	H.SCHA= 000015   	I.RWAT  000026   	V.FFNU  000055   	.GTMAP= ****** GX
F.FEXT  000002   	H.UCHA= 000014   	I.RWCT= 000026   	V.FIEX  000025   	.HDBUF= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.RWVB= 000032   	V.FMAX  000016   	.NXHDR  000000RG
F.FOWN  000014   	IDXFNU= 000001   	I.STD   000004   	V.FPRO  000030   	.NXHD1  000016RG
F.FPRO  000016   	ID$$$ = 000203   	I.TISZ= 000006   	V.FRBK  000034   	.PRFIL= 000004
F.FSEQ  000010   	IE.BHD= ****** GX	I.UIC   000022   	V.IBLB  000012   	.RHDFN= ****** GX
F.FSQN  000013   	IE.SQC= ****** GX	LEV11M= 000401   	V.IBSZ  000013   	.RTPTF= 001401
F.FVBN  000046   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002   	.SYUIC= 000010
F.HDLB  000022   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040   	.VBSIZ= 001000
F.LBN   000026   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056   	...GBL= 000000
F.LGTH  000052   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035   	...TPC= 000012
F.LINK  000000   	I.CRTI= 000040   	M.CTSZ= 000006

. ABS.	000056	   000
      	000066	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2542 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:19
[40,10]NXHDR,[40,20]NXHDR/-SP=[40,30]RSXDC,F11PRE,NXHDR
RSXDC	MACRO M1108  05-DEC-77 17:14  PAGE 3


      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.
OVERR	D0200, OVERLAY ERROR HA	MACRO M1108  05-DEC-77 17:14  PAGE 6


      1						.TITLE	OVERR	D0200, OVERLAY ERROR HANDLER
						.IDENT	"D0200"
      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					;
					; VERSION D200, ASSEMBLED FOR RSX-11D
					;
     20
     21					; ANDREW C. GOLDSTEIN  25 JUL 1974
     22					; PETER H. LIPMAN	8-JULY-74
     23					;
     24					; ERROR HANDLER ROUTINE FOR OVERLAY READ ERRORS
     25					;
     26						.MCALL	DRERR$,WSIG$S
     27	000000					DRERR$			; DEFINE DIRECTIVE ERROR CODES LOCALLY
     28					;+
     29					; **-$ALERR-LOAD OVERLAY ERROR HANDLER
     30					;
     31					; THIS ROUTINE WILL DO A WAIT FOR SIGNIFICANT EVENT IF THE LOAD
     32					; FAILURE WAS DUE TO LACK OF DYNAMIC STORAGE FOR THE QI/O.
     33					; 	ANY OTHER ERROR WILL MERELY RESULT IN A RETRY
     34					;
     35					; INPUTS:
     36					;
     37					; 	$DSW CONTAINS THE ERROR CODE FROM THE QI/O FAILURE IF ANY.
     38					;
     39					; OUTPUTS:
     40					;
     41					; 	ALL REGISTERS PRESERVED
     42					;
     43					;-
     44
     45	000000	023727 	000000G	177777 	$ALERR::CMP	@#$DSW,#IE.UPN	; NO DYNAMIC STORAGE?
     46	000006	001003 				BNE	10$		; BRANCH IF NO
     47	000010					WSIG$S			; YES, WAIT AND TRY AGAIN
     48	000016				10$:	RETURN			; JUST RETURN AND TRY AGAIN
     49					;
     50					;
     51	000020					$END	OVERR
     52					;
     53					;
     54		000001 				.END
OVERR	D0200, OVERLAY ERROR HA	MACRO M1108  05-DEC-77 17:14  PAGE 6-1
SYMBOL TABLE

AC.DLK= 000002   	F.RVN   000012   	IE.LNL= 177646   	I.STD   000004   	V.IBLB  000012
AC.LCK= 000001   	F.SCHA  000021   	IE.SDP= 177635   	I.TISZ= 000006   	V.IBSZ  000013
BITFNU= 000002   	F.SIZE  000032   	IE.ULN= 177773   	I.UIC   000022   	V.IFWI  000002
EX.AC1= 000001   	F.STAT  000040   	IE.UPN= 177777   	LEV11M= 000401   	V.LABL  000040
EX.AC2= 000002   	F.STD   000004   	IS.CLR= 000000   	LOWFCN= 000011   	V.LGTH  000056
EX.ADF= 000010   	F.UCHA  000020   	IS.SET= 000002   	MFDFNO= 000004   	V.LRUC  000035
EX.ENA= 000200   	F11PR$= 000000   	I.ACTL  000035   	MFDFSQ= 000004   	V.SBCL  000021
EX.FCO= 000004   	HIFCN = 000030   	I.AST   000020   	M$$HDR= 000001   	V.SBLB  000024
E$$MSG= 000001   	H.CKSM= 000776   	I.ATL   000006   	M.CTSZ= 000006   	V.SBSZ  000022
E$$TRP= 000001   	H.FCHA= 000014   	I.CRDT= 000031   	M.EFNU= 000002   	V.STAT  000054
FCPLUN= 000001   	H.FLEV= 000006   	I.CRTI= 000040   	M.EFSQ= 000004   	V.STD   000004
FC.CEF= 020000   	H.FNUM= 000002   	I.DASZ= 000007   	M.ERVN= 000001   	V.TRCT  000000
FC.DIR= 040000   	H.FOWN= 000010   	I.DPB   000011   	M.ESQN= 000000   	V.WISZ  000020
FC.FCO= 010000   	H.FPRO= 000012   	I.EFN   000013   	M.LBSZ= 000007   	WI.BPS= 100000
FC.WAC= 100000   	H.FSEQ= 000004   	I.EXDT= 000046   	M.MAX = 000011   	WI.DLK= 010000
FP.DEL= 000010   	H.IDOF= 000000   	I.EXTD  000030   	M.RTRV= 000012   	WI.EXT= 002000
FP.EXT= 000004   	H.MPOF= 000001   	I.FCN   000014   	M.USE = 000010   	WI.LCK= 004000
FP.RAT= 000001   	H.PROG= 000010   	I.FIDP  000024   	QIOEFN= 000002   	WI.RDV= 000400
FP.RDV= 000001   	H.PROJ= 000011   	I.FNAM= 000000   	R$$10F= 000001   	WI.WRV= 001000
FP.WRV= 000002   	H.SCHA= 000015   	I.FNBP  000036   	R$$11D= 000001   	W.CTL   000000
F$$LVL= 000001   	H.UCHA= 000014   	I.FTYP= 000006   	SC.BAD= 000100   	W.FCB   000002
F.DREF  000042   	H.UFAT= 000016   	I.FVER= 000010   	SC.MDL= 000200   	W.RTRV  000012
F.DRNM  000044   	IDXFNU= 000001   	I.IOSB  000016   	S.HDHD= 000056   	W.STD   000004
F.FEXT  000002   	ID$$$ = 000200   	I.LGTH  000040   	S.IDHD= 000056   	W.VBN   000006
F.FNUM  000006   	IE.ACT= 177771   	I.LNK   000000   	S.MPHD= 000012   	W.WISZ  000007
F.FOWN  000014   	IE.ADP= 177636   	I.LUN   000012   	S.STBK= 000012   	$ALERR  000000RG
F.FPRO  000016   	IE.AST= 177660   	I.PRI   000010   	UC.CON= 000200   	$DSW  = ****** GX
F.FSEQ  000010   	IE.CKP= 177766   	I.PRM   000024   	UC.DLK= 000100   	$$MSG = 000000
F.FSQN  000013   	IE.HWR= 177772   	I.RTRV  000034   	VC.BMW= 000002   	.DFEXT= 000005
F.FVBN  000046   	IE.IDU= 177644   	I.RVDT= 000014   	VC.IFW= 000001   	.DFPRO= 164000
F.HDLB  000022   	IE.IEF= 177637   	I.RVNO= 000012   	V.FCB   000006   	.PRFIL= 000004
F.LBN   000026   	IE.ILU= 177640   	I.RVTI= 000023   	V.FFNU  000055   	.RTPTF= 001401
F.LGTH  000052   	IE.INS= 177776   	I.RWAD= 000024   	V.FIEX  000025   	.SYUIC= 000010
F.LINK  000000   	IE.IPR= 177641   	I.RWAT  000026   	V.FMAX  000016   	.VBSIZ= 001000
F.NACS  000036   	IE.ITI= 177643   	I.RWCT= 000026   	V.FPRO  000030   	...GBL= 000000
F.NLCK  000037   	IE.ITS= 177770   	I.RWVB= 000032   	V.FRBK  000034   	...TPC= 000012
F.NWAC  000040

. ABS.	000056	   000
      	000020	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2681 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:21
[40,10]OVERR,[40,20]OVERR/-SP=[40,30]RSXDC,F11PRE,OVERR
RSXDC	MACRO M1108  05-DEC-77 17:14  PAGE 3


      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.
PROCK	D0202, CHECK FILE PROTE	MACRO M1108  05-DEC-77 17:14  PAGE 6


      1						.TITLE	PROCK	D0202, CHECK FILE PROTECTION
						.IDENT	"D0202"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D202, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  29 OCT 74  13:43
     23					; PETER H. LIPMAN	5-MAR-74
     24					;
     25					; CHECK DESIRED ACCESS AGAINST THE FILE PROTECTION WORD
     26					;
     31					;+
     32					; **-.PROCK-CHECK FILE PROTECTION
     33					;
     34					; THIS ROUTINE ACCEPTS AN ACCESS REQUEST AND CHECKS WHETHER THE
     35					; REQUESTOR HAS THE PRIVILEGE TO ALLOW THAT ACCESS.
     36					;
     37					; THE FOLLOWING ENTRY POINTS ARE DEFINED
     38					; 	.PROCK - CHECK FILE FOR DELETE (IF NOT ACCESSED) AND
     39					; CHECK ACCESS PROTECTION
     40					; 	.PRCK1 - CHECK FILE FOR DELETE IGNORING ACCESS STATUS AND
     41					; CHECK ACCESS PROTECTION
     42					; 	.PRCK2 - JUST CHECK ACCESS PROTECTION
     43					; 	.PRCK3 - JUST CHECK ACCESS PROTECTION, FOLLOWING REGISTERS SET UP
     44					; 		R2=OWNER'S UIC
     45					; 		R3=PROTECTION WORD
     46					; 		FILE HEADER NOT ASSUMED TO BE IN BUFFER
     47					;
     48					; INPUTS:
     49					;
     50					; 	R0=ACCESS REQUEST
     51					; 		0=WRITE ATTRIBUTES
     52					; 		1=READ, READ ATTRIBUTES
     53					; 		2=WRITE
     54					; 		4=EXTEND
     55					; 		10=DELETE
     56					; 	R4=VOLUME CONTROL BLOCK
     57					; 	R5=I/O PACKET
     58					;
PROCK	D0202, CHECK FILE PROTE	MACRO M1108  05-DEC-77 17:14  PAGE 6-1


     59					; OUTPUTS:
     60					;
     61					; 	R0-R3 ALTERED R4-R5 PRESERVED
     62					; 	RETURNS IN LINE IF AND ONLY IF ACCESS IS ALLOWED
     63					;-
     64
     65						.ENABL	LSB
     66
     67	000000				.PROCK::
     72	000000	026727 	000000G	000001 		CMP	.LUTN2,#1	; IF FILE IS ACCESSED
     74	000006	101004 				BHI	10$		; IGNORE THE DELETE BIT
     75
     76	000010					ASSUME	SC.MDL,200	; DELETE BIT IS SIGN BIT OF BYTE
     77	000010	105767 	000015G		.PRCK1::TSTB	.HDBUF+H.SCHA	; IS FILE MARKED FOR DELETE
     78	000014	100001 				BPL	10$		; BRANCH IF NO
     79	000016					ERRX	IE.NSF,<DENY EXISTENCE OF FILE>
	000016	   000C	   211 			TRAP	-IE.NSF		; DENY EXISTENCE OF FILE
     80					;
     81					; HERE TO JUST CHECK DESIRED ACCESS AGAINST FILE PROTECTION
     82					;
     83	000020				.PRCK2::
     84	000020	016703 	000012G		10$:	MOV	.HDBUF+H.FPRO,R3 ; R3=PROTECTION WORD
     85	000024	016702 	000010G			MOV	.HDBUF+H.FOWN,R2 ; R2=FILE OWNER
     86	000030				.PRCK3::
     87	000030	016701 	000000G			MOV	.UCBAD,R1
     92	000034	032761 	000000G	000000G		BIT	#UC.SWL,U.C1(R1) ; DEVICE SOFTWARE WRITE LOCKED?
     94	000042	001404 				BEQ	20$		; BRANCH IF NO
     95	000044	022700 	000001 			CMP	#1,R0		; YES, ONLY READ ACCESS ALLOWED
     96	000050	001401 				BEQ	20$
     97	000052					ERRX	IE.WLK,<DEVICE WRITE LOCKED>
	000052	   000C	   211 			TRAP	-IE.WLK		; DEVICE WRITE LOCKED
     98	000054				20$:
    105	000054	126527 	000023 	000010 		CMPB	I.UIC+1(R5),#.SYUIC ; IS REQUESTOR A SYSTEM UIC
    107	000062	101001 				BHI	30$		; BRANCH IF NO
    108	000064	000264 				SEZ			; Z=1 IF SYSTEM UIC
    109	000066				30$:	CALL	PROCK1		; SEE IF SYSTEM IS ALLOWED ACCESS
    110	000072	026502 	000022 			CMP	I.UIC(R5),R2	; IS HE THE OWNER
    111	000076					CALL	PROCK1		; SEE IF OWNER IS ALLOWED ACCESS
    112	000102	005700 				TST	R0		; DENY WRITE ATTRIBUTES TO GROUP AND WORLD
    113	000104	001410 				BEQ	40$
    114	000106	000302 				SWAB	R2
    115	000110	126502 	000023 			CMPB	I.UIC+1(R5),R2	; IS HE A MEMBER OF THE GROUP
    116	000114					CALL	PROCK1		; SEE IF GROUP IS ALLOWED ACCESS
    117	000120	000264 				SEZ			; Z=1 TO CHECK WORLD PROTECTION
    118	000122					CALL	PROCK1		; SEE IF WORLD IS ALLOWED ACCESS
    119	000126				40$:	ERRX	IE.PRI,<PRIVILEGE VIOLATION>
	000126	   000C	   211 			TRAP	-IE.PRI		; PRIVILEGE VIOLATION
    120
    121						.DSABL	LSB
PROCK	D0202, CHECK FILE PROTE	MACRO M1108  05-DEC-77 17:14  PAGE 7


    123					;+
    124					; **-PROCK1 - CHECK PROTECTION FOR WRITE ATTRIBUTES, READ, WRITE, EXTEND,
    125					; 		AND DELETE
    126					;
    127					; INPUTS:
    128					;
    129					; 	Z=1 IF CHECKING PROTECTION AND SHIFTING R3 IF FAILURE
    130					; 	Z=0 IF JUSTING SHIFTING R3 4 BITS
    131					; 	R0=ACCESS REQUEST-(SEE .PROCK)
    132					; 	LOW ORDER 4 BITS OF R3=PRIVILEGE TO CHECK AGAINST
    133					;
    134					; OUTPUTS:
    135					;
    136					; 	R0-R2,R4,R5 PRESERVED
    137					; 	R3 SHIFTED RIGHT 4 BITS
    138					; 	RETURNS IF ACCESS NOT GRANTED
    139					; 	RETURN TO .PROCK CALLER IF ACCESS GRANTED
    140					; 		BEWARE, DO NOT USE STACK IN .PROCK
    141					;-
    142
    143	000130				PROCK1:
    144	000130	001002 				BNE	10$		; BRANCH IF NOT CHECKING PROTECTION BITS
    145	000132	030003 				BIT	R0,R3		; IF ACCESS GRANTED, THEN BITS ARE ZERO
    146	000134	001405 				BEQ	20$		; BRANCH IF ACCESS GRANTED
    147	000136				10$:
    151	000136	006203 				ASR	R3
    152	000140	006203 				ASR	R3
    153	000142	006203 				ASR	R3
    154	000144	006203 				ASR	R3
    156	000146					RETURN
    157	000150	005726 			20$:	TST	(SP)+		; ACCESS GRANTED, RETURN TO .PROCK CALLER
    158	000152					RETURN
    159					;
    160					;
    161	000154					$END	PROCK
    162					;
    163					;
    164		000001 				.END
PROCK	D0202, CHECK FILE PROTE	MACRO M1108  05-DEC-77 17:14  PAGE 7-1
SYMBOL TABLE

AC.DLK= 000002   	F.NLCK  000037   	I.DPB   000011   	M.ERVN= 000001   	V.SBLB  000024
AC.LCK= 000001   	F.NWAC  000040   	I.EFN   000013   	M.ESQN= 000000   	V.SBSZ  000022
BITFNU= 000002   	F.RVN   000012   	I.EXDT= 000046   	M.LBSZ= 000007   	V.STAT  000054
EX.AC1= 000001   	F.SCHA  000021   	I.EXTD  000030   	M.MAX = 000011   	V.STD   000004
EX.AC2= 000002   	F.SIZE  000032   	I.FCN   000014   	M.RTRV= 000012   	V.TRCT  000000
EX.ADF= 000010   	F.STAT  000040   	I.FIDP  000024   	M.USE = 000010   	V.WISZ  000020
EX.ENA= 000200   	F.STD   000004   	I.FNAM= 000000   	PROCK1  000130R  	WI.BPS= 100000
EX.FCO= 000004   	F.UCHA  000020   	I.FNBP  000036   	QIOEFN= 000002   	WI.DLK= 010000
E$$MSG= 000001   	F11PR$= 000000   	I.FTYP= 000006   	R$$10F= 000001   	WI.EXT= 002000
E$$TRP= 000001   	HIFCN = 000030   	I.FVER= 000010   	R$$11D= 000001   	WI.LCK= 004000
FCPLUN= 000001   	H.CKSM= 000776   	I.IOSB  000016   	SC.BAD= 000100   	WI.RDV= 000400
FC.CEF= 020000   	H.FCHA= 000014   	I.LGTH  000040   	SC.MDL= 000200   	WI.WRV= 001000
FC.DIR= 040000   	H.FLEV= 000006   	I.LNK   000000   	S.HDHD= 000056   	W.CTL   000000
FC.FCO= 010000   	H.FNUM= 000002   	I.LUN   000012   	S.IDHD= 000056   	W.FCB   000002
FC.WAC= 100000   	H.FOWN= 000010   	I.PRI   000010   	S.MPHD= 000012   	W.RTRV  000012
FP.DEL= 000010   	H.FPRO= 000012   	I.PRM   000024   	S.STBK= 000012   	W.STD   000004
FP.EXT= 000004   	H.FSEQ= 000004   	I.RTRV  000034   	UC.CON= 000200   	W.VBN   000006
FP.RAT= 000001   	H.IDOF= 000000   	I.RVDT= 000014   	UC.DLK= 000100   	W.WISZ  000007
FP.RDV= 000001   	H.MPOF= 000001   	I.RVNO= 000012   	UC.SWL= ****** GX	$$    = 000067
FP.WRV= 000002   	H.PROG= 000010   	I.RVTI= 000023   	U.C1  = ****** GX	.DFEXT= 000005
F$$LVL= 000001   	H.PROJ= 000011   	I.RWAD= 000024   	VC.BMW= 000002   	.DFPRO= 164000
F.DREF  000042   	H.SCHA= 000015   	I.RWAT  000026   	VC.IFW= 000001   	.HDBUF= ****** GX
F.DRNM  000044   	H.UCHA= 000014   	I.RWCT= 000026   	V.FCB   000006   	.LUTN2= ****** GX
F.FEXT  000002   	H.UFAT= 000016   	I.RWVB= 000032   	V.FFNU  000055   	.PRCK1  000010RG
F.FNUM  000006   	IDXFNU= 000001   	I.STD   000004   	V.FIEX  000025   	.PRCK2  000020RG
F.FOWN  000014   	ID$$$ = 000202   	I.TISZ= 000006   	V.FMAX  000016   	.PRCK3  000030RG
F.FPRO  000016   	IE.NSF= ****** GX	I.UIC   000022   	V.FPRO  000030   	.PRFIL= 000004
F.FSEQ  000010   	IE.PRI= ****** GX	LEV11M= 000401   	V.FRBK  000034   	.PROCK  000000RG
F.FSQN  000013   	IE.WLK= ****** GX	LOWFCN= 000011   	V.IBLB  000012   	.RTPTF= 001401
F.FVBN  000046   	I.ACTL  000035   	MFDFNO= 000004   	V.IBSZ  000013   	.SYUIC= 000010
F.HDLB  000022   	I.AST   000020   	MFDFSQ= 000004   	V.IFWI  000002   	.UCBAD= ****** GX
F.LBN   000026   	I.ATL   000006   	M$$HDR= 000001   	V.LABL  000040   	.VBSIZ= 001000
F.LGTH  000052   	I.CRDT= 000031   	M.CTSZ= 000006   	V.LGTH  000056   	...GBL= 000000
F.LINK  000000   	I.CRTI= 000040   	M.EFNU= 000002   	V.LRUC  000035   	...TPC= 000012
F.NACS  000036   	I.DASZ= 000007   	M.EFSQ= 000004   	V.SBCL  000021

. ABS.	000056	   000
      	000154	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2580 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:20
[40,10]PROCK,[40,20]PROCK/-SP=[40,30]RSXDC,F11PRE,PROCK
RSXDC	MACRO M1108  05-DEC-77 17:15  PAGE 3


      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.
PURGE	D0210, CLOSE ALL FILES	MACRO M1108  05-DEC-77 17:15  PAGE 6


      1						.TITLE	PURGE	D0210, CLOSE ALL FILES
						.IDENT	"D0210"
      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					;
					; VERSION D210, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  13 FEB 75  19:17
     23					;
     24					;+
     25					;
     26					; **-.PURGE - DEACCESS ALL FILES OF A TASK FOR A SPECIFIC DEVICE
     27					;
     28					; THIS ROUTINE CLOSES ALL FILES OF A TASK UNDERGOING I/O RUNDOWN.
     29					; NOTE THAT THERE IS NO I/O PACKET FOR THIS REQUEST - THE ONLY
     30					; DATA AVAILABLE IS WHAT COMES IN THE MESSAGE FROM THE HANDLER.
     31					; THE TASK'S LUT IS SCANNED FOR LUNS ASSIGNED TO THE SPECIFIED DEVICE.
     32					; FOR EACH ONE THAT IS FOUND AND HAS A NON-ZERO WINDOW POINTER, A
     33					; NORMAL DEACCESS IS DONE (WITHOUT WRITE ATTRIBUTES).
     34					;
     35					; INPUTS:
     36					;
     37					;	R4 = VCB ADDRESS
     38					;	.IOPKT = USER'S ATL ADDRESS
     39					;	.UCBAD = PUD ADDRESS
     40					;
     41					;-
     42
     43						.ENABL	LSB
     44
     45	000000				.PURGE::
     46	000000	016767 	000000G	000000G		MOV	.IOPKT,.ATLAD	; SAVE USER'S ATL ADDRESS
     47	000006	005067 	000000G			CLR	.IOPKT		; INDICATE NO I/O PACKET
     48	000012	005005 				CLR	R5
     49	000014	005704 				TST	R4		; CHECK IF THE VOLUME IS MOUNTED
     50	000016	001473 				BEQ	60$		; NO - GET OUT
     51	000020	016701 	000000G			MOV	.ATLAD,R1	; GET ATL ADDRESS OF TASK
     52	000024	012746 				MOV	(PC)+,-(SP)
     53	000026	   006 	   177 			.BYTE	6,177		; PDR FOR 4K ACCESS
     54	000030	016146 	000000G			MOV	A.HA(R1),-(SP)	; ADDRESS OF TASK HEADER
PURGE	D0210, CLOSE ALL FILES	MACRO M1108  05-DEC-77 17:15  PAGE 6-1


     55	000034					CALL	..SPD3		; MAP TO TASK HEADER
     56	000040	012700 	060000G			MOV	#60000+H.LUT,R0	; POINT TO START OF LUT
     57	000044	012001 				MOV	(R0)+,R1	; GET NUMBER OF LUNS
     58	000046	001454 				BEQ	50$		; WHAT, NO LUNS?
     59
     60					; CHECK IF THIS LUN IS ASSIGNED TO THE PUD IN QUESTION
     61
     62	000050	012005 			10$:	MOV	(R0)+,R5	; GET PUD POINTER
     63	000052	002014 				BGE	20$		; REAL PUD ADDRESSES ARE IN UPPER 16K
     64	000054					CALL	..REDT		; REDIRECT THE ASSIGNMENT
     65	000060	020567 	000000G			CMP	R5,.UCBAD	; CHECK THROUGH REDIRECTION
     66	000064	001007 				BNE	20$		; BRANCH IF NO MATCH
     67	000066	005005 				CLR	R5		; KEEP R5 CLEAN
     68	000070	011067 	000000G			MOV	(R0),.LUTN2	; MATCH - GET WINDOW POINTER
     69	000074	042767 	000001 	000000G		BIC	#1,.LUTN2	; CLEAR OUT INTERLOCK BIT
     70	000102	001002 				BNE	30$		; IF NOT ACCESSED, SKIP IT
     71	000104	005720 			20$:	TST	(R0)+		; NO MATCH - SKIP WINDOW POINTER
     72	000106	000433 				BR	40$		; AND TRY ANOTHER
     73
     74					; FOUND AN ACCESSED FILE ON THIS DEVICE - DEACCESS IT
     75
     76	000110	005020 			30$:	CLR	(R0)+		; CLEAR THE WINDOW POINTER
     77	000112					CALL	..SPD3		; RESTORE MAPPING
     78	000116	022626 				CMP	(SP)+,(SP)+
     79	000120	010067 	000000G			MOV	R0,.PTM0	; SAVE REGISTERS
     80	000124	010167 	000000G			MOV	R1,.PTM1
     81	000130	012767 	000000C	000000G		MOV	#<<IO.DAC/256.>-LOWFCN+1>*2,.EXDSP
     82									; SET UP CONTEXT FOR A DEACCESS
     83	000136	012746 	000000G			MOV	#.EXIT,-(SP)	; FAKE A RETURN TO .EXIT SINCE WE
     84									; MAY CALL ACROSS OVERLAYS
     85	000142	000167 	000000G			JMP	.PURGD		; AND DEACCESS THE FILE
     86
     87					; .EXIT RETURNS US HERE IF THE DEACCESS CRASHED. IT IS PRESUMABLY CLEANED
     88					; UP TO AN ACCEPTABLE LEVEL, SO GO ON TO THE NEXT LUN.
     89
     90	000146				.PURGX::
     91	000146	016701 	000000G			MOV	.ATLAD,R1	; GET TASK'S ATL AGAIN
     92	000152	012746 				MOV	(PC)+,-(SP)
     93	000154	   006 	   177 			.BYTE	6,177		; PDR FOR 4K ACCESS
     94	000156	016146 	000000G			MOV	A.HA(R1),-(SP)	; GET TASK HEADER ADDR
     95	000162					CALL	..SPD3		; MAP TO TASK HEADER AGAIN
     96	000166	016700 	000000G			MOV	.PTM0,R0	; RESTORE REGISTERS
     97	000172	016701 	000000G			MOV	.PTM1,R1
     98	000176	077154 			40$:	SOB	R1,10$		; AND GO TRY NEXT LUN
     99
    100					; ALL LUN'S OF INTEREST ARE DEACCESSED
    101
    102	000200				50$:	CALL	..SPD3		; RESTORE MAPPING
    103	000204	022626 				CMP	(SP)+,(SP)+	; CLEAN THE STACK
    104	000206	016701 	000000G		60$:	MOV	.ATLAD,R1	; GET TASK'S ATL ONCE MORE
    105	000212	105361 	000000G			DECB	A.IN(R1)	; BUMP DOWN I/O PENDING COUNT
    106	000216	000167 	000000G			JMP	.START		; AND GET OUT
    107
    108						.DSABL	LSB
    109					;
    110					;
    111	000222					$END	PURGE
PURGE	D0210, CLOSE ALL FILES	MACRO M1108  05-DEC-77 17:15  PAGE 6-2


    112					;
    113					;
    114		000001 				.END
PURGE	D0210, CLOSE ALL FILES	MACRO M1108  05-DEC-77 17:15  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.EFN   000013   	M.LBSZ= 000007   	WI.BPS= 100000
AC.LCK= 000001   	F.NLCK  000037   	I.EXDT= 000046   	M.MAX = 000011   	WI.DLK= 010000
A.HA  = ****** GX	F.NWAC  000040   	I.EXTD  000030   	M.RTRV= 000012   	WI.EXT= 002000
A.IN  = ****** GX	F.RVN   000012   	I.FCN   000014   	M.USE = 000010   	WI.LCK= 004000
BITFNU= 000002   	F.SCHA  000021   	I.FIDP  000024   	QIOEFN= 000002   	WI.RDV= 000400
EX.AC1= 000001   	F.SIZE  000032   	I.FNAM= 000000   	R$$10F= 000001   	WI.WRV= 001000
EX.AC2= 000002   	F.STAT  000040   	I.FNBP  000036   	R$$11D= 000001   	W.CTL   000000
EX.ADF= 000010   	F.STD   000004   	I.FTYP= 000006   	SC.BAD= 000100   	W.FCB   000002
EX.ENA= 000200   	F.UCHA  000020   	I.FVER= 000010   	SC.MDL= 000200   	W.RTRV  000012
EX.FCO= 000004   	F11PR$= 000000   	I.IOSB  000016   	S.HDHD= 000056   	W.STD   000004
E$$MSG= 000001   	HIFCN = 000030   	I.LGTH  000040   	S.IDHD= 000056   	W.VBN   000006
E$$TRP= 000001   	H.CKSM= 000776   	I.LNK   000000   	S.MPHD= 000012   	W.WISZ  000007
FCPLUN= 000001   	H.FCHA= 000014   	I.LUN   000012   	S.STBK= 000012   	$$    = 000067
FC.CEF= 020000   	H.FLEV= 000006   	I.PRI   000010   	UC.CON= 000200   	.ATLAD= ****** GX
FC.DIR= 040000   	H.FNUM= 000002   	I.PRM   000024   	UC.DLK= 000100   	.DFEXT= 000005
FC.FCO= 010000   	H.FOWN= 000010   	I.RTRV  000034   	VC.BMW= 000002   	.DFPRO= 164000
FC.WAC= 100000   	H.FPRO= 000012   	I.RVDT= 000014   	VC.IFW= 000001   	.EXDSP= ****** GX
FP.DEL= 000010   	H.FSEQ= 000004   	I.RVNO= 000012   	V.FCB   000006   	.EXIT = ****** GX
FP.EXT= 000004   	H.IDOF= 000000   	I.RVTI= 000023   	V.FFNU  000055   	.IOPKT= ****** GX
FP.RAT= 000001   	H.LUT = ****** GX	I.RWAD= 000024   	V.FIEX  000025   	.LUTN2= ****** GX
FP.RDV= 000001   	H.MPOF= 000001   	I.RWAT  000026   	V.FMAX  000016   	.PRFIL= 000004
FP.WRV= 000002   	H.PROG= 000010   	I.RWCT= 000026   	V.FPRO  000030   	.PTM0 = ****** GX
F$$LVL= 000001   	H.PROJ= 000011   	I.RWVB= 000032   	V.FRBK  000034   	.PTM1 = ****** GX
F.DREF  000042   	H.SCHA= 000015   	I.STD   000004   	V.IBLB  000012   	.PURGD= ****** GX
F.DRNM  000044   	H.UCHA= 000014   	I.TISZ= 000006   	V.IBSZ  000013   	.PURGE  000000RG
F.FEXT  000002   	H.UFAT= 000016   	I.UIC   000022   	V.IFWI  000002   	.PURGX  000146RG
F.FNUM  000006   	IDXFNU= 000001   	LEV11M= 000401   	V.LABL  000040   	.RTPTF= 001401
F.FOWN  000014   	ID$$$ = 000210   	LOWFCN= 000011   	V.LGTH  000056   	.START= ****** GX
F.FPRO  000016   	IO.DAC= ****** GX	MFDFNO= 000004   	V.LRUC  000035   	.SYUIC= 000010
F.FSEQ  000010   	I.ACTL  000035   	MFDFSQ= 000004   	V.SBCL  000021   	.UCBAD= ****** GX
F.FSQN  000013   	I.AST   000020   	M$$HDR= 000001   	V.SBLB  000024   	.VBSIZ= 001000
F.FVBN  000046   	I.ATL   000006   	M.CTSZ= 000006   	V.SBSZ  000022   	..REDT= ****** GX
F.HDLB  000022   	I.CRDT= 000031   	M.EFNU= 000002   	V.STAT  000054   	..SPD3= ****** GX
F.LBN   000026   	I.CRTI= 000040   	M.EFSQ= 000004   	V.STD   000004   	...GBL= 000000
F.LGTH  000052   	I.DASZ= 000007   	M.ERVN= 000001   	V.TRCT  000000   	...TPC= 000012
F.LINK  000000   	I.DPB   000011   	M.ESQN= 000000   	V.WISZ  000020

. ABS.	000056	   000
      	000222	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2680 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:19
[40,10]PURGE,[40,20]PURGE/-SP=[40,30]RSXDC,F11PRE,PURGE
RSXDC	MACRO M1108  05-DEC-77 17:15  PAGE 3


      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.
RATCM	D0202, READ ATTRIBUTES 	MACRO M1108  05-DEC-77 17:15  PAGE 6


      1						.TITLE	RATCM	D0202, READ ATTRIBUTES COMMON CODE
						.IDENT	"D0202"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D202, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  10 SEP 74  18:02:24
     23					; PETER H. LIPMAN	1-MAR-74
     24					;
     25					; READ ATTRIBUTES-COMMON CODE
     26
     27					;
     28					;
     30	000000				RATCTL:	.BLKW	2		; SPACE TO HOLD ATTRIBUTE CONTROL PAIR
     31
     33					;+
     34					; **.RATCM-READ ATTRIBUTES COMMON CODE
     35					;
     36					; THIS ROUTINE SCANS AN ATTRIBUTE CONTROL BLOCK AND MOVES THE DESIRED
     37					; INFORMATION TO THE SPECIFIED USER BUFFERS. WHEN COMPLETE IT ZEROES
     38					; THE I/O PACKET SLOT AND RELEASES THE ATTRIBUTE CONTROL BLOCK.
     39					;
     40					; INPUTS:
     41					;
     42					; 	I.RWAT(R5)=ADDRESS OF ATTRIBUTE CONTROL BLOCK OR 0
     43					; 	.HDBUF CONTAINS THE HEADER FOR THE FILE
     44					; 	.FCBAD CONTAINS THE FCB ADDRESS (MUST NOT BE ZERO)
     45					; 	R5=I/O PACKET ADDRESS
     46					;
     47					; OUTPUTS:
     48					;
     49					; 	R0-R3 ALTERED, R4-R5 PRESERVED
     50					;-
     51
     52	000004				.RATCM::
     60	000004	016546 	000026 			MOV	I.RWAT(R5),-(SP) ; PUT ATTRIBUTE CONTROL BLOCK ADDR ON STACK
     61	000010	001472 				BEQ	100$		; GET OUT IF THERE IS NONE
     62
     63	000012	010600 			20$:	MOV	SP,R0		; POINT TO USER VIRTUAL ADDR
RATCM	D0202, READ ATTRIBUTES 	MACRO M1108  05-DEC-77 17:15  PAGE 6-1


     64	000014	012701 	000000'			MOV	#RATCTL,R1	; POINT TO INTERNAL BUFFER
     65	000020	010103 				MOV	R1,R3		; AND SAVE A COPY
     66	000022	012702 	000004 			MOV	#4,R2		; BYTE COUNT = 4
     67	000026					CALL	.BLXI		; TRANSFER IN NEXT ATTRIBUTE CONTROL PAIR
     69	000032	112301 				MOVB	(R3)+,R1	; R1=ATTRIBUTE CODE
     74	000034	001460 				BEQ	100$		; 0 ATTRIBUTE CODE MEANS END OF LIST
     76	000036	003061 				BGT	110$		; BRANCH IF WRITE REQUEST, ERROR
     77	000040	005401 				NEG	R1		; R1=POSITIVE ATTRIBUTE CODE
     78	000042	020127 	000000G			CMP	R1,#.ATMAX	; LEGAL ATTRIBUTE CODE?
     79	000046	101055 				BHI	110$		; BRANCH IF TOO BIG
     80	000050	005002 				CLR	R2
     81	000052	152302 				BISB	(R3)+,R2	; R2=DESIRED NO. OF BYTES
     82	000054	001002 				BNE	30$
     83	000056	012702 	001000 			MOV	#1000,R2
     84	000062				30$:	MUL	#3,R1		; R1=EXTRY OFFSET IF .ATCTL TABLE
     85	000072	062701 	177775G			ADD	#.ATCTL-3,R1	; R1=ADDRESS OF SIZE FIELD
     86	000076	005000 				CLR	R0		;
     87	000100	152100 				BISB	(R1)+,R0	; R0=MAXIMUM COUNT ALLOWED
     88	000102	001002 				BNE	40$		;
     89	000104	012700 	001000 			MOV	#1000,R0	; ZERO MEANS 1000
     90	000110	020200 			40$:	CMP	R2,R0		; DESIRED COUNT LEGAL?
     91	000112	101033 				BHI	110$		; BRANCH IF NO
     92	000114	112100 				MOVB	(R1)+,R0	; R0=OFFSET IN SPECIFIED SECTION
     93	000116	111101 				MOVB	(R1),R1		; R1=SECTION CODE
     94	000120	032701 	000000G			BIT	#AT.FCB,R1	; DATA IN FCB?
     95	000124	001013 				BNE	60$		; BRANCH IF YES
     96	000126	042701 	177774 			BIC	#177774,R1	;
     97	000132	001405 				BEQ	50$		; BRANCH IF SECTION 0, HEADER AREA
     98	000134	116101 	177777G			MOVB	.HDBUF-1(R1),R1	; SECTION 1=IDENT, 2=MAP AREA
     99	000140	042701 	177400 			BIC	#177400,R1	; R1=WORD OFFSET OF AREA
    100	000144	006301 				ASL	R1		; MAKE BYTE OFFSET
    101	000146	062701 	000000G		50$:	ADD	#.HDBUF,R1
    102	000152	000402 				BR	70$
    103	000154	016701 	000000G		60$:	MOV	.FCBAD,R1
    104	000160	060100 			70$:	ADD	R1,R0		; R0=ADDRESS OF DATA TO MOVE TO USER
    105	000162	010301 				MOV	R3,R1		; R1=ADR OF 2 WORD USER ADDRESS
    106	000164					CALL	.BLXO
    122	000170	062716 	000004 			ADD	#4,(SP)		; MOVE ADDRESS TO NEXT ATTRIBUTE PAIR
    123	000174	000706 				BR	20$		; AND TRY AGAIN
    124
    125	000176	005726 			100$:	TST	(SP)+		; CLEAN THE STACK
    126	000200					RETURN
    128					;
    129					; ILLEGAL ATTRIBUTE CODE OR TOO MANY BYTES TO MOVE
    130					;
    131	000202				110$:	ERRX	IE.WAT,<ILLEGAL READ/WRITE ATTRIBUTE CONTROL BLOCK>
	000202	   000C	   211 			TRAP	-IE.WAT		; ILLEGAL READ/WRITE ATTRIBUTE CONTROL BLOCK
    132					;
    133					;
    134	000204					$END	RATCM
    135					;
    136					;
    137		000001 				.END
RATCM	D0202, READ ATTRIBUTES 	MACRO M1108  05-DEC-77 17:15  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.EFN   000013   	M.ERVN= 000001   	V.SBSZ  000022
AC.LCK= 000001   	F.NLCK  000037   	I.EXDT= 000046   	M.ESQN= 000000   	V.STAT  000054
AT.FCB= ****** GX	F.NWAC  000040   	I.EXTD  000030   	M.LBSZ= 000007   	V.STD   000004
BITFNU= 000002   	F.RVN   000012   	I.FCN   000014   	M.MAX = 000011   	V.TRCT  000000
EX.AC1= 000001   	F.SCHA  000021   	I.FIDP  000024   	M.RTRV= 000012   	V.WISZ  000020
EX.AC2= 000002   	F.SIZE  000032   	I.FNAM= 000000   	M.USE = 000010   	WI.BPS= 100000
EX.ADF= 000010   	F.STAT  000040   	I.FNBP  000036   	QIOEFN= 000002   	WI.DLK= 010000
EX.ENA= 000200   	F.STD   000004   	I.FTYP= 000006   	RATCTL  000000R  	WI.EXT= 002000
EX.FCO= 000004   	F.UCHA  000020   	I.FVER= 000010   	R$$10F= 000001   	WI.LCK= 004000
E$$MSG= 000001   	F11PR$= 000000   	I.IOSB  000016   	R$$11D= 000001   	WI.RDV= 000400
E$$TRP= 000001   	HIFCN = 000030   	I.LGTH  000040   	SC.BAD= 000100   	WI.WRV= 001000
FCPLUN= 000001   	H.CKSM= 000776   	I.LNK   000000   	SC.MDL= 000200   	W.CTL   000000
FC.CEF= 020000   	H.FCHA= 000014   	I.LUN   000012   	S.HDHD= 000056   	W.FCB   000002
FC.DIR= 040000   	H.FLEV= 000006   	I.PRI   000010   	S.IDHD= 000056   	W.RTRV  000012
FC.FCO= 010000   	H.FNUM= 000002   	I.PRM   000024   	S.MPHD= 000012   	W.STD   000004
FC.WAC= 100000   	H.FOWN= 000010   	I.RTRV  000034   	S.STBK= 000012   	W.VBN   000006
FP.DEL= 000010   	H.FPRO= 000012   	I.RVDT= 000014   	UC.CON= 000200   	W.WISZ  000007
FP.EXT= 000004   	H.FSEQ= 000004   	I.RVNO= 000012   	UC.DLK= 000100   	$MUL  = ****** GX
FP.RAT= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	VC.BMW= 000002   	$$    = 000067
FP.RDV= 000001   	H.MPOF= 000001   	I.RWAD= 000024   	VC.IFW= 000001   	.ATCTL= ****** GX
FP.WRV= 000002   	H.PROG= 000010   	I.RWAT  000026   	V.FCB   000006   	.ATMAX= ****** GX
F$$LVL= 000001   	H.PROJ= 000011   	I.RWCT= 000026   	V.FFNU  000055   	.BLXI = ****** GX
F.DREF  000042   	H.SCHA= 000015   	I.RWVB= 000032   	V.FIEX  000025   	.BLXO = ****** GX
F.DRNM  000044   	H.UCHA= 000014   	I.STD   000004   	V.FMAX  000016   	.DFEXT= 000005
F.FEXT  000002   	H.UFAT= 000016   	I.TISZ= 000006   	V.FPRO  000030   	.DFPRO= 164000
F.FNUM  000006   	IDXFNU= 000001   	I.UIC   000022   	V.FRBK  000034   	.FCBAD= ****** GX
F.FOWN  000014   	ID$$$ = 000202   	LEV11M= 000401   	V.IBLB  000012   	.HDBUF= ****** GX
F.FPRO  000016   	IE.WAT= ****** GX	LOWFCN= 000011   	V.IBSZ  000013   	.PRFIL= 000004
F.FSEQ  000010   	I.ACTL  000035   	MFDFNO= 000004   	V.IFWI  000002   	.RATCM  000004RG
F.FSQN  000013   	I.AST   000020   	MFDFSQ= 000004   	V.LABL  000040   	.RTPTF= 001401
F.FVBN  000046   	I.ATL   000006   	M$$HDR= 000001   	V.LGTH  000056   	.SYUIC= 000010
F.HDLB  000022   	I.CRDT= 000031   	M.CTSZ= 000006   	V.LRUC  000035   	.VBSIZ= 001000
F.LBN   000026   	I.CRTI= 000040   	M.EFNU= 000002   	V.SBCL  000021   	...GBL= 000000
F.LGTH  000052   	I.DASZ= 000007   	M.EFSQ= 000004   	V.SBLB  000024   	...TPC= 000012
F.LINK  000000   	I.DPB   000011

. ABS.	000056	   000
      	000204	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2580 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:19
[40,10]RATCM,[40,20]RATCM/-SP=[40,30]RSXDC,F11PRE,RATCM
RSXDC	MACRO M1108  05-DEC-77 17:15  PAGE 3


      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.
RDATT	D0203, READ ATTRIBUTES 	MACRO M1108  05-DEC-77 17:15  PAGE 6


      1						.TITLE	RDATT	D0203, READ ATTRIBUTES QI/O
						.IDENT	"D0203"
      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					;
					; VERSION D203, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  5 NOV 74  0:30
     23					; PETER H. LIPMAN	10-MAR-74
     24					;
     25					; READ ATTRIBUTES QI/O
     26					;
     27					;+
     28					;
     29					; **-.RDATT-READ ATTRIBUTES QI/O
     30					;
     31					; THIS ROUTINE IMPLEMENTS THE READ, ATTRIBUTES QI/O. THE QIO DPB
     32					; PARAMETER REQUIREMENTS ARE AS FOLLOWS:
     33					; 	FILE ID ADDRESS-OPTIONAL IF ACCESSED, REQUIRED IF NOT
     34					; 	READ/WRITE ATTRIBUTE LIST ADDRESS-REQUIRED
     35					; 	EXTEND PARAMETERS (2 WORDS) -0
     36					; 	ACCESS CONTROL WORD -0
     37					; 	FILE NAME BLOCK ADDRESS -0
     38					;
     39					; THE ROUTINE READS IN THE FILE HEADER AND ESTABLISHES A FILE CONTROL
     40					; BLOCK IF NONE ALREADY EXISTS. THEN IT PROCESSES THE ATTRIBUTE LIST AND
     41					; RELEASES THE FILE CONTROL BLOCK IF IT WAS CREATED.
     42					;
     43					; INPUTS:
     44					;
     45					; 	R4=VOLUME CONTROL BLOCK ADDRESS
     46					; 	R5=I/O PACKET ADDRESS
     47					;
     48					; OUTPUTS:
     49					;
     50					; 	R0-R3 ALTERED, R4-R5 PRESERVED
     51					;
     52					;-
     53
     54	000000				.RDATT::
RDATT	D0203, READ ATTRIBUTES 	MACRO M1108  05-DEC-77 17:15  PAGE 6-1


     55	000000	012700 	000001 			MOV	#FP.RAT,R0
     56	000004					CALL	.RWATT		; INITIALIZE READ ATTRIBUTES
     57	000010	005767 	000000G			TST	.FCBAD		; AN FCB IS REQUIRED
     58	000014	001044 				BNE	30$		; BRANCH IF ONE IS PRESENT
     59	000016					CALL	.CRFCB		; OTHERWISE, CREATE ONE
     60	000022	010067 	000000G			MOV	R0,.FCBAD	; SET FCB ADDRESS
     61	000026	105267 	000000G			INCB	.EXSTS		; INDICATE THAT CLEANUP MUST RELEASE IT
     63	000032	016046 	000034 			MOV	F.SIZE+2(R0),-(SP) ; SAVE THE FILE SIZE OF FIRST HEADER
     64	000036	016046 	000032 			MOV	F.SIZE(R0),-(SP)
     65	000042				10$:	CALL	.NXHDR		; READ NEXT HEADER IF PRESENT
     66	000046	103413 				BCS	20$		; BRANCH IF NO MORE
     67	000050	016700 	000000G			MOV	.FCBAD,R0
     68	000054					CALL	.INFCB		; SET UP FCB FOR IT
     69	000060	066016 	000032 			ADD	F.SIZE(R0),(SP)	; ACCUMULATE FILE SIZE
     70	000064	066066 	000034 	000002 		ADD	F.SIZE+2(R0),2(SP)
     71	000072	005516 				ADC	(SP)
     72	000074	000762 				BR	10$
     73	000076	016700 	000000G		20$:	MOV	.FILNO,R0	; GET FILE NUMBER
     74	000102					CALL	.RHDFN		; READ PRIMARY HEADER AGAIN
     75	000106	016700 	000000G			MOV	.FCBAD,R0
     76	000112					CALL	.INFCB		; INIT THE FCB ONCE MORE
     77	000116	012660 	000032 			MOV	(SP)+,F.SIZE(R0) ; PUT TOTAL FILE SIZE IN FCB
     78	000122	012660 	000034 			MOV	(SP)+,F.SIZE+2(R0)
     79
     81	000126				30$:	CALL	.RATCM		; PROCESS THE ATTRIBUTE LIST
     82	000132	105767 	000000G			TSTB	.EXSTS		; MUST WE RELEASE THE FCB
     83	000136	001406 				BEQ	40$		; BRANCH IF NO
     84	000140	016700 	000000G			MOV	.FCBAD,R0	; YES
     85	000144	012701 	000052 			MOV	#F.LGTH,R1	;
     86	000150					CALL	.RLEAS		; RELEASE THE FCB
     87	000154				40$:	RETURN
     88					;
     89					;
     90	000156					$END	RDATT
     91					;
     92					;
     93		000001 				.END
RDATT	D0203, READ ATTRIBUTES 	MACRO M1108  05-DEC-77 17:15  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NLCK  000037   	I.EXTD  000030   	M.LBSZ= 000007   	V.TRCT  000000
AC.LCK= 000001   	F.NWAC  000040   	I.FCN   000014   	M.MAX = 000011   	V.WISZ  000020
BITFNU= 000002   	F.RVN   000012   	I.FIDP  000024   	M.RTRV= 000012   	WI.BPS= 100000
EX.AC1= 000001   	F.SCHA  000021   	I.FNAM= 000000   	M.USE = 000010   	WI.DLK= 010000
EX.AC2= 000002   	F.SIZE  000032   	I.FNBP  000036   	QIOEFN= 000002   	WI.EXT= 002000
EX.ADF= 000010   	F.STAT  000040   	I.FTYP= 000006   	R$$10F= 000001   	WI.LCK= 004000
EX.ENA= 000200   	F.STD   000004   	I.FVER= 000010   	R$$11D= 000001   	WI.RDV= 000400
EX.FCO= 000004   	F.UCHA  000020   	I.IOSB  000016   	SC.BAD= 000100   	WI.WRV= 001000
E$$MSG= 000001   	F11PR$= 000000   	I.LGTH  000040   	SC.MDL= 000200   	W.CTL   000000
E$$TRP= 000001   	HIFCN = 000030   	I.LNK   000000   	S.HDHD= 000056   	W.FCB   000002
FCPLUN= 000001   	H.CKSM= 000776   	I.LUN   000012   	S.IDHD= 000056   	W.RTRV  000012
FC.CEF= 020000   	H.FCHA= 000014   	I.PRI   000010   	S.MPHD= 000012   	W.STD   000004
FC.DIR= 040000   	H.FLEV= 000006   	I.PRM   000024   	S.STBK= 000012   	W.VBN   000006
FC.FCO= 010000   	H.FNUM= 000002   	I.RTRV  000034   	UC.CON= 000200   	W.WISZ  000007
FC.WAC= 100000   	H.FOWN= 000010   	I.RVDT= 000014   	UC.DLK= 000100   	$$    = 000067
FP.DEL= 000010   	H.FPRO= 000012   	I.RVNO= 000012   	VC.BMW= 000002   	.CRFCB= ****** GX
FP.EXT= 000004   	H.FSEQ= 000004   	I.RVTI= 000023   	VC.IFW= 000001   	.DFEXT= 000005
FP.RAT= 000001   	H.IDOF= 000000   	I.RWAD= 000024   	V.FCB   000006   	.DFPRO= 164000
FP.RDV= 000001   	H.MPOF= 000001   	I.RWAT  000026   	V.FFNU  000055   	.EXSTS= ****** GX
FP.WRV= 000002   	H.PROG= 000010   	I.RWCT= 000026   	V.FIEX  000025   	.FCBAD= ****** GX
F$$LVL= 000001   	H.PROJ= 000011   	I.RWVB= 000032   	V.FMAX  000016   	.FILNO= ****** GX
F.DREF  000042   	H.SCHA= 000015   	I.STD   000004   	V.FPRO  000030   	.INFCB= ****** GX
F.DRNM  000044   	H.UCHA= 000014   	I.TISZ= 000006   	V.FRBK  000034   	.NXHDR= ****** GX
F.FEXT  000002   	H.UFAT= 000016   	I.UIC   000022   	V.IBLB  000012   	.PRFIL= 000004
F.FNUM  000006   	IDXFNU= 000001   	LEV11M= 000401   	V.IBSZ  000013   	.RATCM= ****** GX
F.FOWN  000014   	ID$$$ = 000203   	LOWFCN= 000011   	V.IFWI  000002   	.RDATT  000000RG
F.FPRO  000016   	I.ACTL  000035   	MFDFNO= 000004   	V.LABL  000040   	.RHDFN= ****** GX
F.FSEQ  000010   	I.AST   000020   	MFDFSQ= 000004   	V.LGTH  000056   	.RLEAS= ****** GX
F.FSQN  000013   	I.ATL   000006   	M$$HDR= 000001   	V.LRUC  000035   	.RTPTF= 001401
F.FVBN  000046   	I.CRDT= 000031   	M.CTSZ= 000006   	V.SBCL  000021   	.RWATT= ****** GX
F.HDLB  000022   	I.CRTI= 000040   	M.EFNU= 000002   	V.SBLB  000024   	.SYUIC= 000010
F.LBN   000026   	I.DASZ= 000007   	M.EFSQ= 000004   	V.SBSZ  000022   	.VBSIZ= 001000
F.LGTH  000052   	I.DPB   000011   	M.ERVN= 000001   	V.STAT  000054   	...GBL= 000000
F.LINK  000000   	I.EFN   000013   	M.ESQN= 000000   	V.STD   000004   	...TPC= 000012
F.NACS  000036   	I.EXDT= 000046

. ABS.	000056	   000
      	000156	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2552 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:19
[40,10]RDATT,[40,20]RDATT/-SP=[40,30]RSXDC,F11PRE,RDATT
RSXDC	MACRO M1108  05-DEC-77 17:16  PAGE 3


      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.
RDHDR	D0205, READ FILE HEADER	MACRO M1108  05-DEC-77 17:16  PAGE 6


      1						.TITLE	RDHDR	D0205, READ FILE HEADER
						.IDENT	"D0205"
      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					;
					; VERSION D205, ASSEMBLED FOR RSX-11D
					;
     20
     21					; ANDREW C. GOLDSTEIN  25 FEB 75  20:16
     22					; PETER H. LIPMAN	7-MAR-74
     23					;
     24					; READ A FILE HEADER
     25
     26					;+
     27					;
     28					; **-.RDFHD-READ FILE HEADER AND CHECK SEQUENCE NUMBER
     29					;
     30					; THIS ROUTINE READS THE FILE HEADER USING THE FILE CONTROL BLOCK IF IT EXISTS
     31					; OR THE FILE NUMBER IF IT DOESN'T AND THEN VERIFIES THE FILE SEQUENCE NUMBER
     32					;
     33					; INPUTS:
     34					;
     35					; 	.FCBAD CONTAINS 0 OR A FILE CONTROL BLOCK ADDRESS
     36					; 	.FILNO, .FILSQ MUST BE SET
     37					;
     38					; OUTPUTS:
     39					;
     40					; 	R0-R3 ALTERED R4-R5 PRESERVED
     41					; 	RETURNS IN LINE IF AND ONLY IF HEADER IS SUCCESSFULLY
     42					; 	READ AND THE FILE SEQUENCE NUMBER MATCHES
     43					;
     44					;-
     45
     46	000000				.RDFHD::
     47	000000	012701 	000040'			MOV	#.RDHDR,R1	; CALL .RDHDR IF FCB EXISTS
     48	000004	016700 	000000G			MOV	.FCBAD,R0	; WITH R0=FCB ADDRESS
     49	000010	001004 				BNE	10$		; BRANCH IF IT DOES EXIST
     50	000012	012701 	000056'			MOV	#.RHDFN,R1	; OTHERWISE CALL .RHDFN
     51	000016	016700 	000000G			MOV	.FILNO,R0	; WITH R0=FILE NUMBER
     52	000022				10$:	CALL	(R1)
     53	000024	026767 	000000G	000004G		CMP	.FILSQ,.HDBUF+H.FSEQ
     54	000032	001001 				BNE	20$
RDHDR	D0205, READ FILE HEADER	MACRO M1108  05-DEC-77 17:16  PAGE 6-1


     55	000034					RETURN
     56	000036				20$:	ERRX	IE.SQC,<FILE SEQUENCE NUMBER CHECK>
	000036	   000C	   211 			TRAP	-IE.SQC		; FILE SEQUENCE NUMBER CHECK
RDHDR	D0205, READ FILE HEADER	MACRO M1108  05-DEC-77 17:16  PAGE 7


     58					;+
     59					;
     60					; **-.RDHDR-READ FILE HEADER
     61					;
     62					; THIS ROUTINE READS THE FILE HEADER SPECIFIED BY
     63					; THE INPUT FILE CONTROL BLOCK. THE HEADER
     64					; IS READ INTO THE HEADER BUFFER AND THE HEADER
     65					; BUFFER CONTROL WORDS ARE SET TO INDICATE THE
     66					; LBN AND UCB OF THE HEADER. IF THE HEADER
     67					; CANNOT BE READ SUCCESSFULLY OR IF THE CHECKSUM
     68					; IS NOT CORRECT, THEN THIS ROUTINE INVOKES ERRX.
     69					;
     70					; INPUTS:
     71					;
     72					; 	R0=ADDRESS OF FILE CONTROL BLOCK
     73					; 	R4=VOLUME CONTROL BLOCK
     74					; 	R5=I/O PACKET ADDRESS
     75					;
     76					; OUTPUTS:
     77					;
     78					; 	R0-R3 ALTERED
     79					; 	R4-R5 PRESERVED
     80					; 	RETURNS IN LINE IF AND ONLY IF SUCCESSFUL
     81					;
     82					;-
     83
     84						.ENABL	LSB
     85
     86	000040				.RDHDR::
     87	000040	016002 	000022 			MOV	F.HDLB(R0),R2
     88	000044	016003 	000024 			MOV	F.HDLB+2(R0),R3
     89	000050	016000 	000006 			MOV	F.FNUM(R0),R0
     90	000054	000403 				BR	10$
RDHDR	D0205, READ FILE HEADER	MACRO M1108  05-DEC-77 17:16  PAGE 8


     92					;+
     93					; **-.RHDFN-READ FILE HEADER BY FILE NUMBER
     94					;
     95					; THIS ROUTINE READS THE FILE HEADER SPECIFIED BY
     96					; THE INPUT FILE NUMBER. THE HEADER IS READ INTO
     97					; THE HEADER BUFFER AND THE HEADER BUFFER CONTROL
     98					; WORDS ARE SET TO INDICATE THE LBN AND UCB
     99					; OF THE HEADER. THIS ROUTINE RETURNS IN LINE
    100					; IF SUCCESSFUL. IF THERE IS ANY ERROR
    101					; CONDITION THEN THE ROUTINE EXITS THROUGH ERRX.
    102					;
    103					; INPUTS:
    104					;
    105					; 	R0=FILE NUMBER
    106					; 	R4=VOLUME CONTROL BLOCK ADDRESS
    107					; 	R5=I/O PACKET ADDRESS
    108					;
    109					; OUTPUTS:
    110					;
    111					; 	R0-R3 ALTERED
    112					; 	R4-R5 PRESERVED
    113					; 	RETURNS IN LINE IF AND ONLY IF SUCCESSFUL
    114					;
    115					;-
    116
    117	000056				.RHDFN::
    118	000056					CALL	.MPHDR
    119	000062	103432 				BCS	40$		; BRANCH IF DESIRED FILE DOES NOT EXIST
    120
    121					;+
    122					;
    123					; **.RHDLB - READ FILE HEADER BY LBN
    124					;
    125					; ALL THE ABOVE ENTRIES FALL THROUGH TO HERE
    126					;
    127					; R0=FILE NUMBER
    128					; R2,R3=LBN
    129					;
    130					; OUTPUTS:
    131					;
    132					;	R0-R3 ALTERED
    133					;	R4-R5 PRESERVED
    134					;
    135					;-
    136
    137					; SEE IF THIS HEADER IS IN CORE
    138					;
    139	000064				.RHDLB::
    140	000064	012701 	000000G		10$:	MOV	#.HDUCB,R1
    141	000070	026721 	000000G			CMP	.UCBAD,(R1)+
    142	000074	001010 				BNE	20$
    143	000076	020221 				CMP	R2,(R1)+
    144	000100	001006 				BNE	20$
    145	000102	020321 				CMP	R3,(R1)+
    146	000104	001004 				BNE	20$		; NO - READ IT
    147	000106	132764 	000001 	000054 		BITB	#VC.IFW,V.STAT(R4) ; SEE IF THE INDEX FILE IS WRITE ACCESSED
    148	000114	001412 				BEQ	30$		; IF NOT, CAN USE HEADER IN CORE
RDHDR	D0205, READ FILE HEADER	MACRO M1108  05-DEC-77 17:16  PAGE 8-1


    149					;
    150					; R0=FILE NUMBER
    151					; R2,R3 = DESIRED LBN
    152					;
    153	000116	012701 	000000G		20$:	MOV	#.HDUCB,R1
    154	000122	016721 	000000G			MOV	.UCBAD,(R1)+	; SET HEADER UCB ADDRESS
    155	000126	010221 				MOV	R2,(R1)+	; AND LBN
    156	000130	010321 				MOV	R3,(R1)+
    157					;
    158					; R1 IS NOW THE ADDRESS OF THE HEADER BUFFER
    159					;
    160	000132	010046 				MOV	R0,-(SP)
    161	000134					CALL	.RD1LB		; READ ONE LOGICAL BLOCK, PRESERVES R1
    162	000140	012600 				MOV	(SP)+,R0	; RESTORE FILE NUMBER
    163					;
    164					; HEADER IS NOW IN HEADER BUFFER - VERIFY IT
    165					; R0=FILE NUMBER
    166					;
    167	000142	016102 	000002 		30$:	MOV	H.FNUM(R1),R2	; R2=FILE NUMBER FROM HEADER
    168	000146	001001 				BNE	50$		; BRANCH IF FILE HEADER IS NOT DELETED
    169	000150				40$:	ERRX	IE.NSF,<THIS FILE DOES NOT EXIST>
	000150	   000C	   211 			TRAP	-IE.NSF		; THIS FILE DOES NOT EXIST
    170	000152	026100 	000002 		50$:	CMP	H.FNUM(R1),R0
    171	000156	001017 				BNE	70$
    172					;
    173					; INDIVIDUAL CALLER MUST CHECK FILE SEQUENCE NUMBER IF DESIRED
    174					; VERIFY HEADER CHECKSUM
    175					;
    176	000160					CALL	.CKSUM
    177	000164	103416 				BCS	80$
    178	000166					CALL	.GTMAP		; POINT TO MAP AREA
    180	000172	105761 	000001 			TSTB	M.ERVN(R1)	; CHECK FOR ZERO EXTENSION RVN
    181	000176	001005 				BNE	60$		; NO MULTI-VOLUME SUPPORT
    182	000200	022761 	001401 	000006 		CMP	#.RTPTF,M.CTSZ(R1) ; REQUIRE 1,3 RETRIEVAL POINTER FORMAT
    195	000206	001001 				BNE	60$
    196	000210					RETURN
    197
    198	000212				60$:	ERR	IE.BHD,<BAD FILE HEADER>
	000212	   000G	   211 			TRAP	IE.BHD		; BAD FILE HEADER
    199	000214	000403 				BR	90$
    200
    201	000216				70$:	ERR	IE.SNC		; FILE NUMBER CHECK
	000216	   000G	   211 			TRAP	IE.SNC		;
    202	000220	000401 				BR	90$
    203
    204	000222				80$:	ERR	IE.CKS		; CHECKSUM ERROR
	000222	   000G	   211 			TRAP	IE.CKS		;
    205	000224	005067 	000000G		90$:	CLR	.HDUCB		; INVALIDATE HEADER UCB ADDRESS
    206	000230					ERRP	E.BDHD		; PRINT BAD HEADER MESSAGE
	000230	   000G	   210 			EMT	E.BDHD		;
    207	000232					ERRX			; ERROR EXIT
	000232	104400 				TRAP	0		;
    208
    209						.DSABL	LSB
    210					;
    211					;
    212	000234					$END	RDHDR
RDHDR	D0205, READ FILE HEADER	MACRO M1108  05-DEC-77 17:16  PAGE 8-2


    213					;
    214					;
    215		000001 				.END
RDHDR	D0205, READ FILE HEADER	MACRO M1108  05-DEC-77 17:16  PAGE 8-3
SYMBOL TABLE

AC.DLK= 000002   	F.NWAC  000040   	I.DPB   000011   	M.ESQN= 000000   	V.WISZ  000020
AC.LCK= 000001   	F.RVN   000012   	I.EFN   000013   	M.LBSZ= 000007   	WI.BPS= 100000
BITFNU= 000002   	F.SCHA  000021   	I.EXDT= 000046   	M.MAX = 000011   	WI.DLK= 010000
EX.AC1= 000001   	F.SIZE  000032   	I.EXTD  000030   	M.RTRV= 000012   	WI.EXT= 002000
EX.AC2= 000002   	F.STAT  000040   	I.FCN   000014   	M.USE = 000010   	WI.LCK= 004000
EX.ADF= 000010   	F.STD   000004   	I.FIDP  000024   	QIOEFN= 000002   	WI.RDV= 000400
EX.ENA= 000200   	F.UCHA  000020   	I.FNAM= 000000   	R$$10F= 000001   	WI.WRV= 001000
EX.FCO= 000004   	F11PR$= 000000   	I.FNBP  000036   	R$$11D= 000001   	W.CTL   000000
E$$MSG= 000001   	HIFCN = 000030   	I.FTYP= 000006   	SC.BAD= 000100   	W.FCB   000002
E$$TRP= 000001   	H.CKSM= 000776   	I.FVER= 000010   	SC.MDL= 000200   	W.RTRV  000012
E.BDHD= ****** GX	H.FCHA= 000014   	I.IOSB  000016   	S.HDHD= 000056   	W.STD   000004
FCPLUN= 000001   	H.FLEV= 000006   	I.LGTH  000040   	S.IDHD= 000056   	W.VBN   000006
FC.CEF= 020000   	H.FNUM= 000002   	I.LNK   000000   	S.MPHD= 000012   	W.WISZ  000007
FC.DIR= 040000   	H.FOWN= 000010   	I.LUN   000012   	S.STBK= 000012   	$$    = 000067
FC.FCO= 010000   	H.FPRO= 000012   	I.PRI   000010   	UC.CON= 000200   	.CKSUM= ****** GX
FC.WAC= 100000   	H.FSEQ= 000004   	I.PRM   000024   	UC.DLK= 000100   	.DFEXT= 000005
FP.DEL= 000010   	H.IDOF= 000000   	I.RTRV  000034   	VC.BMW= 000002   	.DFPRO= 164000
FP.EXT= 000004   	H.MPOF= 000001   	I.RVDT= 000014   	VC.IFW= 000001   	.FCBAD= ****** GX
FP.RAT= 000001   	H.PROG= 000010   	I.RVNO= 000012   	V.FCB   000006   	.FILNO= ****** GX
FP.RDV= 000001   	H.PROJ= 000011   	I.RVTI= 000023   	V.FFNU  000055   	.FILSQ= ****** GX
FP.WRV= 000002   	H.SCHA= 000015   	I.RWAD= 000024   	V.FIEX  000025   	.GTMAP= ****** GX
F$$LVL= 000001   	H.UCHA= 000014   	I.RWAT  000026   	V.FMAX  000016   	.HDBUF= ****** GX
F.DREF  000042   	H.UFAT= 000016   	I.RWCT= 000026   	V.FPRO  000030   	.HDUCB= ****** GX
F.DRNM  000044   	IDXFNU= 000001   	I.RWVB= 000032   	V.FRBK  000034   	.MPHDR= ****** GX
F.FEXT  000002   	ID$$$ = 000205   	I.STD   000004   	V.IBLB  000012   	.PRFIL= 000004
F.FNUM  000006   	IE.BHD= ****** GX	I.TISZ= 000006   	V.IBSZ  000013   	.RDFHD  000000RG
F.FOWN  000014   	IE.CKS= ****** GX	I.UIC   000022   	V.IFWI  000002   	.RDHDR  000040RG
F.FPRO  000016   	IE.NSF= ****** GX	LEV11M= 000401   	V.LABL  000040   	.RD1LB= ****** GX
F.FSEQ  000010   	IE.SNC= ****** GX	LOWFCN= 000011   	V.LGTH  000056   	.RHDFN  000056RG
F.FSQN  000013   	IE.SQC= ****** GX	MFDFNO= 000004   	V.LRUC  000035   	.RHDLB  000064RG
F.FVBN  000046   	I.ACTL  000035   	MFDFSQ= 000004   	V.SBCL  000021   	.RTPTF= 001401
F.HDLB  000022   	I.AST   000020   	M$$HDR= 000001   	V.SBLB  000024   	.SYUIC= 000010
F.LBN   000026   	I.ATL   000006   	M.CTSZ= 000006   	V.SBSZ  000022   	.UCBAD= ****** GX
F.LGTH  000052   	I.CRDT= 000031   	M.EFNU= 000002   	V.STAT  000054   	.VBSIZ= 001000
F.LINK  000000   	I.CRTI= 000040   	M.EFSQ= 000004   	V.STD   000004   	...GBL= 000000
F.NACS  000036   	I.DASZ= 000007   	M.ERVN= 000001   	V.TRCT  000000   	...TPC= 000012
F.NLCK  000037

. ABS.	000056	   000
      	000234	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2640 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:21
[40,10]RDHDR,[40,20]RDHDR/-SP=[40,30]RSXDC,F11PRE,RDHDR
RSXDC	MACRO M1108  05-DEC-77 17:16  PAGE 3


      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.
RLEAS	D0200, RELEASE A CORE B	MACRO M1108  05-DEC-77 17:16  PAGE 6


      1						.TITLE	RLEAS	D0200, RELEASE A CORE BLOCK
						.IDENT	"D0200"
      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					;
					; VERSION D200, ASSEMBLED FOR RSX-11D
					;
     22
     23					; ANDREW C. GOLDSTEIN  14 AUG 1974
     24					; PETER H. LIPMAN	22-JAN-74
     25					;
     26					; RELEASE A CORE BLOCK
     27					;
     28					;+
     29					; **.RLEAS-RELEASE A SPECIFIED BLOCK OF CORE TO THE SYSTEM
     30					;
     31					; THIS ROUTINE SWITCHES TO THE SYSTEM STACK AND RELEASES THE SPECIFIED
     32					; CORE BLOCK. THERE ARE NO ERROR CONDITIONS.
     33					;
     34					; INPUTS:
     35					;
     36					; 	R0=ADDRESS OF CORE BLOCK
     37					; 	R1=SIZE (IN BYTES) OF CORE BLOCK
     38					;
     39					; OUTPUTS:
     40					;
     41					; 	ALL REGISTERS PRESERVED
     42					; 	ALWAYS RETURNS IN LINE
     43					;-
     44
     46	000000				.RLEAS::
     47	000000					CALL	..DECB
     48	000004					RETURN
     69					;
     70					;
     71	000006					$END	RLEAS
     72					;
     73					;
     74		000001 				.END
RLEAS	D0200, RELEASE A CORE B	MACRO M1108  05-DEC-77 17:16  PAGE 6-1
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.DASZ= 000007   	M.CTSZ= 000006   	V.LGTH  000056
AC.LCK= 000001   	F.NACS  000036   	I.DPB   000011   	M.EFNU= 000002   	V.LRUC  000035
BITFNU= 000002   	F.NLCK  000037   	I.EFN   000013   	M.EFSQ= 000004   	V.SBCL  000021
EX.AC1= 000001   	F.NWAC  000040   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBLB  000024
EX.AC2= 000002   	F.RVN   000012   	I.EXTD  000030   	M.ESQN= 000000   	V.SBSZ  000022
EX.ADF= 000010   	F.SCHA  000021   	I.FCN   000014   	M.LBSZ= 000007   	V.STAT  000054
EX.ENA= 000200   	F.SIZE  000032   	I.FIDP  000024   	M.MAX = 000011   	V.STD   000004
EX.FCO= 000004   	F.STAT  000040   	I.FNAM= 000000   	M.RTRV= 000012   	V.TRCT  000000
E$$MSG= 000001   	F.STD   000004   	I.FNBP  000036   	M.USE = 000010   	V.WISZ  000020
E$$TRP= 000001   	F.UCHA  000020   	I.FTYP= 000006   	QIOEFN= 000002   	WI.BPS= 100000
FCPLUN= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$10F= 000001   	WI.DLK= 010000
FC.CEF= 020000   	HIFCN = 000030   	I.IOSB  000016   	R$$11D= 000001   	WI.EXT= 002000
FC.DIR= 040000   	H.CKSM= 000776   	I.LGTH  000040   	SC.BAD= 000100   	WI.LCK= 004000
FC.FCO= 010000   	H.FCHA= 000014   	I.LNK   000000   	SC.MDL= 000200   	WI.RDV= 000400
FC.WAC= 100000   	H.FLEV= 000006   	I.LUN   000012   	S.HDHD= 000056   	WI.WRV= 001000
FP.DEL= 000010   	H.FNUM= 000002   	I.PRI   000010   	S.IDHD= 000056   	W.CTL   000000
FP.EXT= 000004   	H.FOWN= 000010   	I.PRM   000024   	S.MPHD= 000012   	W.FCB   000002
FP.RAT= 000001   	H.FPRO= 000012   	I.RTRV  000034   	S.STBK= 000012   	W.RTRV  000012
FP.RDV= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	UC.CON= 000200   	W.STD   000004
FP.WRV= 000002   	H.IDOF= 000000   	I.RVNO= 000012   	UC.DLK= 000100   	W.VBN   000006
F$$LVL= 000001   	H.MPOF= 000001   	I.RVTI= 000023   	VC.BMW= 000002   	W.WISZ  000007
F.DREF  000042   	H.PROG= 000010   	I.RWAD= 000024   	VC.IFW= 000001   	$$    = 000067
F.DRNM  000044   	H.PROJ= 000011   	I.RWAT  000026   	V.FCB   000006   	.DFEXT= 000005
F.FEXT  000002   	H.SCHA= 000015   	I.RWCT= 000026   	V.FFNU  000055   	.DFPRO= 164000
F.FNUM  000006   	H.UCHA= 000014   	I.RWVB= 000032   	V.FIEX  000025   	.PRFIL= 000004
F.FOWN  000014   	H.UFAT= 000016   	I.STD   000004   	V.FMAX  000016   	.RLEAS  000000RG
F.FPRO  000016   	IDXFNU= 000001   	I.TISZ= 000006   	V.FPRO  000030   	.RTPTF= 001401
F.FSEQ  000010   	ID$$$ = 000200   	I.UIC   000022   	V.FRBK  000034   	.SYUIC= 000010
F.FSQN  000013   	I.ACTL  000035   	LEV11M= 000401   	V.IBLB  000012   	.VBSIZ= 001000
F.FVBN  000046   	I.AST   000020   	LOWFCN= 000011   	V.IBSZ  000013   	..DECB= ****** GX
F.HDLB  000022   	I.ATL   000006   	MFDFNO= 000004   	V.IFWI  000002   	...GBL= 000000
F.LBN   000026   	I.CRDT= 000031   	MFDFSQ= 000004   	V.LABL  000040   	...TPC= 000012
F.LGTH  000052   	I.CRTI= 000040   	M$$HDR= 000001

. ABS.	000056	   000
      	000006	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2482 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[40,10]RLEAS,[40,20]RLEAS/-SP=[40,30]RSXDC,F11PRE,RLEAS
RSXDC	MACRO M1108  05-DEC-77 17:16  PAGE 3


      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.
RLFCB	D0200, RELEASE FCB FROM	MACRO M1108  05-DEC-77 17:16  PAGE 6


      1						.TITLE	RLFCB	D0200, RELEASE FCB FROM FCB CHAIN
						.IDENT	"D0200"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D200, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  23 OCT 74  16:52
     23					;
     24					; RELEASE FCB FROM FCB CHAIN
     25
     26					;+
     27					;
     28					; **.RLFCB - RELEASE FCB FROM FCB CHAIN
     29					;
     30					; THIS ROUTINE SEARCHES THE FCB CHAIN FOR THE FCB IMMEDIATELY
     31					; PRECEDING THE ONE POINTED TO BY R0. IT CHAINS AROUND THE
     32					; ONE TO BE RELEASED, AND THEN RELEASES THE STORAGE TO THE
     33					; SYSTEM.
     34					;
     35					; INPUTS:
     36					;
     37					;	R0 = FCB ADDRESS
     38					;	R4 = VCB ADDRESS
     39					;
     40					; OUTPUTS:
     41					;
     42					;	R1,R3 ALTERED
     43					;	R0,R2,R4,R5 PRESERVED
     44					;
     45					;-
     46
     47	000000				.RLFCB::
     48	000000	010403 				MOV	R4,R3
     49	000002	062703 	000006 			ADD	#V.FCB,R3	; R3=POINTER TO FIRST FCB IN LIST
     50	000006	020013 			10$:	CMP	R0,(R3)		; DOES THIS FCB POINT TO THE ONE TO BE REMOVED?
     51	000010	001403 				BEQ	20$		;
     52	000012	011303 				MOV	(R3),R3		;
     53	000014	001374 				BNE	10$
     54	000016					FATAL	<FCB NOT IN LIST>
RLFCB	D0200, RELEASE FCB FROM	MACRO M1108  05-DEC-77 17:16  PAGE 6-1


	000016	000004 				IOT			; *** FATAL ERROR FCB NOT IN LIST
     55	000020	011013 			20$:	MOV	(R0),(R3)	; CHAIN AROUND REMOVED FCB
     56	000022	001002 				BNE	30$		; AND IF END OF LIST
     57	000024	010364 	000010 			MOV	R3,V.FCB+2(R4)	; UPDATE END POINTER AS WELL
     58	000030	012701 	000052 		30$:	MOV	#F.LGTH,R1	;
     59	000034					CALLR	.RLEAS		; RELEASE THE FCB AND RETURN
     60					;
     61					;
     62	000040					$END	RLFCB
     63					;
     64					;
     65		000001 				.END
RLFCB	D0200, RELEASE FCB FROM	MACRO M1108  05-DEC-77 17:16  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.DASZ= 000007   	M$$HDR= 000001   	V.LABL  000040
AC.LCK= 000001   	F.NACS  000036   	I.DPB   000011   	M.CTSZ= 000006   	V.LGTH  000056
BITFNU= 000002   	F.NLCK  000037   	I.EFN   000013   	M.EFNU= 000002   	V.LRUC  000035
EX.AC1= 000001   	F.NWAC  000040   	I.EXDT= 000046   	M.EFSQ= 000004   	V.SBCL  000021
EX.AC2= 000002   	F.RVN   000012   	I.EXTD  000030   	M.ERVN= 000001   	V.SBLB  000024
EX.ADF= 000010   	F.SCHA  000021   	I.FCN   000014   	M.ESQN= 000000   	V.SBSZ  000022
EX.ENA= 000200   	F.SIZE  000032   	I.FIDP  000024   	M.LBSZ= 000007   	V.STAT  000054
EX.FCO= 000004   	F.STAT  000040   	I.FNAM= 000000   	M.MAX = 000011   	V.STD   000004
E$$MSG= 000001   	F.STD   000004   	I.FNBP  000036   	M.RTRV= 000012   	V.TRCT  000000
E$$TRP= 000001   	F.UCHA  000020   	I.FTYP= 000006   	M.USE = 000010   	V.WISZ  000020
FCPLUN= 000001   	F11PR$= 000000   	I.FVER= 000010   	QIOEFN= 000002   	WI.BPS= 100000
FC.CEF= 020000   	HIFCN = 000030   	I.IOSB  000016   	R$$10F= 000001   	WI.DLK= 010000
FC.DIR= 040000   	H.CKSM= 000776   	I.LGTH  000040   	R$$11D= 000001   	WI.EXT= 002000
FC.FCO= 010000   	H.FCHA= 000014   	I.LNK   000000   	SC.BAD= 000100   	WI.LCK= 004000
FC.WAC= 100000   	H.FLEV= 000006   	I.LUN   000012   	SC.MDL= 000200   	WI.RDV= 000400
FP.DEL= 000010   	H.FNUM= 000002   	I.PRI   000010   	S.HDHD= 000056   	WI.WRV= 001000
FP.EXT= 000004   	H.FOWN= 000010   	I.PRM   000024   	S.IDHD= 000056   	W.CTL   000000
FP.RAT= 000001   	H.FPRO= 000012   	I.RTRV  000034   	S.MPHD= 000012   	W.FCB   000002
FP.RDV= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	S.STBK= 000012   	W.RTRV  000012
FP.WRV= 000002   	H.IDOF= 000000   	I.RVNO= 000012   	UC.CON= 000200   	W.STD   000004
F$$LVL= 000001   	H.MPOF= 000001   	I.RVTI= 000023   	UC.DLK= 000100   	W.VBN   000006
F.DREF  000042   	H.PROG= 000010   	I.RWAD= 000024   	VC.BMW= 000002   	W.WISZ  000007
F.DRNM  000044   	H.PROJ= 000011   	I.RWAT  000026   	VC.IFW= 000001   	.DFEXT= 000005
F.FEXT  000002   	H.SCHA= 000015   	I.RWCT= 000026   	V.FCB   000006   	.DFPRO= 164000
F.FNUM  000006   	H.UCHA= 000014   	I.RWVB= 000032   	V.FFNU  000055   	.PRFIL= 000004
F.FOWN  000014   	H.UFAT= 000016   	I.STD   000004   	V.FIEX  000025   	.RLEAS= ****** GX
F.FPRO  000016   	IDXFNU= 000001   	I.TISZ= 000006   	V.FMAX  000016   	.RLFCB  000000RG
F.FSEQ  000010   	ID$$$ = 000200   	I.UIC   000022   	V.FPRO  000030   	.RTPTF= 001401
F.FSQN  000013   	I.ACTL  000035   	LEV11M= 000401   	V.FRBK  000034   	.SYUIC= 000010
F.FVBN  000046   	I.AST   000020   	LOWFCN= 000011   	V.IBLB  000012   	.VBSIZ= 001000
F.HDLB  000022   	I.ATL   000006   	MFDFNO= 000004   	V.IBSZ  000013   	...GBL= 000000
F.LBN   000026   	I.CRDT= 000031   	MFDFSQ= 000004   	V.IFWI  000002   	...TPC= 000012
F.LGTH  000052   	I.CRTI= 000040

. ABS.	000056	   000
      	000040	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2492 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[40,10]RLFCB,[40,20]RLFCB/-SP=[40,30]RSXDC,F11PRE,RLFCB
RSXDC	MACRO M1108  05-DEC-77 17:17  PAGE 3


      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.
RMVNM	D0200, REMOVE NAME QI/O	MACRO M1108  05-DEC-77 17:17  PAGE 6


      1						.TITLE	RMVNM	D0200, REMOVE NAME QI/O
						.IDENT	"D0200"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D200, ASSEMBLED FOR RSX-11D
					;
     22
     23					; ANDREW C. GOLDSTEIN  25 JUL 1974
     24					; PETER H. LIPMAN	7-JUM-74
     25					;
     26					; REMOVE QI/O
     27					;
     28					;+
     29					; **-.RMVNM-REMOVE NAME QI/O
     30					;
     31					; THIS ROUTINE IMPLEMENTS THE REMOVE NAME QI/O. FIRST THE DIRECTORY IS ACCESSED
     32					; (SEE FNDNM FOR DISCUSSION OF PRE-ACCESSED DIRECTORIES). THEN THE ENTRY IS
     33					; REMOVED AND THE DIRECTORY BLOCK REWRITEN. FINALLY IF THE LAST BLOCK(S) OF
     34					; THE DIRECTORY ARE EMPTY THE DIRECTORY EOF IS RESET TO REFLECT THE LAST
     35					; BLOCK CONTAINING A DIRECTORY ENTRY.
     36					;-
     37
     38	000000				.RMVNM::
     39	000000					CALL	.DRINI		; INITIALIZE FOR DIRECTORY OPERATION
     40	000004					CALL	.DRPAC		; SEE IF DIRECTORY IS PREACCESSED
     41	000010	103002 				BCC	10$		; BRANCH IF ITS
     42	000012	000177 	000000G			JMP	@.DRAC1		; GO ACCESS IT OTHERWISE
     43
     44	000016	012700 	000002 		10$:	MOV	#FP.WRV,R0	; CHECK ACCESS FOR READ/WRITE
     45	000022					CALL	.FDRMV		; COMMON CODE FOR FIND/REMOVE
     46	000026	103403 				BCS	20$		; BRANCH IF FILE NOT FOUND
     47	000030	005011 				CLR	(R1)		; DELETE THE ENTRY
     48	000032					CALL	.DRWRT		; AND WRITE THE DIRECTORY BLOCK
     49	000036	012702 	000000G		20$:	MOV	#S.DRFN,R2	; RETURN ENTIRE SCRATCH FNB TO USER
     50	000042					CALLR	.DRWEX		; EXIT FROM DIRECTORY WRITE OPERATION
     51					;
     52					;
     53	000046					$END	RMVNM
     54					;
RMVNM	D0200, REMOVE NAME QI/O	MACRO M1108  05-DEC-77 17:17  PAGE 6-1


     55					;
     56		000001 				.END
RMVNM	D0200, REMOVE NAME QI/O	MACRO M1108  05-DEC-77 17:17  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.EFN   000013   	M.ERVN= 000001   	V.SBSZ  000022
AC.LCK= 000001   	F.NLCK  000037   	I.EXDT= 000046   	M.ESQN= 000000   	V.STAT  000054
BITFNU= 000002   	F.NWAC  000040   	I.EXTD  000030   	M.LBSZ= 000007   	V.STD   000004
EX.AC1= 000001   	F.RVN   000012   	I.FCN   000014   	M.MAX = 000011   	V.TRCT  000000
EX.AC2= 000002   	F.SCHA  000021   	I.FIDP  000024   	M.RTRV= 000012   	V.WISZ  000020
EX.ADF= 000010   	F.SIZE  000032   	I.FNAM= 000000   	M.USE = 000010   	WI.BPS= 100000
EX.ENA= 000200   	F.STAT  000040   	I.FNBP  000036   	QIOEFN= 000002   	WI.DLK= 010000
EX.FCO= 000004   	F.STD   000004   	I.FTYP= 000006   	R$$10F= 000001   	WI.EXT= 002000
E$$MSG= 000001   	F.UCHA  000020   	I.FVER= 000010   	R$$11D= 000001   	WI.LCK= 004000
E$$TRP= 000001   	F11PR$= 000000   	I.IOSB  000016   	SC.BAD= 000100   	WI.RDV= 000400
FCPLUN= 000001   	HIFCN = 000030   	I.LGTH  000040   	SC.MDL= 000200   	WI.WRV= 001000
FC.CEF= 020000   	H.CKSM= 000776   	I.LNK   000000   	S.DRFN= ****** GX	W.CTL   000000
FC.DIR= 040000   	H.FCHA= 000014   	I.LUN   000012   	S.HDHD= 000056   	W.FCB   000002
FC.FCO= 010000   	H.FLEV= 000006   	I.PRI   000010   	S.IDHD= 000056   	W.RTRV  000012
FC.WAC= 100000   	H.FNUM= 000002   	I.PRM   000024   	S.MPHD= 000012   	W.STD   000004
FP.DEL= 000010   	H.FOWN= 000010   	I.RTRV  000034   	S.STBK= 000012   	W.VBN   000006
FP.EXT= 000004   	H.FPRO= 000012   	I.RVDT= 000014   	UC.CON= 000200   	W.WISZ  000007
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVNO= 000012   	UC.DLK= 000100   	$$    = 000067
FP.RDV= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	VC.BMW= 000002   	.DFEXT= 000005
FP.WRV= 000002   	H.MPOF= 000001   	I.RWAD= 000024   	VC.IFW= 000001   	.DFPRO= 164000
F$$LVL= 000001   	H.PROG= 000010   	I.RWAT  000026   	V.FCB   000006   	.DRAC1= ****** GX
F.DREF  000042   	H.PROJ= 000011   	I.RWCT= 000026   	V.FFNU  000055   	.DRINI= ****** GX
F.DRNM  000044   	H.SCHA= 000015   	I.RWVB= 000032   	V.FIEX  000025   	.DRPAC= ****** GX
F.FEXT  000002   	H.UCHA= 000014   	I.STD   000004   	V.FMAX  000016   	.DRWEX= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.TISZ= 000006   	V.FPRO  000030   	.DRWRT= ****** GX
F.FOWN  000014   	IDXFNU= 000001   	I.UIC   000022   	V.FRBK  000034   	.FDRMV= ****** GX
F.FPRO  000016   	ID$$$ = 000200   	LEV11M= 000401   	V.IBLB  000012   	.PRFIL= 000004
F.FSEQ  000010   	I.ACTL  000035   	LOWFCN= 000011   	V.IBSZ  000013   	.RMVNM  000000RG
F.FSQN  000013   	I.AST   000020   	MFDFNO= 000004   	V.IFWI  000002   	.RTPTF= 001401
F.FVBN  000046   	I.ATL   000006   	MFDFSQ= 000004   	V.LABL  000040   	.SYUIC= 000010
F.HDLB  000022   	I.CRDT= 000031   	M$$HDR= 000001   	V.LGTH  000056   	.VBSIZ= 001000
F.LBN   000026   	I.CRTI= 000040   	M.CTSZ= 000006   	V.LRUC  000035   	...GBL= 000000
F.LGTH  000052   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBCL  000021   	...TPC= 000012
F.LINK  000000   	I.DPB   000011   	M.EFSQ= 000004   	V.SBLB  000024

. ABS.	000056	   000
      	000046	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2522 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:18
[40,10]RMVNM,[40,20]RMVNM/-SP=[40,30]RSXDC,F11PRE,RMVNM
RSXDC	MACRO M1108  05-DEC-77 17:17  PAGE 3


      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.
RWATT	D0201, READ/WRITE ATTRI	MACRO M1108  05-DEC-77 17:17  PAGE 6


      1						.TITLE	RWATT	D0201, READ/WRITE ATTRIBUTE INITIALIZATION
						.IDENT	"D0201"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D201, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  10 SEP 74  18:04:19
     23					; PETER H. LIPMAN	10-MAR-74
     24					;
     25					; READ AND WRITE ATTRIBUTE QI/O INITIALIZATION CODE
     26
     27					;
     28					;+
     29					;
     30					; **-.RWATT-READ/WRITE ATTRIBUTES INITIALIZATION
     31					;
     32					; THIS ROUTINE CHECKS THE I/O PACKET PARAMETERS, GETS THE FILE ID,
     33					; READS THE FILE HEADER AND CHECKS THAT THE DESIRED ACCESS IS ALLOWED.
     34					;
     35					; INPUTS:
     36					;
     37					; 	R0=ACCESS REQUEST FOR PROTECTION ROUTINE
     38					; 	R4=VOLUME CONTROL BLOCK ADDRESS
     39					; 	R5=I/O PACKET ADDRESS
     40					;
     41					; OUTPUTS:
     42					;
     43					; 	R0-R3 ALTERED R4-R5 PRESERVED
     44					;
     45					;-
     46
     47	000000				.RWATT::
     48	000000	010046 				MOV	R0,-(SP)	; SAVE PROTECTION CHECK PARAMETER
     49	000002	010500 				MOV	R5,R0		;
     50	000004	062700 	000026 			ADD	#I.RWAT,R0	; POSITION TO ATTRIBUTE CONTROL BLOCK
     51	000010	005720 				TST	(R0)+		; ATTRIBUTE CONTROL BLOCK MUST BE PRESENT
     52	000012	001416 				BEQ	10$		; BRANCH IF NOT
     53	000014	012001 				MOV	(R0)+,R1	; NO EXTEND ALLOWED
     54	000016	052001 				BIS	(R0)+,R1	;
RWATT	D0201, READ/WRITE ATTRI	MACRO M1108  05-DEC-77 17:17  PAGE 6-1


     55	000020	052001 				BIS	(R0)+,R1	; NO ACCESS
     56	000022	052001 				BIS	(R0)+,R1	; NO FILENAME BLOCK
     60	000024	001011 				BNE	10$		; BRANCH IF ANY ARE NON ZERO
     61	000026					CALL	.GTFID		; SET UP FILE NO. AND FILE SEQUENCE NO.
     62	000032					CALL	.SCFAC		; SEE IF FILE IS ACCESSED BY ANYONE
     63	000036					CALL	.RDFHD		; READ THE FILE HEADER
     64	000042	012600 				MOV	(SP)+,R0	;
     65	000044					CALLR	.PROCK		; SEE IF READ/WRITE ATTRIBUTES IS ALLOWED
     66
     67	000050				10$:	ERRX	IE.BAD,<BAD PARAMETERS TO READ/WRITE ATTRIBUTES>
	000050	   000C	   211 			TRAP	-IE.BAD		; BAD PARAMETERS TO READ/WRITE ATTRIBUTES
     68					;
     69					;
     70	000052					$END	RWATT
     71					;
     72					;
     73		000001 				.END
RWATT	D0201, READ/WRITE ATTRI	MACRO M1108  05-DEC-77 17:17  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.DPB   000011   	M.EFNU= 000002   	V.SBCL  000021
AC.LCK= 000001   	F.NLCK  000037   	I.EFN   000013   	M.EFSQ= 000004   	V.SBLB  000024
BITFNU= 000002   	F.NWAC  000040   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBSZ  000022
EX.AC1= 000001   	F.RVN   000012   	I.EXTD  000030   	M.ESQN= 000000   	V.STAT  000054
EX.AC2= 000002   	F.SCHA  000021   	I.FCN   000014   	M.LBSZ= 000007   	V.STD   000004
EX.ADF= 000010   	F.SIZE  000032   	I.FIDP  000024   	M.MAX = 000011   	V.TRCT  000000
EX.ENA= 000200   	F.STAT  000040   	I.FNAM= 000000   	M.RTRV= 000012   	V.WISZ  000020
EX.FCO= 000004   	F.STD   000004   	I.FNBP  000036   	M.USE = 000010   	WI.BPS= 100000
E$$MSG= 000001   	F.UCHA  000020   	I.FTYP= 000006   	QIOEFN= 000002   	WI.DLK= 010000
E$$TRP= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$10F= 000001   	WI.EXT= 002000
FCPLUN= 000001   	HIFCN = 000030   	I.IOSB  000016   	R$$11D= 000001   	WI.LCK= 004000
FC.CEF= 020000   	H.CKSM= 000776   	I.LGTH  000040   	SC.BAD= 000100   	WI.RDV= 000400
FC.DIR= 040000   	H.FCHA= 000014   	I.LNK   000000   	SC.MDL= 000200   	WI.WRV= 001000
FC.FCO= 010000   	H.FLEV= 000006   	I.LUN   000012   	S.HDHD= 000056   	W.CTL   000000
FC.WAC= 100000   	H.FNUM= 000002   	I.PRI   000010   	S.IDHD= 000056   	W.FCB   000002
FP.DEL= 000010   	H.FOWN= 000010   	I.PRM   000024   	S.MPHD= 000012   	W.RTRV  000012
FP.EXT= 000004   	H.FPRO= 000012   	I.RTRV  000034   	S.STBK= 000012   	W.STD   000004
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	UC.CON= 000200   	W.VBN   000006
FP.RDV= 000001   	H.IDOF= 000000   	I.RVNO= 000012   	UC.DLK= 000100   	W.WISZ  000007
FP.WRV= 000002   	H.MPOF= 000001   	I.RVTI= 000023   	VC.BMW= 000002   	$$    = 000067
F$$LVL= 000001   	H.PROG= 000010   	I.RWAD= 000024   	VC.IFW= 000001   	.DFEXT= 000005
F.DREF  000042   	H.PROJ= 000011   	I.RWAT  000026   	V.FCB   000006   	.DFPRO= 164000
F.DRNM  000044   	H.SCHA= 000015   	I.RWCT= 000026   	V.FFNU  000055   	.GTFID= ****** GX
F.FEXT  000002   	H.UCHA= 000014   	I.RWVB= 000032   	V.FIEX  000025   	.PRFIL= 000004
F.FNUM  000006   	H.UFAT= 000016   	I.STD   000004   	V.FMAX  000016   	.PROCK= ****** GX
F.FOWN  000014   	IDXFNU= 000001   	I.TISZ= 000006   	V.FPRO  000030   	.RDFHD= ****** GX
F.FPRO  000016   	ID$$$ = 000201   	I.UIC   000022   	V.FRBK  000034   	.RTPTF= 001401
F.FSEQ  000010   	IE.BAD= ****** GX	LEV11M= 000401   	V.IBLB  000012   	.RWATT  000000RG
F.FSQN  000013   	I.ACTL  000035   	LOWFCN= 000011   	V.IBSZ  000013   	.SCFAC= ****** GX
F.FVBN  000046   	I.AST   000020   	MFDFNO= 000004   	V.IFWI  000002   	.SYUIC= 000010
F.HDLB  000022   	I.ATL   000006   	MFDFSQ= 000004   	V.LABL  000040   	.VBSIZ= 001000
F.LBN   000026   	I.CRDT= 000031   	M$$HDR= 000001   	V.LGTH  000056   	...GBL= 000000
F.LGTH  000052   	I.CRTI= 000040   	M.CTSZ= 000006   	V.LRUC  000035   	...TPC= 000012
F.LINK  000000   	I.DASZ= 000007

. ABS.	000056	   000
      	000052	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2517 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:17
[40,10]RWATT,[40,20]RWATT/-SP=[40,30]RSXDC,F11PRE,RWATT
RSXDC	MACRO M1108  05-DEC-77 17:17  PAGE 3


      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.
RWVB	D0210, READ/WRITE VIRTU	MACRO M1108  05-DEC-77 17:17  PAGE 6


      1						.TITLE	RWVB	D0210, READ/WRITE VIRTUAL BLOCK
						.IDENT	"D0210"
      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					;
					; VERSION D210, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  12 FEB 75  16:56
     23					; PETER H. LIPMAN	22-JAN-74
     24					;
     25					; READ AND WRITE VIRTUAL BLOCK QI/O
     26
     28						.MCALL	DECL$S
     30					;
     31					; **.RWVB - READ/WRITE VIRTUAL BLOCK
     32					;
     33					; THIS ROUTINE IMPLEMENTS THE READ AND WRITE VIRTUAL BLOCK QI/O.
     34					; IT OPERATES ON AN I/O PACKET WHICH LOOKS LIKE:
     35					;
     36					; I.RWAD: I/O BUFFER ADDRESS (DOUBLE WORD IN RSX/11M)
     37					; I.RWCT: LENGTH OF TRANSFER IN BYTES
     38					; I.RWVB: HIGH VIRTUAL BLOCK NUMBER BITS
     39					;     +2: LOW VIRTUAL BLOCK NUMBER BITS
     40					;
     41					; THE WINDOW IS TURNED SO THAT THE DESIRED VBN WILL MAP. THE MAPPING
     42					; ROUTINE IS THEN CALLED AND IF IT MAPS THE TRANSFER SUCCESSFULLY THE
     43					; I/O PACKET IS REQUEUED TO THE HANDLER. BECAUSE I/O IS NOT ACTUALLY
     44					; COMPLETE THIS ROUTINE DOES NOT DO A NORMAL RETURN WHICH IS ONLY VALID IF
     45					; I/O IS COMPLETE. INSTEAD IT JUMPS TO THE START POINT. THIS ROUTINE WILL
     46					; TRANSFER MULTIPLE BLOCKS AS LONG AS THEY MAP INTO ONE LOGICAL TRANSFER.
     47					;
     48					; INPUTS:
     49					;
     50					; 	R4=VCB ADDRESS
     51					; 	R5=I/O PACKET ADDRESS
     52					;
     53					; OUTPUTS:
     54					;
     55					; 	R0-R3 ALTERED
     56					; 	R4-R5 PRESERVED
RWVB	D0210, READ/WRITE VIRTU	MACRO M1108  05-DEC-77 17:17  PAGE 6-1


     57					; 	DOES NOT RETURN IN LINE AT ALL
     58					; 	IF ERROR EXITS THROUGH .ERRX
     59					; 	IF SUCCESSFUL JMP'S TO .START
     60					;
     61					; EFFECTS:
     62					;
     63					; 	.HDBUF CONTAINS HEADER OF THIS FILE
     64					;
     65					;-
     66
     67	000000				.RWVB::
     71	000000					GETLUN	R1		; R1=WINDOW ADDRESS
     73	000004	001001 				BNE	10$		; BRANCH IF WINDOW EXISTS
     74	000006					ERRX	IE.NLN,<NO FILE ACCESSED ON LUN>
	000006	   000C	   211 			TRAP	-IE.NLN		; NO FILE ACCESSED ON LUN
     75
     77	000010	042701 	000001 		10$:	BIC	#1,R1
     78	000014	026527 	000014 	000000G		CMP	I.FCN(R5),#IO.WVB ; SEE IF THIS IS A WRITE
     79	000022	001004 				BNE	20$		; NO, MUST BE A READ
     80	000024					ASSUME	W.CTL,0
     81	000024	032711 	001000 			BIT	#WI.WRV,(R1)	; WRITE - CHECK FOR WRITE ACCESS
     82	000030	001001 				BNE	20$		; OK
     83	000032					ERRX	IE.PRI,<WRITE ATTEMPTED TO FILE ACCESSED FOR READ>
	000032	   000C	   211 			TRAP	-IE.PRI		; WRITE ATTEMPTED TO FILE ACCESSED FOR READ
     84					;
     85					; PICK UP THE DESIRED VBN AND ATTEMPT TO TURN THE WINDOW TO IT.
     86					;
     87	000034	016502 	000032 		20$:	MOV	I.RWVB(R5),R2	; R2,R3=DESIRED VBN
     88	000040	016503 	000034 			MOV	I.RWVB+2(R5),R3
     89	000044	010200 				MOV	R2,R0
     90	000046	050300 				BIS	R3,R0		; CHECK FOR ZERO VBN
     91	000050	001001 				BNE	30$
     92	000052					ERRX	IE.BAD,<ZERO VBN - BAD PARAMETERS>
	000052	   000C	   211 			TRAP	-IE.BAD		; ZERO VBN - BAD PARAMETERS
     93
     94	000054				30$:	CALL	.WITRN
     95	000060	103001 				BCC	40$
     96	000062					ERRX	IE.EOF,<DESIRED VBN BEYOND END OF ALLOCATED SPACE>
	000062	   000C	   211 			TRAP	-IE.EOF		; DESIRED VBN BEYOND END OF ALLOCATED SPACE
     97
     98	000064	010501 			40$:	MOV	R5,R1		; R1=I/O PACKET
    129	000066					CALL	..VTOL		; MAP THE REQUEST
    130	000072	103002 				BCC	90$
    131	000074					CALLR	@.RWVB1		; TRY FOR LONG TRANSFER
    132
    133					; NOW REQUEUE THE I/O PACKET TO THE HANDLER
    134
    135	000100	016502 	000006 		90$:	MOV	I.ATL(R5),R2	; GET POINTER TO ATL
    139	000104	016702 	000000G			MOV	.UCBAD,R2	; POINT TO PUD
    140	000110	016203 	000000G			MOV	U.HA(R2),R3	; GET ATL ADDR OF HANDLER
    141	000114	062702 	000000G			ADD	#U.RF,R2	; POINT TO HANDLER'S REQUEST QUEUE
    142	000120	105065 	000011 			CLRB	I.DPB(R5)	; ZERO TO INDICATE A VALIDATED REQUEST
    143	000124					CALL	..IPRI		; INSERT PACKET IN DRIVER QUEUE
    144	000130	052763 	000000G	000000G		BIS	#EF.NIR,A.EF(R3) ; SET DRIVER'S EVENT FLAG
    145	000136					DECL$S			; DECLARE A SIGNIFICANT EVENT
    146	000144	000167 	000000G			JMP	.START		; AND GO TO THE TOP
    148					;
RWVB	D0210, READ/WRITE VIRTU	MACRO M1108  05-DEC-77 17:17  PAGE 6-2


    149					;
    150	000150					$END	RWVB
    151					;
    152					;
    153		000001 				.END
RWVB	D0210, READ/WRITE VIRTU	MACRO M1108  05-DEC-77 17:17  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.CRTI= 000040   	M.EFSQ= 000004   	V.SBLB  000024
AC.LCK= 000001   	F.NLCK  000037   	I.DASZ= 000007   	M.ERVN= 000001   	V.SBSZ  000022
A.EF  = ****** GX	F.NWAC  000040   	I.DPB   000011   	M.ESQN= 000000   	V.STAT  000054
BITFNU= 000002   	F.RVN   000012   	I.EFN   000013   	M.LBSZ= 000007   	V.STD   000004
EF.NIR= ****** GX	F.SCHA  000021   	I.EXDT= 000046   	M.MAX = 000011   	V.TRCT  000000
EX.AC1= 000001   	F.SIZE  000032   	I.EXTD  000030   	M.RTRV= 000012   	V.WISZ  000020
EX.AC2= 000002   	F.STAT  000040   	I.FCN   000014   	M.USE = 000010   	WI.BPS= 100000
EX.ADF= 000010   	F.STD   000004   	I.FIDP  000024   	QIOEFN= 000002   	WI.DLK= 010000
EX.ENA= 000200   	F.UCHA  000020   	I.FNAM= 000000   	R$$10F= 000001   	WI.EXT= 002000
EX.FCO= 000004   	F11PR$= 000000   	I.FNBP  000036   	R$$11D= 000001   	WI.LCK= 004000
E$$MSG= 000001   	HIFCN = 000030   	I.FTYP= 000006   	SC.BAD= 000100   	WI.RDV= 000400
E$$TRP= 000001   	H.CKSM= 000776   	I.FVER= 000010   	SC.MDL= 000200   	WI.WRV= 001000
FCPLUN= 000001   	H.FCHA= 000014   	I.IOSB  000016   	S.HDHD= 000056   	W.CTL   000000
FC.CEF= 020000   	H.FLEV= 000006   	I.LGTH  000040   	S.IDHD= 000056   	W.FCB   000002
FC.DIR= 040000   	H.FNUM= 000002   	I.LNK   000000   	S.MPHD= 000012   	W.RTRV  000012
FC.FCO= 010000   	H.FOWN= 000010   	I.LUN   000012   	S.STBK= 000012   	W.STD   000004
FC.WAC= 100000   	H.FPRO= 000012   	I.PRI   000010   	UC.CON= 000200   	W.VBN   000006
FP.DEL= 000010   	H.FSEQ= 000004   	I.PRM   000024   	UC.DLK= 000100   	W.WISZ  000007
FP.EXT= 000004   	H.IDOF= 000000   	I.RTRV  000034   	U.HA  = ****** GX	$$    = 000067
FP.RAT= 000001   	H.MPOF= 000001   	I.RVDT= 000014   	U.RF  = ****** GX	.DFEXT= 000005
FP.RDV= 000001   	H.PROG= 000010   	I.RVNO= 000012   	VC.BMW= 000002   	.DFPRO= 164000
FP.WRV= 000002   	H.PROJ= 000011   	I.RVTI= 000023   	VC.IFW= 000001   	.LUTN2= ****** GX
F$$LVL= 000001   	H.SCHA= 000015   	I.RWAD= 000024   	V.FCB   000006   	.PRFIL= 000004
F.DREF  000042   	H.UCHA= 000014   	I.RWAT  000026   	V.FFNU  000055   	.RTPTF= 001401
F.DRNM  000044   	H.UFAT= 000016   	I.RWCT= 000026   	V.FIEX  000025   	.RWVB   000000RG
F.FEXT  000002   	IDXFNU= 000001   	I.RWVB= 000032   	V.FMAX  000016   	.RWVB1= ****** GX
F.FNUM  000006   	ID$$$ = 000210   	I.STD   000004   	V.FPRO  000030   	.START= ****** GX
F.FOWN  000014   	IE.BAD= ****** GX	I.TISZ= 000006   	V.FRBK  000034   	.SYUIC= 000010
F.FPRO  000016   	IE.EOF= ****** GX	I.UIC   000022   	V.IBLB  000012   	.UCBAD= ****** GX
F.FSEQ  000010   	IE.NLN= ****** GX	LEV11M= 000401   	V.IBSZ  000013   	.VBSIZ= 001000
F.FSQN  000013   	IE.PRI= ****** GX	LOWFCN= 000011   	V.IFWI  000002   	.WITRN= ****** GX
F.FVBN  000046   	IO.WVB= ****** GX	MFDFNO= 000004   	V.LABL  000040   	..IPRI= ****** GX
F.HDLB  000022   	I.ACTL  000035   	MFDFSQ= 000004   	V.LGTH  000056   	..VTOL= ****** GX
F.LBN   000026   	I.AST   000020   	M$$HDR= 000001   	V.LRUC  000035   	...GBL= 000000
F.LGTH  000052   	I.ATL   000006   	M.CTSZ= 000006   	V.SBCL  000021   	...TPC= 000012
F.LINK  000000   	I.CRDT= 000031   	M.EFNU= 000002

. ABS.	000056	   000
      	000150	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2612 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:21
[40,10]RWVB,[40,20]RWVB/-SP=[40,30]RSXDC,F11PRE,RWVB
RSXDC	MACRO M1108  05-DEC-77 17:18  PAGE 3


      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.
RWVBL	D0211, R/W VIRTUAL BLOC	MACRO M1108  05-DEC-77 17:18  PAGE 6


      1						.TITLE	RWVBL	D0211, R/W VIRTUAL BLOCK - LONG TRANSFER
						.IDENT	"D0211"
      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					;
					; VERSION D211, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  13 FEB 75  19:21
     23					; PETER H. LIPMAN	22-JUN-74
     24					;
     25					; PERFORM A MULTI-PIECE READ OR WRITE VIRTUAL BLOCK FOR THE USER
     26					;
     31						.MCALL	QIOW$,DIR$
     37					;
     38					; STORAGE AND QI/O DPB
     39					;
     40	000000				RWBLC:	.BLKW	1		; NO. OF BLOCKS REMAINING TO TRANSFER
     45	000002				RWDPB:	QIOW$	,FCPLUN,QIOEFN,,.QIOST,,<,,,,,>
     47		000004'				RWFCN=RWDPB+Q.IOFN	; I/O FUNCTION CODE
     48		000016'				RWADR=RWDPB+Q.IOPL	; ADDRESS TO TRANSFER TO/FROM
     49		000020'				RWCNT=RWADR+2		; BYTE COUNT TO TRANSFER
     50		000024'				RWLBN=RWCNT+4		; LOGICAL BLOCK NO. TO READ FROM/WRITE TO
     51					;+
     52					; **-.RWVBL- R/W LONG VIRTUAL BLOCK
     53					;
     54					; THIS ROUTINE IMPLEMENTS THE MULTI-PIECE TRANSFER FOR A LONG
     55					; READ OR WRITE VIRTUAL BLOCK.  THE PIECES ARE ALWAYS THE LARGEST
     56					; POSSIBLE PIECES BASED ON THE RELATIVE CONTIGUITY OF THE DESIRED BLOCKS.
     57					; 	THE FOLLOWING ASSUMPTIONS ARE MADE.  AN ATTEMPT HAS ALREADY BEEN
     58					; MADE TO MAP THE ENTIRE TRANSFER AS ONE PIECE AND IT FAILED.  THE
     59					; FILE HEADER IS IN MEMORY AND THE WINDOW HAS BEEN TURNED TO THE 1ST VBN.
     60					; THE TRANSACTION COUNT HAS BEEN INCREMENTED.
     61					; 	NOTE THAT THE FOLLOWING LOCATIONS DO NOT CONTAIN THEIR USUAL
     62					; CONTEXT, BUT CONTAIN ZERO INSTEAD.
     63					; 	.FILNO, .FILSQ, .WNDOW, .FCBAD
     64					;
     65					; INPUTS:
     66					;
     67					; 	R4=VOLUME CONTROL BLOCK
     68					; 	R5=I/O PACKET
RWVBL	D0211, R/W VIRTUAL BLOC	MACRO M1108  05-DEC-77 17:18  PAGE 6-1


     69					;
     70					; OUTPUTS:
     71					;
     72					; 	R0-R3 ALTERED
     73					; 	R4,R5 PRESERVED
     74					;-
     75
     76	000032				.RWVBL::
     77	000032	012767 	000000G	177744 		MOV	#IO.WLB,RWFCN	; SET UP THE FUNCTION CODE
     78	000040	022765 	000000G	000014 		CMP	#IO.WVB,I.FCN(R5) ; IF NOT WRITE, SET UP FOR READ
     79	000046	001403 				BEQ	20$
     80	000050	012767 	000000G	177726 		MOV	#IO.RLB,RWFCN
     81	000056				20$:
     85	000056	016500 	000026 			MOV	I.RWCT(R5),R0	; R0=NO. OF BYTES TO TRANSFER
     86	000062					ASSUME	.VBSIZ,1000
     87	000062	062700 	000777 			ADD	#.VBSIZ-1,R0	; ROUND UP TO BLOCK BOUNDARY
     91	000066	105000 				CLRB	R0
     92	000070	000300 				SWAB	R0
     93	000072	006200 				ASR	R0
     95	000074	010067 	177700 			MOV	R0,RWBLC	; NO. OF BLOCKS TO TRANSFER
     96	000100				30$:	GETLUN	R1		; R1=WINDOW ADDRESS
     97	000104	042701 	000001 			BIC	#1,R1		; RESET INTERLOCK BIT (DEACCESS PENDING)
     98	000110	016500 	000026 			MOV	I.RWCT(R5),R0	; R0=BYTES TO TRANSFER
     99	000114	001417 				BEQ	60$		; IF ZERO, ALL DONE
    100	000116	016502 	000032 			MOV	I.RWVB(R5),R2	; R2,R3=VBN
    101	000122	016503 	000034 			MOV	I.RWVB+2(R5),R3
    111	000126					CALL	..VVLL		; TRY TO MAP THE TRANSFER
    112	000132	103011 				BCC	70$		; GOT SOMETHING
    113	000134	016502 	000032 			MOV	I.RWVB(R5),R2	; GET THE VBN AGAIN
    114	000140	016503 	000034 			MOV	I.RWVB+2(R5),R3
    120	000144					CALL	.WITRN		; NO, TURN THE WINDOW
    121	000150	103353 				BCC	30$		; AND RETRY IF SUCCESSFUL
    122	000152					ERR	IE.EOF,<END OF FILE>
	000152	   000G	   211 			TRAP	IE.EOF		; END OF FILE
    123	000154				60$:	RETURN
    124
    125	000156	016701 	177616 		70$:	MOV	RWBLC,R1	; R1=NO. OF BLOCKS LEFT TO TRANSFER
    127	000162	010267 	177636 			MOV	R2,RWLBN	; SET UP LBN FOR TRANSFER
    128	000166	010367 	177634 			MOV	R3,RWLBN+2
    134	000172	005700 				TST	R0		; CHECK NUMBER OF BLOCKS NOT MAPPED
    136	000174	001003 				BNE	80$		; BRANCH IF NOT  ENTIRELY MAPPED
    137	000176	016501 	000026 			MOV	I.RWCT(R5),R1	; R1=BYTE COUNT FOR THIS XFER
    138	000202	000405 				BR	100$
    139
    140	000204	160001 			80$:	SUB	R0,R1		; R1=NO. OF BLOCKS FOR THIS XFER
    141	000206	010100 			90$:	MOV	R1,R0		; SAVE BLOCK COUNT IN R0
    145	000210	000301 				SWAB	R1
    146	000212	105001 				CLRB	R1
    147	000214	006301 				ASL	R1
    149	000216	010167 	177576 		100$:	MOV	R1,RWCNT	; STORE BYTE COUNT TO XFER
    164	000222	020127 	057000 			CMP	R1,#3*20000-1000 ; SEE IF TRANSFER IS LESS THAN 12K - 1 BLK
    165	000226	101403 				BLOS	110$		; YES - DO AS IS
    166	000230	012701 	000057 			MOV	#3*20-1,R1	; SO SORRY, CAN ONLY DO 12K - 1 BLOCK
    167	000234	000764 				BR	90$		; DUE TO MAPPING LIMITATIONS
    168
    169	000236	160067 	177536 		110$:	SUB	R0,RWBLC	; ADJUST BLOCK COUNT REMAINING
    170
RWVBL	D0211, R/W VIRTUAL BLOC	MACRO M1108  05-DEC-77 17:18  PAGE 6-2


    171	000242					PUSH	R4		; SAVE VCB ADDRESS
    172	000244	010103 				MOV	R1,R3		; SAVE AWAY BYTE COUNT
    173	000246	010501 				MOV	R5,R1		; GET I/O PACKET ADDR IN RIGHT REG
    174	000250	016502 	000024 			MOV	I.RWAD(R5),R2	; GET USER VIRTUAL ADDRESS
    175	000254	005005 				CLR	R5		; SET FOR WRITE OPERATION
    176	000256	026727 	177522 	000000G		CMP	RWFCN,#IO.WLB	; SEE IF IT IS IN FACT A WRITE
    177	000264	001401 				BEQ	120$
    178	000266	005205 				INC	R5		; NO - SET FOR READ OPERATION
    179	000270				120$:	CALL	..VXFR		; SEE IF TRANSFER IS LEGAL
    180	000274	103001 				BCC	130$
    181	000276					ERRX	IE.SPC,<ILLEGAL USER BUFFER>
	000276	   000C	   211 			TRAP	-IE.SPC		; ILLEGAL USER BUFFER
    182
    183	000300				130$:
    190	000300	010567 	177512 			MOV	R5,RWADR
    208	000304					DIR$	#RWDPB		; DO THE TRANSFER ALREADY
    219	000312					POP	R4		; RESTORE VCB ADDRESS
    220	000314	016705 	000000G			MOV	.IOPKT,R5	; RESTORE I/O PACKET POINTER
    221	000320	010301 				MOV	R3,R1		; RESTORE BYTE COUNT
    222	000322	103430 				BCS	150$		; EXIT ON DIRECTIVE ERROR
    224	000324	105767 	000000G			TSTB	.QIOST		; COMPLETED SUCCESSFULLY?
    225	000330	002416 				BLT	140$		; BRANCH IF NO
    226					;
    227					; R0=BLOCK COUNT, R1=BYTE COUNT
    228					;
    229	000332	060167 	000002G			ADD	R1,.IOSTS+2	; COUNT THE BYTES TRANSFERRED
    230	000336	026701 	000002G			CMP	.QIOST+2,R1	; BYTE COUNT AGREE?
    231	000342	001025 				BNE	160$		; BRANCH IF NO, ERROR
    232	000344	160165 	000026 			SUB	R1,I.RWCT(R5)	; UPDATE BYTES LEFT TO XFER
    233	000350	060065 	000034 			ADD	R0,I.RWVB+2(R5)	; UPDATE VBN OF NEXT PIECE
    234	000354	005565 	000032 			ADC	I.RWVB(R5)
    235
    254	000360	060165 	000024 			ADD	R1,I.RWAD(R5)	; INCREMENT USER VIRTUAL ADDRESS
    255	000364	000645 				BR	30$		; AND GO BACK FOR NEXT SEGMENT
    257					;
    258					; ERROR DURING QI/O OR AFTER
    259					;
    260	000366	016767 	000000G	000000G	140$:	MOV	.QIOST,.IOSTS	; BOUNCE ERROR CODE BACK TO USER
    261	000374	016767 	000002G	000002G		MOV	.QIOST+2,.IOSTS+2
    262	000402					ERRX
	000402	104400 				TRAP	0		;
    263
    264	000404	126727 	000000G	000000G	150$:	CMPB	$DSW,#IE.UPN	; CHECK IF NO NODES AVAILABLE
    265	000412	001001 				BNE	160$		; NO - SOMETHING RANDOM
    266	000414					ERRX	IE.NOD,<NODE NOT AVAILABLE TO DO QIO>
	000414	   000C	   211 			TRAP	-IE.NOD		; NODE NOT AVAILABLE TO DO QIO
    267
    268	000416				160$:	ERRX	IE.ABO,<SHORT BLOCK FROM DEVICE>
	000416	   000C	   211 			TRAP	-IE.ABO		; SHORT BLOCK FROM DEVICE
    269					;
    270					;
    271	000420					$END	RWVBL
    272					;
    273					;
    274		000001 				.END
RWVBL	D0211, R/W VIRTUAL BLOC	MACRO M1108  05-DEC-77 17:18  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.SIZE  000032   	I.EXTD  000030   	Q.IOAE= 000012   	V.SBLB  000024
AC.LCK= 000001   	F.STAT  000040   	I.FCN   000014   	Q.IOEF= 000006   	V.SBSZ  000022
BITFNU= 000002   	F.STD   000004   	I.FIDP  000024   	Q.IOFN= 000002   	V.STAT  000054
EX.AC1= 000001   	F.UCHA  000020   	I.FNAM= 000000   	Q.IOLU= 000004   	V.STD   000004
EX.AC2= 000002   	F11PR$= 000000   	I.FNBP  000036   	Q.IOPL= 000014   	V.TRCT  000000
EX.ADF= 000010   	HIFCN = 000030   	I.FTYP= 000006   	Q.IOPR= 000007   	V.WISZ  000020
EX.ENA= 000200   	H.CKSM= 000776   	I.FVER= 000010   	Q.IOSB= 000010   	WI.BPS= 100000
EX.FCO= 000004   	H.FCHA= 000014   	I.IOSB  000016   	RWADR = 000016R  	WI.DLK= 010000
E$$MSG= 000001   	H.FLEV= 000006   	I.LGTH  000040   	RWBLC   000000R  	WI.EXT= 002000
E$$TRP= 000001   	H.FNUM= 000002   	I.LNK   000000   	RWCNT = 000020R  	WI.LCK= 004000
FCPLUN= 000001   	H.FOWN= 000010   	I.LUN   000012   	RWDPB   000002R  	WI.RDV= 000400
FC.CEF= 020000   	H.FPRO= 000012   	I.PRI   000010   	RWFCN = 000004R  	WI.WRV= 001000
FC.DIR= 040000   	H.FSEQ= 000004   	I.PRM   000024   	RWLBN = 000024R  	W.CTL   000000
FC.FCO= 010000   	H.IDOF= 000000   	I.RTRV  000034   	R$$10F= 000001   	W.FCB   000002
FC.WAC= 100000   	H.MPOF= 000001   	I.RVDT= 000014   	R$$11D= 000001   	W.RTRV  000012
FP.DEL= 000010   	H.PROG= 000010   	I.RVNO= 000012   	SC.BAD= 000100   	W.STD   000004
FP.EXT= 000004   	H.PROJ= 000011   	I.RVTI= 000023   	SC.MDL= 000200   	W.VBN   000006
FP.RAT= 000001   	H.SCHA= 000015   	I.RWAD= 000024   	S.HDHD= 000056   	W.WISZ  000007
FP.RDV= 000001   	H.UCHA= 000014   	I.RWAT  000026   	S.IDHD= 000056   	$DSW  = ****** GX
FP.WRV= 000002   	H.UFAT= 000016   	I.RWCT= 000026   	S.MPHD= 000012   	$$    = 000067
F$$LVL= 000001   	IDXFNU= 000001   	I.RWVB= 000032   	S.STBK= 000012   	$$$ARG= 000014
F.DREF  000042   	ID$$$ = 000211   	I.STD   000004   	UC.CON= 000200   	$$$OST= 000014
F.DRNM  000044   	IE.ABO= ****** GX	I.TISZ= 000006   	UC.DLK= 000100   	.DFEXT= 000005
F.FEXT  000002   	IE.EOF= ****** GX	I.UIC   000022   	VC.BMW= 000002   	.DFPRO= 164000
F.FNUM  000006   	IE.NOD= ****** GX	LEV11M= 000401   	VC.IFW= 000001   	.IOPKT= ****** GX
F.FOWN  000014   	IE.SPC= ****** GX	LOWFCN= 000011   	V.FCB   000006   	.IOSTS= ****** GX
F.FPRO  000016   	IE.UPN= ****** GX	MFDFNO= 000004   	V.FFNU  000055   	.LUTN2= ****** GX
F.FSEQ  000010   	IO.RLB= ****** GX	MFDFSQ= 000004   	V.FIEX  000025   	.PRFIL= 000004
F.FSQN  000013   	IO.WLB= ****** GX	M$$HDR= 000001   	V.FMAX  000016   	.QIOST= ****** GX
F.FVBN  000046   	IO.WVB= ****** GX	M.CTSZ= 000006   	V.FPRO  000030   	.RTPTF= 001401
F.HDLB  000022   	I.ACTL  000035   	M.EFNU= 000002   	V.FRBK  000034   	.RWVBL  000032RG
F.LBN   000026   	I.AST   000020   	M.EFSQ= 000004   	V.IBLB  000012   	.SYUIC= 000010
F.LGTH  000052   	I.ATL   000006   	M.ERVN= 000001   	V.IBSZ  000013   	.VBSIZ= 001000
F.LINK  000000   	I.CRDT= 000031   	M.ESQN= 000000   	V.IFWI  000002   	.WITRN= ****** GX
F.NACS  000036   	I.CRTI= 000040   	M.LBSZ= 000007   	V.LABL  000040   	..VVLL= ****** GX
F.NLCK  000037   	I.DASZ= 000007   	M.MAX = 000011   	V.LGTH  000056   	..VXFR= ****** GX
F.NWAC  000040   	I.DPB   000011   	M.RTRV= 000012   	V.LRUC  000035   	...GBL= 000000
F.RVN   000012   	I.EFN   000013   	M.USE = 000010   	V.SBCL  000021   	...TPC= 000012
F.SCHA  000021   	I.EXDT= 000046   	QIOEFN= 000002

. ABS.	000056	   000
      	000420	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2774 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:27
[40,10]RWVBL,[40,20]RWVBL/-SP=[40,30]RSXDC,F11PRE,RWVBL
RSXDC	MACRO M1108  05-DEC-77 17:18  PAGE 3


      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.
RW1LB	D0202, READ/WRITE ONE L	MACRO M1108  05-DEC-77 17:18  PAGE 6


      1						.TITLE	RW1LB	D0202, READ/WRITE ONE LOGICAL BLOCK
						.IDENT	"D0202"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D202, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  28 FEB 75  18:33
     23					; PETER H. LIPMAN	7-JAN-74
     24					;
     25					; READ OR WRITE ONE LOGICAL BLOCK
     26					;
     27
     28						.MCALL	QIO$S,WSIG$S,WTSE$S
     29
     30					;+
     31					; **-WR1LB-WRITE ONE LOGICAL BLOCK
     32					; **-RD1LB-READ ONE LOGICAL BLOCK
     33					;
     34					; THIS ROUTINE READS/WRITES ONE LOGICAL BLOCK FROM/TO
     35					; THE DEVICE ASSIGNED TO LUN1. IF NO NODES ARE AVAILABLE FOR
     36					; THE QI/O, THE ROUTINE WAITS AND TRIES AGAIN. IT WAITS FOR I/O
     37					; COMPLETION AND ONLY RETURNS IN LINE IF SUCCESSFUL. IF ANY ERROR
     38					; OCCURS IE.RER/IE.WER IS RETURNED AND THE ROUTINE EXITS THROUGH ERRX.
     39					;
     40					; INPUTS:
     41					;
     42					; 	R1=MEMORY ADDRESS
     43					; 	R2,R3=LBN
     44					;
     45					; OUTPUTS:
     46					;
     47					; 	R1-R5 PRESERVED
     48					; 	R0 ALTERED
     49					; 	RETURNS IN LINE IF AND ONLY IF SUCCESSFUL
     50					;
     51					;-
     52
     53						.ENABL	LSB
     54
RW1LB	D0202, READ/WRITE ONE L	MACRO M1108  05-DEC-77 17:18  PAGE 6-1


     55	000000	012700 	000000G		.WR1LB::MOV	#IO.WLB,R0
     56	000004	000402 				BR	10$
     57
     58	000006	012700 	000000G		.RD1LB::MOV	#IO.RLB,R0
     59
     60	000012				10$:	QIO$S	R0,#1,#QIOEFN,,#.QIOST,,<R1,#.VBSIZ,,R2,R3,>
     61	000060	103412 				BCS	20$
     62	000062					WTSE$S	#QIOEFN
     63	000074	103411 				BCS	30$
     64	000076	105767 	000000G			TSTB	.QIOST
     65	000102	002406 				BLT	30$
     66	000104					RETURN
     67
     68	000106	022767 	000000G	000000G	20$:	CMP	#IE.UPN,$DSW	; IF OUT OF NODES
     69	000114	001001 				BNE	30$
     71	000116					ERRX	IE.NOD,<SYSTEM'S OR FCP'S NODES EXHAUSTED>
	000116	   000C	   211 			TRAP	-IE.NOD		; SYSTEM'S OR FCP'S NODES EXHAUSTED
     76
     77	000120	022700 	000000G		30$:	CMP	#IO.RLB,R0
     78	000124	001001 				BNE	40$
     79	000126					ERRX	IE.RER,<FILE PROCESSOR DEVICE READ ERROR>
	000126	   000C	   211 			TRAP	-IE.RER		; FILE PROCESSOR DEVICE READ ERROR
     80
     81	000130				40$:	ERRX	IE.WER,<FILE PROCESSOR DEVICE WRITE ERROR>
	000130	   000C	   211 			TRAP	-IE.WER		; FILE PROCESSOR DEVICE WRITE ERROR
     82
     83						.DSABL	LSB
     84
     85					;
     86					;
     87	000132					$END	RW1LB
     88					;
     89					;
     90		000001 				.END
RW1LB	D0202, READ/WRITE ONE L	MACRO M1108  05-DEC-77 17:18  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NLCK  000037   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035
AC.LCK= 000001   	F.NWAC  000040   	I.CRTI= 000040   	M.CTSZ= 000006   	V.SBCL  000021
BITFNU= 000002   	F.RVN   000012   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBLB  000024
EX.AC1= 000001   	F.SCHA  000021   	I.DPB   000011   	M.EFSQ= 000004   	V.SBSZ  000022
EX.AC2= 000002   	F.SIZE  000032   	I.EFN   000013   	M.ERVN= 000001   	V.STAT  000054
EX.ADF= 000010   	F.STAT  000040   	I.EXDT= 000046   	M.ESQN= 000000   	V.STD   000004
EX.ENA= 000200   	F.STD   000004   	I.EXTD  000030   	M.LBSZ= 000007   	V.TRCT  000000
EX.FCO= 000004   	F.UCHA  000020   	I.FCN   000014   	M.MAX = 000011   	V.WISZ  000020
E$$MSG= 000001   	F11PR$= 000000   	I.FIDP  000024   	M.RTRV= 000012   	WI.BPS= 100000
E$$TRP= 000001   	HIFCN = 000030   	I.FNAM= 000000   	M.USE = 000010   	WI.DLK= 010000
FCPLUN= 000001   	H.CKSM= 000776   	I.FNBP  000036   	QIOEFN= 000002   	WI.EXT= 002000
FC.CEF= 020000   	H.FCHA= 000014   	I.FTYP= 000006   	R$$10F= 000001   	WI.LCK= 004000
FC.DIR= 040000   	H.FLEV= 000006   	I.FVER= 000010   	R$$11D= 000001   	WI.RDV= 000400
FC.FCO= 010000   	H.FNUM= 000002   	I.IOSB  000016   	SC.BAD= 000100   	WI.WRV= 001000
FC.WAC= 100000   	H.FOWN= 000010   	I.LGTH  000040   	SC.MDL= 000200   	W.CTL   000000
FP.DEL= 000010   	H.FPRO= 000012   	I.LNK   000000   	S.HDHD= 000056   	W.FCB   000002
FP.EXT= 000004   	H.FSEQ= 000004   	I.LUN   000012   	S.IDHD= 000056   	W.RTRV  000012
FP.RAT= 000001   	H.IDOF= 000000   	I.PRI   000010   	S.MPHD= 000012   	W.STD   000004
FP.RDV= 000001   	H.MPOF= 000001   	I.PRM   000024   	S.STBK= 000012   	W.VBN   000006
FP.WRV= 000002   	H.PROG= 000010   	I.RTRV  000034   	UC.CON= 000200   	W.WISZ  000007
F$$LVL= 000001   	H.PROJ= 000011   	I.RVDT= 000014   	UC.DLK= 000100   	$DSW  = ****** GX
F.DREF  000042   	H.SCHA= 000015   	I.RVNO= 000012   	VC.BMW= 000002   	$$$ARG= 000006
F.DRNM  000044   	H.UCHA= 000014   	I.RVTI= 000023   	VC.IFW= 000001   	$$$T1 = 000014
F.FEXT  000002   	H.UFAT= 000016   	I.RWAD= 000024   	V.FCB   000006   	.DFEXT= 000005
F.FNUM  000006   	IDXFNU= 000001   	I.RWAT  000026   	V.FFNU  000055   	.DFPRO= 164000
F.FOWN  000014   	ID$$$ = 000202   	I.RWCT= 000026   	V.FIEX  000025   	.PRFIL= 000004
F.FPRO  000016   	IE.NOD= ****** GX	I.RWVB= 000032   	V.FMAX  000016   	.QIOST= ****** GX
F.FSEQ  000010   	IE.RER= ****** GX	I.STD   000004   	V.FPRO  000030   	.RD1LB  000006RG
F.FSQN  000013   	IE.UPN= ****** GX	I.TISZ= 000006   	V.FRBK  000034   	.RTPTF= 001401
F.FVBN  000046   	IE.WER= ****** GX	I.UIC   000022   	V.IBLB  000012   	.SYUIC= 000010
F.HDLB  000022   	IO.RLB= ****** GX	LEV11M= 000401   	V.IBSZ  000013   	.VBSIZ= 001000
F.LBN   000026   	IO.WLB= ****** GX	LOWFCN= 000011   	V.IFWI  000002   	.WR1LB  000000RG
F.LGTH  000052   	I.ACTL  000035   	MFDFNO= 000004   	V.LABL  000040   	...GBL= 000000
F.LINK  000000   	I.AST   000020   	MFDFSQ= 000004   	V.LGTH  000056   	...TPC= 000012
F.NACS  000036   	I.ATL   000006

. ABS.	000056	   000
      	000132	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2944 WORDS  ( 12 PAGES)
DYNAMIC MEMORY:  4160 WORDS  ( 16 PAGES)
ELAPSED TIME:  00:00:24
[40,10]RW1LB,[40,20]RW1LB/-SP=[40,30]RSXDC,F11PRE,RW1LB
RSXDC	MACRO M1108  05-DEC-77 17:19  PAGE 3


      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.
SCFAC	D0201, SEE IF FILE IS A	MACRO M1108  05-DEC-77 17:19  PAGE 6


      1						.TITLE	SCFAC	D0201, SEE IF FILE IS ACCESSED
						.IDENT	"D0201"
      2
      3					;
      4					;                             COPYRIGHT (C) 1974, 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					;
					; VERSION D201, ASSEMBLED FOR RSX-11D
					;
     22
     23					; ANDREW C. GOLDSTEIN  20 MAR 75  18:04
     24					; PETER H. LIPMAN	7-JUN-74
     25					;
     26					; SCAN TO SEE IF THE FILE IN (.FILNO, .FILSQ) IS ACCESSED.
     27					;
     28					;+
     29					; **-.SCFAC-SCAN TO SEE IF FILE IS ACCESSED
     30					;
     31					; THIS ROUTINE SCANS THE FCB LIST SEARCHING FOR A FILE WHICH HAS THE SAME
     32					; FILE ID AS STORED IN .FILNO, .FILSQ. IF A FILE IS FOUND AND IT IS IN THE
     33					; DIRECTORY LRU, THEN IT IS RELEASED FROM THE LRU AND IT IS REPORTED AS NOT
     34					; FOUND. THIS RESULTS IN KICKING DIRECTORIES OUT OF THE LRU WHEN NORMAL FILE
     35					; OPERATIONS ARE ATTEMPTED ON THEM.
     36					;
     37					; INPUTS:
     38					;
     39					; 	R4=VOLUME CONTROL BLOCK
     40					; 	.FILNO=FILE NUMBER DESIRED
     41					; 	.FILSQ=FILE SEQUENCE NUMBER DESIRED
     42					;
     43					; OUTPUTS:
     44					;
     45					; 	Z=0 IF FCB FOUND, Z=1 IF NOT FOUND
     46					; 	R3=FCB ADDRESS IF FOUND, R3=0 IF NOT
     47					; 	.FCBAD=FCB ADDRESS IF FOUND, 0 IF NOT
     48					; 	R2=PREVIOUS FCB IF FCB FOUND
     49					; 	R0,R1 ALTERED
     50					; 	R4,R5 PRESERVED
     51					;
     52					;-
     53
     54	000000				.SCFAC::
SCFAC	D0201, SEE IF FILE IS A	MACRO M1108  05-DEC-77 17:19  PAGE 6-1


     55	000000					CALL	.SCFCB
     56	000004	001426 				BEQ	20$
     57	000006	032763 	040000 	000040 		BIT	#FC.DIR,F.STAT(R3)
     58	000014	001422 				BEQ	20$
     59	000016	011312 				MOV	(R3),(R2)	; REMOVE THIS FCB FROM LIST
     60	000020	001002 				BNE	10$		; AND IF LAST ENTRY
     61	000022	010264 	000010 			MOV	R2,V.FCB+2(R4)	; FIX UP END POINTER
     62	000026	012701 	000052 		10$:	MOV	#F.LGTH,R1	;
     63	000032	010300 				MOV	R3,R0
     64	000034					CALL	.RLEAS		; RELEASE THE FCB
     65	000040	105264 	000035 			INCB	V.LRUC(R4)	; ONE MORE LRU ENTRY AVAILABLE
     66	000044	005003 				CLR	R3
     67	000046	026767 	000000G	000000G		CMP	.UCBAD,.DRUCB	; IS A DIRECTORY BLOCK FROM THIS VOLUME IN CORE?
     68	000054	001002 				BNE	20$		; NO
     69	000056	005067 	000000G			CLR	.DRUCB		; YES - INVALIDATE IT
     70									; NOTE THAT THIS TEST COULD BE MORE
     71									; INTELLIGENT - WE COULD CHECK FOR THE
     72									; SPECIFIC DIRECTORY, BUT THAT WOULD INVOLVE
     73									; A RANGE CHECK THAT IS NOT WORTH THE EFFORT.
     74	000062	010367 	000000G		20$:	MOV	R3,.FCBAD
     75	000066					RETURN
     76
     77					;
     78					;
     79	000070					$END	SCFAC
     80					;
     81					;
     82		000001 				.END
SCFAC	D0201, SEE IF FILE IS A	MACRO M1108  05-DEC-77 17:19  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.EFN   000013   	M.EFSQ= 000004   	V.SBLB  000024
AC.LCK= 000001   	F.NLCK  000037   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBSZ  000022
BITFNU= 000002   	F.NWAC  000040   	I.EXTD  000030   	M.ESQN= 000000   	V.STAT  000054
EX.AC1= 000001   	F.RVN   000012   	I.FCN   000014   	M.LBSZ= 000007   	V.STD   000004
EX.AC2= 000002   	F.SCHA  000021   	I.FIDP  000024   	M.MAX = 000011   	V.TRCT  000000
EX.ADF= 000010   	F.SIZE  000032   	I.FNAM= 000000   	M.RTRV= 000012   	V.WISZ  000020
EX.ENA= 000200   	F.STAT  000040   	I.FNBP  000036   	M.USE = 000010   	WI.BPS= 100000
EX.FCO= 000004   	F.STD   000004   	I.FTYP= 000006   	QIOEFN= 000002   	WI.DLK= 010000
E$$MSG= 000001   	F.UCHA  000020   	I.FVER= 000010   	R$$10F= 000001   	WI.EXT= 002000
E$$TRP= 000001   	F11PR$= 000000   	I.IOSB  000016   	R$$11D= 000001   	WI.LCK= 004000
FCPLUN= 000001   	HIFCN = 000030   	I.LGTH  000040   	SC.BAD= 000100   	WI.RDV= 000400
FC.CEF= 020000   	H.CKSM= 000776   	I.LNK   000000   	SC.MDL= 000200   	WI.WRV= 001000
FC.DIR= 040000   	H.FCHA= 000014   	I.LUN   000012   	S.HDHD= 000056   	W.CTL   000000
FC.FCO= 010000   	H.FLEV= 000006   	I.PRI   000010   	S.IDHD= 000056   	W.FCB   000002
FC.WAC= 100000   	H.FNUM= 000002   	I.PRM   000024   	S.MPHD= 000012   	W.RTRV  000012
FP.DEL= 000010   	H.FOWN= 000010   	I.RTRV  000034   	S.STBK= 000012   	W.STD   000004
FP.EXT= 000004   	H.FPRO= 000012   	I.RVDT= 000014   	UC.CON= 000200   	W.VBN   000006
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVNO= 000012   	UC.DLK= 000100   	W.WISZ  000007
FP.RDV= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	VC.BMW= 000002   	$$    = 000067
FP.WRV= 000002   	H.MPOF= 000001   	I.RWAD= 000024   	VC.IFW= 000001   	.DFEXT= 000005
F$$LVL= 000001   	H.PROG= 000010   	I.RWAT  000026   	V.FCB   000006   	.DFPRO= 164000
F.DREF  000042   	H.PROJ= 000011   	I.RWCT= 000026   	V.FFNU  000055   	.DRUCB= ****** GX
F.DRNM  000044   	H.SCHA= 000015   	I.RWVB= 000032   	V.FIEX  000025   	.FCBAD= ****** GX
F.FEXT  000002   	H.UCHA= 000014   	I.STD   000004   	V.FMAX  000016   	.PRFIL= 000004
F.FNUM  000006   	H.UFAT= 000016   	I.TISZ= 000006   	V.FPRO  000030   	.RLEAS= ****** GX
F.FOWN  000014   	IDXFNU= 000001   	I.UIC   000022   	V.FRBK  000034   	.RTPTF= 001401
F.FPRO  000016   	ID$$$ = 000201   	LEV11M= 000401   	V.IBLB  000012   	.SCFAC  000000RG
F.FSEQ  000010   	I.ACTL  000035   	LOWFCN= 000011   	V.IBSZ  000013   	.SCFCB= ****** GX
F.FSQN  000013   	I.AST   000020   	MFDFNO= 000004   	V.IFWI  000002   	.SYUIC= 000010
F.FVBN  000046   	I.ATL   000006   	MFDFSQ= 000004   	V.LABL  000040   	.UCBAD= ****** GX
F.HDLB  000022   	I.CRDT= 000031   	M$$HDR= 000001   	V.LGTH  000056   	.VBSIZ= 001000
F.LBN   000026   	I.CRTI= 000040   	M.CTSZ= 000006   	V.LRUC  000035   	...GBL= 000000
F.LGTH  000052   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBCL  000021   	...TPC= 000012
F.LINK  000000   	I.DPB   000011

. ABS.	000056	   000
      	000070	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2517 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:18
[40,10]SCFAC,[40,20]SCFAC/-SP=[40,30]RSXDC,F11PRE,SCFAC
RSXDC	MACRO M1108  05-DEC-77 17:19  PAGE 3


      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.
SCFCB	D0200, SCAN FILE CONTRO	MACRO M1108  05-DEC-77 17:19  PAGE 6


      1						.TITLE	SCFCB	D0200, SCAN FILE CONTROL BLOCK LIST
						.IDENT	"D0200"
      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					;
					; VERSION D200, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  25 JUL 1974
     23					; PETER H. LIPMAN - 22-JAN-74
     24					;
     25					; SCAN FILE CONTROL BLOCK LIST FOR FILE ID IN .FILNO AND .FILSQ
     26					;
     27					;+
     28					; **.SCFCB-SCAN FILE CONTROL BLOCK LIST
     29					;
     30					; THIS ROUTINE SCANS THE FCB LIST POINTED TO BY THE VOLUME CONTROL
     31					; BLOCK LOOKING FOR THE FILE ID THAT IS IN .FILNO, .FILSQ
     32					;
     33					; INPUTS:
     34					;
     35					; 	R4=VOLUME CONTROL BLOCK
     36					; 	.FILNO CONTAINS THE DESIRED FILE NUMBER
     37					; 	.FILSQ CONTAINS THE DESIRED FILE SEQUENCE NO.
     38					;
     39					; OUTPUTS:
     40					;
     41					; 	Z=0 IF FCB FOUND, Z=1 IF NOT FOUND
     42					; 	R3=FCB ADDRESS IF FOUND, 0 IF NOT
     43					; 	R2=PREVIOUS FCB ADDRESS IF R3 NON ZERO
     44					; 	R0,R1 ALTERED, R4-R5 PRESERVED
     45					; 	ALWAYS RETURNS IN LINE
     46					;
     47					;-
     48
     49	000000				.SCFCB::
     50	000000	010402 				MOV	R4,R2
     51	000002	062702 	000006 			ADD	#V.FCB,R2	; @R2 =1ST FCB ADDRESS
     52	000006	000411 				BR	30$
     53
     54	000010	026763 	000000G	000006 	10$:	CMP	.FILNO,F.FNUM(R3) ; CHECK FILE NUMBER
SCFCB	D0200, SCAN FILE CONTRO	MACRO M1108  05-DEC-77 17:19  PAGE 6-1


     55	000016	001004 				BNE	20$		; BRANCH IF NOT THE SAME
     56	000020	026763 	000000G	000010 		CMP	.FILSQ,F.FSEQ(R3) ; AND CHECK FILE SEQUENCE NO.
     57	000026	001403 				BEQ	40$		; BRANCH IF FILE FOUND
     58	000030	010302 			20$:	MOV	R3,R2		; SAVE PREVIOUS FCB ADDRESS
     59	000032	011203 			30$:	MOV	(R2),R3		; AND GET NEXT FCB IN CHAIN
     60	000034	001365 				BNE	10$		; BRANCH IF NOT END OF FCB LIST
     61	000036	005703 			40$:	TST	R3		; RETURN Z BIT
     62	000040					RETURN
     63					;
     64					;
     65	000042					$END	SCFCB
     66					;
     67					;
     68		000001 				.END
SCFCB	D0200, SCAN FILE CONTRO	MACRO M1108  05-DEC-77 17:19  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.DASZ= 000007   	M.CTSZ= 000006   	V.LGTH  000056
AC.LCK= 000001   	F.NACS  000036   	I.DPB   000011   	M.EFNU= 000002   	V.LRUC  000035
BITFNU= 000002   	F.NLCK  000037   	I.EFN   000013   	M.EFSQ= 000004   	V.SBCL  000021
EX.AC1= 000001   	F.NWAC  000040   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBLB  000024
EX.AC2= 000002   	F.RVN   000012   	I.EXTD  000030   	M.ESQN= 000000   	V.SBSZ  000022
EX.ADF= 000010   	F.SCHA  000021   	I.FCN   000014   	M.LBSZ= 000007   	V.STAT  000054
EX.ENA= 000200   	F.SIZE  000032   	I.FIDP  000024   	M.MAX = 000011   	V.STD   000004
EX.FCO= 000004   	F.STAT  000040   	I.FNAM= 000000   	M.RTRV= 000012   	V.TRCT  000000
E$$MSG= 000001   	F.STD   000004   	I.FNBP  000036   	M.USE = 000010   	V.WISZ  000020
E$$TRP= 000001   	F.UCHA  000020   	I.FTYP= 000006   	QIOEFN= 000002   	WI.BPS= 100000
FCPLUN= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$10F= 000001   	WI.DLK= 010000
FC.CEF= 020000   	HIFCN = 000030   	I.IOSB  000016   	R$$11D= 000001   	WI.EXT= 002000
FC.DIR= 040000   	H.CKSM= 000776   	I.LGTH  000040   	SC.BAD= 000100   	WI.LCK= 004000
FC.FCO= 010000   	H.FCHA= 000014   	I.LNK   000000   	SC.MDL= 000200   	WI.RDV= 000400
FC.WAC= 100000   	H.FLEV= 000006   	I.LUN   000012   	S.HDHD= 000056   	WI.WRV= 001000
FP.DEL= 000010   	H.FNUM= 000002   	I.PRI   000010   	S.IDHD= 000056   	W.CTL   000000
FP.EXT= 000004   	H.FOWN= 000010   	I.PRM   000024   	S.MPHD= 000012   	W.FCB   000002
FP.RAT= 000001   	H.FPRO= 000012   	I.RTRV  000034   	S.STBK= 000012   	W.RTRV  000012
FP.RDV= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	UC.CON= 000200   	W.STD   000004
FP.WRV= 000002   	H.IDOF= 000000   	I.RVNO= 000012   	UC.DLK= 000100   	W.VBN   000006
F$$LVL= 000001   	H.MPOF= 000001   	I.RVTI= 000023   	VC.BMW= 000002   	W.WISZ  000007
F.DREF  000042   	H.PROG= 000010   	I.RWAD= 000024   	VC.IFW= 000001   	.DFEXT= 000005
F.DRNM  000044   	H.PROJ= 000011   	I.RWAT  000026   	V.FCB   000006   	.DFPRO= 164000
F.FEXT  000002   	H.SCHA= 000015   	I.RWCT= 000026   	V.FFNU  000055   	.FILNO= ****** GX
F.FNUM  000006   	H.UCHA= 000014   	I.RWVB= 000032   	V.FIEX  000025   	.FILSQ= ****** GX
F.FOWN  000014   	H.UFAT= 000016   	I.STD   000004   	V.FMAX  000016   	.PRFIL= 000004
F.FPRO  000016   	IDXFNU= 000001   	I.TISZ= 000006   	V.FPRO  000030   	.RTPTF= 001401
F.FSEQ  000010   	ID$$$ = 000200   	I.UIC   000022   	V.FRBK  000034   	.SCFCB  000000RG
F.FSQN  000013   	I.ACTL  000035   	LEV11M= 000401   	V.IBLB  000012   	.SYUIC= 000010
F.FVBN  000046   	I.AST   000020   	LOWFCN= 000011   	V.IBSZ  000013   	.VBSIZ= 001000
F.HDLB  000022   	I.ATL   000006   	MFDFNO= 000004   	V.IFWI  000002   	...GBL= 000000
F.LBN   000026   	I.CRDT= 000031   	MFDFSQ= 000004   	V.LABL  000040   	...TPC= 000012
F.LGTH  000052   	I.CRTI= 000040   	M$$HDR= 000001

. ABS.	000056	   000
      	000042	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2502 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:18
[40,10]SCFCB,[40,20]SCFCB/-SP=[40,30]RSXDC,F11PRE,SCFCB
RSXDC	MACRO M1108  05-DEC-77 17:19  PAGE 3


      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.
SMALC	D0204, STORAGE MAP ALLO	MACRO M1108  05-DEC-77 17:19  PAGE 6


      1						.TITLE	SMALC	D0204, STORAGE MAP ALLOCATION
						.IDENT	"D0204"
      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					;
					; VERSION D204, ASSEMBLED FOR RSX-11D
					;
     21					; ANDREW C. GOLDSTEIN  6 NOV 74  19:27
     22					; PETER H. LIPMAN	25-FEB-74
     23					;
     24					; ALLOCATE A CHUNK OF BLOCKS FROM THE STORAGE BIT MAP
     25
     26						.MCALL	F11DF$
     27	000000					F11DF$			; DEFINE FCB,VCB,AND WINDOW OFFSETS
     28					;
     29					;+
     30					; **-.SMALC-STORAGE MAP ALLOCATION ROUTINE
     31					;
     32					; THIS ROUTINE ALLOCATES THE SPECIFIED NUMBER OF BLOCKS TO THE FILE.
     33					; IF A NONCONTIGUOUS ALLOCATION IS REQUESTED, THEN IT ALLOCATES
     34					; THE FIRST CHUNK OF BLOCKS IT FINDS LESS THAN OR EQUAL TO THE DESIRED NUMBER
     35					; OF BLOCKS. IF A CONTIGUOUS BLOCK IS NEEDED AND A LARGE ENOUGH BLOCK
     36					; BLOCK CANNOT BE FOUND, THE LARGEST AVAILABLE BLOCK IS ALLOCATED IF
     37					; REQUESTED. IF NOT REQUESTED TO ALLOCATE THE LARGEST AVAILABLE CHUNK
     38					; THE LARGEST CHUNK SIZE AND LBN ARE RETURNED WITH C BIT SET AND
     39					; I/O STATUS INDICATING DEVICE FULL.
     40					;
     41					; INPUTS:
     42					;
     43					;	R1,R2=NUMBER OF BLOCKS TO ALLOCATE
     44					;	R4=VOLUME CONTROL BLOCK ADDRESS
     45					;	R5=I/O PACKET ADDRESS
     46					;	.SMCTL=ALLOCATION CONTROL BYTE
     47					;
     48					; OUTPUT:
     49					;
     50					;	C=0 IF SUCCESSFUL
     51					;	C=1 IF DEVICE FULL AND REQUEST WAS FOR CONTIGUOUS ALLOCATION
     52					;	    RETURN BIGGEST AVAILABLE SIZE TO USER
     53					;	R0,R1=LBN IF C=0
     54					;	R2,R3 ALTERED R4,R5 PRESERVED
SMALC	D0204, STORAGE MAP ALLO	MACRO M1108  05-DEC-77 17:19  PAGE 6-1


     55					;	.SM1BT,.SM1BT+2=NO. OF BLOCKS ALLOCATED, OR LARGEST AVAILABLE
     56					;		SPACE IF CONTIG REQUEST FAILED.
     57					;
     58					; EFFECTS:
     59					;
     60					;	.SMBUF MAY CONTAIN A DIFFERENT STORAGE MAP BLOCK
     61					;	.HDBUF ALTERED
     62					;-
     63	000000				.SMALC::
     64	000000	005067 	000000G			CLR	.SM2BT		; ZERO BIGGEST CHUNK FOUND SO FAR
     65	000004	005067 	000002G			CLR	.SM2BT+2
     66	000010	005000 				CLR	R0
     67	000012	156400 	000021 			BISB	V.SBCL(R4),R0	; R0=STORAGE MAP CLUSTER FACTOR
     68	000016					CALL	$DDIV		; FORM R1,R2=NO. OF BITS DESIRED
     69	000022	005700 				TST	R0		; ROUND UP IF REMAINDER IS NOT ZERO
     70	000024	001403 				BEQ	10$
     71	000026	062702 	000001 			ADD	#1,R2
     72	000032	005501 				ADC	R1
     73	000034	010167 	000000G		10$:	MOV	R1,.SM1BT	; SAVE DESIRED NO. OF BITS
     74	000040	010267 	000002G			MOV	R2,.SM1BT+2
     75	000044	026767 	000000G	000000G		CMP	.UCBAD,.SMUCB	; IS CURRENT STORAGE MAP BLOCK FOR THIS DEVICE?
     76	000052	001003 				BNE	20$		; BRANCH IF NO. READ VBN 1
     77	000054	016703 	000000G			MOV	.SMVBN,R3	; DOES .SMBUF CONTAIN A STORAGE MAP BLOCK?
     78	000060	001004 				BNE	30$		; BRANCH IF YES, START WITH IT
     79	000062	012703 	000001 		20$:	MOV	#1,R3		; READ STORAGE MAP BLOCK 1
     80	000066					CALL	.SMRVB
     81	000072	012701 	000000G		30$:	MOV	#.SMBUF,R1	; START AT FIRST WORD
     82	000076	012700 	000001 			MOV	#1,R0		; AND FIRST BIT
     83					;
     84					; CALCULATE THE BLOCK COUNT TO SCAN, ALLOWING A SCAN FROM THE CURRENT
     85					; VBN TO THE END, AND IF NECESSARY FROM VBN 1 TO THE END AGAIN.
     86					; THIS ALLOWS THE CONTIGUOUS ALLOCATION FROM THE CURRENT VBN -1 TO THE
     87					; END OF THE STORAGE BIT MAP IF THAT PROVES TO BE THE ONLY WAY TO
     88					; ALLOCATE THE DESIRED CONTIGUOUS CHUNK.
     89					;
     90	000102	016703 	000000G			MOV	.SMVBN,R3	; R3=CURRENT VIRTUAL BLOCK NO. IN MEMORY
     91	000106	042703 	000000G			BIC	#.SMFLG,R3	; CLEAR THE FLAG BITS
     92	000112	005303 				DEC	R3		; IF VBN 1 IS IN MEMORY
     93	000114	001403 				BEQ	40$		; NEED ONLY TAKE ONE FULL SCAN
     94	000116	005403 				NEG	R3		; OTHERWISE CALCULATE BLOCKS LEFT TO END
     95	000120	066403 	000022 			ADD	V.SBSZ(R4),R3
     96	000124	066403 	000022 		40$:	ADD	V.SBSZ(R4),R3	; ADD THE STORAGE BIT MAP SIZE
     97	000130	010367 	000000G			MOV	R3,.SMCNT	; STORE BLOCK COUNT THAT MAY BE SCANNED
     98					;
     99					; R0=BIT MASK, R1=BIT WORD ADDRESS SEARCH FOR A FREE BIT
    100					;
    101	000134	005767 	000000G		50$:	TST	.SMCNT		; ALREADY TESTED THE LAST BLOCK OF BITS?
    102	000140	003405 				BLE	60$		; BRANCH IF YES
    103	000142	030011 				BIT	R0,(R1)		; IF THIS BIT AVAILABLE
    104	000144	001034 				BNE	90$		; BRANCH IF YES
    105	000146					CALL	.SMNXB		; SET UP TO TEST NEXT BIT
    106	000152	103370 				BCC	50$		; BRANCH IF MORE BITS TO TEST
    107					;
    108					; FAILED TO ALLOCATE DESIRED NO. OF BITS; IF CONTIGUOUS ALLOCATION
    109					; REQUEST, RETURN LARGEST CONTIGUOUS BLOCK FOUND, AND IF REQUEST
    110					; INDICATES, "ALLOCATE LARGEST AVAILABLE PIECE" ALLOCATE IT TOO.
    111					;
SMALC	D0204, STORAGE MAP ALLO	MACRO M1108  05-DEC-77 17:19  PAGE 6-2


    112
    113	000154	012700 	000000G		60$:	MOV	#.SM2VB,R0	; MOVE LARGEST REGION INFO
    114	000160	010001 				MOV	R0,R1		; INTO THE CURRENT REGION
    115	000162	012041 				MOV	(R0)+,-(R1)	; MOVE VIRTUAL BLOCK NO.
    116	000164	012041 				MOV	(R0)+,-(R1)	; STARTING ADDRESS IN BUFFER
    117	000166	012041 				MOV	(R0)+,-(R1)	; MASK WORD
    118	000170	016041 	000002 			MOV	2(R0),-(R1)	; LOW ORDER COUNT
    119	000174	011041 				MOV	(R0),-(R1)	; HIGH ORDER COUNT
    120	000176	132767 	000001 	000000G		BITB	#EX.AC1,.SMCTL
    121	000204	001413 				BEQ	80$
    122					;
    123					; R1=POINTER TO .SM1BT
    124					;
    125	000206	012102 				MOV	(R1)+,R2	; R2=HIGH ORDER NO. OF BITS
    126	000210	011146 				MOV	(R1),-(SP)	; PUSH LOW ORDER NO. OF BITS
    127	000212	010246 				MOV	R2,-(SP)	; PUSH HIGH ORDER NO. OF BITS
    128	000214	051102 				BIS	(R1),R2		; IF ZERO BIT COUNT THEN DEVICE FULL
    129	000216	001404 				BEQ	70$
    130	000220	132767 	000002 	000000G		BITB	#EX.AC2,.SMCTL	; ALLOCATE LARGEST AVAILABLE REGION?
    131	000226	001054 				BNE	120$
    132	000230				70$:	ERR	IE.DFU,<DEVICE FULL>
	000230	   000G	   211 			TRAP	IE.DFU		; DEVICE FULL
    133	000232	000476 				BR	130$		; RETURN LARGEST AVAILABLE REGION
    134	000234				80$:	ERRX	IE.DFU,<DEVICE FULL>
	000234	   000C	   211 			TRAP	-IE.DFU		; DEVICE FULL
    135					;
    136					; FOUND FIRST FREE BIT, SCAN FOR DESIRED SIZE CHUNK
    137					;
    138	000236	012705 	000000G		90$:	MOV	#.SM1BT,R5
    139	000242	012502 				MOV	(R5)+,R2	; R2,R3=DESIRED BIT COUNT
    140	000244	012503 				MOV	(R5)+,R3
    141	000246	010025 				MOV	R0,(R5)+	; SAVE MASK WORD
    142	000250	010125 				MOV	R1,(R5)+	; AND BIT WORD ADDRESS
    143	000252	016715 	000000G			MOV	.SMVBN,(R5)	; AND CURRENT VBN IN CORE
    144	000256	010346 				MOV	R3,-(SP)	; SAVE DESIRED COUNT (LOW BITS)
    145	000260	010246 				MOV	R2,-(SP)	; AND HIGH BITS
    146					;
    147					; SCAN FOR DESIRED NO. OF BITS FREE STARTING AT BIT IN R0, WORD IN R1
    148					;
    149					; WRAP AROUND ALLOCATION IS PREVENTED BY THE FACT THAT LOGICAL BLOCK 0
    150					; IS ALLOCATED IN A FILES 11 STRUCTURE AS THE 1ST VBN OF THE INDEX FILE
    151					;
    152	000262	012705 	000000G			MOV	#.CKFRE,R5
    153	000266					CALL	.SMSCN
    154	000272	103032 				BCC	120$		; BRANCH IF FOUND SPACE
    155					;
    156					; CALCULATE SIZE OF CONTIGUOUS CHUNK FOUND ON TOP OF STACK
    157					;
    158	000274	160366 	000002 			SUB	R3,2(SP)
    159	000300	005616 				SBC	(SP)
    160	000302	160216 				SUB	R2,(SP)
    161	000304	132767 	000001 	000000G		BITB	#EX.AC1,.SMCTL	; IF NON CONTIGUOUS EXTEND, THEN ALL SET
    162	000312	001422 				BEQ	120$		; NO. OF BITS ALLOCATED ON TOP OF STACK
    163					;
    164					; CONTIGUOUS EXTEND AND DIDN'T FIND ENOUGH SPACE, KEEP TRACK OF
    165					; BIGGEST CONTIGUOUS CHUNK FOUND.
    166					;
SMALC	D0204, STORAGE MAP ALLO	MACRO M1108  05-DEC-77 17:19  PAGE 6-3


    167	000314	012705 	000000G			MOV	#.SM2BT,R5
    168	000320	012602 				MOV	(SP)+,R2	; R2,R3=SIZE OF CHUNK IN BITS
    169	000322	012603 				MOV	(SP)+,R3
    170	000324	020225 				CMP	R2,(R5)+	; IS IT LARGER THAN CURRENT LARGEST?
    171	000326	001001 				BNE	100$
    172	000330	020315 				CMP	R3,(R5)
    173	000332	101407 			100$:	BLOS	110$		; BRANCH IF NO
    174					;
    175					; SAVE THIS AS THE LARGEST AREA
    176					;
    177	000334	010315 				MOV	R3,(R5)
    178	000336	010245 				MOV	R2,-(R5)
    179	000340	012702 	000000G			MOV	#.SM1MK,R2
    180	000344	012245 				MOV	(R2)+,-(R5)	; SM1MK TO SM2MK
    181	000346	012245 				MOV	(R2)+,-(R5)	; SM1AD TO SM2AD
    182	000350	012245 				MOV	(R2)+,-(R5)	; SM1VB TO SM2VB
    183					;
    184					; R0=MASK WORD, R1=ADDRESS - TRY TO FIND A BIG ENOUGH PIECE
    185					;
    186	000352				110$:
    187	000352	016705 	000000G			MOV	.IOPKT,R5
    188	000356	000666 				BR	50$
    189					;
    190					; SUCCESSFUL ALLOCATION, NO. OF BITS ALLOCATED ON TOP OF STACK
    191					; 0(SP)=HIGH BITS OF COUNT, 2(SP)=LOW BITS.
    192					;
    193	000360	016705 	000000G		120$:	MOV	.IOPKT,R5
    194	000364	016467 	000022 	000000G		MOV	V.SBSZ(R4),.SMCNT ; DISABLE BLOCK COUNT LOGIC IN .SMNXT
    195	000372	016703 	000000G			MOV	.SM1VB,R3	; R3=VBN FOR 1ST BIT
    196	000376					CALL	.SMRVB		; MAKE SURE STARTING BIT MAP BLOCK IS IN
    197	000402	011602 				MOV	(SP),R2		; R2,R3=NO. OF BITS
    198	000404	016603 	000002 			MOV	2(SP),R3
    199	000410	016700 	000000G			MOV	.SM1MK,R0	; R0=STARTING MASK WORD
    200	000414	016701 	000000G			MOV	.SM1AD,R1	; R1=STARTING WORD ADDRESS
    201	000420	012705 	000000G			MOV	#.ALOBT,R5	; ALLOCATE THE BITS FOUND
    202	000424					CALL	.SMSCN
    203					;
    204					; CALCULATE NO. OF BLOCKS ALLOCATED AND STARTING LBN,
    205					;
    206	000430	016705 	000000G		130$:	MOV	.IOPKT,R5
    207	000434	005000 				CLR	R0
    208	000436	156400 	000021 			BISB	V.SBCL(R4),R0	; R0=CLUSTER FACTOR
    209	000442	012602 				MOV	(SP)+,R2	; R2,R3=BIT COUNT ALLOCATED
    210	000444	012603 				MOV	(SP)+,R3
    211	000446	010046 				MOV	R0,-(SP)	; SAVE THE CLUSTER FACTOR
    212	000450					CALL	$DMUL		; CALCULATE R0,R1=NO. OF BLOCKS
    213	000454	010067 	000000G			MOV	R0,.SM1BT	; STORE NO. OF BLOCK ALLOCATED
    214	000460	010167 	000002G			MOV	R1,.SM1BT+2
    215	000464	105767 	000000G			TSTB	.IOSTS		; IF DEVICE FULL, JUST RETURN SIZE
    216	000470	002443 				BLT	180$
    217	000472	160164 	000036 			SUB	R1,V.FRBK+2(R4) ; SUBTRACT COUNT FROM FREE BLOCK COUNT
    218	000476	005664 	000034 			SBC	V.FRBK(R4)
    219	000502	160064 	000034 			SUB	R0,V.FRBK(R4)
    220					;
    221					; CALCULATE LOGICAL BLOCK NUMBER
    222					;
    223	000506	016701 	000000G			MOV	.SM1AD,R1
SMALC	D0204, STORAGE MAP ALLO	MACRO M1108  05-DEC-77 17:19  PAGE 6-4


    224	000512	162701 	000000G			SUB	#.SMBUF,R1	; R1=BYTE NO. IN BUFFER
    228	000516	012700 	000010 			MOV	#8.,R0
    229	000522					CALL	$MUL		; CALCULATE R1=BITS UP TO THE MARKED WORD
    231	000526	016702 	000000G			MOV	.SM1MK,R2	; R2=MASK WORD
    232	000532	000241 				CLC
    233	000534	006002 			140$:	ROR	R2		; SHIFT MASK BIT
    234	000536	103402 				BCS	150$		; IF C=1, MASK=0
    235	000540	005201 				INC	R1		; COUNT THE BITS
    236	000542	000774 				BR	140$
    237	000544	010103 			150$:	MOV	R1,R3		; BIT NUMBER IN THIS BLOCK, R2=0
    238	000546	016700 	000000G			MOV	.SM1VB,R0	; VBN OF BIT MAP BLOCK (STARTS AT 1)
    239	000552	042700 	000000G			BIC	#.SMFLG,R0	; CLEAR FLAG BITS
    240	000556	000403 				BR	170$
    241	000560	062703 	010000 		160$:	ADD	#.VBSIZ*8.,R3	; ADD NO. OF BITS  PER BLOCK
    242	000564	005502 				ADC	R2
    243	000566	077004 			170$:	SOB	R0,160$		; FOR EACH VBN UP TO THIS ONE
    244	000570	012600 				MOV	(SP)+,R0	; R0=CLUSTER FACTOR
    245	000572					CALL	$DMUL		; FORM LBN IN R0,R1, RETURN C=0
    246	000576					RETURN
    247	000600	005726 			180$:	TST	(SP)+		; POP THE SAVED CLUSTER FACTOR
    248	000602	000261 				SEC
    249	000604					RETURN
    250
    251					;
    252					;
    253	000606					$END	SMALC
    254					;
    255					;
    256		000001 				.END
SMALC	D0204, STORAGE MAP ALLO	MACRO M1108  05-DEC-77 17:19  PAGE 6-5
SYMBOL TABLE

AC.DLK= 000002   	F.SCHA  000021   	I.FNBP  000036   	SC.BAD= 000100   	W.RTRV  000012
AC.LCK= 000001   	F.SIZE  000032   	I.FTYP= 000006   	SC.MDL= 000200   	W.STD   000004
BITFNU= 000002   	F.STAT  000040   	I.FVER= 000010   	S.HDHD= 000056   	W.VBN   000006
EX.AC1= 000001   	F.STD   000004   	I.IOSB  000016   	S.IDHD= 000056   	W.WISZ  000007
EX.AC2= 000002   	F.UCHA  000020   	I.LGTH  000040   	S.MPHD= 000012   	$DDIV = ****** GX
EX.ADF= 000010   	F11PR$= 000000   	I.LNK   000000   	S.STBK= 000012   	$DMUL = ****** GX
EX.ENA= 000200   	HIFCN = 000030   	I.LUN   000012   	UC.CON= 000200   	$MUL  = ****** GX
EX.FCO= 000004   	H.CKSM= 000776   	I.PRI   000010   	UC.DLK= 000100   	$$    = 000067
E$$MSG= 000001   	H.FCHA= 000014   	I.PRM   000024   	VC.BMW= 000002   	.ALOBT= ****** GX
E$$TRP= 000001   	H.FLEV= 000006   	I.RTRV  000034   	VC.IFW= 000001   	.CKFRE= ****** GX
FCPLUN= 000001   	H.FNUM= 000002   	I.RVDT= 000014   	V.FCB   000006   	.DFEXT= 000005
FC.CEF= 020000   	H.FOWN= 000010   	I.RVNO= 000012   	V.FFNU  000055   	.DFPRO= 164000
FC.DIR= 040000   	H.FPRO= 000012   	I.RVTI= 000023   	V.FIEX  000025   	.IOPKT= ****** GX
FC.FCO= 010000   	H.FSEQ= 000004   	I.RWAD= 000024   	V.FMAX  000016   	.IOSTS= ****** GX
FC.WAC= 100000   	H.IDOF= 000000   	I.RWAT  000026   	V.FPRO  000030   	.PRFIL= 000004
FP.DEL= 000010   	H.MPOF= 000001   	I.RWCT= 000026   	V.FRBK  000034   	.RTPTF= 001401
FP.EXT= 000004   	H.PROG= 000010   	I.RWVB= 000032   	V.IBLB  000012   	.SMALC  000000RG
FP.RAT= 000001   	H.PROJ= 000011   	I.STD   000004   	V.IBSZ  000013   	.SMBUF= ****** GX
FP.RDV= 000001   	H.SCHA= 000015   	I.TISZ= 000006   	V.IFWI  000002   	.SMCNT= ****** GX
FP.WRV= 000002   	H.UCHA= 000014   	I.UIC   000022   	V.LABL  000040   	.SMCTL= ****** GX
F$$LVL= 000001   	H.UFAT= 000016   	LEV11M= 000401   	V.LGTH  000056   	.SMFLG= ****** GX
F.DREF  000042   	IDXFNU= 000001   	LOWFCN= 000011   	V.LRUC  000035   	.SMNXB= ****** GX
F.DRNM  000044   	ID$$$ = 000204   	MFDFNO= 000004   	V.SBCL  000021   	.SMRVB= ****** GX
F.FEXT  000002   	IE.DFU= ****** GX	MFDFSQ= 000004   	V.SBLB  000024   	.SMSCN= ****** GX
F.FNUM  000006   	I.ACTL  000035   	M$$HDR= 000001   	V.SBSZ  000022   	.SMUCB= ****** GX
F.FOWN  000014   	I.AST   000020   	M.CTSZ= 000006   	V.STAT  000054   	.SMVBN= ****** GX
F.FPRO  000016   	I.ATL   000006   	M.EFNU= 000002   	V.STD   000004   	.SM1AD= ****** GX
F.FSEQ  000010   	I.CRDT= 000031   	M.EFSQ= 000004   	V.TRCT  000000   	.SM1BT= ****** GX
F.FSQN  000013   	I.CRTI= 000040   	M.ERVN= 000001   	V.WISZ  000020   	.SM1MK= ****** GX
F.FVBN  000046   	I.DASZ= 000007   	M.ESQN= 000000   	WI.BPS= 100000   	.SM1VB= ****** GX
F.HDLB  000022   	I.DPB   000011   	M.LBSZ= 000007   	WI.DLK= 010000   	.SM2BT= ****** GX
F.LBN   000026   	I.EFN   000013   	M.MAX = 000011   	WI.EXT= 002000   	.SM2VB= ****** GX
F.LGTH  000052   	I.EXDT= 000046   	M.RTRV= 000012   	WI.LCK= 004000   	.SYUIC= 000010
F.LINK  000000   	I.EXTD  000030   	M.USE = 000010   	WI.RDV= 000400   	.UCBAD= ****** GX
F.NACS  000036   	I.FCN   000014   	QIOEFN= 000002   	WI.WRV= 001000   	.VBSIZ= 001000
F.NLCK  000037   	I.FIDP  000024   	R$$10F= 000001   	W.CTL   000000   	...GBL= 000000
F.NWAC  000040   	I.FNAM= 000000   	R$$11D= 000001   	W.FCB   000002   	...TPC= 000012
F.RVN   000012

. ABS.	000056	   000
      	000606	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2700 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:25
[40,10]SMALC,[40,20]SMALC/-SP=[40,30]RSXDC,F11PRE,SMALC
RSXDC	MACRO M1108  05-DEC-77 17:20  PAGE 3


      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.
SMCOM	D0201, STORAGE MAP COMM	MACRO M1108  05-DEC-77 17:20  PAGE 6


      1						.TITLE	SMCOM	D0201, STORAGE MAP COMMON DATA
						.IDENT	"D0201"
      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					;
					; VERSION D201, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  11 NOV 74  11:27
     23					; PETER H. LIPMAN	5-MAR-74
     24					;
     25					; IMPURE DATA REGION USED FOR EXTENDING AND DELETING BLOCKS
     26					;
     27					; ***DO NOT ALTER THE ORDER OF THE FOLLOWING LINES
     28					;
     29	000000				.SVLBN::.BLKW	2		; SAVED LOGICAL BLOCK NUMBER
     30	000004				.SM1BT::.BLKW	2		; NUMBER OF BITS DESIRED/FOUND, BLOCKS RETURNED
     31	000010				.SM1MK::.BLKW	1		; SAVED MASK WORD FOR START OF SEARCH
     32	000012				.SM1AD::.BLKW	1		; SAVED BIT WORD ADDRESS FOR START OF SEARCH
     33	000014				.SM1VB::.BLKW	1		; SAVED VIRTUAL BLOCK NO. FOR START OF SEARCH
     34	000016				.SM2VB::.BLKW	1		; SAVED VIRTUAL BLOCK NO. FOR LARGEST CHUNK FOUND
     35	000020				.SM2AD::.BLKW	1		; SAVED BIT WORD ADDRESS FOR LARGEST CHUNK FOUND
     36	000022				.SM2MK::.BLKW	1		; SAVED MASK WORD FOR LARGEST CHUNK FOUND
     37	000024				.SM2BT::.BLKW	2		; NO. OF BITS IN LARGEST CHUNK
     38					;
     39					; ***DO NOT ALTER THE ORDER OF THE PRECEEDING LINES
     40					;
     41
     42	000030				.SMEXT::.BLKB	1		; HIGH ORDER EXTEND SIZE
     43	000031				.SMCTL::.BLKB	1		; EXTEND CONTROL BYTE
     44						.BLKW	1		; LOW ORDER EXTEND SIZE
     45	000034				.SMCNT::.BLKW	1		; NO. OF BLOCKS OF STORAGE MAP NOT YET SCANNED
     46	000036				.USEPT::.BLKW	1		; POINTER TO M.USE IN MAP AREA OF FILE HEADER
     47	000040				.FREPT::.BLKW	1		; POINTER TO NEXT FREE RETRIEVAL POINTER
     48					;
     49					;
     50	000042					$END	SMCOM
     51					;
     52					;
     53		000001 				.END
SMCOM	D0201, STORAGE MAP COMM	MACRO M1108  05-DEC-77 17:20  PAGE 6-1
SYMBOL TABLE

AC.DLK= 000002   	F.NLCK  000037   	I.EXTD  000030   	M.MAX = 000011   	WI.BPS= 100000
AC.LCK= 000001   	F.NWAC  000040   	I.FCN   000014   	M.RTRV= 000012   	WI.DLK= 010000
BITFNU= 000002   	F.RVN   000012   	I.FIDP  000024   	M.USE = 000010   	WI.EXT= 002000
EX.AC1= 000001   	F.SCHA  000021   	I.FNAM= 000000   	QIOEFN= 000002   	WI.LCK= 004000
EX.AC2= 000002   	F.SIZE  000032   	I.FNBP  000036   	R$$10F= 000001   	WI.RDV= 000400
EX.ADF= 000010   	F.STAT  000040   	I.FTYP= 000006   	R$$11D= 000001   	WI.WRV= 001000
EX.ENA= 000200   	F.STD   000004   	I.FVER= 000010   	SC.BAD= 000100   	W.CTL   000000
EX.FCO= 000004   	F.UCHA  000020   	I.IOSB  000016   	SC.MDL= 000200   	W.FCB   000002
E$$MSG= 000001   	F11PR$= 000000   	I.LGTH  000040   	S.HDHD= 000056   	W.RTRV  000012
E$$TRP= 000001   	HIFCN = 000030   	I.LNK   000000   	S.IDHD= 000056   	W.STD   000004
FCPLUN= 000001   	H.CKSM= 000776   	I.LUN   000012   	S.MPHD= 000012   	W.VBN   000006
FC.CEF= 020000   	H.FCHA= 000014   	I.PRI   000010   	S.STBK= 000012   	W.WISZ  000007
FC.DIR= 040000   	H.FLEV= 000006   	I.PRM   000024   	UC.CON= 000200   	.DFEXT= 000005
FC.FCO= 010000   	H.FNUM= 000002   	I.RTRV  000034   	UC.DLK= 000100   	.DFPRO= 164000
FC.WAC= 100000   	H.FOWN= 000010   	I.RVDT= 000014   	VC.BMW= 000002   	.FREPT  000040RG
FP.DEL= 000010   	H.FPRO= 000012   	I.RVNO= 000012   	VC.IFW= 000001   	.PRFIL= 000004
FP.EXT= 000004   	H.FSEQ= 000004   	I.RVTI= 000023   	V.FCB   000006   	.RTPTF= 001401
FP.RAT= 000001   	H.IDOF= 000000   	I.RWAD= 000024   	V.FFNU  000055   	.SMCNT  000034RG
FP.RDV= 000001   	H.MPOF= 000001   	I.RWAT  000026   	V.FIEX  000025   	.SMCTL  000031RG
FP.WRV= 000002   	H.PROG= 000010   	I.RWCT= 000026   	V.FMAX  000016   	.SMEXT  000030RG
F$$LVL= 000001   	H.PROJ= 000011   	I.RWVB= 000032   	V.FPRO  000030   	.SM1AD  000012RG
F.DREF  000042   	H.SCHA= 000015   	I.STD   000004   	V.FRBK  000034   	.SM1BT  000004RG
F.DRNM  000044   	H.UCHA= 000014   	I.TISZ= 000006   	V.IBLB  000012   	.SM1MK  000010RG
F.FEXT  000002   	H.UFAT= 000016   	I.UIC   000022   	V.IBSZ  000013   	.SM1VB  000014RG
F.FNUM  000006   	IDXFNU= 000001   	LEV11M= 000401   	V.IFWI  000002   	.SM2AD  000020RG
F.FOWN  000014   	ID$$$ = 000201   	LOWFCN= 000011   	V.LABL  000040   	.SM2BT  000024RG
F.FPRO  000016   	I.ACTL  000035   	MFDFNO= 000004   	V.LGTH  000056   	.SM2MK  000022RG
F.FSEQ  000010   	I.AST   000020   	MFDFSQ= 000004   	V.LRUC  000035   	.SM2VB  000016RG
F.FSQN  000013   	I.ATL   000006   	M$$HDR= 000001   	V.SBCL  000021   	.SVLBN  000000RG
F.FVBN  000046   	I.CRDT= 000031   	M.CTSZ= 000006   	V.SBLB  000024   	.SYUIC= 000010
F.HDLB  000022   	I.CRTI= 000040   	M.EFNU= 000002   	V.SBSZ  000022   	.USEPT  000036RG
F.LBN   000026   	I.DASZ= 000007   	M.EFSQ= 000004   	V.STAT  000054   	.VBSIZ= 001000
F.LGTH  000052   	I.DPB   000011   	M.ERVN= 000001   	V.STD   000004   	...GBL= 000000
F.LINK  000000   	I.EFN   000013   	M.ESQN= 000000   	V.TRCT  000000   	...TPC= 000012
F.NACS  000036   	I.EXDT= 000046   	M.LBSZ= 000007   	V.WISZ  000020

. ABS.	000056	   000
      	000042	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2537 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:19
[40,10]SMCOM,[40,20]SMCOM/-SP=[40,30]RSXDC,F11PRE,SMCOM
RSXDC	MACRO M1108  05-DEC-77 17:20  PAGE 3


      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.
SMDEL	D0202, STORAGE MAP DELE	MACRO M1108  05-DEC-77 17:20  PAGE 6


      1						.TITLE	SMDEL	D0202, STORAGE MAP DELETE
						.IDENT	"D0202"
      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					;
					; VERSION D202, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  11 SEP 74  18:01:34
     23					; PETER H. LIPMAN	27-FEB-74
     24					;
     25					; RELEASE THE SPECIFIED RANGE OF BLOCKS TO THE STORAGE BIT MAP
     26
     27					;
     28					;
     29					;+
     30					; **-.SMDEL-STORAGE MAP DELETE
     31					;
     32					; THIS ROUTINE ACCEPTS A LOGICAL BLOCK NUMBER AND A BLOCK COUNT AND
     33					; FREES THE ASSOCIATED BITS IN THE STORAGE BIT MAP. THE ROUTINE RETURNS
     34					; IN LINE IF AND ONLY IF IT IS SUCCESSFUL.
     35					;
     36					; INPUTS:
     37					;
     38					; 	R1,R2=NUMBER OF BLOCKS
     39					; 	R4=VOLUME CONTROL BLOCK
     40					; 	R5=I/O PACKET
     41					; 	.SVLBN,.SVLBN+2=LOGICAL BLOCK NUMBER
     42					;
     43					; OUTPUTS:
     44					;
     45					; 	R0-R3 ALTERED R4,R5 PRESEVED
     46					; 	RETURNS IN LINE IF ONLY IF SUCCESSFUL
     47					;
     48					; EFFECTS:
     49					;
     50					; 	CONTENTS OF .SMBUF ALTERED, POSSIBLY NEW VBN READ.
     51					;
     52					;-
     53
     54	000000				.SMDEL::
SMDEL	D0202, STORAGE MAP DELE	MACRO M1108  05-DEC-77 17:20  PAGE 6-1


     55	000000	060264 	000036 			ADD	R2,V.FRBK+2(R4)	; ADD THE BLOCKS INTO THE FREE BLK CNT
     56	000004	005564 	000034 			ADC	V.FRBK(R4)
     57	000010	060164 	000034 			ADD	R1,V.FRBK(R4)
     58	000014	010546 				MOV	R5,-(SP)	; SAVE I/O PACKET ADDRESS
     59	000016	012705 	000002G			MOV	#.SM1BT+2,R5
     60	000022	005000 				CLR	R0
     61	000024	156400 	000021 			BISB	V.SBCL(R4),R0	; R0=CLUSTER FACTOR
     62	000030	010046 				MOV	R0,-(SP)
     63	000032					CALL	$DDIV		; FORM R1,R2=NO. OF BITS TO MARK FREE
     64	000036	010215 				MOV	R2,(R5)		; SAVE NO. OF BITS
     65	000040	010145 				MOV	R1,-(R5)
     66	000042	005700 				TST	R0		; REMAINDER MUST BE ZERO
     67	000044	001066 				BNE	20$		; BRANCH IF NOT EVENLY DIVIDED BY CLUSTER FACTOR
     68	000046	014502 				MOV	-(R5),R2	; SAVED LBN TO R1,R2
     69	000050	014501 				MOV	-(R5),R1
     70	000052	012600 				MOV	(SP)+,R0	; RECOVER SAVED CLUSTER FACTOR
     71	000054					CALL	$DDIV		; FORM R1,R2=BIT NUMBER
     72	000060	005700 				TST	R0		; THIS REMAINDER MUST ALSO BE ZERO
     73	000062	001057 				BNE	20$		; BRANCH IF NOT EVENLY DIVIDED BY CLUSTER FACTOR
     74	000064	012700 	010000 			MOV	#.VBSIZ*8.,R0	; NO. OF BITS IN A BLOCK
     75	000070					CALL	$DDIV		; FORM R2=BLOCK NUMBER STARTING AT 0
     76	000074	016467 	000022 	000000G		MOV	V.SBSZ(R4),.SMCNT ; SET MAX BIT MAP BLOCKS TO SCAN
     77	000102	160267 	000000G			SUB	R2,.SMCNT	; AND DON'T ALLOW WRAP AROUND TO BLOCK 1
     78	000106	005202 				INC	R2		 ; R2 = STORAGE MAP VBN (STARTING AT 1)
     79	000110	020264 	000022 			CMP	R2,V.SBSZ(R4)	; LEGAL STORAGE MAP BLOCK NUMBER?
     80	000114	101042 				BHI	20$		; BRANCH IF TOO BIG
     81	000116	012705 	000000G			MOV	#.SM1VB,R5	;
     82	000122	010215 				MOV	R2,(R5)		; SAVE DESIRED STORAGE MAP VBN
     88	000124	012701 	000020 			MOV	#16.,R1		; NO. OF BITS PER WORD
     89	000130					CALL	$DIV		; DIVIDE R0 BY R1, R1=BIT NUMBER IN WORD
     91	000134	006300 				ASL	R0		; R0=BYTE NO. IN BUFFER
     92	000136	062700 	000000G			ADD	#.SMBUF,R0	; FORM BYTE ADDRESS IN BUFFER
     93	000142	010045 				MOV	R0,-(R5)	; AND SAVE IT.
     98	000144	005000 				CLR	R0
     99	000146	000261 				SEC
    100	000150	006100 			10$:	ROL	R0		; USE A SHIFT LOOP TO FORM THE BIT MASK
    101	000152	005301 				DEC	R1
    102	000154	002375 				BGE	10$
    104	000156	010045 				MOV	R0,-(R5)	; SAVE MASK WORD
    105	000160	011605 				MOV	(SP),R5		; RESTORE I/O PACKET ADDRESS
    106	000162	016703 	000000G			MOV	.SM1VB,R3	; R3=DESIRED STORAGE MAP VBN
    107	000166					CALL	.SMRVB		; READ DESIRED STORAGE MAP VIRTUAL BLOCK
    108	000172	012705 	000000G			MOV	#.SM1BT,R5
    109	000176	012502 				MOV	(R5)+,R2	; R2,R3=COUNT OF BITS TO DELETE
    110	000200	012503 				MOV	(R5)+,R3	;
    111	000202	012500 				MOV	(R5)+,R0	; R0=MASK WORD
    112	000204	011501 				MOV	(R5),R1		; R1=WORD ADDRESS
    113	000206	012705 	000000G			MOV	#.DELBT,R5
    114	000212					CALL	.SMSCN
    115	000216	012605 				MOV	(SP)+,R5
    116	000220					RETURN
    117					;
    118					; BAD FILE HEADER, LBN OR SIZE OF RETRIEVAL POINTER IS NOT EVENLY DIVIDED
    119					; BY THE VOLUME CLUSTER FACTOR
    120					;
    121	000222				20$:	ERRX	IE.BHD,<BAD FILE HEADER>
	000222	   000C	   211 			TRAP	-IE.BHD		; BAD FILE HEADER
SMDEL	D0202, STORAGE MAP DELE	MACRO M1108  05-DEC-77 17:20  PAGE 6-2


    122					;
    123					;
    124	000224					$END	SMDEL
    125					;
    126					;
    127		000001 				.END
SMDEL	D0202, STORAGE MAP DELE	MACRO M1108  05-DEC-77 17:20  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.NLCK  000037   	I.EXDT= 000046   	M.ESQN= 000000   	V.STD   000004
AC.LCK= 000001   	F.NWAC  000040   	I.EXTD  000030   	M.LBSZ= 000007   	V.TRCT  000000
BITFNU= 000002   	F.RVN   000012   	I.FCN   000014   	M.MAX = 000011   	V.WISZ  000020
EX.AC1= 000001   	F.SCHA  000021   	I.FIDP  000024   	M.RTRV= 000012   	WI.BPS= 100000
EX.AC2= 000002   	F.SIZE  000032   	I.FNAM= 000000   	M.USE = 000010   	WI.DLK= 010000
EX.ADF= 000010   	F.STAT  000040   	I.FNBP  000036   	QIOEFN= 000002   	WI.EXT= 002000
EX.ENA= 000200   	F.STD   000004   	I.FTYP= 000006   	R$$10F= 000001   	WI.LCK= 004000
EX.FCO= 000004   	F.UCHA  000020   	I.FVER= 000010   	R$$11D= 000001   	WI.RDV= 000400
E$$MSG= 000001   	F11PR$= 000000   	I.IOSB  000016   	SC.BAD= 000100   	WI.WRV= 001000
E$$TRP= 000001   	HIFCN = 000030   	I.LGTH  000040   	SC.MDL= 000200   	W.CTL   000000
FCPLUN= 000001   	H.CKSM= 000776   	I.LNK   000000   	S.HDHD= 000056   	W.FCB   000002
FC.CEF= 020000   	H.FCHA= 000014   	I.LUN   000012   	S.IDHD= 000056   	W.RTRV  000012
FC.DIR= 040000   	H.FLEV= 000006   	I.PRI   000010   	S.MPHD= 000012   	W.STD   000004
FC.FCO= 010000   	H.FNUM= 000002   	I.PRM   000024   	S.STBK= 000012   	W.VBN   000006
FC.WAC= 100000   	H.FOWN= 000010   	I.RTRV  000034   	UC.CON= 000200   	W.WISZ  000007
FP.DEL= 000010   	H.FPRO= 000012   	I.RVDT= 000014   	UC.DLK= 000100   	$DDIV = ****** GX
FP.EXT= 000004   	H.FSEQ= 000004   	I.RVNO= 000012   	VC.BMW= 000002   	$DIV  = ****** GX
FP.RAT= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	VC.IFW= 000001   	$$    = 000067
FP.RDV= 000001   	H.MPOF= 000001   	I.RWAD= 000024   	V.FCB   000006   	.DELBT= ****** GX
FP.WRV= 000002   	H.PROG= 000010   	I.RWAT  000026   	V.FFNU  000055   	.DFEXT= 000005
F$$LVL= 000001   	H.PROJ= 000011   	I.RWCT= 000026   	V.FIEX  000025   	.DFPRO= 164000
F.DREF  000042   	H.SCHA= 000015   	I.RWVB= 000032   	V.FMAX  000016   	.PRFIL= 000004
F.DRNM  000044   	H.UCHA= 000014   	I.STD   000004   	V.FPRO  000030   	.RTPTF= 001401
F.FEXT  000002   	H.UFAT= 000016   	I.TISZ= 000006   	V.FRBK  000034   	.SMBUF= ****** GX
F.FNUM  000006   	IDXFNU= 000001   	I.UIC   000022   	V.IBLB  000012   	.SMCNT= ****** GX
F.FOWN  000014   	ID$$$ = 000202   	LEV11M= 000401   	V.IBSZ  000013   	.SMDEL  000000RG
F.FPRO  000016   	IE.BHD= ****** GX	LOWFCN= 000011   	V.IFWI  000002   	.SMRVB= ****** GX
F.FSEQ  000010   	I.ACTL  000035   	MFDFNO= 000004   	V.LABL  000040   	.SMSCN= ****** GX
F.FSQN  000013   	I.AST   000020   	MFDFSQ= 000004   	V.LGTH  000056   	.SM1BT= ****** GX
F.FVBN  000046   	I.ATL   000006   	M$$HDR= 000001   	V.LRUC  000035   	.SM1VB= ****** GX
F.HDLB  000022   	I.CRDT= 000031   	M.CTSZ= 000006   	V.SBCL  000021   	.SYUIC= 000010
F.LBN   000026   	I.CRTI= 000040   	M.EFNU= 000002   	V.SBLB  000024   	.VBSIZ= 001000
F.LGTH  000052   	I.DASZ= 000007   	M.EFSQ= 000004   	V.SBSZ  000022   	...GBL= 000000
F.LINK  000000   	I.DPB   000011   	M.ERVN= 000001   	V.STAT  000054   	...TPC= 000012
F.NACS  000036   	I.EFN   000013

. ABS.	000056	   000
      	000224	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2547 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:22
[40,10]SMDEL,[40,20]SMDEL/-SP=[40,30]RSXDC,F11PRE,SMDEL
RSXDC	MACRO M1108  05-DEC-77 17:21  PAGE 3


      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.
SMNXB	D0201, SET UP NEXT STOR	MACRO M1108  05-DEC-77 17:21  PAGE 6


      1						.TITLE	SMNXB	D0201, SET UP NEXT STORAGE MAP BIT
						.IDENT	"D0201"
      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					;
					; VERSION D201, ASSEMBLED FOR RSX-11D
					;
     21					; ANDREW C. GOLDSTEIN  25 OCT 74  12:42
     22					; PETER H. LIPMAN	27-FEB-74
     23					;
     24					; SET UP TO TEST NEXT BIT IN STORAGE BIT MAP
     25					;
     26						.MCALL	F11DF$
     27	000000					F11DF$			; DEFINE FCB,VCB,AND WINDOW OFFSETS
     28					;
     29					;+
     30					; **-.SMNXB-SET UP TO TEST NEXT STORAGE MAP BIT
     31					;
     32					; THIS ROUTINE ACCEPTS A MASK WORD AND ADDRESS IN THE CURRENT STORAGE
     33					; MAP BLOCK AND CALCULATES THE MASK AND ADDRESS FOR THE NEXT BIT, CROSSING
     34					; TO THE NEXT STORAGE MAP BLOCK IF NECESSARY. WHEN NECESSARY TO CROSS
     35					; TO ANOTHER STORAGE MAP BLOCK THE CURRENT ONE IS WRITTEN IF NECESSARY
     36					; AND THE NEXT ONE IS READ. A COUNT OF STORAGE MAP BLOCKS TO BE  SCANNED
     37					; MUST BE INITIALIZED BEFORE THIS ROUTINE IS CALLED. THIS
     38					; COUNT IS USED TO SEE IF THE NEXT BLOCK SHOULD BE READ. THE
     39					; NEXT BLOCK TO BE READ CORRECTLY WRAPS AROUND TO 1 IF THE NEXT BLOCK WOULD
     40					; BE BEYOND THE END.
     41					;
     42					; INPUTS:
     43					;
     44					;	R0=MASK WORD
     45					;	R1=ADDRESS IN BUFFER
     46					;	.SMVBN=CURRENT STORAGE MAP BLOCK NUMBER
     47					;	.SMCNT=NO. OF BLOCKS TO SCAN.
     48					;
     49					; OUTPUT:
     50					;
     51					;	C=1 IF NO MORE BITS (CHECKED ALL BLOCKS)
     52					;	C=0 IF NEXT BIT IS SET TO TEST AND
     53					;	R=0 MASK
     54					;	R1=ADDRESS
SMNXB	D0201, SET UP NEXT STOR	MACRO M1108  05-DEC-77 17:21  PAGE 6-1


     55					;	.SMVBN=UPDATED IF CROSSED TO NEW BLOCK
     56					;	.SMCNT DECREMENTED IF CROSSED TO NEW BLOCK
     57					;	R2-R5	PRESERVED
     58					;-
     59	000000				.SMNXB::
     60	000000	006300 				ASL	R0		; SHIFT THE MASK
     61	000002	103040 				BCC	20$		; BRANCH IF NOT LAST BIT
     62	000004	006100 				ROL	R0		; SET INITIAL MASK
     63	000006	005721 				TST	(R1)+		; AND NEXT WORD IN BUFFER
     64	000010	022701 	000776G			CMP	#.SMBUF+.VBSIZ-2,R1
     65	000014	103033 				BHIS	20$		; BRANCH IF NOT BEYOND END OF BUFFER, C=0
     66					;
     67					; READ NEXT VIRTUAL BLOCK OF STORAGE BIT MAP, C=1
     68					;
     69	000016	006000 				ROR	R0		; C WAS 1, R0 WAS 1, R0 =100000, C=1
     70	000020	014111 				MOV	-(R1),(R1)	; BACK UP CONTEXT TO LAST BIT LAST WORD
     71	000022	005367 	000000G			DEC	.SMCNT		; TRIED ALL THE BLOCKS
     72	000026	003426 				BLE	20$		; BRANCH IF YES, C=1
     73	000030	010546 				MOV	R5,-(SP)	; SAVE R5
     74	000032	016705 	000000G			MOV	.IOPKT,R5	; R5=I/O PACKET ADDRESS FOR .SMRVB
     75	000036	010346 				MOV	R3,-(SP)
     76	000040	010246 				MOV	R2,-(SP)
     77	000042	016703 	000000G			MOV	.SMVBN,R3
     78	000046	042703 	000000G			BIC	#.SMFLG,R3
     79	000052	005203 				INC	R3
     80	000054	026403 	000022 			CMP	V.SBSZ(R4),R3	; IF BEYOND LAST BLOCK
     81	000060	103002 				BHIS	10$
     82	000062	012703 	000001 			MOV	#1,R3		; THEN WRAP TO BLOCK 1
     83	000066				10$:	CALL	.SMRVB
     84	000072	012602 				MOV	(SP)+,R2
     85	000074	012603 				MOV	(SP)+,R3
     86	000076	012605 				MOV	(SP)+,R5	; RESTORE R5
     87					;
     88					; R1=BUFFER ADDRESS; R2,R3 RESTORED; R4,R5 PRESERVED
     89					;
     90	000100	005000 				CLR	R0		; CLEAR CARRY
     91	000102	005200 				INC	R0		; SET R0 TO 1
     92	000104				20$:	RETURN
     93					;
     94					;
     95	000106					$END
     96					;
     97					;
     98		000001 				.END
SMNXB	D0201, SET UP NEXT STOR	MACRO M1108  05-DEC-77 17:21  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.EFN   000013   	M.ERVN= 000001   	V.SBSZ  000022
AC.LCK= 000001   	F.NLCK  000037   	I.EXDT= 000046   	M.ESQN= 000000   	V.STAT  000054
BITFNU= 000002   	F.NWAC  000040   	I.EXTD  000030   	M.LBSZ= 000007   	V.STD   000004
EX.AC1= 000001   	F.RVN   000012   	I.FCN   000014   	M.MAX = 000011   	V.TRCT  000000
EX.AC2= 000002   	F.SCHA  000021   	I.FIDP  000024   	M.RTRV= 000012   	V.WISZ  000020
EX.ADF= 000010   	F.SIZE  000032   	I.FNAM= 000000   	M.USE = 000010   	WI.BPS= 100000
EX.ENA= 000200   	F.STAT  000040   	I.FNBP  000036   	QIOEFN= 000002   	WI.DLK= 010000
EX.FCO= 000004   	F.STD   000004   	I.FTYP= 000006   	R$$10F= 000001   	WI.EXT= 002000
E$$MSG= 000001   	F.UCHA  000020   	I.FVER= 000010   	R$$11D= 000001   	WI.LCK= 004000
E$$TRP= 000001   	F11PR$= 000000   	I.IOSB  000016   	SC.BAD= 000100   	WI.RDV= 000400
FCPLUN= 000001   	HIFCN = 000030   	I.LGTH  000040   	SC.MDL= 000200   	WI.WRV= 001000
FC.CEF= 020000   	H.CKSM= 000776   	I.LNK   000000   	S.HDHD= 000056   	W.CTL   000000
FC.DIR= 040000   	H.FCHA= 000014   	I.LUN   000012   	S.IDHD= 000056   	W.FCB   000002
FC.FCO= 010000   	H.FLEV= 000006   	I.PRI   000010   	S.MPHD= 000012   	W.RTRV  000012
FC.WAC= 100000   	H.FNUM= 000002   	I.PRM   000024   	S.STBK= 000012   	W.STD   000004
FP.DEL= 000010   	H.FOWN= 000010   	I.RTRV  000034   	UC.CON= 000200   	W.VBN   000006
FP.EXT= 000004   	H.FPRO= 000012   	I.RVDT= 000014   	UC.DLK= 000100   	W.WISZ  000007
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVNO= 000012   	VC.BMW= 000002   	$$    = 000067
FP.RDV= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	VC.IFW= 000001   	.DFEXT= 000005
FP.WRV= 000002   	H.MPOF= 000001   	I.RWAD= 000024   	V.FCB   000006   	.DFPRO= 164000
F$$LVL= 000001   	H.PROG= 000010   	I.RWAT  000026   	V.FFNU  000055   	.IOPKT= ****** GX
F.DREF  000042   	H.PROJ= 000011   	I.RWCT= 000026   	V.FIEX  000025   	.PRFIL= 000004
F.DRNM  000044   	H.SCHA= 000015   	I.RWVB= 000032   	V.FMAX  000016   	.RTPTF= 001401
F.FEXT  000002   	H.UCHA= 000014   	I.STD   000004   	V.FPRO  000030   	.SMBUF= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.TISZ= 000006   	V.FRBK  000034   	.SMCNT= ****** GX
F.FOWN  000014   	IDXFNU= 000001   	I.UIC   000022   	V.IBLB  000012   	.SMFLG= ****** GX
F.FPRO  000016   	ID$$$ = 000201   	LEV11M= 000401   	V.IBSZ  000013   	.SMNXB  000000RG
F.FSEQ  000010   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002   	.SMRVB= ****** GX
F.FSQN  000013   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040   	.SMVBN= ****** GX
F.FVBN  000046   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056   	.SYUIC= 000010
F.HDLB  000022   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035   	.VBSIZ= 001000
F.LBN   000026   	I.CRTI= 000040   	M.CTSZ= 000006   	V.SBCL  000021   	...GBL= 000000
F.LGTH  000052   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBLB  000024   	...TPC= 000012
F.LINK  000000   	I.DPB   000011   	M.EFSQ= 000004

. ABS.	000056	   000
      	000106	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2522 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:20
[40,10]SMNXB,[40,20]SMNXB/-SP=[40,30]RSXDC,F11PRE,SMNXB
RSXDC	MACRO M1108  05-DEC-77 17:21  PAGE 3


      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.
SMRVB	D0202, READ STORAGE MAP	MACRO M1108  05-DEC-77 17:21  PAGE 6


      1						.TITLE	SMRVB	D0202, READ STORAGE MAP BLOCK
						.IDENT	"D0202"
      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					;
					; VERSION D202, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  25 FEB 75  20:18
     23					; PETER H. LIPMAN	27-FEB-74
     24					;
     25					; WRITE, IF NECESSARY, AND READ A STORAGE MAP VIRTUAL BLOCK
     26					;
     27					;+
     28					; **-.SMRVB-READ STORAGE MAP VIRTUAL BLOCK
     29					;
     30					; THIS ROUTINE FIRST CHECKS TO SEE IF THE DESIRED BLOCK IS ALREADY IN CORE.
     31					; IF NOT IT WRITES THE BLOCK THAT IS IN CORE IF NECESSARY AND READS THE
     32					; DESIRED BLOCK IN.
     33					;
     34					; INPUTS:
     35					;
     36					; 	R3=BLOCK NUMBER OF STORAGE MAP STARTING AT 1 OR 0 IF JUST
     37					; 	   FORCING THE WRITE OF THE CURRENT BLOCK (IF DIRTY).
     38					; 	R4=UCB ADDRESS
     39					; 	R5=I/O PACKET ADDRESS
     40					;
     41					; OUTPUT:
     42					;
     43					; 	R1=BUFFER ADDRESS OF STORAGE MAP BLOCK
     44					; 	R2,R3 ALTERED
     45					; 	R4,R5 PRESERVED
     46					;-
     47
     48	000000	042703 	000000G		.SMRVB::BIC	#.SMFLG,R3	; CLEAR OUT FLAG BITS
     49	000004	010346 				MOV	R3,-(SP)	; SAVE DESIRED BLOCK NUMBER
     50	000006	012701 	000000G			MOV	#.SMUCB,R1	; IS CURRENT STORAGE MAP BLOCK
     51	000012	026721 	000000G			CMP	.UCBAD,(R1)+	; ON THIS DEVICE?
     52	000016	001407 				BEQ	20$		; BRANCH IF YES
     53	000020	005711 				TST	(R1)		; DID WE FORGET TO WRITE A BLOCK?
     54	000022	002001 				BGE	10$		; BRANCH IF NO.
SMRVB	D0202, READ STORAGE MAP	MACRO M1108  05-DEC-77 17:21  PAGE 6-1


     55	000024					FATAL	<BITMAP ON WRONG UCB NEEEDED TO BE WRITTEN>
	000024	000004 				IOT			; *** FATAL ERROR BITMAP ON WRONG UCB NEEEDED TO BE WRITTEN
     56
     57	000026	016761 	000000G	177776 	10$:	MOV	.UCBAD,-2(R1)	; FORCE CURRENT DEVICE
     58	000034	005011 				CLR	(R1)		; SAY BUFFER EMPTY
     59	000036	011103 			20$:	MOV	(R1),R3		;
     60	000040	042703 	000000G			BIC	#.SMFLG,R3
     61	000044	020316 				CMP	R3,(SP)
     62	000046	001004 				BNE	30$		; NOT THE SAME BLOCK - READ IT
     63	000050	132764 	000002 	000054 		BITB	#VC.BMW,V.STAT(R4) ; IS THE BITMAP WRITE ACCESSED?
     64	000056	001420 				BEQ	50$		; IF NOT, CAN USE BLOCK CURRENTLY IN CORE
     65					;
     66					; NEED TO WRITE THIS BUFFER?, R3=VBN TO WRITE
     67					;
     68	000060	005711 			30$:	TST	(R1)		; NEGATIVE IF BUFFER IS DIRTY
     69	000062	002006 				BGE	40$
     70	000064	010321 				MOV	R3,(R1)+	; R3=BLOCK TO WRITE RESET DIRTY BIT
     71	000066					CALL	CSMLB		; FORM LBN
     72	000072					CALL	.WR1LB		; AND WIRTE IT
     73	000076	005741 				TST	-(R1)		; POINT BACK AT CURRENT BLOCK NO.
     74	000100	011603 			40$:	MOV	(SP),R3		; DESIRED VBN=0?
     75	000102	001406 				BEQ	50$		; BRANCH IF YES, LEAVE CURRENT BLOCK IN
     76	000104	005021 				CLR	(R1)+		; SAY BUFFER EMPTY, POINT R1 TO BUF ADR
     77	000106					CALL	CSMLB		; FROM LBN TO READ
     78	000112					CALL	.RD1LB		; AND READ IT
     79	000116	011641 				MOV	(SP),-(R1)	; STORE NEW BLOCK NO. AS CURRENT ONE
     80	000120	022621 			50$:	CMP	(SP)+,(R1)+	; POINT R1 AT BUFFER, POP STACK
     81	000122					RETURN
     82					;
     83					; CALCULATE STORAGE MAP LOGICAL BLOCK NUMBER IN R2,R3
     84					; R3=VIRTUAL BLOCK NO. STARTING AT 1
     85					;
     86	000124				CSMLB:
     87	000124	020364 	000022 			CMP	R3,V.SBSZ(R4)	; LEGAL STORAGE MAP BLOCK NUMBER?
     88	000130	101007 				BHI	60$		; BRANCH IF NO, TOO BIG
     89	000132	005002 				CLR	R2
     90	000134	156402 	000024 			BISB	V.SBLB(R4),R2 ; ADD STORAGE MAP LBN TO VBN
     91	000140	066403 	000026 			ADD	V.SBLB+2(R4),R3
     92	000144	005502 				ADC	R2
     93	000146					RETURN
     94
     95	000150				60$:	FATAL	<ILLEGAL STORAGE MAP BLOCK NO.>
	000150	000004 				IOT			; *** FATAL ERROR ILLEGAL STORAGE MAP BLOCK NO.
     96					;
     97					;
     98	000152					$END	SMRVB
     99					;
    100					;
    101		000001 				.END
SMRVB	D0202, READ STORAGE MAP	MACRO M1108  05-DEC-77 17:21  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.DPB   000011   	M.EFSQ= 000004   	V.SBLB  000024
AC.LCK= 000001   	F.NACS  000036   	I.EFN   000013   	M.ERVN= 000001   	V.SBSZ  000022
BITFNU= 000002   	F.NLCK  000037   	I.EXDT= 000046   	M.ESQN= 000000   	V.STAT  000054
CSMLB   000124R  	F.NWAC  000040   	I.EXTD  000030   	M.LBSZ= 000007   	V.STD   000004
EX.AC1= 000001   	F.RVN   000012   	I.FCN   000014   	M.MAX = 000011   	V.TRCT  000000
EX.AC2= 000002   	F.SCHA  000021   	I.FIDP  000024   	M.RTRV= 000012   	V.WISZ  000020
EX.ADF= 000010   	F.SIZE  000032   	I.FNAM= 000000   	M.USE = 000010   	WI.BPS= 100000
EX.ENA= 000200   	F.STAT  000040   	I.FNBP  000036   	QIOEFN= 000002   	WI.DLK= 010000
EX.FCO= 000004   	F.STD   000004   	I.FTYP= 000006   	R$$10F= 000001   	WI.EXT= 002000
E$$MSG= 000001   	F.UCHA  000020   	I.FVER= 000010   	R$$11D= 000001   	WI.LCK= 004000
E$$TRP= 000001   	F11PR$= 000000   	I.IOSB  000016   	SC.BAD= 000100   	WI.RDV= 000400
FCPLUN= 000001   	HIFCN = 000030   	I.LGTH  000040   	SC.MDL= 000200   	WI.WRV= 001000
FC.CEF= 020000   	H.CKSM= 000776   	I.LNK   000000   	S.HDHD= 000056   	W.CTL   000000
FC.DIR= 040000   	H.FCHA= 000014   	I.LUN   000012   	S.IDHD= 000056   	W.FCB   000002
FC.FCO= 010000   	H.FLEV= 000006   	I.PRI   000010   	S.MPHD= 000012   	W.RTRV  000012
FC.WAC= 100000   	H.FNUM= 000002   	I.PRM   000024   	S.STBK= 000012   	W.STD   000004
FP.DEL= 000010   	H.FOWN= 000010   	I.RTRV  000034   	UC.CON= 000200   	W.VBN   000006
FP.EXT= 000004   	H.FPRO= 000012   	I.RVDT= 000014   	UC.DLK= 000100   	W.WISZ  000007
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVNO= 000012   	VC.BMW= 000002   	$$    = 000067
FP.RDV= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	VC.IFW= 000001   	.DFEXT= 000005
FP.WRV= 000002   	H.MPOF= 000001   	I.RWAD= 000024   	V.FCB   000006   	.DFPRO= 164000
F$$LVL= 000001   	H.PROG= 000010   	I.RWAT  000026   	V.FFNU  000055   	.PRFIL= 000004
F.DREF  000042   	H.PROJ= 000011   	I.RWCT= 000026   	V.FIEX  000025   	.RD1LB= ****** GX
F.DRNM  000044   	H.SCHA= 000015   	I.RWVB= 000032   	V.FMAX  000016   	.RTPTF= 001401
F.FEXT  000002   	H.UCHA= 000014   	I.STD   000004   	V.FPRO  000030   	.SMFLG= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.TISZ= 000006   	V.FRBK  000034   	.SMRVB  000000RG
F.FOWN  000014   	IDXFNU= 000001   	I.UIC   000022   	V.IBLB  000012   	.SMUCB= ****** GX
F.FPRO  000016   	ID$$$ = 000202   	LEV11M= 000401   	V.IBSZ  000013   	.SYUIC= 000010
F.FSEQ  000010   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002   	.UCBAD= ****** GX
F.FSQN  000013   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040   	.VBSIZ= 001000
F.FVBN  000046   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056   	.WR1LB= ****** GX
F.HDLB  000022   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035   	...GBL= 000000
F.LBN   000026   	I.CRTI= 000040   	M.CTSZ= 000006   	V.SBCL  000021   	...TPC= 000012
F.LGTH  000052   	I.DASZ= 000007   	M.EFNU= 000002

. ABS.	000056	   000
      	000152	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2537 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:21
[40,10]SMRVB,[40,20]SMRVB/-SP=[40,30]RSXDC,F11PRE,SMRVB
RSXDC	MACRO M1108  05-DEC-77 17:21  PAGE 3


      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.
SMSCN	D0201, STORAGE MAP SCAN	MACRO M1108  05-DEC-77 17:21  PAGE 6


      1						.TITLE	SMSCN	D0201, STORAGE MAP SCAN
						.IDENT	"D0201"
      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					;
					; VERSION D201, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  10 SEP 74  18:55:10
     23					; PETER H. LIPMAN	27-FEB-74
     24					;
     25					; SCAN AND OPERATE ON THE STORAGE BIT MAP
     26
     27					;
     28					;+
     29					;
     30					; **-.SMSCN-SCAN AND OPERATE ON STORAGE MAP
     31					;
     32					; THIS ROUTINE ACCEPTS A BIT COUNT AND A STARTING BIT ADDRESS, AND
     33					; THE ADDRESS OF A ROUTINE TO CALL. STARTING WITH THE SPECIFIED BIT,
     34					; THE ROUTINE IS CALLED ITERATIVELY WITH THE ADDRESS AND VALUE OF EACH
     35					; BIT UNTIL:
     36					; 	1) THE BIT COUNT GOES TO ZERO, I.E. THE SCAN SUCCEEDED
     37					; 	2) C=1 IS RETURNED BY THE SPECIFIED ROUTINE I.E. THE SCAN FAILED
     38					;
     39					; INPUTS:
     40					;
     41					; 	R0=BIT MASK STARTING BIT
     42					; 	R1=BIT WORD ADDRESS OF STARTING BIT
     43					; 	R2,R3=COUNT OF BITS TO OPERATE ON
     44					; 	R4=VOLUME CONTROL BLOCK ADDRESS
     45					; 	R5=ADDRESS OF ROUTINE TO CALL
     46					; 	   CALLING AND RETURN CONVENTIONS DOCUMENTED BELOW
     47					; 	.SMVBN CONTAINS CURRENT STORAGE MAP VBN IN .SMBUF
     48					; 	.IOPKT CONTAINS I/O PACKET ADDRESS
     49					;
     50					; OUTPUTS:
     51					;
     52					; 	C=0 IF DESIRED NO. OF BITS SUCCESSFULLY OPERATED ON
     53					; 	C=1 IF COUNT NOT EXHAUSTED
     54					; 	R0=BIT MASK OF LAST BIT OPERATED ON
SMSCN	D0201, STORAGE MAP SCAN	MACRO M1108  05-DEC-77 17:21  PAGE 6-1


     55					; 	R1=BIT WORD ADDRESS OF LAST BIT OPERATED ON
     56					; 	R2,R3=REMAINING BIT COUNT
     57					; 	R4,R5 PRESERVED
     58					;
     59					;-
     60
     61	000000	000241 			.SMSCN::CLC
     62	000002	030011 			10$:	BIT	R0,(R1)
     63	000004					CALL	(R5)		; C=0 AND Z=0 IF BIT OFF, Z=1 IF BIT ON
     64	000006	103411 				BCS	20$
     65	000010	162703 	000001 			SUB	#1,R3		; COUNT THIS OPERATION
     66	000014	005602 				SBC	R2		; AND CLEAR CARRY
     67	000016	010346 				MOV	R3,-(SP)	; ANY MORE BITS TO TEST
     68	000020	050226 				BIS	R2,(SP)+
     69	000022	001403 				BEQ	20$		; BRANCH IF DONE
     70	000024					CALL	.SMNXB		; SET UP NEXT BIT
     71	000030	103364 				BCC	10$		; BRANCH IF ANOTHER BIT IS AVAILABLE
     72	000032				20$:	RETURN
     73					;+
     74					;
     75					; THE FOLLOWING ROUTINES OPERATE ON A BIT IN THE STORAGE MAP AND OBEY
     76					; THE FOLLOWING INPUT AND OUTPUT CONVENTIONS.
     77					;
     78					; INPUTS:
     79					;
     80					; 	C=0
     81					; 	Z=0 IF BIT IS CLEAR
     82					; 	Z=1 IF BIT IS SET
     83					; 	R0=BIT MASK WORD OF BIT TO OPERATE ON
     84					; 	R1=BIT WORD ADDRESS OF BIT TO OPERATE ON
     85					;
     86					; OUTPUTS:
     87					;
     88					; 	C=0 IF OPERATION IS SUCCESSFUL
     89					; 	C=1 IF OPERATION FAILED
     90					; 	IF BIT IS ALTERED, THEN "DIRTY BIT" IN .SMVBN
     91					; 		(SIGN BIT) MUST BE SET
     92					;-
     93					;
     94					; CHECK IF BIT IS AVAILABLE, C=1 IF NOT
     95					;
     96	000034				.CKFRE::
     97	000034	001001 				BNE	10$		; BRANCH IF BIT IS AVAILABLE
     98	000036	000261 				SEC
     99	000040				10$:	RETURN
    100					;
    101					; ALLOCATE (CLEAR) SPECIFIED BIT
    102					;
    103	000042				.ALOBT::
    104	000042	001405 				BEQ	10$		; BRANCH IF BIT ALREADY ALLOCATED
    105	000044	040011 				BIC	R0,(R1)		; ALLOCATE IT
    106	000046	052767 	100000 	000000G		BIS	#100000,.SMVBN	; SET DIRTY BIT FOR THIS BLOCK
    107	000054					RETURN
    108
    109	000056				10$:	FATAL <BIT IN USE BUT SHOULD HAVE BEEN FREE>
	000056	000004 				IOT			; *** FATAL ERROR BIT IN USE BUT SHOULD HAVE BEEN FREE
    110					;
SMSCN	D0201, STORAGE MAP SCAN	MACRO M1108  05-DEC-77 17:21  PAGE 6-2


    111					; DEALLOCATE (SET) SPECIFIED BIT
    112					;
    113	000060				.DELBT::
    114	000060	001005 				BNE	10$		; BRANCH IF BIT ALREADY FREE
    115	000062	050011 				BIS	R0,(R1)		; FREE IT
    116	000064	052767 	100000 	000000G		BIS	#100000,.SMVBN	; SET DIRTY BIT FOR THIS BLOCK
    117	000072					RETURN
    118
    119	000074				10$:	ERRX	IE.BHD,<TRIED TO FREE A FREE BLOCK>
	000074	   000C	   211 			TRAP	-IE.BHD		; TRIED TO FREE A FREE BLOCK
    120					;
    121					;
    122	000076					$END	SMSCN
    123					;
    124					;
    125		000001 				.END
SMSCN	D0201, STORAGE MAP SCAN	MACRO M1108  05-DEC-77 17:21  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.DPB   000011   	M.EFSQ= 000004   	V.SBLB  000024
AC.LCK= 000001   	F.NLCK  000037   	I.EFN   000013   	M.ERVN= 000001   	V.SBSZ  000022
BITFNU= 000002   	F.NWAC  000040   	I.EXDT= 000046   	M.ESQN= 000000   	V.STAT  000054
EX.AC1= 000001   	F.RVN   000012   	I.EXTD  000030   	M.LBSZ= 000007   	V.STD   000004
EX.AC2= 000002   	F.SCHA  000021   	I.FCN   000014   	M.MAX = 000011   	V.TRCT  000000
EX.ADF= 000010   	F.SIZE  000032   	I.FIDP  000024   	M.RTRV= 000012   	V.WISZ  000020
EX.ENA= 000200   	F.STAT  000040   	I.FNAM= 000000   	M.USE = 000010   	WI.BPS= 100000
EX.FCO= 000004   	F.STD   000004   	I.FNBP  000036   	QIOEFN= 000002   	WI.DLK= 010000
E$$MSG= 000001   	F.UCHA  000020   	I.FTYP= 000006   	R$$10F= 000001   	WI.EXT= 002000
E$$TRP= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$11D= 000001   	WI.LCK= 004000
FCPLUN= 000001   	HIFCN = 000030   	I.IOSB  000016   	SC.BAD= 000100   	WI.RDV= 000400
FC.CEF= 020000   	H.CKSM= 000776   	I.LGTH  000040   	SC.MDL= 000200   	WI.WRV= 001000
FC.DIR= 040000   	H.FCHA= 000014   	I.LNK   000000   	S.HDHD= 000056   	W.CTL   000000
FC.FCO= 010000   	H.FLEV= 000006   	I.LUN   000012   	S.IDHD= 000056   	W.FCB   000002
FC.WAC= 100000   	H.FNUM= 000002   	I.PRI   000010   	S.MPHD= 000012   	W.RTRV  000012
FP.DEL= 000010   	H.FOWN= 000010   	I.PRM   000024   	S.STBK= 000012   	W.STD   000004
FP.EXT= 000004   	H.FPRO= 000012   	I.RTRV  000034   	UC.CON= 000200   	W.VBN   000006
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	UC.DLK= 000100   	W.WISZ  000007
FP.RDV= 000001   	H.IDOF= 000000   	I.RVNO= 000012   	VC.BMW= 000002   	$$    = 000067
FP.WRV= 000002   	H.MPOF= 000001   	I.RVTI= 000023   	VC.IFW= 000001   	.ALOBT  000042RG
F$$LVL= 000001   	H.PROG= 000010   	I.RWAD= 000024   	V.FCB   000006   	.CKFRE  000034RG
F.DREF  000042   	H.PROJ= 000011   	I.RWAT  000026   	V.FFNU  000055   	.DELBT  000060RG
F.DRNM  000044   	H.SCHA= 000015   	I.RWCT= 000026   	V.FIEX  000025   	.DFEXT= 000005
F.FEXT  000002   	H.UCHA= 000014   	I.RWVB= 000032   	V.FMAX  000016   	.DFPRO= 164000
F.FNUM  000006   	H.UFAT= 000016   	I.STD   000004   	V.FPRO  000030   	.PRFIL= 000004
F.FOWN  000014   	IDXFNU= 000001   	I.TISZ= 000006   	V.FRBK  000034   	.RTPTF= 001401
F.FPRO  000016   	ID$$$ = 000201   	I.UIC   000022   	V.IBLB  000012   	.SMNXB= ****** GX
F.FSEQ  000010   	IE.BHD= ****** GX	LEV11M= 000401   	V.IBSZ  000013   	.SMSCN  000000RG
F.FSQN  000013   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002   	.SMVBN= ****** GX
F.FVBN  000046   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040   	.SYUIC= 000010
F.HDLB  000022   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056   	.VBSIZ= 001000
F.LBN   000026   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035   	...GBL= 000000
F.LGTH  000052   	I.CRTI= 000040   	M.CTSZ= 000006   	V.SBCL  000021   	...TPC= 000012
F.LINK  000000   	I.DASZ= 000007   	M.EFNU= 000002

. ABS.	000056	   000
      	000076	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2542 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:20
[40,10]SMSCN,[40,20]SMSCN/-SP=[40,30]RSXDC,F11PRE,SMSCN
.TPARS - TABLE DRIVEN FINITE ST	MACRO M1108  05-DEC-77 17:22
TABLE OF CONTENTS

    6-   5	TITLE PAGE
    7-  29	MACRO DEFINITIONS
    7-  64	IMPURE DATA
    8-  80	MAIN ROUTINE BODY
    9- 202	COMPLEX TYPE ROUTINES
   10- 281	GET STRING ROUTINE
RSXDC	MACRO M1108  05-DEC-77 17:22  PAGE 3


      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.
.TPARS - TABLE DRIVEN FINITE ST	MACRO M1108  05-DEC-77 17:22  PAGE 6


      1					.TITLE	.TPARS - TABLE DRIVEN FINITE STATE PARSER
      2
      3					.IDENT	"V0112"
      4
      5					.SBTTL	TITLE PAGE
      6
      7					;                             COPYRIGHT (C) 1975, 1978 BY
      8					;                     DIGITAL EQUIPMENT CORPORATION, MAYNARD MASS.
      9					;
     10					;       THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE  USED  AND  COPIED
     11					;       ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
     12					;       OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY OTHER COPIES THERE-
     13					;       OF  MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.
     14					;       NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
     15					;
     16					;       THE INFORMATION CONTAINED IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT
     17					;       NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
     18					;       CORPORATION.
     19					;
     20					;       DIGITAL ASSUMES NO RESPONSIBILITY FOR THE  USE  OR  RELIABILITY  OF  ITS
     21					;       SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPILED BY DIGITAL.
     22					;
     23					;
     24					; ANDREW C. GOLDSTEIN  5 MAR 75  20:51
     25
     26
     27		000000 				R$$EIS = 0		; USE EIS
.TPARS - TABLE DRIVEN FINITE ST	MACRO M1108  05-DEC-77 17:22  PAGE 7
MACRO DEFINITIONS

     29					.SBTTL	MACRO DEFINITIONS
     30
     31						.MCALL	CALL,RETURN
     32
     33					; INTERNAL MACROS
     34
     35					.MACRO	PUSH	LIST
     36						.IRP	RX,<LIST>
     37						MOV	RX,-(SP)
     38						.ENDM
     39					.ENDM	PUSH
     40
     41					.MACRO	POP	LIST
     42						.IRP	RX,<LIST>
     43						MOV	(SP)+,RX
     44						.ENDM
     45					.ENDM	POP
     46
     47					; MACRO TO DO SOB'S ON SMALL MACHINES
     48
     55
     56					; RANDOM CHARACTERS
     57
     58		000011 			TAB=	11
     59		000015 			CR=	15
     60		000033 			AM=	33
     61		000040 			SPA=	40
     62
     63
     64					.SBTTL	IMPURE DATA
     65
     66	000000					.PSECT	IMPURE,D
     67
     68					; ITEMS OF INTEREST TO ACTION ROUTINES AND THE OUTSIDE WORLD
     69					; IN GENERAL.
     70
     71	000000				.PSTCN::.BLKW	1		; CHARACTER COUNT OF FOUND STRING
     72	000002				.PSTPT::.BLKW	1		; POINTER TO FOUND STRING
     73
     74	000004				.PNUMH::.BLKW	1		; HIGH ORDER VALUE AND ....
     75	000006				.PNUMB::.BLKW	1		; LOW ORDER VALUE OF FOUND NUMBER
     76	000010				.PCHAR::.BLKW	1		; FOUND CHARACTER
     77
     78	000000					.PSECT
.TPARS - TABLE DRIVEN FINITE ST	MACRO M1108  05-DEC-77 17:22  PAGE 8
MAIN ROUTINE BODY

     80					.SBTTL	MAIN ROUTINE BODY
     81
     82					;+
     83					;
     84					; *** - .TPARS
     85					;
     86					; ENTRY:	CALL	.TPARS
     87					;
     88					; INPUTS:
     89					;
     90					;	R1 = 0	IGNORE ALL SPACES BETWEEN SYNTACTIC ELEMENTS
     91					;	  >< 0	TREAT SPACES AS SIGNIFICANT CHARACTERS
     92					;	R2 =	POINTER TO KEYWORD TABLE
     93					;	R3 =	LENGTH OF COMMAND STRING
     94					;	R4 =	ADDRESS OF COMMAND STRING
     95					;	R5 =	INITIAL STATE POINTER
     96					;
     97					; OUTPUTS:
     98					;
     99					;	C = 0	SUCCESSFUL PARSE
    100					;	C = 1	SYNTAX OR STATE TABLE ERROR
    101					;	R3 =	NUMBER OF CHARACTERS NOT SCANNED
    102					;	R4 =	POINTER TO UNSCANNED PART OF COMMAND STRING
    103					;
    104					;	ALL OTHER REGISTERS ARE PRESERVED.
    105					;
    106					; .TPARS PARSES THE COMMAND STRING ACCORDING TO THE FINITE
    107					; STATE MACHINE REPRESENTED IN THE STATE AND KEYWORD TABLES
    108					; SUPPLIED BY THE CALLER. USER SUPPLIED ACTION ROUTINES ARE
    109					; CALLED AS SPECIFIED.
    110					;
    111					;-
    112
    113
    114	000000				.TPARS::
    116
    117					; ENTER THE STATE SPECIFIED IN R5 AND
    118					; EVALUATE POSSIBLE STATE TRANSITIONS
    119
    120	000010	005067 	000000'		TSTAT:	CLR	.PSTCN		; KILL ANY OLD STRING
    121	000014	005716 				TST	(SP)		; CHECK SPACE FLUSH FLAG
    122	000016	001002 				BNE	10$
    124	000024	112500 			10$:	MOVB	(R5)+,R0	; GET TYPE BYTE
    125	000026	002044 				BGE	TSCHAR		; BIT 7 = 0 - MATCH SPECIFIED CHAR
    126	000030	120027 	000300 			CMPB	R0,#300
    127	000034	002573 				BLT	DOKEY		; 200 - 277 - MATCH KEYWORD
    128	000036	120027 	000320 			CMPB	R0,#MAXTYP	; CHECK TYPE CODE FOR LEGALITY
    129	000042	003034 				BGT	SYNERR		; TOO HIGH - OUT
    130	000044	010701 				MOV	PC,R1		; GARBAGE R1 FOR USE AS A FLAG
    131	000046	042700 	177700 			BIC	#^C77,R0	; RETAIN ONLY THE TYPE INDEX
    132	000052	060007 				ADD	R0,PC		; AND DISPATCH ON IT
    133	000054	000440 				BR	DOLAMB		; $LAMDA = 300 - MATCH EMPTY
    134	000056	000510 				BR	DONUMB		; $NUMBR = 302 - MATCH NUMBER
    135	000060	000503 				BR	DOSTRG		; $STRNG = 304 - MATCH ANY STRING
    136	000062	000553 				BR	DOBLNK		; $BLANK = 306 - MATCH ANY SET OF BLANKS
    137	000064	000455 				BR	DOSUBR		; $SUBXP = 310 - MATCH A SUBEXPRESSION
    138	000066	000403 				BR	DOENDS		; $EOS   = 312 - MATCH END OF STRING
.TPARS - TABLE DRIVEN FINITE ST	MACRO M1108  05-DEC-77 17:22  PAGE 8-1
MAIN ROUTINE BODY

    139	000070	000502 				BR	DODNMB		; $DNUMB = 314 - MATCH DECIMAL NUMBER
    140	000072	000475 				BR	DORD50		; $RAD50 = 316 - MATCH RAD-50 STRING
    141	000074	000423 				BR	DOCHAR		; $ANY   = 320 - MATCH ANY CHARACTER
    142
    143					; NOTE - IT IS CRITICAL THAT R0 AND R1 BE NON-ZERO AT THE DISPATCH
    144
    145		000320 				MAXTYP = 320
    146
    147					; CHECK FOR END OF STRING
    148
    149	000076	005703 			DOENDS:	TST	R3		; CHECK CHAR COUNT
    150	000100	001426 				BEQ	DOTRAN		; YES
    151
    152					; TYPE MATCH FAILED - TRY NEXT ENTRY IN TRANSITION TABLE
    153
    154	000102	066703 	000000'		NXTRAN:	ADD	.PSTCN,R3	; RETURN ANY STRING
    155	000106	166704 	000000'			SUB	.PSTCN,R4	; TO THE COMMAND LINE
    156	000112	112500 				MOVB	(R5)+,R0	; GET FLAGS BYTE
    157	000114	002407 				BLT	SYNERR		; THIS WAS LAST TRANSITION - YOU LOSE
    158	000116	012701 	000003 			MOV	#3,R1		; COUNT OF FLAG BITS TO TEST
    159	000122	006000 			20$:	ROR	R0		; CHECK FLAG BIT
    160	000124	103001 				BCC	30$
    161	000126	005725 				TST	(R5)+		; SKIP POINTER WORD
    162	000130	077104 			30$:	SOB	R1,20$		; COUNT BITS
    163	000132	000726 				BR	TSTAT		; TRY NEXT TRANSITION
    164
    165					; OUT OF TRANSITION TABLE ENTRIES, OR SOME OTHER ANOMALY,
    166					; LIKE A BAD TYPE CODE. ALL ARE SYNTAX ERRORS.
    167
    168	000134	000261 			SYNERR:	SEC			; SAY SO
    169	000136	000423 				BR	EXIT		; AND QUIT
    170
    171					; TEST FOR SPECIFIED CHARACTER
    172
    173	000140	120014 			TSCHAR:	CMPB	R0,(R4)		; CHECK CHAR IN COMMAND STRING
    174	000142	001357 				BNE	NXTRAN		; IF NO MATCH, TRY ANOTHER TRANSITION
    175
    176					; GOBBLE A CHARACTER AND DO THE TRANSITION
    177
    178	000144	005703 			DOCHAR:	TST	R3		; CHECK FOR END OF STRING
    179	000146	003755 				BLE	NXTRAN		; IF YES, DON'T TRY THIS
    180	000150	112467 	000010'			MOVB	(R4)+,.PCHAR	; SAVE CHAR FOR ACTION ROUTINE
    181	000154	005303 				DEC	R3		; COUNT IT
    182
    183					; DO THE STATE TRANSITION
    184
    185	000156				DOLAMB:
    186	000156	112500 			DOTRAN:	MOVB	(R5)+,R0	; GET FLAGS BYTE
    187	000160	006000 				ROR	R0		; CHECK EXTENSION BIT
    188	000162	103001 				BCC	40$
    189	000164	005725 				TST	(R5)+		; SKIP EXTENSION WORD
    190	000166	006000 			40$:	ROR	R0		; CHECK ACTION BIT
    191	000170	103001 				BCC	50$
    193	000174	006000 			50$:	ROR	R0		; CHECK EXPLICIT TRANSITION BIT
    194	000176	103304 				BCC	TSTAT
    195	000200	012505 				MOV	(R5)+,R5	; POINT TO NEXT STATE
    196	000202	001302 			60$:	BNE	TSTAT		; PROCESS NEXT STATE
.TPARS - TABLE DRIVEN FINITE ST	MACRO M1108  05-DEC-77 17:22  PAGE 8-2
MAIN ROUTINE BODY

    197	000204	000257 				CCC			; STATE NUMBER OF ZERO MEANS STOP
    198
    199	000206				EXIT:
.TPARS - TABLE DRIVEN FINITE ST	MACRO M1108  05-DEC-77 17:22  PAGE 9
COMPLEX TYPE ROUTINES

    202					.SBTTL	COMPLEX TYPE ROUTINES
    203
    204					; SUB EXPRESSION TYPE - CALL ONESELF RECURSIVELY
    205
    206	000220	011601 			DOSUBR:	MOV	(SP),R1		; SET SPACE FLUSH FLAG
    207	000222	016602 	000002 			MOV	2(SP),R2	; SET KEYWORD TABLE POINTER
    209	000232	010500 				MOV	R5,R0		; SAVE STATE TABLE POINTER
    210	000234	016505 	000001 			MOV	1(R5),R5	; GET STARTING STATE
    212	000244	010005 				MOV	R0,R5		; RESTORE STATE POINTER
    213	000246	103402 				BCS	10$		; CHECK FOR SUCCESS
    214	000250	022626 				CMP	(SP)+,(SP)+	; THROW AWAY STRING POINTER SAVE
    215	000252	000741 				BR	DOTRAN		; AND TAKE THE TRANSITION
    216
    217	000254	005067 	000000'		10$:	CLR	.PSTCN		; FLUSH ANY STRINGS FOUND
    219	000264	000706 				BR	NXTRAN		; AND TRY SOMETHING ELSE
    220
    221					; MATCH ANY ALPHANUMERIC STRING
    222
    223	000266	005000 			DORD50:	CLR	R0		; SET RAD-50 FLAG
    224	000270				DOSTRG:
    225	000274	000730 				BR	DOTRAN
    226
    227					; MATCH ANY NUMBER
    228
    229	000276	005001 			DODNMB:	CLR	R1		; SET DECIMAL MODE
    230	000300				DONUMB:
    231	000304	005767 	000000'			TST	.PSTCN		; CHECK STRING LENGTH
    232	000310	001674 				BEQ	NXTRAN		; COME ON, AT LEAST ONE DIGIT
    233	000312	005701 				TST	R1		; CHECK MODE
    234	000314	001411 				BEQ	20$		; DECIMAL - DON'T LOOK FOR TRAILING DOT
    235	000316	005703 				TST	R3		; SEE IF WE'RE AT END OF STRING
    236	000320	003407 				BLE	20$		; YES
    237	000322	121427 	000056 			CMPB	(R4),#'.	; CHECK FOR TRAILING DECIMAL
    238	000326	001004 				BNE	20$		; NO
    239	000330	005204 				INC	R4		; YES - INCLUDE IN NUMBER STRING
    240	000332	005303 				DEC	R3
    241	000334	005267 	000000'			INC	.PSTCN		; BUMP STRING COUNT
    242	000340				20$:
    243	000346	016705 	000002'			MOV	.PSTPT,R5	; GET STRING POINTER
    244	000352	016704 	000000'			MOV	.PSTCN,R4	; AND STRING COUNT
    245	000356	012703 	000004'			MOV	#.PNUMH,R3	; POINT TO DOUBLE WORD FOR NUMBER
    246	000362	005701 				TST	R1		; CHECK IF OCTAL OR DECIMAL
    247	000364	001003 				BNE	30$		; OCTAL
    249	000372	000402 				BR	40$
    250	000374				30$:
    251	000400				40$:
    252	000406	103635 				BCS	NXTRAN		; IF ERRORS, FORGET IT
    253	000410	000662 				BR	DOTRAN		; ELSE JUST DO TRANSITION
    254
    255					; MATCH ANY NON-EMPTY STRING OF SPACES OF TABS
    256
    257	000412				DOBLNK:
    258	000416	005702 				TST	R2		; CHECK NUMBER FOUND
    259	000420	001630 				BEQ	NXTRAN		; NO BLANKS - TRY SOMETHING ELSE
    260	000422	000655 				BR	DOTRAN		; YES - DO IT
    261
    262					; MATCH SPECIFIED KEYWORD
.TPARS - TABLE DRIVEN FINITE ST	MACRO M1108  05-DEC-77 17:22  PAGE 9-1
COMPLEX TYPE ROUTINES

    263
    264	000424				DOKEY:
    265	000430	042700 	177700 			BIC	#^C77,R0	; GET KEYWORD INDEX
    266	000434	006300 				ASL	R0		; CONVERT TO OFFSET
    267	000436	006300 				ASL	R0
    268	000440	006300 				ASL	R0
    269	000442	066600 	000002 			ADD	2(SP),R0	; INDEX INTO KEYWORD TABLE
    270	000446	016701 	000000'			MOV	.PSTCN,R1	; GET STRING DESCRIPTOR
    271	000452	001613 				BEQ	NXTRAN		; DON'T TRY TO MATCH NULL STRING
    272	000454	016702 	000002'			MOV	.PSTPT,R2
    273
    274	000460	122022 			50$:	CMPB	(R0)+,(R2)+	; COMPARE TO KEYWORD
    275	000462	001207 				BNE	NXTRAN		; OUT ON MISMATCH
    276	000464	077103 				SOB	R1,50$		; COUNT CHARS AND LOOP
    277	000466	121027 	000377 			CMPB	(R0),#377	; CHECK FOR KEYWORD TERMINATOR
    278	000472	001203 				BNE	NXTRAN		; STRING WAS SUBSET - NO
    279	000474	000630 				BR	DOTRAN		; MATCH
.TPARS - TABLE DRIVEN FINITE ST	MACRO M1108  05-DEC-77 17:22  PAGE 10
GET STRING ROUTINE

    281					.SBTTL	GET STRING ROUTINE
    282
    283					; THIS ROUTINE POINTS THE STRING DESCRIPTOR AT THE ALPHA-NUMERIC
    284					; STRING AT THE CURRENT POSITION IN THE COMMAND LINE.
    285
    286	000476	010467 	000002'		GETSTR:	MOV	R4,.PSTPT	; INIT STRING POINTER
    287	000502	005067 	000000'			CLR	.PSTCN		; AND COUNT
    288	000506	005703 				TST	R3		; CHECK FOR END OF STRING
    289	000510	003414 				BLE	20$		; IF YES, DON'T TRY THIS
    290
    291	000512	121427 	000060 		10$:	CMPB	(R4),#'0	; CHECK NEXT CHAR IN COMMAND LINE
    292	000516	002411 				BLT	20$		; LESS THAN "0" - OUT
    293	000520	121427 	000071 			CMPB	(R4),#'9
    294	000524	003416 				BLE	30$		; LESS THAN "9" - OK
    295	000526	121427 	000101 			CMPB	(R4),#'A
    296	000532	002403 				BLT	20$		; LESS THAN "A" - OUT
    297	000534	121427 	000132 			CMPB	(R4),#'Z
    298	000540	003410 				BLE	30$		; LESS THAN "Z" - OK
    299	000542	005700 			20$:	TST	R0		; SEE IF RAD-50 MODE
    300	000544	001012 				BNE	40$		; NO
    301	000546	121427 	000056 			CMPB	(R4),#'.	; CHECK FOR "."
    302	000552	001403 				BEQ	30$
    303	000554	121427 	000044 			CMPB	(R4),#'$	; CHECK FOR "$"
    304	000560	001004 				BNE	40$
    305	000562	005267 	000000'		30$:	INC	.PSTCN		; GOOD CHAR - BUMP COUNT
    306	000566	005204 				INC	R4		; GOBBLE THE CHAR
    307	000570	077330 				SOB	R3,10$		; COUNT IT AND LOOP
    308	000572				40$:
    309
    310
    311					; THIS ROUTINE FINDS AND PASSES OVER BLANKS AND TABS AT THE CURRENT
    312					; POSITION IN THE COMMAND LINE.
    313
    314	000574	005002 			GETSP:	CLR	R2		; ZERO CHAR COUNT
    315	000576	005703 				TST	R3		; CHECK FOR END OF STRING
    316	000600	003411 				BLE	70$		; IF YES, DON'T TRY THIS
    317	000602	121427 	000040 		50$:	CMPB	(R4),#SPA	; TEST FOR SPACE IN COMMAND LINE
    318	000606	001403 				BEQ	60$
    319	000610	121427 	000011 			CMPB	(R4),#TAB	; TEST FOR TAB
    320	000614	001003 				BNE	70$
    321	000616	005202 			60$:	INC	R2		; BLANK OR TAB FOUND - BUMP COUNT
    322	000620	005204 				INC	R4		; BUMP STRING POINTER
    323	000622	077311 				SOB	R3,50$		; COUNT CHARS AND LOOP
    324	000624				70$:
    325
    326
    327
    328		000001 				.END
.TPARS - TABLE DRIVEN FINITE ST	MACRO M1108  05-DEC-77 17:22  PAGE 10-1
SYMBOL TABLE

AC.DLK= 000002   	F.FOWN  000014   	I.ATL   000006   	M.EFNU= 000002   	V.LGTH  000056
AC.LCK= 000001   	F.FPRO  000016   	I.CRDT= 000031   	M.EFSQ= 000004   	V.LRUC  000035
AM    = 000033   	F.FSEQ  000010   	I.CRTI= 000040   	M.ERVN= 000001   	V.SBCL  000021
BITFNU= 000002   	F.FSQN  000013   	I.DASZ= 000007   	M.ESQN= 000000   	V.SBLB  000024
CR    = 000015   	F.FVBN  000046   	I.DPB   000011   	M.LBSZ= 000007   	V.SBSZ  000022
DOBLNK  000412R  	F.HDLB  000022   	I.EFN   000013   	M.MAX = 000011   	V.STAT  000054
DOCHAR  000144R  	F.LBN   000026   	I.EXDT= 000046   	M.RTRV= 000012   	V.STD   000004
DODNMB  000276R  	F.LGTH  000052   	I.EXTD  000030   	M.USE = 000010   	V.TRCT  000000
DOENDS  000076R  	F.LINK  000000   	I.FCN   000014   	NXTRAN  000102R  	V.WISZ  000020
DOKEY   000424R  	F.NACS  000036   	I.FIDP  000024   	QIOEFN= 000002   	WI.BPS= 100000
DOLAMB  000156R  	F.NLCK  000037   	I.FNAM= 000000   	R$$EIS= 000000   	WI.DLK= 010000
DONUMB  000300R  	F.NWAC  000040   	I.FNBP  000036   	R$$10F= 000001   	WI.EXT= 002000
DORD50  000266R  	F.RVN   000012   	I.FTYP= 000006   	R$$11D= 000001   	WI.LCK= 004000
DOSTRG  000270R  	F.SCHA  000021   	I.FVER= 000010   	SC.BAD= 000100   	WI.RDV= 000400
DOSUBR  000220R  	F.SIZE  000032   	I.IOSB  000016   	SC.MDL= 000200   	WI.WRV= 001000
DOTRAN  000156R  	F.STAT  000040   	I.LGTH  000040   	SPA   = 000040   	W.CTL   000000
EXIT    000206R  	F.STD   000004   	I.LNK   000000   	SYNERR  000134R  	W.FCB   000002
EX.AC1= 000001   	F.UCHA  000020   	I.LUN   000012   	S.HDHD= 000056   	W.RTRV  000012
EX.AC2= 000002   	F11PR$= 000000   	I.PRI   000010   	S.IDHD= 000056   	W.STD   000004
EX.ADF= 000010   	GETSP   000574R  	I.PRM   000024   	S.MPHD= 000012   	W.VBN   000006
EX.ENA= 000200   	GETSTR  000476R  	I.RTRV  000034   	S.STBK= 000012   	W.WISZ  000007
EX.FCO= 000004   	HIFCN = 000030   	I.RVDT= 000014   	TAB   = 000011   	$$    = 000067
E$$MSG= 000001   	H.CKSM= 000776   	I.RVNO= 000012   	TSCHAR  000140R  	.DD2CT= ****** GX
E$$TRP= 000001   	H.FCHA= 000014   	I.RVTI= 000023   	TSTAT   000010R  	.DFEXT= 000005
FCPLUN= 000001   	H.FLEV= 000006   	I.RWAD= 000024   	UC.CON= 000200   	.DFPRO= 164000
FC.CEF= 020000   	H.FNUM= 000002   	I.RWAT  000026   	UC.DLK= 000100   	.OD2CT= ****** GX
FC.DIR= 040000   	H.FOWN= 000010   	I.RWCT= 000026   	VC.BMW= 000002   	.PCHAR  000010RG    002
FC.FCO= 010000   	H.FPRO= 000012   	I.RWVB= 000032   	VC.IFW= 000001   	.PNUMB  000006RG    002
FC.WAC= 100000   	H.FSEQ= 000004   	I.STD   000004   	V.FCB   000006   	.PNUMH  000004RG    002
FP.DEL= 000010   	H.IDOF= 000000   	I.TISZ= 000006   	V.FFNU  000055   	.PRFIL= 000004
FP.EXT= 000004   	H.MPOF= 000001   	I.UIC   000022   	V.FIEX  000025   	.PSTCN  000000RG    002
FP.RAT= 000001   	H.PROG= 000010   	LEV11M= 000401   	V.FMAX  000016   	.PSTPT  000002RG    002
FP.RDV= 000001   	H.PROJ= 000011   	LOWFCN= 000011   	V.FPRO  000030   	.RTPTF= 001401
FP.WRV= 000002   	H.SCHA= 000015   	MAXTYP= 000320   	V.FRBK  000034   	.SYUIC= 000010
F$$LVL= 000001   	H.UCHA= 000014   	MFDFNO= 000004   	V.IBLB  000012   	.TPARS  000000RG
F.DREF  000042   	H.UFAT= 000016   	MFDFSQ= 000004   	V.IBSZ  000013   	.VBSIZ= 001000
F.DRNM  000044   	IDXFNU= 000001   	M$$HDR= 000001   	V.IFWI  000002   	...GBL= 000000
F.FEXT  000002   	I.ACTL  000035   	M.CTSZ= 000006   	V.LABL  000040   	...TPC= 000012
F.FNUM  000006   	I.AST   000020

. ABS.	000056	   000
      	000626	   001
IMPURE	000012	   002
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2730 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:29
[40,10]TPARS,[40,20]TPARS/-SP=[40,30]RSXDC,F11PRE,TPARS
RSXDC	MACRO M1108  05-DEC-77 17:22  PAGE 3


      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.
TRUNC	D0206, TRUNCATE FILE	MACRO M1108  05-DEC-77 17:22  PAGE 6


      1						.TITLE	TRUNC	D0206, TRUNCATE FILE
						.IDENT	"D0206"
      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
     20					;
					; VERSION D206, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  12 FEB 75  16:57
     23					;
     24					; TRUNCATE A FILE TO THE SIZE SPECIFIED.
     25
     26					;+
     27					;
     28					; **.TRUNC - TRUNCATE A FILE
     29					;
     30					; THIS ROUTINE SETS A FILE UP FOR TRUNCATION. IT VERIFIES THAT THERE
     31					; ARE NO OTHER ACCESSES ON THE FILE (OTHERWISE AN OUT OF DATE, TOO LONG
     32					; WINDOW WOULD ALLOW A TASK TO READ OFF THE END OF A FILE). IT ALSO
     33					; CHECKS FOR PRIVILEGES. THEN IT SCANS THE FILE HEADER(S) TO FIND THE
     34					; POINT AT WHICH TO BEGIN TRUNCATION. IT SETS UP THE APPROPRIATE
     35					; CONTEXT AND THEN LETS THE EXTEND CLEANUP DO THE ACTUAL TRUNCATE.
     36					;
     37					; INPUTS:
     38					;
     39					;	R4 = VCB ADDRESS
     40					;	R5 = I/O PACKET
     41					;
     42					; OUTPUTS:
     43					;
     44					;	R0-R3 ALTERED
     45					;	.HDBUF ALTERED
     46					;
     47					;-
     48
     49	000000				.TRUNC::
     50	000000	016700 	000000G			MOV	.FCBAD,R0	; GET FCB ADDRESS
     51	000004	001415 				BEQ	30$		; BRANCH IF NONE
     52	000006	005767 	000000G			TST	.WNDOW		; SEE IF CALLER IS THE ACCESSOR
     53	000012	001411 				BEQ	20$		; NO - MUST BE SOMEONE ELSE
     54	000014	032777 	001000 	000000G		BIT	#WI.WRV,@.WNDOW	; SEE IF FILE IS WRITE ACCESSED
TRUNC	D0206, TRUNCATE FILE	MACRO M1108  05-DEC-77 17:22  PAGE 6-1


     55	000022	001001 				BNE	10$
     56	000024					ERRX	IE.PRI,<FILE IS NOT WRITE ACCESSED>
	000024	   000C	   211 			TRAP	-IE.PRI		; FILE IS NOT WRITE ACCESSED
     57	000026	126027 	000036 	000001 	10$:	CMPB	F.NACS(R0),#1	; THIS CALLER MUST BE THE ONLY ACCESSOR
     58	000034	001401 				BEQ	30$		; OK
     59	000036				20$:	ERRX	IE.LCK,<FILE LOCKED AGAINST TRUNCATE OPERATION>
	000036	   000C	   211 			TRAP	-IE.LCK		; FILE LOCKED AGAINST TRUNCATE OPERATION
     60
     61	000040	012700 	000004 		30$:	MOV	#FP.EXT,R0	; CHECK FOR EXTEND PERMISSION
     62	000044					CALL	.PROCK
     63	000050	016502 	000030 			MOV	I.EXTD(R5),R2	; GET EXTEND CONTROL AGAIN
     64	000054	016503 	000032 			MOV	I.EXTD+2(R5),R3
     65	000060	042702 	100000 			BIC	#100000,R2	; KNOCK DOWN ENABLE BIT
     66									; THE REST IS FILE SIZE
     67					;
     68					; SCAN THE FILE HEADER FOR THE SPECIFIED NUMBER OF BLOCKS
     69					;
     70	000064				40$:	CALL	.GTMAP		; POINT TO MAP AREA
     71	000070	062701 	000010 			ADD	#M.USE,R1	; TO POINTER USE COUNT
     72	000074	012100 				MOV	(R1)+,R0	; GET COUNT
     73	000076	042700 	177400 			BIC	#177400,R0
     74	000102	001425 				BEQ	60$		; EMPTY HEADER
     75	000104					PUSH	R0		; SAVE CURRENT VALUE
     76	000106	006200 				ASR	R0		; CONVERT TO RETRIEVAL POINTER COUNT
     77	000110	005005 			50$:	CLR	R5
     78	000112	156105 	000001 			BISB	1(R1),R5	; GET BLOCK COUNT OF THIS POINTER
     79	000116	005205 				INC	R5		; MAKE TRUE COUNT
     80	000120	160503 				SUB	R5,R3		; SUBTRACT FROM DESIRED SIZE
     81	000122	005602 				SBC	R2
     82	000124	103421 				BLO	80$		; THIS IS IT
     83	000126	022121 				CMP	(R1)+,(R1)+	; NO IT ISN'T - SKIP OVER POINTER
     84	000130	077011 				SOB	R0,50$		; LOOP
     86					;
     87					; CHAIN TO THE NEXT HEADER, IF IT EXISTS
     88					;
     89	000132	005726 				TST	(SP)+		; THROW AWAY SAVED R0
     90	000134	016705 	000000G			MOV	.IOPKT,R5	; RESTORE R5
     91	000140					PUSH	<R2,R3>		; SAVE BLOCK COUNT
     92	000144					CALL	.NXHDR		; READ THE NEXT HEADER
     93	000150					POP	<R3,R2>		; RESTORE BLOCK COUNT
     94	000154	103343 				BCC	40$		; CONTINUE WITH NEXT HEADER
     96					;
     97					; THERE IS NO EXTENSION HEADER. IF THE SPECIFIED BLOCK COUNT
     98					; MATCHES THE FILE SIZE, RETURN. ELSE, SIGNAL END OF FILE.
     99					;
    100	000156	010200 			60$:	MOV	R2,R0
    101	000160	050300 				BIS	R3,R0		; CHECK REMAINING FILE SIZE
    102	000162	001001 				BNE	70$
    103	000164					RETURN			; ZERO - EXIT
    104
    105	000166				70$:	ERRX	IE.EOF,<END OF FILE - FILE IS SHORTER THAN SPECIFIED>
	000166	   000C	   211 			TRAP	-IE.EOF		; END OF FILE - FILE IS SHORTER THAN SPECIFIED
    106					;
    107					; WE HAVE FOUND THE RETRIEVAL POINTER CONTAINING THE DESIRED END
    108					; OF FILE. COMPUTE ITS CORRECT BLOCK COUNT AND THE NUMBER OF POINTERS
    109					; TO RETAIN.
    110					;
TRUNC	D0206, TRUNCATE FILE	MACRO M1108  05-DEC-77 17:22  PAGE 6-2


    111	000170	060503 			80$:	ADD	R5,R3		; R5 = NEW BLOCK COUNT FOR LAST POINTER
    112	000172	001003 				BNE	90$
    113	000174	116103 	177775 			MOVB	-3(R1),R3	; LAST POINTER WILL BE EMPTY - USE THE PREVIOUS
    114	000200	000402 				BR	100$
    115
    116	000202	005300 			90$:	DEC	R0		; COUNT IN THE LAST RETRIEVAL POINTER
    117	000204	005303 				DEC	R3		; MAKE BLOCK COUNT IN STANDARD FORMAT
    118	000206	110367 	000001G		100$:	MOVB	R3,.EXTSV+1	; SET UP EXTEND CLEAN UP CONTEXT
    119	000212					POP	R1		; GET ORIGINAL POINTER WORD COUNT
    120	000214	006300 				ASL	R0		; R0 = NUMBER OF WORDS REMAINING
    121	000216	160001 				SUB	R0,R1		; COMPUTE NEW POINTER WORD COUNT
    122	000220	110167 	000000G			MOVB	R1,.EXTSV	; SET UP FOR .CLEXT
    123	000224	016767 	000002G	000000G		MOV	.HDBUF+H.FNUM,.EXHDR ; SET UP STARTING FILE NUMBER
    124	000232	012767 	077777 	000000G		MOV	#77777,.EXNHD	; MAKE CLEANUP LOOP FOR ALL HEADERS
    125	000240	012700 	000002 			MOV	#2,R0
    126	000244	110067 	000000G			MOVB	R0,.EXSTS	; EXIT STATUS = LAST HEADER WRITTEN
    127	000250					CALLR	@.CLEX1		; AND LET EXTEND CLEANUP DO THE TRUNCATE
    128					;
    129					;
    130	000254					$END	TRUNC
    131					;
    132					;
    133		000001 				.END
TRUNC	D0206, TRUNCATE FILE	MACRO M1108  05-DEC-77 17:22  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.NWAC  000040   	I.EXDT= 000046   	M.LBSZ= 000007   	V.WISZ  000020
AC.LCK= 000001   	F.RVN   000012   	I.EXTD  000030   	M.MAX = 000011   	WI.BPS= 100000
BITFNU= 000002   	F.SCHA  000021   	I.FCN   000014   	M.RTRV= 000012   	WI.DLK= 010000
EX.AC1= 000001   	F.SIZE  000032   	I.FIDP  000024   	M.USE = 000010   	WI.EXT= 002000
EX.AC2= 000002   	F.STAT  000040   	I.FNAM= 000000   	QIOEFN= 000002   	WI.LCK= 004000
EX.ADF= 000010   	F.STD   000004   	I.FNBP  000036   	R$$10F= 000001   	WI.RDV= 000400
EX.ENA= 000200   	F.UCHA  000020   	I.FTYP= 000006   	R$$11D= 000001   	WI.WRV= 001000
EX.FCO= 000004   	F11PR$= 000000   	I.FVER= 000010   	SC.BAD= 000100   	W.CTL   000000
E$$MSG= 000001   	HIFCN = 000030   	I.IOSB  000016   	SC.MDL= 000200   	W.FCB   000002
E$$TRP= 000001   	H.CKSM= 000776   	I.LGTH  000040   	S.HDHD= 000056   	W.RTRV  000012
FCPLUN= 000001   	H.FCHA= 000014   	I.LNK   000000   	S.IDHD= 000056   	W.STD   000004
FC.CEF= 020000   	H.FLEV= 000006   	I.LUN   000012   	S.MPHD= 000012   	W.VBN   000006
FC.DIR= 040000   	H.FNUM= 000002   	I.PRI   000010   	S.STBK= 000012   	W.WISZ  000007
FC.FCO= 010000   	H.FOWN= 000010   	I.PRM   000024   	UC.CON= 000200   	$$    = 000067
FC.WAC= 100000   	H.FPRO= 000012   	I.RTRV  000034   	UC.DLK= 000100   	.CLEX1= ****** GX
FP.DEL= 000010   	H.FSEQ= 000004   	I.RVDT= 000014   	VC.BMW= 000002   	.DFEXT= 000005
FP.EXT= 000004   	H.IDOF= 000000   	I.RVNO= 000012   	VC.IFW= 000001   	.DFPRO= 164000
FP.RAT= 000001   	H.MPOF= 000001   	I.RVTI= 000023   	V.FCB   000006   	.EXHDR= ****** GX
FP.RDV= 000001   	H.PROG= 000010   	I.RWAD= 000024   	V.FFNU  000055   	.EXNHD= ****** GX
FP.WRV= 000002   	H.PROJ= 000011   	I.RWAT  000026   	V.FIEX  000025   	.EXSTS= ****** GX
F$$LVL= 000001   	H.SCHA= 000015   	I.RWCT= 000026   	V.FMAX  000016   	.EXTSV= ****** GX
F.DREF  000042   	H.UCHA= 000014   	I.RWVB= 000032   	V.FPRO  000030   	.FCBAD= ****** GX
F.DRNM  000044   	H.UFAT= 000016   	I.STD   000004   	V.FRBK  000034   	.GTMAP= ****** GX
F.FEXT  000002   	IDXFNU= 000001   	I.TISZ= 000006   	V.IBLB  000012   	.HDBUF= ****** GX
F.FNUM  000006   	ID$$$ = 000206   	I.UIC   000022   	V.IBSZ  000013   	.IOPKT= ****** GX
F.FOWN  000014   	IE.EOF= ****** GX	LEV11M= 000401   	V.IFWI  000002   	.NXHDR= ****** GX
F.FPRO  000016   	IE.LCK= ****** GX	LOWFCN= 000011   	V.LABL  000040   	.PRFIL= 000004
F.FSEQ  000010   	IE.PRI= ****** GX	MFDFNO= 000004   	V.LGTH  000056   	.PROCK= ****** GX
F.FSQN  000013   	I.ACTL  000035   	MFDFSQ= 000004   	V.LRUC  000035   	.RTPTF= 001401
F.FVBN  000046   	I.AST   000020   	M$$HDR= 000001   	V.SBCL  000021   	.SYUIC= 000010
F.HDLB  000022   	I.ATL   000006   	M.CTSZ= 000006   	V.SBLB  000024   	.TRUNC  000000RG
F.LBN   000026   	I.CRDT= 000031   	M.EFNU= 000002   	V.SBSZ  000022   	.VBSIZ= 001000
F.LGTH  000052   	I.CRTI= 000040   	M.EFSQ= 000004   	V.STAT  000054   	.WNDOW= ****** GX
F.LINK  000000   	I.DASZ= 000007   	M.ERVN= 000001   	V.STD   000004   	...GBL= 000000
F.NACS  000036   	I.DPB   000011   	M.ESQN= 000000   	V.TRCT  000000   	...TPC= 000012
F.NLCK  000037   	I.EFN   000013

. ABS.	000056	   000
      	000254	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2615 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:21
[40,10]TRUNC,[40,20]TRUNC/-SP=[40,30]RSXDC,F11PRE,TRUNC
RSXDC	MACRO M1108  05-DEC-77 17:23  PAGE 3


      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.
WACCK	D0202, WRITE ACCESS CHE	MACRO M1108  05-DEC-77 17:23  PAGE 6


      1						.TITLE	WACCK	D0202, WRITE ACCESS CHECK
						.IDENT	"D0202"
      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					;
					; VERSION D202, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  11 JAN 75  20:31
     23					; PETER H. LIPMAN	21-MAR-74
     24					;
     25					; SEE IF WRITE ACCESS WOULD BE CONSISTENT WITH CURRENT ACCESS STATE
     26					; OF THIS FILE.
     27
     28					;
     29					;+
     30					; **-.WACCK-WRITE ACCESS CHECK
     31					;
     32					; IF THIS FILE IS ACCESSED, SEE IF A WRITE ACCESS WOULD BE ALLOWED.
     33					; RETURN ONLY IF IT WOULD.
     34					;
     35					; INPUTS:
     36					;
     37					; 	.FCBAD CONTAINS 0 OR THE FCB ADDRESS
     38					;
     39					; OUTPUTS:
     40					;
     41					; 	R0=FCB ADDRESS
     42					; 	R1-R5 PRESERVED
     43					; 	RETURNS IN LINE IF AND ONLY IF WRITE ACCESS WOULD BE ALLOWED
     44					;
     45					;-
     46
     47	000000				.WACCK::
     48	000000	016700 	000000G			MOV	.FCBAD,R0	; ANY ACCESSORS?
     49	000004	001404 				BEQ	10$		; BRANCH IF NO
     50	000006	105760 	000037 			TSTB	F.NLCK(R0)	; IF FILE LOCKED AGAINST WRITE ACCESS
     51	000012	001401 				BEQ	10$		;
     52	000014					ERRX	IE.LCK,<FILE IS LOCKED AGAINST WRITE ACCESS>
	000014	   000C	   211 			TRAP	-IE.LCK		; FILE IS LOCKED AGAINST WRITE ACCESS
     53
WACCK	D0202, WRITE ACCESS CHE	MACRO M1108  05-DEC-77 17:23  PAGE 6-1


     54	000016				10$:	RETURN
     55					;
     56					;
     57	000020					$END	WACCK
     58					;
     59					;
     60		000001 				.END
WACCK	D0202, WRITE ACCESS CHE	MACRO M1108  05-DEC-77 17:23  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.CRTI= 000040   	M$$HDR= 000001   	V.LABL  000040
AC.LCK= 000001   	F.NACS  000036   	I.DASZ= 000007   	M.CTSZ= 000006   	V.LGTH  000056
BITFNU= 000002   	F.NLCK  000037   	I.DPB   000011   	M.EFNU= 000002   	V.LRUC  000035
EX.AC1= 000001   	F.NWAC  000040   	I.EFN   000013   	M.EFSQ= 000004   	V.SBCL  000021
EX.AC2= 000002   	F.RVN   000012   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBLB  000024
EX.ADF= 000010   	F.SCHA  000021   	I.EXTD  000030   	M.ESQN= 000000   	V.SBSZ  000022
EX.ENA= 000200   	F.SIZE  000032   	I.FCN   000014   	M.LBSZ= 000007   	V.STAT  000054
EX.FCO= 000004   	F.STAT  000040   	I.FIDP  000024   	M.MAX = 000011   	V.STD   000004
E$$MSG= 000001   	F.STD   000004   	I.FNAM= 000000   	M.RTRV= 000012   	V.TRCT  000000
E$$TRP= 000001   	F.UCHA  000020   	I.FNBP  000036   	M.USE = 000010   	V.WISZ  000020
FCPLUN= 000001   	F11PR$= 000000   	I.FTYP= 000006   	QIOEFN= 000002   	WI.BPS= 100000
FC.CEF= 020000   	HIFCN = 000030   	I.FVER= 000010   	R$$10F= 000001   	WI.DLK= 010000
FC.DIR= 040000   	H.CKSM= 000776   	I.IOSB  000016   	R$$11D= 000001   	WI.EXT= 002000
FC.FCO= 010000   	H.FCHA= 000014   	I.LGTH  000040   	SC.BAD= 000100   	WI.LCK= 004000
FC.WAC= 100000   	H.FLEV= 000006   	I.LNK   000000   	SC.MDL= 000200   	WI.RDV= 000400
FP.DEL= 000010   	H.FNUM= 000002   	I.LUN   000012   	S.HDHD= 000056   	WI.WRV= 001000
FP.EXT= 000004   	H.FOWN= 000010   	I.PRI   000010   	S.IDHD= 000056   	W.CTL   000000
FP.RAT= 000001   	H.FPRO= 000012   	I.PRM   000024   	S.MPHD= 000012   	W.FCB   000002
FP.RDV= 000001   	H.FSEQ= 000004   	I.RTRV  000034   	S.STBK= 000012   	W.RTRV  000012
FP.WRV= 000002   	H.IDOF= 000000   	I.RVDT= 000014   	UC.CON= 000200   	W.STD   000004
F$$LVL= 000001   	H.MPOF= 000001   	I.RVNO= 000012   	UC.DLK= 000100   	W.VBN   000006
F.DREF  000042   	H.PROG= 000010   	I.RVTI= 000023   	VC.BMW= 000002   	W.WISZ  000007
F.DRNM  000044   	H.PROJ= 000011   	I.RWAD= 000024   	VC.IFW= 000001   	.DFEXT= 000005
F.FEXT  000002   	H.SCHA= 000015   	I.RWAT  000026   	V.FCB   000006   	.DFPRO= 164000
F.FNUM  000006   	H.UCHA= 000014   	I.RWCT= 000026   	V.FFNU  000055   	.FCBAD= ****** GX
F.FOWN  000014   	H.UFAT= 000016   	I.RWVB= 000032   	V.FIEX  000025   	.PRFIL= 000004
F.FPRO  000016   	IDXFNU= 000001   	I.STD   000004   	V.FMAX  000016   	.RTPTF= 001401
F.FSEQ  000010   	ID$$$ = 000202   	I.TISZ= 000006   	V.FPRO  000030   	.SYUIC= 000010
F.FSQN  000013   	IE.LCK= ****** GX	I.UIC   000022   	V.FRBK  000034   	.VBSIZ= 001000
F.FVBN  000046   	I.ACTL  000035   	LEV11M= 000401   	V.IBLB  000012   	.WACCK  000000RG
F.HDLB  000022   	I.AST   000020   	LOWFCN= 000011   	V.IBSZ  000013   	...GBL= 000000
F.LBN   000026   	I.ATL   000006   	MFDFNO= 000004   	V.IFWI  000002   	...TPC= 000012
F.LGTH  000052   	I.CRDT= 000031   	MFDFSQ= 000004

. ABS.	000056	   000
      	000020	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2497 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:18
[40,10]WACCK,[40,20]WACCK/-SP=[40,30]RSXDC,F11PRE,WACCK
RSXDC	MACRO M1108  05-DEC-77 17:23  PAGE 3


      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.
WATCM	D0204, WRITE ATTRIBUTES	MACRO M1108  05-DEC-77 17:23  PAGE 6


      1						.TITLE	WATCM	D0204, WRITE ATTRIBUTES COMMON CODE
						.IDENT	"D0204"
      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					;
					; VERSION D204, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  11 JAN 75  20:32
     23					; PETER H. LIPMAN	5-MAR-74
     24					;
     25					; WRITE ATTRIBUTES COMMON CODE
     26					;
     27					;
     29	000000				WATCTL:	.BLKW	2		; SPACE FOR ATTRIBUTE CONTROL PAIR
     30
     32					;+
     33					; **-.WATCM-WRITE ATTRIBUTES COMMON CODE
     34					;
     35					; THIS ROUTINE SCANS THE ATTRIBUTE CONTROL BLOCK AND MOVES THE DESIRED
     36					; ATTRIBUTES FROM THE SPECIFIED USER BUFFERS TO THE APPROPRIATE PLACES
     37					; IN THE FILE HEADER. THOUGH THE USER IS ALLOWED TO WRITE THE USER CONTROLLED
     38					; CHARACTERISTICS BYTE (H.UCHA) THIS ROUTINE PREVENTS HIM FROM CHANGING
     39					; A NON CONTIGUOUS FILE TO A CONTIGUOUS ONE.
     40					; 	WHEN ALL THE ATTRIBUTES HAVE BEEN MOVED, THE FCB IS UPDATED
     41					; (IF IT EXISTS).
     46					;
     47					; INPUTS:
     48					;
     49					;	R0 = 0	CALLER IS SYSTEM OR OWNER - ALL ACCESS PERMITTED
     50					;	  .NE.0	CALLER IS WRITE ACCESSOR FURTHER PROTECTION CHECK
     51					;		IS NECESSARY FOR PROTECTED ATTRIBUTES
     52					; 	.HDBUF CONTAINS THE HEADER TO BE ALTERED.
     53					; 	I.RWAT(R5) CONTAINS THE ADDRESS OF THE ATTRIBUTE
     54					; 		CONTROL BLOCK OR 0 IN NONE SPECIFIED
     55					; 	.FCBAD IS THE ADDRESS OF THE FCB OR 0.
     56					; 	R5=I/O PACKET ADDRESS
     57					;
     58					; OUTPUTS:
     59					;
     60					; 	R0-R3 ALTERED R4,R5 PRESERVED
WATCM	D0204, WRITE ATTRIBUTES	MACRO M1108  05-DEC-77 17:23  PAGE 6-1


     61					;
     62					; EFFECTS:
     63					;
     64					; 	.HDBUF ALTERED-NEEDS TO BE WRITTEN EVEN IF THIS ROUTINE EXITS
     65					; 		ABNORMALLY!
     66					;-
     67
     68	000004				.WATCM::
     78	000004	116746 	000014G			MOVB	.HDBUF+H.UCHA,-(SP) ; SAVE USER CHARACTERISTICS BYTE
     79	000010	010046 				MOV	R0,-(SP)	; SAVE PROTECTION FLAG
     80	000012	016546 	000026 			MOV	I.RWAT(R5),-(SP) ; PUSH ADDRESS OF USER'S CONTROL BLOCK
     81	000016	001502 				BEQ	60$		; BRANCH IF NONE
     82
     83	000020	010600 			20$:	MOV	SP,R0		; GET USER VIRTUAL ADDRESS OF ATTR CONTROL
     84	000022	012701 	000000'			MOV	#WATCTL,R1	; GET ADDR OF INTERNAL BUFFER
     85	000026	010103 				MOV	R1,R3		; MAKE A COPY
     86	000030	012702 	000004 			MOV	#4,R2		; TRANSFER 4 BYTES
     87	000034					CALL	.BLXI		; READ ATTRIBUTE CONTROL PAIR
     89	000040	112301 				MOVB	(R3)+,R1	; R1=ATTRIBUTE CODE
     90	000042	001470 				BEQ	60$		; 0 ATTRIBUTE CODE MEANS END OF LIST
     91	000044	005002 				CLR	R2		;
     92	000046	152302 				BISB	(R3)+,R2	; R2=NO. OF BYTES TO MOVE
     93	000050	001464 				BEQ	50$		; BRANCH IF ILLEGAL BYTE COUNT
     94	000052	022701 	000000G			CMP	#.ATMAX,R1	; LEGAL ATTRIBUTE CODE?
     95	000056	103461 				BLO	50$		; BRANCH IF NO
     96	000060					MUL	#3,R1		; R1=ENTRY OFFSET IN .ATCTL TABLE
     97	000070	062701 	177775G			ADD	#.ATCTL-3,R1	; R1=ADDRESS OF SIZE FIELD
     98	000074	122102 				CMPB	(R1)+,R2	; MOVE MORE THAN MAX SIZE
     99	000076	103451 				BLO	50$		; BRANCH IF YES, ILLEGAL
    100	000100	112100 				MOVB	(R1)+,R0	; R0=OFFSET IN DESIRED AREA
    101	000102	111101 				MOVB	(R1),R1		; R1=ATTRIBUTE CONTROL BYTE
    102	000104	032701 	000000G			BIT	#AT.PRO,R1	; CHECK IF THIS ATTRIBUTE IS PROTECTED
    103	000110	001420 				BEQ	30$		; NO - OK
    104	000112	005766 	000002 			TST	2(SP)		; YES - CHECK PROTECTION FLAG
    105	000116	001415 				BEQ	30$		; OK
    106	000120					PUSH	<R0,R1,R2,R3>	; SAVE THE WORLD
    107	000130	005000 				CLR	R0		; WRITE ATTRIBUTES ACCESS
    108	000132					CALL	.PROCK		; MAKE A PROTECTION CHECK NOW
    109	000136					POP	<R3,R2,R1,R0>	; RESTORE REGISTERS
    110	000146	005066 	000002 			CLR	2(SP)		; SET PROTECTION FLAG TO OK
    111	000152	032701 	000000C		30$:	BIT	#AT.RO!AT.FCB,R1 ; ATTRIBUTE READ ONLY OR IN FCB?
    112	000156	001021 				BNE	50$		; BRANCH IF YES ILLEGAL WRITE ATTRIBUTE
    113	000160	042701 	177774 			BIC	#177774,R1	; CLEAR OUT FLAG BITS
    114	000164	001405 				BEQ	40$		; ZERO MEANS HEADER AREA
    115	000166	116101 	177777G			MOVB	.HDBUF-1(R1),R1	; 1 MEANS IDENT AREA, 2=MAP AREA
    116	000172	042701 	177400 			BIC	#177400,R1	; ZERO POSSIBLE SIGN EXTENSION
    117	000176	006301 				ASL	R1		; R1=BYTE OFFSET OF DESIRED AREA
    118	000200	062701 	000000G		40$:	ADD	#.HDBUF,R1	; R1=BEGINNING OF DESIRED HEADER AREA
    119	000204	060001 				ADD	R0,R1		; R1=ADDRESS TO MOVE ATTRIBUTE TO
    120	000206	010300 				MOV	R3,R0		; R0=ADR OF 2 WORD USER ADDRESS
    121	000210					CALL	.BLXI		; MOVE ATTRIBUTE TO HEADER
    129	000214	062716 	000004 			ADD	#4,(SP)		; POINT TO NEXT ATTRIBUTE CONTROL PAIR
    130	000220	000677 				BR	20$		; AND TRY IT
    132					;
    133					; ILLEGAL WRITE ATTRIBUTES PARAMETERS
    134					;
    135	000222				50$:	ERR	IE.WAT,<ILLEGAL WRITE ATTRIBUTES PARAMETER>
WATCM	D0204, WRITE ATTRIBUTES	MACRO M1108  05-DEC-77 17:23  PAGE 6-2


	000222	   000G	   211 			TRAP	IE.WAT		; ILLEGAL WRITE ATTRIBUTES PARAMETER
    136					;
    137					; ALL ATTRIBUTES HAVE BEEN MOVED
    138					;
    139	000224	022626 			60$:	CMP	(SP)+,(SP)+	; CLEAN THE STACK
    140	000226	132726 	000200 			BITB	#UC.CON,(SP)+	; IF FILE WAS NON CONTIGUOUS
    141	000232	001003 				BNE	70$
    142	000234	142767 	000200 	000014G		BICB	#UC.CON,.HDBUF+H.UCHA ; MAKE SURE IT STILL IS
    143	000242	016700 	000000G		70$:	MOV	.FCBAD,R0	; IF FCB EXISTS
    144	000246	001412 				BEQ	80$
    146	000250					PUSH	<F.SIZE(R0),F.SIZE+2(R0)> ; SAVE FILE SIZE
    148	000260					CALL	.INFCB		; REINIT SO IT AGREES WITH THE FILE HEADER
    150	000264					POP	<F.SIZE+2(R0),F.SIZE(R0)> ; RESTORE FILE SIZE
    152	000274				80$:
    159	000274	105767 	000000G			TSTB	.IOSTS		; IF ERROR
    160	000300	002401 				BLT	100$		; EXIT THROUGH ERRX
    161	000302				90$:	RETURN
    162
    163	000304				100$:	ERRX
	000304	104400 				TRAP	0		;
    164					;
    165					;
    166	000306					$END	WATCM
    167					;
    168					;
    169		000001 				.END
WATCM	D0204, WRITE ATTRIBUTES	MACRO M1108  05-DEC-77 17:23  PAGE 6-3
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.DPB   000011   	M.ERVN= 000001   	V.STD   000004
AC.LCK= 000001   	F.NACS  000036   	I.EFN   000013   	M.ESQN= 000000   	V.TRCT  000000
AT.FCB= ****** GX	F.NLCK  000037   	I.EXDT= 000046   	M.LBSZ= 000007   	V.WISZ  000020
AT.PRO= ****** GX	F.NWAC  000040   	I.EXTD  000030   	M.MAX = 000011   	WATCTL  000000R
AT.RO = ****** GX	F.RVN   000012   	I.FCN   000014   	M.RTRV= 000012   	WI.BPS= 100000
BITFNU= 000002   	F.SCHA  000021   	I.FIDP  000024   	M.USE = 000010   	WI.DLK= 010000
EX.AC1= 000001   	F.SIZE  000032   	I.FNAM= 000000   	QIOEFN= 000002   	WI.EXT= 002000
EX.AC2= 000002   	F.STAT  000040   	I.FNBP  000036   	R$$10F= 000001   	WI.LCK= 004000
EX.ADF= 000010   	F.STD   000004   	I.FTYP= 000006   	R$$11D= 000001   	WI.RDV= 000400
EX.ENA= 000200   	F.UCHA  000020   	I.FVER= 000010   	SC.BAD= 000100   	WI.WRV= 001000
EX.FCO= 000004   	F11PR$= 000000   	I.IOSB  000016   	SC.MDL= 000200   	W.CTL   000000
E$$MSG= 000001   	HIFCN = 000030   	I.LGTH  000040   	S.HDHD= 000056   	W.FCB   000002
E$$TRP= 000001   	H.CKSM= 000776   	I.LNK   000000   	S.IDHD= 000056   	W.RTRV  000012
FCPLUN= 000001   	H.FCHA= 000014   	I.LUN   000012   	S.MPHD= 000012   	W.STD   000004
FC.CEF= 020000   	H.FLEV= 000006   	I.PRI   000010   	S.STBK= 000012   	W.VBN   000006
FC.DIR= 040000   	H.FNUM= 000002   	I.PRM   000024   	UC.CON= 000200   	W.WISZ  000007
FC.FCO= 010000   	H.FOWN= 000010   	I.RTRV  000034   	UC.DLK= 000100   	$MUL  = ****** GX
FC.WAC= 100000   	H.FPRO= 000012   	I.RVDT= 000014   	VC.BMW= 000002   	$$    = 000067
FP.DEL= 000010   	H.FSEQ= 000004   	I.RVNO= 000012   	VC.IFW= 000001   	.ATCTL= ****** GX
FP.EXT= 000004   	H.IDOF= 000000   	I.RVTI= 000023   	V.FCB   000006   	.ATMAX= ****** GX
FP.RAT= 000001   	H.MPOF= 000001   	I.RWAD= 000024   	V.FFNU  000055   	.BLXI = ****** GX
FP.RDV= 000001   	H.PROG= 000010   	I.RWAT  000026   	V.FIEX  000025   	.DFEXT= 000005
FP.WRV= 000002   	H.PROJ= 000011   	I.RWCT= 000026   	V.FMAX  000016   	.DFPRO= 164000
F$$LVL= 000001   	H.SCHA= 000015   	I.RWVB= 000032   	V.FPRO  000030   	.FCBAD= ****** GX
F.DREF  000042   	H.UCHA= 000014   	I.STD   000004   	V.FRBK  000034   	.HDBUF= ****** GX
F.DRNM  000044   	H.UFAT= 000016   	I.TISZ= 000006   	V.IBLB  000012   	.INFCB= ****** GX
F.FEXT  000002   	IDXFNU= 000001   	I.UIC   000022   	V.IBSZ  000013   	.IOSTS= ****** GX
F.FNUM  000006   	ID$$$ = 000204   	LEV11M= 000401   	V.IFWI  000002   	.PRFIL= 000004
F.FOWN  000014   	IE.WAT= ****** GX	LOWFCN= 000011   	V.LABL  000040   	.PROCK= ****** GX
F.FPRO  000016   	I.ACTL  000035   	MFDFNO= 000004   	V.LGTH  000056   	.RTPTF= 001401
F.FSEQ  000010   	I.AST   000020   	MFDFSQ= 000004   	V.LRUC  000035   	.SYUIC= 000010
F.FSQN  000013   	I.ATL   000006   	M$$HDR= 000001   	V.SBCL  000021   	.VBSIZ= 001000
F.FVBN  000046   	I.CRDT= 000031   	M.CTSZ= 000006   	V.SBLB  000024   	.WATCM  000004RG
F.HDLB  000022   	I.CRTI= 000040   	M.EFNU= 000002   	V.SBSZ  000022   	...GBL= 000000
F.LBN   000026   	I.DASZ= 000007   	M.EFSQ= 000004   	V.STAT  000054   	...TPC= 000012
F.LGTH  000052

. ABS.	000056	   000
      	000306	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2630 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:22
[40,10]WATCM,[40,20]WATCM/-SP=[40,30]RSXDC,F11PRE,WATCM
RSXDC	MACRO M1108  05-DEC-77 17:23  PAGE 3


      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.
WITRN	D0204, TURN WINDOW	MACRO M1108  05-DEC-77 17:23  PAGE 6


      1						.TITLE	WITRN	D0204, TURN WINDOW
						.IDENT	"D0204"
      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					;
					; VERSION D204, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  11 NOV 74  11:07
     23					; PETER H. LIPMAN	12/28/73
     24					;
     25					; TURN A WINDOW
     26					;
     27
     28					;+
     29					; **-.WITRN-TURN A WINDOW
     30					;
     31					; THIS ROUTINE ACCEPTS A WINDOW ADDRESS AND DESIRED VBN AND UPDATES
     32					; THE WINDOW SO THAT THE DESIRED VBN CAN BE MAPPED TO ITS LBN. IT
     33					; RETURNS WITH CARRY SET IN THE SPECIAL CASE THAT THE VBN IS BEYOND
     34					; EOF. OTHER ERRORS RETURN THROUGH ERRX.
     35					;
     36					; INPUTS:
     37					;
     38					; 	R1=WINDOW ADDRESS
     39					; 	R2,R3=DESIRED VBN
     40					; 	R4=VOLUME CONTROL BLOCK ADDRESS
     41					; 	R5=I/O POCKET ADDRESS
     42					;
     43					; OUTPUTS:
     44					;
     45					; 	C=0 IF WINDOW TURNED OK AND
     46					; 	R1,R4,R5 PRESERVED
     47					; 	R0,R2,R3 ALTERED
     48					;
     49					; 	C=1 IF VBN BEYOND EOF
     50					; 	R0=FCB ADDRESS
     51					; 	R1-R5 PRESERVED
     52					;
     53					;-
     54
WITRN	D0204, TURN WINDOW	MACRO M1108  05-DEC-77 17:23  PAGE 6-1


     55	000000				.WITRN::
     56
     57	000000	016100 	000002 			MOV	W.FCB(R1),R0	; R0=FCB ADDRESS
     58	000004	026002 	000032 			CMP	F.SIZE(R0),R2	; DESIRED VBN BEYOND EOF?
     59	000010	001002 				BNE	10$
     60	000012	026003 	000034 			CMP	F.SIZE+2(R0),R3
     61	000016	103001 			10$:	BHIS	20$
     62
     63					;
     64					; CARRY MUST BE SET - INDICATES VBN BEYOND EOF
     65					;
     66	000020					RETURN
     67
     68					;
     69					; DESIRED VBN CAN BE MAPPED-SET UP THE WINDOW TO MAP IT.
     70					;
     71	000022				20$:	PUSH	<R1,R2,R3>	; SAVE VITAL REGISTERS
     73	000030	016001 	000002 		30$:	MOV	F.FEXT(R0),R1	; GET POINTER TO EXTENSION FCB
     74	000034	001410 				BEQ	50$		; BRANCH IF NONE
     75	000036	020261 	000046 			CMP	R2,F.FVBN(R1)	; CHECK DESIRED VBN AGAINST
     76	000042	001002 				BNE	40$		; STARTING VBN OF NEXT FCB
     77	000044	020361 	000050 			CMP	R3,F.FVBN+2(R1)
     78	000050	103402 			40$:	BLO	50$		; BRANCH IF VBN IS IN CURRENT FCB
     79	000052	010100 				MOV	R1,R0		; NO - VBN IS IN THIS OR HIGHER
     80	000054	000765 				BR	30$		; TRY NEXT ONE
     81
     82	000056				50$:	PUSH	R0		; SAVE FCB ADDRESS
     84	000060					CALL	.RDHDR		; DRAG IN THE FILE HEADER
     86	000064					POP	<R0,R3,R2,R1>	; RESTORE REGISTERS
     90	000074					CALLR	.WTRN1		; GO TO COMMON WINDOW TURNER
     91					;
     92					;
     93	000100					$END	WITRN
     94					;
     95					;
     96		000001 				.END
WITRN	D0204, TURN WINDOW	MACRO M1108  05-DEC-77 17:23  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.LINK  000000   	I.DASZ= 000007   	M.CTSZ= 000006   	V.LRUC  000035
AC.LCK= 000001   	F.NACS  000036   	I.DPB   000011   	M.EFNU= 000002   	V.SBCL  000021
BITFNU= 000002   	F.NLCK  000037   	I.EFN   000013   	M.EFSQ= 000004   	V.SBLB  000024
EX.AC1= 000001   	F.NWAC  000040   	I.EXDT= 000046   	M.ERVN= 000001   	V.SBSZ  000022
EX.AC2= 000002   	F.RVN   000012   	I.EXTD  000030   	M.ESQN= 000000   	V.STAT  000054
EX.ADF= 000010   	F.SCHA  000021   	I.FCN   000014   	M.LBSZ= 000007   	V.STD   000004
EX.ENA= 000200   	F.SIZE  000032   	I.FIDP  000024   	M.MAX = 000011   	V.TRCT  000000
EX.FCO= 000004   	F.STAT  000040   	I.FNAM= 000000   	M.RTRV= 000012   	V.WISZ  000020
E$$MSG= 000001   	F.STD   000004   	I.FNBP  000036   	M.USE = 000010   	WI.BPS= 100000
E$$TRP= 000001   	F.UCHA  000020   	I.FTYP= 000006   	QIOEFN= 000002   	WI.DLK= 010000
FCPLUN= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$10F= 000001   	WI.EXT= 002000
FC.CEF= 020000   	HIFCN = 000030   	I.IOSB  000016   	R$$11D= 000001   	WI.LCK= 004000
FC.DIR= 040000   	H.CKSM= 000776   	I.LGTH  000040   	SC.BAD= 000100   	WI.RDV= 000400
FC.FCO= 010000   	H.FCHA= 000014   	I.LNK   000000   	SC.MDL= 000200   	WI.WRV= 001000
FC.WAC= 100000   	H.FLEV= 000006   	I.LUN   000012   	S.HDHD= 000056   	W.CTL   000000
FP.DEL= 000010   	H.FNUM= 000002   	I.PRI   000010   	S.IDHD= 000056   	W.FCB   000002
FP.EXT= 000004   	H.FOWN= 000010   	I.PRM   000024   	S.MPHD= 000012   	W.RTRV  000012
FP.RAT= 000001   	H.FPRO= 000012   	I.RTRV  000034   	S.STBK= 000012   	W.STD   000004
FP.RDV= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	UC.CON= 000200   	W.VBN   000006
FP.WRV= 000002   	H.IDOF= 000000   	I.RVNO= 000012   	UC.DLK= 000100   	W.WISZ  000007
F$$LVL= 000001   	H.MPOF= 000001   	I.RVTI= 000023   	VC.BMW= 000002   	$$    = 000067
F.DREF  000042   	H.PROG= 000010   	I.RWAD= 000024   	VC.IFW= 000001   	.DFEXT= 000005
F.DRNM  000044   	H.PROJ= 000011   	I.RWAT  000026   	V.FCB   000006   	.DFPRO= 164000
F.FEXT  000002   	H.SCHA= 000015   	I.RWCT= 000026   	V.FFNU  000055   	.PRFIL= 000004
F.FNUM  000006   	H.UCHA= 000014   	I.RWVB= 000032   	V.FIEX  000025   	.RDHDR= ****** GX
F.FOWN  000014   	H.UFAT= 000016   	I.STD   000004   	V.FMAX  000016   	.RTPTF= 001401
F.FPRO  000016   	IDXFNU= 000001   	I.TISZ= 000006   	V.FPRO  000030   	.SYUIC= 000010
F.FSEQ  000010   	ID$$$ = 000204   	I.UIC   000022   	V.FRBK  000034   	.VBSIZ= 001000
F.FSQN  000013   	I.ACTL  000035   	LEV11M= 000401   	V.IBLB  000012   	.WITRN  000000RG
F.FVBN  000046   	I.AST   000020   	LOWFCN= 000011   	V.IBSZ  000013   	.WTRN1= ****** GX
F.HDLB  000022   	I.ATL   000006   	MFDFNO= 000004   	V.IFWI  000002   	...GBL= 000000
F.LBN   000026   	I.CRDT= 000031   	MFDFSQ= 000004   	V.LABL  000040   	...TPC= 000012
F.LGTH  000052   	I.CRTI= 000040   	M$$HDR= 000001   	V.LGTH  000056

. ABS.	000056	   000
      	000100	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2522 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:19
[40,10]WITRN,[40,20]WITRN/-SP=[40,30]RSXDC,F11PRE,WITRN
RSXDC	MACRO M1108  05-DEC-77 17:24  PAGE 3


      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.
WRATT	D0202, WRITE ATTRIBUTES	MACRO M1108  05-DEC-77 17:24  PAGE 6


      1						.TITLE	WRATT	D0202, WRITE ATTRIBUTES QI/O
						.IDENT	"D0202"
      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					;
					; VERSION D202, ASSEMBLED FOR RSX-11D
					;
     21
     22					; ANDREW C. GOLDSTEIN  11 JAN 75  20:43
     23					; PETER H. LIPMAN	10- MAR-74
     24					;
     25					; WRITE ATTRIBUTES QI/O
     26
     27					;
     28					;+
     29					;
     30					; **-.WRATT-WRITE ATTRIBUTES QI/O
     31					;
     32					; THIS ROUTINE IMPLEMENTS THE WRITE ATTRIBUTES QI/O. THE QI/O
     33					; DPB PARAMETER REQUIREMENTS ARE AS FOLLOWS:
     34					; 	FILE ID ADDRESS-OPTIONAL IF ACCESSED, REQUIRED OTHERWISE
     35					; 	READ/WRITE ATTRIBUTE LIST ADDRESS-REQUIRED
     36					; 	EXTEND PARAMETERS (2 WORDS) -0
     37					; 	ACCESS CONTROL WORD -0
     38					; 	FILE NAME BLOCK ADDRESS -0
     39					;
     40					; THE ROUTINE READS IN THE FILE HEADER PROCESSES THE ATTRIBUTE LIST,
     41					; UPDATING THE FCB IF FILE ACCESSED, AND REWRITES THE FILE HEADER.
     42					;
     43					; INPUTS:
     44					;
     45					; 	R4=VOLUME CONTROL BLOCK ADDRESS
     46					; 	R5=I/O PACKET ADDRESS
     47					;
     48					; OUTPUTS:
     49					;
     50					; 	R0-R3 ALTERED, R4-R5 PRESERVED
     51					;
     52					;-
     53
     54	000000				.WRATT::
WRATT	D0202, WRITE ATTRIBUTES	MACRO M1108  05-DEC-77 17:24  PAGE 6-1


     55	000000	005000 				CLR	R0
     56	000002					CALL	.RWATT		; INITIALIZE WRITE ATTRIBUTES
     57	000006	016700 	000000G			MOV	.WNDOW,R0	; DOES THIS USER HAVE FILE ACCESSED?
     58	000012	001404 				BEQ	10$		; BRANCH IF NO
     59	000014	032710 	001000 			BIT	#WI.WRV,(R0)	; YES, MUST NOT BE READ ONLY
     60	000020	001412 				BEQ	30$		; IF READ ONLY, DENY ACCESS
     61	000022	000402 				BR	20$		; OTHERWISE ACCESS IS GRANTED
     62					;
     63					; FILE IS NOT ACCESSED BY THIS USER. IF IT IS ACCESSED BY ANYONE ELSE,
     64					; MUST NOT BE WRITE LOCKED.
     65					;
     66	000024				10$:	CALL	.WACCK		; CHECK IF WRITE ACCESS WOULD BE ALLOWED
     67	000030	105267 	000000G		20$:	INCB	.EXSTS		; NOTE, CLEANUP MUST WRITE HEADER
     68	000034	005000 				CLR	R0		; SET PERMISSION FOR ALL ATTRIBUTES
     69	000036					CALL	.WATCM		; PROCESS WRITE ATTRIBUTES LIST
     70	000042					CALLR	.WRHDR		; WRITE THE FILE HEADER AND RETURN
     71
     72	000046				30$:	ERRX	IE.PRI,<PRIVILEGE VIOLATION>
	000046	   000C	   211 			TRAP	-IE.PRI		; PRIVILEGE VIOLATION
     73					;
     74					;
     75	000050					$END	WRATT
     76					;
     77					;
     78		000001 				.END
WRATT	D0202, WRITE ATTRIBUTES	MACRO M1108  05-DEC-77 17:24  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.DPB   000011   	M.EFSQ= 000004   	V.SBSZ  000022
AC.LCK= 000001   	F.NLCK  000037   	I.EFN   000013   	M.ERVN= 000001   	V.STAT  000054
BITFNU= 000002   	F.NWAC  000040   	I.EXDT= 000046   	M.ESQN= 000000   	V.STD   000004
EX.AC1= 000001   	F.RVN   000012   	I.EXTD  000030   	M.LBSZ= 000007   	V.TRCT  000000
EX.AC2= 000002   	F.SCHA  000021   	I.FCN   000014   	M.MAX = 000011   	V.WISZ  000020
EX.ADF= 000010   	F.SIZE  000032   	I.FIDP  000024   	M.RTRV= 000012   	WI.BPS= 100000
EX.ENA= 000200   	F.STAT  000040   	I.FNAM= 000000   	M.USE = 000010   	WI.DLK= 010000
EX.FCO= 000004   	F.STD   000004   	I.FNBP  000036   	QIOEFN= 000002   	WI.EXT= 002000
E$$MSG= 000001   	F.UCHA  000020   	I.FTYP= 000006   	R$$10F= 000001   	WI.LCK= 004000
E$$TRP= 000001   	F11PR$= 000000   	I.FVER= 000010   	R$$11D= 000001   	WI.RDV= 000400
FCPLUN= 000001   	HIFCN = 000030   	I.IOSB  000016   	SC.BAD= 000100   	WI.WRV= 001000
FC.CEF= 020000   	H.CKSM= 000776   	I.LGTH  000040   	SC.MDL= 000200   	W.CTL   000000
FC.DIR= 040000   	H.FCHA= 000014   	I.LNK   000000   	S.HDHD= 000056   	W.FCB   000002
FC.FCO= 010000   	H.FLEV= 000006   	I.LUN   000012   	S.IDHD= 000056   	W.RTRV  000012
FC.WAC= 100000   	H.FNUM= 000002   	I.PRI   000010   	S.MPHD= 000012   	W.STD   000004
FP.DEL= 000010   	H.FOWN= 000010   	I.PRM   000024   	S.STBK= 000012   	W.VBN   000006
FP.EXT= 000004   	H.FPRO= 000012   	I.RTRV  000034   	UC.CON= 000200   	W.WISZ  000007
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	UC.DLK= 000100   	$$    = 000067
FP.RDV= 000001   	H.IDOF= 000000   	I.RVNO= 000012   	VC.BMW= 000002   	.DFEXT= 000005
FP.WRV= 000002   	H.MPOF= 000001   	I.RVTI= 000023   	VC.IFW= 000001   	.DFPRO= 164000
F$$LVL= 000001   	H.PROG= 000010   	I.RWAD= 000024   	V.FCB   000006   	.EXSTS= ****** GX
F.DREF  000042   	H.PROJ= 000011   	I.RWAT  000026   	V.FFNU  000055   	.PRFIL= 000004
F.DRNM  000044   	H.SCHA= 000015   	I.RWCT= 000026   	V.FIEX  000025   	.RTPTF= 001401
F.FEXT  000002   	H.UCHA= 000014   	I.RWVB= 000032   	V.FMAX  000016   	.RWATT= ****** GX
F.FNUM  000006   	H.UFAT= 000016   	I.STD   000004   	V.FPRO  000030   	.SYUIC= 000010
F.FOWN  000014   	IDXFNU= 000001   	I.TISZ= 000006   	V.FRBK  000034   	.VBSIZ= 001000
F.FPRO  000016   	ID$$$ = 000202   	I.UIC   000022   	V.IBLB  000012   	.WACCK= ****** GX
F.FSEQ  000010   	IE.PRI= ****** GX	LEV11M= 000401   	V.IBSZ  000013   	.WATCM= ****** GX
F.FSQN  000013   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002   	.WNDOW= ****** GX
F.FVBN  000046   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040   	.WRATT  000000RG
F.HDLB  000022   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056   	.WRHDR= ****** GX
F.LBN   000026   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035   	...GBL= 000000
F.LGTH  000052   	I.CRTI= 000040   	M.CTSZ= 000006   	V.SBCL  000021   	...TPC= 000012
F.LINK  000000   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBLB  000024

. ABS.	000056	   000
      	000050	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2537 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:18
[40,10]WRATT,[40,20]WRATT/-SP=[40,30]RSXDC,F11PRE,WRATT
RSXDC	MACRO M1108  05-DEC-77 17:24  PAGE 3


      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.
WRHDR	D0200, WRITE FILE HEADE	MACRO M1108  05-DEC-77 17:24  PAGE 6


      1						.TITLE	WRHDR	D0200, WRITE FILE HEADER
						.IDENT	"D0200"
      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					;
					; VERSION D200, ASSEMBLED FOR RSX-11D
					;
     20					;
     21					; ANDREW C. GOLDSTEIN  9 AUG 1974
     22					; PETER H. LIPMAN	7-MAR-74
     23					;
     24					; WRITE A FILE HEADER
     25					;
     26					;+
     27					; **-.WRHDR-WRITE FILE HEADER
     28					;
     29					; THIS ROUTINE WRITES OUT THE FILE HEADER BUFFER,
     30					; .HDBUF, TO ITS ASSOCIATED LBN, .HDLBN, ON THE
     31					; DEVICE CURRENTLY ASSIGNED TO LUN 1. THE CHECKSUM
     32					; IS CALCULATED AND STORED AND THE HEADER IS WRITTEN.
     33					; THIS ROUTINE RETURNS IN LINE ONLY IF THE HEADER IS
     34					; SUCCESSFULLY WRITTEN. OTHERWISE IT EXITS THROUGH ERRX.
     35					;
     36					; INPUTS:
     37					;
     38					; 	NONE
     39					;
     40					; OUTPUTS:
     41					;
     42					; 	R1=HEADER BUFFER ADDRESS
     43					; 	R2,R3=HEADER LBN
     44					; 	R0=ALTERED
     45					; 	R4,R5 PRESERVED
     46					; 	RETURNS IN LINE IF AND ONLY IF SUCCESSFUL
     47					;
     48					;-
     49
     50	000000				.WRHDR::
     51
     52	000000	012701 	000000G			MOV	#.HDBUF,R1
     53	000004					CALL	.CKSUM
     54	000010	010011 				MOV	R0,(R1)
WRHDR	D0200, WRITE FILE HEADE	MACRO M1108  05-DEC-77 17:24  PAGE 6-1


     55	000012				.WRHD1::
     56	000012	012701 	000000G			MOV	#.HDUCB,R1	; R1=ADDRESS OF HEADER UCB
     57	000016	026721 	000000G			CMP	.UCBAD,(R1)+	; AGREE WITH CURRENT UCB?
     58	000022	001401 				BEQ	10$
     59	000024					FATAL	<TRIED TO WRITE BUFFER TO WRONG VOLUME>
	000024	000004 				IOT			; *** FATAL ERROR TRIED TO WRITE BUFFER TO WRONG VOLUME
     60
     61	000026	012102 			10$:	MOV	(R1)+,R2	; HIGH LBN
     62	000030	012103 				MOV	(R1)+,R3	; LOW LBN
     63					;
     64					; R1=HEADER BUFFER ADDRESS
     65					;
     66	000032					CALLR	.WR1LB		; WRITE LOGICAL BLOCK AND RETURN
     67					;
     68					;
     69	000036					$END	WRHDR
     70					;
     71					;
     72		000001 				.END
WRHDR	D0200, WRITE FILE HEADE	MACRO M1108  05-DEC-77 17:24  PAGE 6-2
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.EFN   000013   	M.ERVN= 000001   	V.SBSZ  000022
AC.LCK= 000001   	F.NLCK  000037   	I.EXDT= 000046   	M.ESQN= 000000   	V.STAT  000054
BITFNU= 000002   	F.NWAC  000040   	I.EXTD  000030   	M.LBSZ= 000007   	V.STD   000004
EX.AC1= 000001   	F.RVN   000012   	I.FCN   000014   	M.MAX = 000011   	V.TRCT  000000
EX.AC2= 000002   	F.SCHA  000021   	I.FIDP  000024   	M.RTRV= 000012   	V.WISZ  000020
EX.ADF= 000010   	F.SIZE  000032   	I.FNAM= 000000   	M.USE = 000010   	WI.BPS= 100000
EX.ENA= 000200   	F.STAT  000040   	I.FNBP  000036   	QIOEFN= 000002   	WI.DLK= 010000
EX.FCO= 000004   	F.STD   000004   	I.FTYP= 000006   	R$$10F= 000001   	WI.EXT= 002000
E$$MSG= 000001   	F.UCHA  000020   	I.FVER= 000010   	R$$11D= 000001   	WI.LCK= 004000
E$$TRP= 000001   	F11PR$= 000000   	I.IOSB  000016   	SC.BAD= 000100   	WI.RDV= 000400
FCPLUN= 000001   	HIFCN = 000030   	I.LGTH  000040   	SC.MDL= 000200   	WI.WRV= 001000
FC.CEF= 020000   	H.CKSM= 000776   	I.LNK   000000   	S.HDHD= 000056   	W.CTL   000000
FC.DIR= 040000   	H.FCHA= 000014   	I.LUN   000012   	S.IDHD= 000056   	W.FCB   000002
FC.FCO= 010000   	H.FLEV= 000006   	I.PRI   000010   	S.MPHD= 000012   	W.RTRV  000012
FC.WAC= 100000   	H.FNUM= 000002   	I.PRM   000024   	S.STBK= 000012   	W.STD   000004
FP.DEL= 000010   	H.FOWN= 000010   	I.RTRV  000034   	UC.CON= 000200   	W.VBN   000006
FP.EXT= 000004   	H.FPRO= 000012   	I.RVDT= 000014   	UC.DLK= 000100   	W.WISZ  000007
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVNO= 000012   	VC.BMW= 000002   	$$    = 000067
FP.RDV= 000001   	H.IDOF= 000000   	I.RVTI= 000023   	VC.IFW= 000001   	.CKSUM= ****** GX
FP.WRV= 000002   	H.MPOF= 000001   	I.RWAD= 000024   	V.FCB   000006   	.DFEXT= 000005
F$$LVL= 000001   	H.PROG= 000010   	I.RWAT  000026   	V.FFNU  000055   	.DFPRO= 164000
F.DREF  000042   	H.PROJ= 000011   	I.RWCT= 000026   	V.FIEX  000025   	.HDBUF= ****** GX
F.DRNM  000044   	H.SCHA= 000015   	I.RWVB= 000032   	V.FMAX  000016   	.HDUCB= ****** GX
F.FEXT  000002   	H.UCHA= 000014   	I.STD   000004   	V.FPRO  000030   	.PRFIL= 000004
F.FNUM  000006   	H.UFAT= 000016   	I.TISZ= 000006   	V.FRBK  000034   	.RTPTF= 001401
F.FOWN  000014   	IDXFNU= 000001   	I.UIC   000022   	V.IBLB  000012   	.SYUIC= 000010
F.FPRO  000016   	ID$$$ = 000200   	LEV11M= 000401   	V.IBSZ  000013   	.UCBAD= ****** GX
F.FSEQ  000010   	I.ACTL  000035   	LOWFCN= 000011   	V.IFWI  000002   	.VBSIZ= 001000
F.FSQN  000013   	I.AST   000020   	MFDFNO= 000004   	V.LABL  000040   	.WRHDR  000000RG
F.FVBN  000046   	I.ATL   000006   	MFDFSQ= 000004   	V.LGTH  000056   	.WRHD1  000012RG
F.HDLB  000022   	I.CRDT= 000031   	M$$HDR= 000001   	V.LRUC  000035   	.WR1LB= ****** GX
F.LBN   000026   	I.CRTI= 000040   	M.CTSZ= 000006   	V.SBCL  000021   	...GBL= 000000
F.LGTH  000052   	I.DASZ= 000007   	M.EFNU= 000002   	V.SBLB  000024   	...TPC= 000012
F.LINK  000000   	I.DPB   000011   	M.EFSQ= 000004

. ABS.	000056	   000
      	000036	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2512 WORDS  ( 10 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:18
[40,10]WRHDR,[40,20]WRHDR/-SP=[40,30]RSXDC,F11PRE,WRHDR
RSXDC	MACRO M1108  05-DEC-77 17:24  PAGE 3


      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.
WTRN1	D0216, TURN WINDOW	MACRO M1108  05-DEC-77 17:24  PAGE 6


      1						.TITLE	WTRN1	D0216, TURN WINDOW
						.IDENT	"D0216"
      2
      3					;                             COPYRIGHT (C) 1973, 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					;
     18					;
     19					;
					; VERSION D216, ASSEMBLED FOR RSX-11D
					;
     20
     21					; ANDREW C. GOLDSTEIN  11 NOV 74  11:06
     22					; PETER H. LIPMAN	12/28/73
     23					;
     24					; TURN A WINDOW
     25					;
     26
     28					;
     29					; LOCAL MACROS TO INHIBIT TASK SWITCHING SO SOME POOR SLOB DOESN'T
     30					; END UP STARING AT A WINDOW HALF TURNED.
     31					;
     32
     33		177776 			PSEXP=177776			; PS IN EXTERNAL PAGE
     34
     35					.MACRO	.INH0
     36						MOV	PSEXP,-(SP)
     37						MOVB	#140,PSEXP
     38					.ENDM	.INH0
     39
     40					.MACRO	.ENB0
     41						CALL	..ENB0
     42					.ENDM	.ENB0
     43
     46	000000				MAPCNT:	.BLKW	1		; COUNTER FOR HEADER MAP ENTRIES
     48
     49					;+
     50					; **-.WTRN1-TURN A WINDOW
     51					;
     52					; THIS ROUTINE ACCEPTS A WINDOW ADDRESS AND DESIRED VBN AND UPDATES
     53					; THE WINDOW SO THAT THE DESIRED VBN CAN BE MAPPED TO ITS LBN.
     54					; THERE ARE NO ERROR RETURNS.
     55					;
     56					; INPUTS:
     57					;
     58					;	R0=FCB ADDRESS
WTRN1	D0216, TURN WINDOW	MACRO M1108  05-DEC-77 17:24  PAGE 6-1


     59					; 	R1=WINDOW ADDRESS
     60					; 	R2,R3=DESIRED VBN
     61					; 	R4=VOLUME CONTROL BLOCK ADDRESS
     62					; 	R5=I/O PACKET ADDRESS
     63					;	.HDBUF CONTAINS FILE HEADER
     64					;
     65					; OUTPUTS:
     66					;
     67					; 	C=0
     68					; 	R1,R4,R5 PRESERVED
     69					; 	R0,R2,R3 ALTERED
     70					;
     71					;-
     72
     73	000002					ASSUME	W.CTL,0		; HOLDS THROUGHOUT THIS MODULE
     74
     75	000002				.WTRN1::
     86	000002					.INH0			; INHIBIT TASK SWITCHING
     88	000014					PUSH	<R5,R4,R3,R2>	; SAVE LOTS OF REGISTERS
     89	000024	016002 	000046 			MOV	F.FVBN(R0),R2	; GET STARTING VBN OF THIS FCB
     90	000030	016003 	000050 			MOV	F.FVBN+2(R0),R3
     91	000034	010105 				MOV	R1,R5
     92	000036	062705 	000006 			ADD	#W.VBN,R5	; POINT TO STARTING VBN OF WINDOW
     93	000042	012504 				MOV	(R5)+,R4	; GET HIGH ORDER VBN
     94	000044	042704 	177400 			BIC	#177400,R4
     95	000050	160402 				SUB	R4,R2		; COMPARE FCB'S VBN TO WINDOW'S
     96	000052	162503 				SUB	(R5)+,R3
     97	000054	005602 				SBC	R2
     98	000056	002424 				BLT	40$		; BRANCH IF FCB STARTS LOWER THAN WINDOW
     99					;
    100					; STARTING VBN OF FCB IS GREATER OR EQUAL TO WINDOW. SEE IF IT IS
    101					; CONTAINED IN WINDOW.
    102					;
    103	000060	111104 				MOVB	(R1),R4		; GET WINDOW'S RETRIEVAL POINTER COUNT
    104	000062	001422 				BEQ	40$		; EMPTY WINDOW
    105	000064	105011 				CLRB	(R1)		; INIT COUNT
    106	000066	162503 			10$:	SUB	(R5)+,R3	; ACCUMULATE CLUSTER COUNTS AGAINST VBN
    107	000070	005602 				SBC	R2
    108	000072	002430 				BLT	50$		; FCB VBN IS IN THIS POINTER
    109	000074	022525 				CMP	(R5)+,(R5)+	; SKIP OVER LBN
    110	000076	105211 				INCB	(R1)		; COUNT THIS POINTER
    111	000100	077406 				SOB	R4,10$		; LOOP FOR WINDOW
    112	000102	005702 				TST	R2		; SEE IF FCB VBN COINCIDES WITH END
    113	000104	001002 				BNE	20$		; OF WINDOW
    114	000106	005703 				TST	R3		; IF SO,
    115	000110	001426 				BEQ	60$		; RETAIN WINDOW CONTENTS
    116					;
    117					; FCB'S VBN IS BEYOND THE END OF THE WINDOW. IF THE DESIRED VBN IS
    118					; BEFORE THE FCB VBN, THIS TURN WILL DO US NO GOOD, SO EXIT WITH
    119					; WINDOW UNTOUCHED. IF DESIRED VBN IS AFTER FCB'S VBN, CLEAR THE
    120					; WINDOW AND TURN IT.
    121					;
    122	000112	021660 	000046 		20$:	CMP	(SP),F.FVBN(R0)	; COMPARE HIGH ORDER VBN
    123	000116	001003 				BNE	30$
    124	000120	026660 	000002 	000050 		CMP	2(SP),F.FVBN+2(R0)
    125	000126	103543 			30$:	BLO	160$		; GET OUT IF WINDOW IS ALREADY BEST EFFORT
    126					;
WTRN1	D0216, TURN WINDOW	MACRO M1108  05-DEC-77 17:24  PAGE 6-2


    127					; CURRENT CONTENTS OF THE WINDOW HAS NOTHING TO DO WITH THE PRESENT
    128					; FCB AND FILE HEADER - CLEAN IT OUT.
    129					;
    130	000130	010105 			40$:	MOV	R1,R5
    131	000132	062705 	000006 			ADD	#W.VBN,R5	; POINT TO STARTING VBN SLOT
    132	000136	116025 	000046 			MOVB	F.FVBN(R0),(R5)+	; SET UP STARTING VBN
    133	000142	005205 				INC	R5
    134	000144	016025 	000050 			MOV	F.FVBN+2(R0),(R5)+
    135	000150	105011 				CLRB	(R1)		; CLEAR POINTER COUNT
    136	000152	000405 				BR	60$
    137					;
    138					; THE STARTING VBN OF THE FCB (AND FILE HEADER) IS CONTAINED IN
    139					; THE WINDOW RETRIEVAL POINTER POINTED AT BY R5. TRUNCATE THE
    140					; WINDOW SO THAT IT MAPS EXACTLY UP TO THE HEADER'S START.
    141					;
    142	000154	064503 			50$:	ADD	-(R5),R3	; RESTORE LOW ORDER OF VBN
    143									; TO NO. OF BLOCKS PAST THIS POINTER
    144	000156	001403 				BEQ	60$		; ZERO - FLUSH THIS POINTER
    145	000160	010325 				MOV	R3,(R5)+	; FIX CLUSTER COUNT
    146	000162	022525 				CMP	(R5)+,(R5)+	; SKIP OVER LBN FIELD
    147	000164	005211 				INC	(R1)		; COUNT THIS POINTER IN
    148					;
    149					; THE WINDOW IS NOW APPROPRIATELY INITIALIZED. USE ITS STARTING
    150					; VBN TO ADJUST DESIRED VBN ON STACK.
    151					;
    152	000166	005002 			60$:	CLR	R2
    153	000170	156102 	000006 			BISB	W.VBN(R1),R2	; GET HIGH ORDER START VBN
    154	000174	160216 				SUB	R2,(SP)		; SUBTRACT HIGH ORDER
    155	000176	166166 	000010 	000002 		SUB	W.VBN+2(R1),2(SP)	; AND LOW ORDER
    156	000204	005616 				SBC	(SP)
    163					;
    164					; NOW SET UP TO SCAN THE MAP AREA IN THE FILE HEADER.
    165					;
    166	000206	005000 				CLR	R0
    167	000210	156700 	000001G			BISB	.HDBUF+H.MPOF,R0
    168	000214	006300 				ASL	R0		; R0=BYTE OFFSET TO MAP AREA
    169	000216	062700 	000010G			ADD	#.HDBUF+M.USE,R0 ; FORM ADDRESS OF M.USE
    175	000222	012002 				MOV	(R0)+,R2	; GET COUNT OF MAP WORDS IN USE
    176	000224	042702 	177400 			BIC	#177400,R2	; MASK OFF HIGH BYTE
    177	000230	001502 				BEQ	160$		; EMPTY HEADER - EXIT NOW
    178	000232	006202 				ASR	R2		; CONVERT TO RETRIEVAL POINTER COUNT
    179	000234	010267 	177540 			MOV	R2,MAPCNT	; AND SAVE
    181	000240					ASSUME	M.USE+2,M.RTRV	; R0 POINTS AT 1ST RETRIEVAL POINTER
    182
    246	000240	105711 				TSTB	(R1)		; IF THE WINDOW IS EMPTY
    247	000242	001461 				BEQ	140$		; DIVE INTO LOOP
    248
    249					; SEE IF THE NEXT RETRIEVAL POINTER IN THE HEADER IS CONTIGUOUS WITH
    250					; THE PREVIOUS; IF SO, MERGE THEM.
    251
    252	000244	014503 			110$:	MOV	-(R5),R3	; GET LOW LBN OF PREVIOUS POINTER
    253	000246	014502 				MOV	-(R5),R2	; AND HIGH LBN
    254	000250	064503 				ADD	-(R5),R3	; ADD IN THE BLOCK COUNT
    255	000252	005502 				ADC	R2
    256	000254	005004 				CLR	R4
    257	000256	151004 				BISB	(R0),R4		; GET HIGH ORDER LBN OF NEXT POINTER
    258	000260	020204 				CMP	R2,R4		; COMPARE HIGH ORDER LBN
WTRN1	D0216, TURN WINDOW	MACRO M1108  05-DEC-77 17:24  PAGE 6-3


    259	000262	001016 				BNE	120$		; NO
    260	000264	020360 	000002 			CMP	R3,2(R0)	; COMPARE LOW ORDER LBN
    261	000270	001013 				BNE	120$
    262	000272	005004 				CLR	R4
    263	000274	156004 	000001 			BISB	1(R0),R4	; GET BLOCK COUNT OF THIS RETRIEVAL POINTER
    264	000300	061504 				ADD	(R5),R4		; ADD TO PREVIOUS COUNT
    265	000302	103406 				BCS	120$		; OVERFLOW - FORGET IT
    266	000304	005204 				INC	R4		; MAKE TRUE COUNT
    267	000306	001404 				BEQ	120$		; OVERFLOW
    268	000310	010425 				MOV	R4,(R5)+	; PUT NEW COUNT IN WINDOW
    269	000312	022525 				CMP	(R5)+,(R5)+	; FIX WINDOW POINTER
    270	000314	022020 				CMP	(R0)+,(R0)+	; BUMP TO NEXT MAP ENTRY
    271	000316	000444 				BR	150$
    272
    273					; NEXT MAP POINTER IS NOT CONTIGUOUS WITH THE LAST. IF THE WINDOW IS
    274					; FULL, SEE IF THE FIRST RETRIEVAL POINTER IN IT MAPS THE DESIRED VBN.
    275					; IF NOT, SCROLL THE WINDOW UP ONE POINTER.
    276
    277	000320	062705 	000006 		120$:	ADD	#6,R5		; FIX WINDOW POINTER
    278	000324	121161 	000007 			CMPB	(R1),W.WISZ(R1)	; SEE IF THE WINDOW IS FULL
    279	000330	002426 				BLT	140$		; NO
    280	000332	010105 				MOV	R1,R5		; GET NEW WINDOW POINTER
    281	000334	062705 	000012 			ADD	#W.RTRV,R5
    283	000340	161566 	000002 			SUB	(R5),2(SP)	; SEE IF VBN IS IN THE FIRST POINTER
    284	000344	005616 				SBC	(SP)		; DO THE CARRY
    285	000346	103433 				BLO	160$		; BRANCH IF YES
    290	000350	061561 	000010 			ADD	(R5),W.VBN+2(R1) ; NO - ACCUMULATE BLOCK COUNT IN STARTING VBN
    292	000354	005561 	000006 			ADC	W.VBN(R1)
    294	000360	105311 				DECB	(R1)		; BUMP WINDOW ENTRY COUNT DOWN 1
    295	000362	001411 				BEQ	140$		; SOME IDIOT WANTS A ONE ENTRY WINDOW
    296	000364	111103 				MOVB	(R1),R3		; GET COUNT
    297	000366	010346 				MOV	R3,-(SP)
    298	000370	006303 				ASL	R3
    299	000372	062603 				ADD	(SP)+,R3
    300	000374	010504 				MOV	R5,R4
    301	000376	062704 	000006 			ADD	#6,R4		; POINT TO NEXT POINTER
    302	000402	012425 			130$:	MOV	(R4)+,(R5)+	; COPY THE POINTERS DOWN ONE POSITION
    303	000404	077302 				SOB	R3,130$
    304
    305					; CREATE A NEW RETRIEVAL POINTER IN THE WINDOW
    306
    307	000406	005002 			140$:	CLR	R2
    308	000410	152002 				BISB	(R0)+,R2	; GET HIGH ORDER LBN
    309	000412	005003 				CLR	R3
    310	000414	152003 				BISB	(R0)+,R3	; GET BLOCK COUNT
    311	000416	005203 				INC	R3		; MAKE IT A REAL BLOCK COUNT
    312	000420	010325 				MOV	R3,(R5)+	; PUT IN WINDOW
    313	000422	010225 				MOV	R2,(R5)+	; HIGH ORDER LBN
    314	000424	012025 				MOV	(R0)+,(R5)+	; LOW ORDER LBN
    315	000426	005211 				INC	(R1)		; BUMP WINDOW ENTRY COUNT
    316	000430	005367 	177344 		150$:	DEC	MAPCNT		; COUNT FILE HEADER MAP ENTRIES
    317	000434	001303 				BNE	110$		; AND START ALL OVER
    318
    319					; THE WINDOW IS DONE, BECAUSE EITHER:
    320					; 1) THE FIRST RETRIEVAL POINTER MAPS THE DESIRED VBN OR
    321					; 2) WE ARE OUT OF MAP ENTRIES IN THE FILE HEADER.
    322
WTRN1	D0216, TURN WINDOW	MACRO M1108  05-DEC-77 17:24  PAGE 6-4


    323	000436				160$:
    325	000436	022626 				CMP	(SP)+,(SP)+	; CLEAN VBN OFF THE STACK
    326	000440					POP	<R4,R5>		; RESTORE REGISTERS
    330	000444					.ENB0			; RESTORE TASK SWITCHING
    331	000450	000241 				CLC			; INDICATE SUCCESS
    332	000452					RETURN
    334
    335					;
    336					;
    337	000454					$END	WTRN1
    338					;
    339					;
    340		000001 				.END
WTRN1	D0216, TURN WINDOW	MACRO M1108  05-DEC-77 17:24  PAGE 6-5
SYMBOL TABLE

AC.DLK= 000002   	F.NACS  000036   	I.DPB   000011   	M.CTSZ= 000006   	V.LGTH  000056
AC.LCK= 000001   	F.NLCK  000037   	I.EFN   000013   	M.EFNU= 000002   	V.LRUC  000035
BITFNU= 000002   	F.NWAC  000040   	I.EXDT= 000046   	M.EFSQ= 000004   	V.SBCL  000021
EX.AC1= 000001   	F.RVN   000012   	I.EXTD  000030   	M.ERVN= 000001   	V.SBLB  000024
EX.AC2= 000002   	F.SCHA  000021   	I.FCN   000014   	M.ESQN= 000000   	V.SBSZ  000022
EX.ADF= 000010   	F.SIZE  000032   	I.FIDP  000024   	M.LBSZ= 000007   	V.STAT  000054
EX.ENA= 000200   	F.STAT  000040   	I.FNAM= 000000   	M.MAX = 000011   	V.STD   000004
EX.FCO= 000004   	F.STD   000004   	I.FNBP  000036   	M.RTRV= 000012   	V.TRCT  000000
E$$MSG= 000001   	F.UCHA  000020   	I.FTYP= 000006   	M.USE = 000010   	V.WISZ  000020
E$$TRP= 000001   	F11PR$= 000000   	I.FVER= 000010   	PSEXP = 177776   	WI.BPS= 100000
FCPLUN= 000001   	HIFCN = 000030   	I.IOSB  000016   	QIOEFN= 000002   	WI.DLK= 010000
FC.CEF= 020000   	H.CKSM= 000776   	I.LGTH  000040   	R$$10F= 000001   	WI.EXT= 002000
FC.DIR= 040000   	H.FCHA= 000014   	I.LNK   000000   	R$$11D= 000001   	WI.LCK= 004000
FC.FCO= 010000   	H.FLEV= 000006   	I.LUN   000012   	SC.BAD= 000100   	WI.RDV= 000400
FC.WAC= 100000   	H.FNUM= 000002   	I.PRI   000010   	SC.MDL= 000200   	WI.WRV= 001000
FP.DEL= 000010   	H.FOWN= 000010   	I.PRM   000024   	S.HDHD= 000056   	W.CTL   000000
FP.EXT= 000004   	H.FPRO= 000012   	I.RTRV  000034   	S.IDHD= 000056   	W.FCB   000002
FP.RAT= 000001   	H.FSEQ= 000004   	I.RVDT= 000014   	S.MPHD= 000012   	W.RTRV  000012
FP.RDV= 000001   	H.IDOF= 000000   	I.RVNO= 000012   	S.STBK= 000012   	W.STD   000004
FP.WRV= 000002   	H.MPOF= 000001   	I.RVTI= 000023   	UC.CON= 000200   	W.VBN   000006
F$$LVL= 000001   	H.PROG= 000010   	I.RWAD= 000024   	UC.DLK= 000100   	W.WISZ  000007
F.DREF  000042   	H.PROJ= 000011   	I.RWAT  000026   	VC.BMW= 000002   	$$    = 000067
F.DRNM  000044   	H.SCHA= 000015   	I.RWCT= 000026   	VC.IFW= 000001   	.DFEXT= 000005
F.FEXT  000002   	H.UCHA= 000014   	I.RWVB= 000032   	V.FCB   000006   	.DFPRO= 164000
F.FNUM  000006   	H.UFAT= 000016   	I.STD   000004   	V.FFNU  000055   	.HDBUF= ****** GX
F.FOWN  000014   	IDXFNU= 000001   	I.TISZ= 000006   	V.FIEX  000025   	.PRFIL= 000004
F.FPRO  000016   	ID$$$ = 000216   	I.UIC   000022   	V.FMAX  000016   	.RTPTF= 001401
F.FSEQ  000010   	I.ACTL  000035   	LEV11M= 000401   	V.FPRO  000030   	.SYUIC= 000010
F.FSQN  000013   	I.AST   000020   	LOWFCN= 000011   	V.FRBK  000034   	.VBSIZ= 001000
F.FVBN  000046   	I.ATL   000006   	MAPCNT  000000R  	V.IBLB  000012   	.WTRN1  000002RG
F.HDLB  000022   	I.CRDT= 000031   	MFDFNO= 000004   	V.IBSZ  000013   	..ENB0= ****** GX
F.LBN   000026   	I.CRTI= 000040   	MFDFSQ= 000004   	V.IFWI  000002   	...GBL= 000000
F.LGTH  000052   	I.DASZ= 000007   	M$$HDR= 000001   	V.LABL  000040   	...TPC= 000012
F.LINK  000000

. ABS.	000056	   000
      	000454	   001
ERRORS DETECTED:  0

VIRTUAL MEMORY USED:  2585 WORDS  ( 11 PAGES)
DYNAMIC MEMORY:  3104 WORDS  ( 11 PAGES)
ELAPSED TIME:  00:00:24
[40,10]WTRN1,[40,20]WTRN1/-SP=[40,30]RSXDC,F11PRE,WTRN1