	.TITLE *** RSX DISK FILES HANDLER OVERLAY #4
/
/ COPYRIGHT (C) 1975
/ DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
/
/ THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY
/ ON A SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH
/ THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS
/ SOFTWARE, OR ANY OTHER COPIES THEREOF, MAY NOT BE PRO-
/ VIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON
/ EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO
/ THESE LICENSE TERMS.  TITLE TO AND OWNERSHIP OF THE
/ SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.
/
/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE
/ WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A COM-
/ MITMENT BY DIGITAL EQUIPMENT CORPORATION.
/
/ DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
/ OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY
/ DEC.
/
	.EJECT
/
/	EDIT	#75	26 JUN 75	C. PROTEAU
/					M. HEBENSTREIT
/
/
/ DEFINING %RF15 PRODUCES A VERSION FOR THE RF DISK.
/ DEFINING %RP02 PRODUCES A VERSION FOR THE RP02 DISK PACK.
/ DEFINING %RK05 PRODUCES A VERSION FOR THE RK05 CATRIDGE DISK.
/
	.IFUND %RF15
	.IFUND %RP02
	.IFUND %RK05
	.END    NO ASSEMBLY PARAMETERS SPECIFIED
	.ENDC
	.ENDC
	.ENDC
/
/ INTERNALLY DEFINED GLOBAL SYMBOL: MUST BE THE SAME AS THE FILE NAME.
/
	.GLOBL	RFDLET
/
/ EXTERNALLY DEFINED GLOBAL SYMBOLS.
/
	.GLOBL	RFRQND,RFALUN,RFSREV,RFGTBL,RFPTBL,RFBFAD,RFFLBF,RFPDNA
	.GLOBL	RFSTL,RFCLFL,RFLUNN
/
	.IFUND %RF15
	.GLOBL RFUNIT
	.ENDC
/
/ DEFINITION OF REGISTERS LOCATED WITHIN THE RSX EXECUTIVE.
/
X10=10				/AUTOINCREMENT REGISTER 10.
R1=101				/GENERAL REGISTER #1.
R2=102				/GENERAL REGISTER #2.
NADD=107			/ENTRY POINT TO "ADD
				/NODE TO DEQUE" SUBROUTINE.
PENP=115			/ENTRY POINT TO "PICK AN EMPTY
				/NODE FROM POOL" SUBROUTINE.
SPRI=126			/ENTRY POINT TO "SEARCH DEQUE FOR PRIORITY
				/AND INSERT NODE" SUBROUTINE.
POOL=240			/HEAD OF THE EMPTY NODES DEQUE.
LUFD1=304			/ADDR. OF PTR TO START OF LUN-UFD TABLE
/
/ IOT AND PARAMETER DEFINITIONS.
/
.INH=705522			/INHIBIT INTERRUPTS.
.ENB=705521			/ENABLE INTERRUPTS.
IDX=ISZ				/IDX IS USED INSTEAD OF ISZ WHEN THE
				/INTENT IS TO ADD 1 TO A REGISTER BUT
				/NOT TO SKIP.
	.TITLE *** DELETE A FILE
/
RFDLET	0
	LAC	(.)		/COMPUTE THE PAGE ADDRESS BITS FOR THIS
	AND	(70000)		/OVERLAY AND SAVE THEM IN BOTH POSITIVE
	DAC	RFPAGE		/AND NEGATIVE FORM.
	TCA
	DAC	RFXADJ
/
/ PICK UP THE PARAMETERS FROM THE I/O REQUEST NODE.
/
	LAC*	RFRQND		/SET UP THE XR TO ACCESS THE NODE.
	JMS	RFADJX
	LAC	7,X		/SAVE I/O ARGUMENT 1.
	DAC	RFARG1
	LAC	10,X		/SAVE I/O ARGUMENT 2.
	DAC	RFARG2
	LAC	11,X		/SAVE I/O ARGUMENT 3.
	DAC	RFARG3
	DZM	RFERCD		/INITIALIZE THE ERROR CODE TO INDICATE
				/THAT NONE HAS YET BEEN DETECTED.
