	.TITLE .FLTB	-FILE TABLE FOR DISK I/O
/ 
/ 
/                   FIRST PRINTING, FEBRUARY 1974
/ 
/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO 
/ CHANGE WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED
/ AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPON-
/ SIBILITY FOR ANY ERRORS THAT MAY APPEAR IN THIS
/ DOCUMENT.
/ 
/ THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FUR-
/ NISHED TO THE PURCHASER UNDER A LICENSE FOR USE ON
/ A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH
/ INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR 
/ USE IN SUCH SYSTEM, EXCEPT AS MAY OTHERWISE BE PRO-
/ VIDED IN WRITING BY DIGITAL.
/ 
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
/ FOR THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIP-
/ MENT THAT IS NOT SUPPLIED BY DIGITAL.
/ 
/ COPYRIGHT (C) 1974, BY DIGITAL EQUIPMENT CORPORATION
/ 
/ 
        .EJECT
/EDIT 004---4--15--71
/COPYRIGHT DIGITAL EQUIPMENT CORP.,1971,MAYNARD,M@SS.
/FOUR WORD ENTRY PER POSITIVE DAT SLOT--DEFAULT 20(8) SLOTS
/DEFINE FLTBSZ TO = OCTAL NUMBER OF POSITIVE SLOTS
/CORRESPONDENCE TO DAT SLOT NUMBER BY DISPLACEMENT WITH
/FIRST ENTRY CORRESP. TO DAT SLOT +1
/ENTRY-------WORD 0---FILE ACTIVE WORD(0=NOT ACTIVE,NON-0=ACTIVE)
/--------------------(000001 IF OPEN FOR OUTPUT)
/--------------------(777777 IF OPEN FOR INPUT)
/------------WORD 1-3----SIXBIT FILENAME AND EXTENSION
/------------IF ZERO,USE DEFAULT FILENAME AND EXT.
	.GLOBL .FLTB,STAB
	.GLOBL .FLTB1,.DFT,.FLSW0,.FLZW0,.FLRA,.FH,.FLZW
	.IFUND FLTBSZ
FLTBSZ=20
	.ENDC
REP=FLTBSZ*4
.FLTB=.
	.REPT REP
	0
FLTBP	0		/FILE TABLE ENTRY POINTER
.FLTB2	.FLTB
.FLTB3	0		/TEMP STORAGE
FLTB4	0	/TEMP. STR.
.FLTB1	0	/ROUTINE TOBUILD DEFAULT FILE NAME IF NO FILE ACTIVE
/DUE TO CALL SEEK OR CALL ENTER OR REWIND
	DAC DF1	/SAVE FOR LATER
	JMS .FLSW0	/RETURNS WITH WORD ZERO OF FILE ENTRY IN AC
	SZA
	JMP* .FLTB1	/FILE ACTIVE--EXIT
	LAC FLTBP	/CHECK FOR ZERO FILE ENTRY TO DETERMINE
	DAC FLTB4	/IF DEFAULT FILENAME SHOULD BE BUILT
	ISZ FLTB4
	LAC* FLTB4
	SZA
	JMP FLTB5
	ISZ FLTB4
	LAC* FLTB4
	SZA
	JMP FLTB5
	ISZ FLTB4
	LAC* FLTB4
	SZA
	JMP FLTB5
	LAC* .FH	/IN OR OUT?
	SNA
	CLC
	DAC* FLTBP	/SET WORD 0 PER INPUT OR OUTPUT
	ISZ FLTBP
	LAC FLTBP	/STORE FOR LATER
	DAC .FLTB3
	LAC (562415)	/'.TM'
	DAC* FLTBP	/BUILD DEFAULT FILE NAME
	LAC DF1	/DAT SLOT TO AC
	JMS .DFT	/BUILD LAST TWO CHARS. OF FILENAME
/PER LOGICAL DIVICE #--RETURNS WITH LAST THREE CHARS. OF FILENAME
/IN AC
	ISZ FLTBP
	DAC* FLTBP
	ISZ FLTBP
	LAC (172423)	/EXTENSION---'OTS'
	DAC* FLTBP
	LAC .FLTB3	/ADDRESS OF DIR. ENTRY BUFFER
	ISZ .FLTB1	/BUMP EXIT
	JMP* .FLTB1
FLTB5	LAC* .FH	/SET FILE ACTIVE WORD PER INPUT OR OUTPUT
	SNA
	CLC		/000001 IF OUTPUT,777777 IF INPUT
	DAC* FLTBP
	ISZ	FLTBP
	LAC	FLTBP
	ISZ .FLTB1	/BUMP EXIT TO TRIGGER .SEEK OR .ENTER IN CALLING
	JMP* .FLTB1	/PROGRAM
/CALLING SEQUENCE--LAC DSLOT
/-------------------JMS .DFT
/MERGE DECIMAL SLOT# INTO LAST TWO CHAR. OF DEFAULT FILENAME.
/RETURNS WITH SECOND WORD OF FILENAME IN AC
.DFT	0
	DAC DF1	/STORE OCTAL SLOT #
	LAC (606060)
	DAC DF5	/PREM. BUILD
DF3	LAC DF1
	TAD (-12)	/OCTAL TO DECIMAL CONV.
	SPA
	JMP DF4
	DAC DF1	/REMAINDER
	LAC DF5
	TAD (100)	/BUMP SIXBIT CHAR
	DAC DF5
	JMP DF3	/AGAIN
DF4	TAD (12)	/ELIMINATE LAST DIFFERENCE
	TAD DF5
	JMP* .DFT
DF1	0	/TEMPS
DF5	0
/CALLING SEQUENCE-----LAC DSLOT
/---------------------JMS(*) .FLSW0
/---------------------SUBROUTINE RETURN
.FLSW0	0	/TESTS WORD 0 OF FILE ENTRY BY RETURNING IT IN AC
	TAD (-1)
	CLL
	RTL	/TIME 4
	TAD .FLTB2
	DAC FLTBP
	LAC* FLTBP
	JMP* .FLSW0
/CALLING SEQUENCE-------LAC DSLOT
/-------------------------JMS(*) .FLZW0
/-------------------------RETURN
.FLZW0	0	/CLEAR FILE ACTIVE WORD OF ENTRY PER DAT SLOT
	TAD (-1)
	CLL
	RTL
	TAD .FLTB2
	DAC FLTBP
	DZM* FLTBP	/ZERO
	JMP* .FLZW0
/CALLING SEQUENCE--------LAC DSLOT
/------------------------JMS(*) .FLRA
/------------------------RETURN IF FIIE OPEN FOR RAND. ACC.
/------------------------RETURN IF NOT
.FLRA	0	/FILE OPEN FOR RAND. ACC? PER DAT SLOT
	TAD (-1)
	TAD STAB	/I/O STATUS TABLE
	DAC FLTBP
	LAC* FLTBP
	AND (200000)	/RAND. ACC?
	SZA
	JMP* .FLRA	/YES
	ISZ .FLRA
	JMP* .FLRA
/CALLING SEQUENCE--------LAC DSLOT
/--------------------------JMS(*) .FLZW
/--------------------------NXT INSTR.--SUBR RETURN
.FLZW	0	/ZERO FILE ENTRY PER DAT SLOT
	TAD (-1)
	CLL
	RTL	/TIMES 4
	TAD .FLTB2
	DAC FLTBP
	DZM* FLTBP
	ISZ FLTBP
	DZM* FLTBP
	ISZ FLTBP
	DZM* FLTBP
	ISZ FLTBP
	DZM* FLTBP
	JMP* .FLZW
	.END