/
/ SEARCH THE ACTIVE LUN DEQUE TO SEE IF THIS TASK HAS A FILE OPEN ON
/ THIS LUN OR IF THE FILE IS ALREADY IN USE. RANDOM ACCESS FILES ARE
/ SELDOM "IN USE" BECAUSE THE ONLY TIME THEY ARE OPENED AND CLOSED IS
/ WHEN THEY ARE BEING RENAMED.
/
	LAC	RFALUN		/SET THE INDEX REGISTER TO START AT
	JMS	RFADJX		/THE HEAD OF RFALUN.
/
RFALLP	LAC*	RFRQND		/SET AUTOINCREMENT REGISTER 10 TO
	IAC			/ACCESS THE TASK NAME IN THE REQUEST NODE.
	DAC*	(X10)
/
/ TEST FOR END OF DEQUE.
/
	LAC	0,X		/END OF RFALUN DEQUE?
	SAD	RFALUN
	JMP	RFDLOK		/YES.
	JMS	RFADJX		/NO -- SET THE INDEX REGISTER TO
				/POINT TO THE NEXT NODE.
/
	.EJECT
/ TEST FOR TASK NAME. ACTUALLY, IT IS NOT A TASK NAME -- SEE "RFALUN"
/ IN RESIDENT CODE.
/
	LAC	2,X		/FIRST HALF OF TASK NAME FOUND?
	SAD*	X10
	SKP
	JMP	RFALCF		/NO -- TRY NEXT CHECK.
	LAC	3,X		/SECOND HALF FOUND?
	SAD*	X10
	SKP
	JMP	RFALCF		/NO -- TRY NEXT CHECK.
/
/ TEST FOR LUN.
/
	LAC*	X10		/SKIP THE PRIORITY CODE.
	LAC	5,X		/DO THE LUNS MATCH?
	XOR*	X10
	AND	(777000)
	SZA
	JMP	RFALCF		/NO -- TRY NEXT CHECK.
/
/#/ THE TASK-LUN NODE IN RFALUN HAS BEEN FOUND. THAT MEANS THAT THAT TASK
/ STILL HAS A FILE OPEN ON THAT LUN, WHICH IS AN ERROR.
/
	LAW	-10
	DAC*	RFCLFL		/SET A FLAG TO SIGNAL THE "DONE" CODE
	JMP*	RFSREV		/TO CLOSE THE FILE.
/
/ CHECK THE ACTIVE LUN TO SEE IF THIS FILE IS ALREADY OPEN.
/
RFALCF	PXA
	LMQ			/SAVE THE NODE'S ADJUSTED ADDRESS IN THE MQ.
	LAC	11,X		/SET THE XR TO POINT TO THIS FILE'S
	JMS	RFADJX		/CORE BUFFER.
	LAC	RF.FN1,X	/FIRST HALF OF FILE NAME MATCH?
	SAD	RFFNM1
	SKP
	JMP	RFNALN		/NO.
	LAC	RF.FN2,X	/YES -- SECOND HALF?
	SAD	RFFNM2
	SKP
	JMP	RFNALN		/NO.
	LAC	RF.EXT,X	/YES -- EXTENSION?
	SAD	RFFEXT
	JMP	RFFLOP		/#/ YES -- ERROR -- FILE ACTIVE.
/
/ TRY NEXT RFALUN NODE.
/
RFNALN	LACQ			/RESTORE THE XR.
	PAX
	JMP	RFALLP		/TRY THE NEXT NODE.
/
	.EJECT
/ VALIDATE THE FILE NAME AND EXTENSION.
/
RFDLOK	LAC	RFFNM1		/IS THE FILE NAME NULL?
	SZA!CLA
	JMP	.+3
	SAD	RFFNM2
	JMP	RFIFNM		/#/ YES -- ERROR.
	SAD	RFFEXT		/WHAT ABOUT THE EXTENSION?
	JMP	RFIFNM		/#/ YES -- ERROR.
/
/ FIND OUT WHERE THE 1ST UFD BLOCK IS STORED AND GET IT
/
	LAC	RFFLBF		/SAVE THE ADDRESS OF THIS HANDLER'S
	DAC*	RFBFAD		/INTERNAL FILE BUFFER.
	JMS	RFXRFB		/SET THE XR TO POINT TO THE FILE BUFFER.
	LAC*	(LUFD1		/CALC ADDR OF LUN-UFD TABLE ENTRY
	AAC	-1
	TAD*	RFLUNN
	DAC	RFTMP1		/SAVE IT
	LAC*	RFTMP1		/GET THE UFD NAME
	SNA			/IS UNIT DISMOUNTED?
	JMP	RFUIDR		/#/YES -- ERROR
	DAC	RFTMP1		/NO -- SAVE UFD NAME
	.IFUND	%RP02
	LAC	(1777		/GET THE START BLK OF MFD FOR RF AND RK
	.ENDC
	.IFDEF	%RP02
	LAC	(47040		/GET START OF MFD FOR RP
	.ENDC
RFMFD1	DAC	RF.BLK,X	/MAKE THIS BLOCK CURRENT
	JMS*	RFGTBL		/GET THE MFD BLOCK
	JMP	RFDKER		/#/RETURN HERE ON A DISK ERROR
	JMS	RFDBFA		/RETURN HERE IF OK -- SET AC TO START OF BUFFER
	AAC	-1		/SET UP X10 AS A POINTER TO THE BUFFER
	DAC*	(X10
	AAC	370		/SET RFTMP2 AS A POINTER TO LAST ENTRY
	DAC	RFTMP2
RFMFD2	LAC*	X10		/GET A UFD NAME
	SAD	RFTMP1		/DOES IT MATCH?
	JMP	RFMFD3		/YES
	LAC*	(X10		/NO -- END OF MFD BLK?
	SAD	RFTMP2
	JMP	RFMFD4		/YES
	AAC	3		/NO -- INCREMENT X10
	DAC*	(X10
	JMP	RFMFD2		/GO LOOK AT NEXT MFD ENTRY
RFMFD4	LAC	RF.DAT+377,X	/IS THIS THE LAST MFD BLOCK?
	SAD	(-1
	JMP	RFUIDR		/#/YES -- ERROR
	JMP	RFMFD1		/NO -- GET NEXT MFD BLOCK
RFMFD3	LAC*	X10		/GET THE UFD STARTING BLOCK
	SAD	(-1		/IS IT INITIALIZED?
	JMP	RFUIDR		/#/NO -- ERROR
/
/ SEARCH THE UFD FOR THE FILE
/
RFGBLC	DAC	RF.BLK,X	/SAVE THE BLOCK NUMBER.
	JMS*	RFGTBL		/GET THAT UFD BLOCK.
				/(EFFECTIVELY, ALL ACTIVE REGISTERS ARE
				/ALTERED; THE XR IS LEFT POINTING AT THE
				/FILE BUFFER).
				/DISK ERROR?
	JMP	RFDKER		/#/ YES -- THE ERROR CODE IS IN THE AC.
	LAW	-37		/NUMBER OF FILE ENTRIES PER UFD BLOCK.
	DAC	RF.CNT
	DZM	RF.REL		/RELATIVE POSITION WITHIN THE BLOCK.
	JMS	RFDBFA		/PREPARE AUTOINDEX REGISTER 10 TO
	AAC	-1		/SCAN THROUGH THE DATA BLOCK (UFD).
/
RFSRCL	DAC*	(X10)
	PAL			/SAVE TEMPORARILY.
	LAC*	X10		/FIRST HALF OF FILE NAME MATCH?
	SAD	RFFNM1
	SKP
	JMP	RFSRCE		/NO.
	LAC*	X10		/YES -- SECOND HALF MATCH?
	SAD	RFFNM2
	SKP
	JMP	RFSRCE		/NO.
	LAC*	X10		/YES -- EXTENSION MATCH?
	SAD	RFFEXT
	JMP	RFSRFF		/YES -- FILE FOUND.
/
	.EJECT
/ MOVE TO THE NEXT UFD FILE ENTRY AND TEST FOR THE END OF THE BLOCK.
/
RFSRCE	ISZ	RF.CNT		/END OF UFD BLOCK?
	SKP			/NO.
	JMP	RFSRNB		/YES.
	LAC	RF.REL		/UPDATE THE RELATIVE FILE ENTRY LOCATION.
	AAC	+10
	DAC	RF.REL
	PLA			/UPDATE AUTOINCREMENT REGISTER 10 FOR
	AAC	+10		/THE NEXT ENTRY.
	JMP	RFSRCL
/
/ THE CURRENT UFD BLOCK DOES NOT CONTAIN THE FILE. PREPARE TO READ IN
/ THE NEXT BLOCK IF ONE EXISTS.
/
RFSRNB	LAC	RF.DAT+377,X	/EXAMINE THE UFD BLOCK'S FORWARD LINKAGE.
	SAD	(-1)
	JMP	RFFLNF		/#/ THIS IS THE FINAL UFD BLOCK; THEREFORE,
				/THE FILE DOES NOT EXIST.
	JMP	RFGBLC		/READ IN THE NEXT UFD BLOCK.
/
/ THE FILE HAS BEEN FOUND IN THE UFD.
/
RFSRFF	LAC*	X10		/SAVE THE START BLOCK NUMBER OR THE
	DAC	RFSTBL		/"TRUNCATED FILE" INDICATOR.
	LAC*	X10
	DAC	RFFLSZ		/SAVE THE FILE SIZE (NUMBER OF BLOCKS)
				/AND THE FILE TYPE INDICATOR (BIT 0).
	LAC*	X10		/SAVE THE START OF THE RIB BLOCK CHAIN OF BLOCKS
	DAC	RFRIB1
	LAC*	X10		/SAVE THE STARTING WORD FOR RIB DATA
	DAC	RFRIB2
	JMS	RFDBFA		/COMPUTE THE ADDRESS OF THE FILE ENTRY
	TAD	RF.REL		/WITHIN THE DATA BLOCK.
	JMS	RFZERO		/ZERO OUT (FREE UP) THE FILE ENTRY.
	-10			/ARGUMENT -- WORD COUNT OF 8.
				/(X10, RFTMP1 & AC ARE ALTERED).
	JMS*	RFPTBL		/REWRITE THE UFD BLOCK.
				/(EFFECTIVELY, ALL ACTIVE REGISTERS ARE
				/ALTERED; THE XR IS LEFT POINTING AT THE
				/FILE BUFFER).
	DAC	RFERCD		/#/ RETURN HERE, IF AN ERROR OCCURRED,
				/WITH THE ERROR CODE IN THE AC.
				/RETURN HERE IF NO ERROR OCCURRED.
	LAC	RFSTBL		/IS THIS A TRUNCATED FILE?
	SPA
	JMP	RFDONE		/YES -- CANNOT DEALLOCATE ITS BLOCKS SINCE
				/THE FILE LENGTH IS NOT RECORDED.
/
	.EJECT
/ DEALLOCATE THE FILE'S BLOCKS.
/
	LAC	RFFLSZ		/STORE THE NUMBER OF DATA BLOCKS FOR DEALLOCATION
				/LEAVE BIT 0 SET IF IT IS TO TELL
				/DEAL S.R. THAT THE FILE WAS CREATED.
	DAC	.+5
	LAC	RFSTBL		/PREPARE TO DEALLOCATE STARTING WITH THE 1ST DATA BLOCK
	SNA
	JMP	RFDLC1
	JMS	RFQDEA
	0			/STORAGE FOR THE NUMBER OF DATA BLOCKS TO DEALLOCATE
	SKP			/#/RETURN HERE IF THE POOL WAS EMPTY
	JMP	.+3		/RETURN HERE IF THE DEALLOCATION WENT OK
	LAW	-777		/REMEMBER THAT THE POOL WAS EMPTY
	DAC	RFERCD
RFDLC1	LAC	RFFLSZ		/IS THIS A RANDOM ,I.E. RSX CREATED, FILE?
	SPA
	JMP	RFDONE		/YES -- THEN THERE ARE NO RIB BLOCKS TO DEALLOCATE
	LAC	RFRIB2		/NO -- IS RIB DATA IN LAST DATA BLOCK?
	AND	(077777		/AND OFF THE PROTECTION CODE
	SZA
	JMP	RFDONE		/YES -- THEN THERE ARE NO MORE BLOCKS TO DEALL.
	LAC	RFRIB1		/NO -- DEALLOCATE THE RIB BLOCKS
	SNA
	JMP	RFDONE
	JMS	RFQDEA
	377777
	JMP	RFQDER		/#/RETURN HERE IF THE POOL WAS EMPTY
	JMP	RFDONE		/RETURN HERE IF DEALLOCATION WENT OK
/
/ SUBROUTINE TO DEALLOCATE BLOCKS
/       (THIS SUBROUTINE IS IDENTICAL TO THE SUBROUTINE OF THE SAME
/       NAME IN RFCLOS)
/
RFQDEA	0
	PAL
	JMS*	(PENP)		/PICK AN EMPTY NODE FROM THE POOL.
				/(R1, R6, XR & AC ARE ALTERED).
				/WAS A NODE FOUND?
	JMP	RFQDEB		/#/ NO -- POOL IS EMPTY.
	DAC*	(R2)		/YES -- SAVE THE NODE'S ADDRESS FOR THE
				/CALL TO "SPRI".
	JMS	RFADJX		/SET THE XR TO POINT TO THE NODE.
	LAC*	RFSTL		/STORE THE ADDRESS OF THIS TASK'S STL NODE.
	DAC	2,X
	DZM	3,X		/0=EXECUTIVE MODE TASK.
	.DEC
	LAC	(513)		/ENTRY WILL BE MADE AT PRIORITY 513,
	.OCT			/WHICH IS LOWER THAN THAT OF ANY TASK
	DAC	4,X		/BUT HIGHER THAN REASSIGN'S "DISCONNECT
				/AND EXIT" REQUEST.
	DZM	5,X		/SPECIAL FORM OF DEALLOCATE IS I/O FUNCTION
				/CODE 0 MADE FROM LUN 0. SEE THE CHECK
				/MADE BY THE DEALLOCATE ROUTINE IN THE
				/RESIDENT PART OF THIS HANDLER.
	PLA			/SAVE THE FIRST BLOCK TO BE DEALLOCATED
	DAC	7,X
	LAC*	RFQDEA		/SAVE THE COUNT OF THE NO. OF BLOCKS
	DAC	10,X		/TO BE DEALLOCATED. BIT 0 INDICATES THE
				/FILE TYPE: 0=SEQUENTIAL ACCESS; 1=RANDOM
				/ACCESS.
	LAC*	RFPDNA		/COMPUTE THE ADDRESS OF THE HEAD OF THE
	AAC	+6		/I/O REQUEST DEQUE WITHIN THE PHYSICAL
	DAC*	(R1)		/DEVICE NODE.
	JMS*	(SPRI)		/INSERT THE NODE BY PRIORITY.
				/(R1, R2, R3, R6, XR & AC ARE ALTERED).
	IDX	RFQDEA
RFQDEB	IDX	RFQDEA
	JMS	RFXRFB
	JMP*	RFQDEA
/
/ ERRORS.
/
RFFLNF	LAW	-13		/FILE NOT FOUND.
	SKP
RFUIDR	LAW     -33		/UNINITIALIZED DIRECTORY
	SKP
RFIFNM	LAW	-53		/ILLEGAL FILE NAME OR EXTENSION.
	SKP
RFFLOP	LAW	-54		/FILE OPEN ELSEWHERE.
	SKP
RFQDER	LAW	-777		/"POOL" IS EMPTY.
RFDKER	DAC	RFERCD		/SAVE THE ERROR CODE TEMPORARILY.
RFDONE	LAC	RFERCD		/RETURN THE ERROR CODE, IF AN ERROR OCCURRED.
	SNA
	CLA!IAC			/OTHERWISE, DELETE WAS SUCCESSFUL.
	JMP*	RFSREV
	.TITLE *** MISCELLANEOUS SUBROUTINES
/
/ SUBROUTINE RFADJX -- SET THE INDEX REGISTER FROM THE VALUE IN THE AC
/ BY ADDING THE INDEX ADJUSTMENT FACTOR, WHICH COMPENSATES FOR THE
/ PAGE ADDRESS BITS ADDED FOR MEMORY REFERENCE INSTRUCTIONS.
/
/ CALLING SEQUENCE:
/
/	UNADJUSTED VALUE IN THE AC
/	JMS	RFADJX
/	(UNCONDITIONAL RETURN)
/
/ ALTERED REGISTERS:
/
/	AC & XR
/
RFADJX	0
	TAD	RFXADJ
	PAX
	JMP*	RFADJX
/
/
/
/
/
/ SUBROUTINE RFXRFB -- SET THE XR TO POINT TO THE FILE BUFFER.
/
/ CALLING SEQUENCE:
/
/	JMS	RFXRFB
/	(UNCONDITIONAL RETURN)
/
/ ALTERED REGISTERS:
/
/	AC & XR
/
RFXRFB	0
	LAC*	RFBFAD
	JMS	RFADJX
	JMP*	RFXRFB
/
	.EJECT
/ SUBROUTINE RFDBFA -- COMPUTE THE ADDRESS OF THE FILE DATA BUFFER.
/
/ CALLING SEQUENCE:
/
/	XR POINTING AT THE FILE BUFFER
/	JMS	RFDBFA
/	(UNCONDITIONAL RETURN)
/
/ ALTERED REGISTERS:
/
/	AC
/
RFDBFA	0
	PXA
	TAD	RFPAGE
	TAD	(RF.DAT)
	JMP*	RFDBFA
/
/
/
/
/
/ SUBROUTINE RFZERO -- CLEAR A SPECIFIED AREA OF CORE.
/
/ CALLING SEQUENCE:
/
/	STARTING ADDRESS IN THE AC
/	JMS	RFZERO
/	TWOS COMPLEMENT WORD COUNT
/	(UNCONDITIONAL RETURN)
/
/ ALTERED REGISTERS:
/
/	X10, RFTMP1 & AC
/
RFZERO	0
	AAC	-1		/PREPARE AUTOINDEX REGISTER 10 WITH THE
	DAC*	(X10)		/FIRST ADDRESS MINUS 1.
	LAC*	RFZERO		/PICK UP THE WORD COUNT.
	DAC	RFTMP1
	DZM*	X10		/ZERO CORE.
	ISZ	RFTMP1
	JMP	.-2
	IDX	RFZERO
	JMP*	RFZERO
	.TITLE *** FILE BUFFER STRUCTURE
/
/ FILE BUFFERS ARE CREATED IN THE TOP PART OF A TASK'S CORE PARTITION BY A
/ COMMON "GET BUFFER" SUBROUTINE WITHIN THE EXECUTIVE.
/ THE BEGINNING OF THE BUFFER IS USED FOR FILE STATUS DESCRIPTORS.
/ THESE ARE DEFINED BELOW RELATIVE TO THE BEGINNING OF THE BUFFER.
/
RF.FN1=0		/FILE NAME -- 1ST HALF.
RF.FN2=1		/FILE NAME -- 2ND HALF.
RF.EXT=2		/FILE NAME EXTENSION.
RF.OPN=3		/CAL FUNCTION CODE BY WHICH THIS FILE WAS OPENED.
RF.BLK=4		/CURRENT DISK DATA BLOCK NUMBER.
/
/ LOCATION OF A FREE FILE ENTRY IN THE UFD.
/
RF.FEF=5		/SET NON-0 (UFD START BLK) BY "RFSRCH" WHEN A FREE FILE
			/	ENTRY HAS BEEN FOUND.
RF.FEB=6		/NUMBER OF THE UFD BLOCK WHICH HAS A FREE FILE ENTRY.
RF.FEL=7		/RELATIVE LOCATION WITHIN THE UFD BLOCK OF THE
			/	FREE FILE ENTRY.
RF.FES=10		/THE NEW FILE'S STARTING BLOCK NUMBER.
/
/ LOCATION OF THE OLD FILE ENTRY IN THE UFD.
/
RF.OFF=11		/SET NON-0 (-1) BY "RFSRCH" IF THE FILE ALREADY
			/	EXISTS IN THE DIRECTORY.
RF.OFB=12		/NUMBER OF THE UFD BLOCK WHICH HAS THE OLD FILE ENTRY.
RF.OFL=13		/RELATIVE LOCATION WITHIN THE UFD BLOCK OF THE
			/	OLD FILE ENTRY.
RF.OFS=14		/BIT 0 = 1 IF THE FILE IS TRUNCATED.
			/BITS 1-17 = THE FILE'S STARTING BLOCK NUMBER.
/
/ READ AND WRITE PARAMETERS.
/
RF.DPT=15		/POINTER TO A DATA LINE IN THE FILE DATA BLOCK.
RF.PER=16		/SET NON-0 WHEN THE CURRENT DATA BLOCK
			/	HAS A PARITY ERROR.
RF.EOF=17		/SET NON-0 WHEN AN END-OF-FILE RECORD
			/	HAS BEEN READ.
RF.FSZ=20		/SIZE OF THE CURRENT OUTPUT FILE IN
			/	NUMBER OF DATA BLOCKS.
RF.NXB=21		/NEXT DATA BLOCK NUMBER ALLOCATED PRIOR
			/	TO WRITING OUT THE CURRENT BLOCK.
/
/ WITHIN THE FILE BUFFER THERE IS A FILE DATA BUFFER OF 256 (DECIMAL)
/ WORDS, WHICH STARTS IMMEDIATELY AFTER THE FILE STATUS DESCRIPTORS.
/ DATA BLOCKS ARE READ HERE FROM THE DISK OR ARE ASSEMBLED HERE AND
/ THEN WRITTEN TO THE DISK.
/
RF.DAT=22		/START OF 400 OCTAL WORD FILE DATA BLOCK.
	.TITLE *** VARIABLES AND CAL PARAMETER BLOCKS
/
/ VARIABLES.
/
RFARG1	0			/I/O ARGUMENT 1.
RFFNM1=RFARG1			/1ST HALF OF FILE NAME IN .SIXBT.
RFARG2	0			/I/O ARGUMENT 2.
RFFNM2=RFARG2			/2ND HALF OF FILE NAME IN .SIXBT.
RFARG3	0			/I/O ARGUMENT 3.
RFFEXT=RFARG3			/FILE NAME EXTENSION IN .SIXBT.
RFTMP1	0			/TEMPORARY STORAGE.
RFTMP2	0
RFPAGE	0			/PAGE ADDRESS BITS FOR THE PAGE IN WHICH
				/THIS CODE IS LOCATED.
RFXADJ	0			/INDEX REGISTER ADJUSTMENT FACTOR (SEE
				/INITIALIZATION CODE IN RESIDENT SECTION
				/FOR AN EXPLANATION). C(RFXADJ) = -C(RFPAGE).
RF.CNT	0			/COUNTER.
RF.REL	0			/RELATIVE POSITION WITHIN UFD BLOCK.
RFERCD	0			/TEMPORARY STORAGE FOR ERROR CODE.
RFSTBL	0			/FILE'S STARTING BLOCK NUMBER.
RFFLSZ	0			/NUMBER OF DATA BLOCKS IN THE FILE.
				/BIT 0 IS THE FILE TYPE INDICATOR:
				/0=SEQUENTIAL ACCESS; 1=RANDOM ACCESS.
RFRIB1	0			/STARTING RIB BLOCK
RFRIB2	0			/STARTING WORD OF RIB IN 1ST OR ONLY
				/RIB BLOCK
/
	.END
