	.SYSID <	.TITLE DTC >,< 103>
/
/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 #003	DEC. 5, 72
/ 103	09-JUN-75 (RCHM)	MAKE XVM CHANGES.
/8-26-70 (CLEAR SWITCHES FOR ^P RESTART)
/ 7-1-70 BANK BIT INITIALIZATION
/M. SIFNAS	1-15-70  (IOPS13 FIX)
/9-16-69 (TIMING BUG)
/   10-21-67 (.WAITR 3-25-68) (IOPS 23 5-8-68)
/(56 FILES 5-15-68)
/DTC.=IOPS DECTAPE HANDLER - READ ONLY, IOPS MODES
/1-256 WD. BUF.
/1 FILE ACTIVE AT ANY GIVEN TIME
/LIMITED FUNCTIONS
/CALLING SEQUENCE
/CAL+.DAT SLOT (9-17)+I(8)/.INIT
/UNIT (0-2)+1
/RESTART ADDRESS (ONLY MEANINGFUL FOR TTY HANDLER)
/BUF SIZE (255)
/CAL+.DAT SLOT (9-17)   /.OPER (ILL. FILE COMMAND)
/UNIT (0-2)+2
/DIR. TYPE (0-2)+CORE ADDR. (3-17)
/CAL+.DAT SLOT (9-17)  /.SEEK
/UNIT (0-2)+3
/USER DIRECTORY ENTRY POINTER
/SAME AS .SEEK (FUNCTION=4) /.ENTER (ILL. FILE COMMAND)
/CAL+.DAT SLOT (9-17)  /.CLEAR (ILL. FILE COMMAND)
/UNIT(0-2)+5
/CAL+.DAT SLOT(9-17)  /.CLOSE
/UNIT(0-2)+6
/CAL+SUBFUNCTION(5-8)+.DAT SLOT /.MTAPE (0=REWIND) (ILL. FILE COMMAND)
/UNIT(0-2)+7			(2=BACKSPACE RECORD)
/CAL+D.M.(6-8)+.DATSLOT(9-17)  /.READ
/UNIT (0-2)+10
/LINE BUF ADDR
/-WC OF L.B. (2'S COMP)
/SAME AS .READ (FUNCTION=11) /.WRITE (ILL. FILE COMMAND)
/CAL+.DAT SLOT(9-17)	/.WAIT,.WAITR
/UNIT(0-2)+12
/CAL+1000+.DAT SLOT(9-17)		/.WAITR
/UNIT(0-2)+12
/15 BIT BUSY ADDR
/CAL+X(8)+.DAT SLOT (9-17)  /.TRAN (X=0=READ) (ILL. FILE COMMAND)
/UNIT (0-2)+13		(X=1=WRITE)
/BLOCK#
/CORE ADDRESS
/-WC
/
	.EJECT
	.GLOBL	DTC.
.MED=3
/IOT ASSIGNMENTS
DTCA=707541
DTXA=707544
DTLA=707545
DTRA=707552
DTEF=707561
DTRB=707572
DTDF=707601
DTBUF=DTDIR
DTC.	DAC	DTCALP		/CAL POINTER
	DAC	DTARGP		/ARG. POINTER
	ISZ	DTARGP		/INDEX TO FUNCTION (AND UNIT#)
	LAC*	DTARGP
	AND	DTUMSK		/MASK OFF UNIT CODE.
	DAC	DTUNIT		/SAVE UNIT#
	LAC*	DTARGP		/FUNCTION (3-17)=1-13
	ISZ	DTARGP		/INDEX TO ARG.3
	AND	(377		/MASK OFF FUNCTION CODE.
	TAD	(JMP DTTABL
	DAC	DTTABL
	LAW	6		/SET UP FOR IOPS 6
DTTABL	XX
	JMP	DTIN		/1=.INIT
	JMP	DTIGNR		/2=.OPER (ILL.)
	JMP	DTSEEK		/3=.SEEK
	JMP	DTER6		/4=ENTER (ILL.)
	JMP	DTER6		/5=.CLEAR (ILL.)
DJSTOP	JMP	DTSTOP		/6=.CLOSE
	JMP	DTER6		/7=.MTAPE (ILL.)
	JMP	DTREAD		/10=.READ
	JMP	DTER6		/11=.WRITE (ILL.)
	JMP	DTWAIT		/12=.WAIT
	JMP	DTER6		/13=.TRAN (ILL.)
/
DTIGNR	ISZ DTARGP
	CLA
	JMP DTDBK
/
/
/I/O UNDERWAY CHECK SUBR.
DTIOU	0
	LAC	DTUND		/I/O UNDERWAY
	SNA			/YES
	JMP*	DTIOU		/OK-EXIT
	LAC	DTCALP		/BUSY-DTA I/O GOING ON
	DAC	DTARGP		/RETURN TO USER CAL
	JMP	DTDBK
/
/DTA INTERRUPT SERVICE
DTINT	JMP	DTPIC		/PIC ENTRY
	DAC	DTAC		/API ENTRY SAVE AC
	LAC	DTDVSW-1		/SET SWITCH TO LEAVE PIC ALONE ON EXIT
	DAC	DTDVSW
	LAC	DTINT		/API PC, L, EM, MP
	JMP	DTCOM
DTPIC	DAC	DTAC		/SAVE AC
	LAC	(ION		/SET SWITCH TO TURN ON PIC AT EXIT
	DAC	DTDVSW
	LAC*	(0		/PIC PC,L,EM,MP
DTCOM	DAC	DOUT		/SAVE FOR EXIT
	LAC	DTUND		/I/O UNDERWAY SWITCH STILL ON?
	SZA			/NO-STOP TAPE
	JMP	DTRBB
	DTLA			/CLEAR CONTROL
	JMP	DTDISM
/STATUS B-0=EF
/	1=MK. TK. ERR.
/	2=EOT
/	3=SELECT ERR
/	4=PARITY ERR.
/	5=TIMING ERR.
/	11=DTF
/STATUS A-0-2=UNIT#
/	3=FORW.(0),REV(1)
/	4=GO(1),STOP(0)
/	5=NORM.(0),CONT.(1)
/	6-8=FUNCTION
/	9=DISABLE DTF,EF(0),ENABLE(1)
/	10=CLEAR EF(0)
/	11=CLEAR DTF(0)
/
DTRBB	DTRB			/READ DTA STATUS B
	SMA
/DTDIS = JMP DTSRCK ON SEARCH
/DTDIS = JMP DTRDWT ON READ
DTDIS	XX
	AND	(330000
	SZA!RTL
/DTERJ=	JMP	DTERS		/ON SEARCH
/	JMP	DTERT		/ON READ
DTERJ	XX
	DTRA			/SELECT ERROR
	AND	LITCMA		/SAVE UNIT AND DIRECTORY
	DAC	DTT2		/SAVE STATUS A
	DTLA+10			/CLEAR A,FLAGS,DISABLE FROM INT.
	LAC	TV1		/SELECT ERROR (NOT READY)
	DAC*	(.MED		/SAVE DT1. RETURN ADDR. IN .MED
	DZM	DTUND		/CLEAR SO CAN RESTART ON ^P.
	LAC	(4		/NOT READY ERROR CODE
	JMP*	(.MED+1		/KM-9 ERR. RET.
DTRYAG	LAW	-1
	DAC	DTUND		/RESET I/O UNDERWAY SWITCH.
	JMS	DTSRCH
	LAC	DTT2
	XOR	(21400
	JMP	DTXIOT		/EXECUTE IOT AGAIN
/
	.EJECT
/ERROR IN SEARCH MODE
DTERS	SPA
	JMP	DTEOT		/EOT-CHANGE DIRECTION
	SNL			/MK .TK. ERR. IRREC.
	JMP	DTTM2		/TIMING ERR.-TRY AGAIN (SET GO BIT)
DTERS1	DTRA		/GET UNIT #
	RTL
	RTL
	AND (7		/INTO 15-17
	DTRB-10		/IOR STATUS B
	DAC*	(.MED		/IN .MED INSTEAD OF CAL ADDR.
	CLA			/IRREC. DTA ERROR
	JMP	DTER12		/MK. TK. OR EOT DURING READ
/
/ERROR DURING READ OR WRITE
DTERT	SZL!SPA!RTL		/PARITY OR TIMING
	JMP	DTERS1		/MK. TK. OR EOT DURING TRANSFER
	SMA!STL			/PARITY
	JMP	DTTIM		/TIMING
	ISZ	DTERCT		/INDEX PARITY ERROR CT.
	JMP	DTTIM-1		/TRY AGAIN
DTRDWT	DZM	DTUND		/CLEAR I/O UNDERWAY
	DZM	DTEOTZ		/SET DOUBLE END ZONE SWITCH
DTTM2	LAC	(20000		/CLEAR (OR SET FOR TIMING) GO BIT
	JMP	DTXIOT
	CLL			/PARITY, CLEAR LINK
DTTIM	JMS	DTSRCH		/SET UP FOR SEARCH MODE.
	LAC	(13000		/READ BIT AND CONTINUOUS BIT
				/WILL BE XOR'ED OUT; THEREFORE, SEARCHING
	SZL
	XOR	(20000		/SET GO BIT IF TIMING
	DTXA
	JMP	DCHK2		/SEARCH AGAIN FOR RETRY
/
	.EJECT
/SEARCH INTERRUPT SERVICE
DTSRCK	CLC
	DAC	DTEOTZ		/CLEAR DOUBLE END ZONE SWITCH
	LAC	DTBCA		/BLK# JUST READ
	SAD	DTBLC		/BLK SEARCHED FOR
	JMP	DCHKF		/MAYBE-CHECK DIRECTION
LITCMA	CMA
	TAD	DTBLC		/BLK# SEARCHED FOR-BL# READ
DCHKC	SMA!CLA			/OVERSHOOT-FORW; SPA!CLA=REV.
	JMP	DTXIOT		/CONT. SEARCH, SAME DIRECTION
DTEOT	DAC	DTEOTS		/CLEAR(0) OR SET(-) EOT SWITCH
DCHK2	LAC	DTBLNC		/FORW: SUB. 2 FROM BL# TO SEARCH
DCHKC3	TAD	DTNXBK		/REV; AND 2 FROM BL# TO SEARCH
	DAC	DTBLC
	CLC			/CHANGE SIGN OF BLK INCR.
	TAD	DTBLNC		/FOR NEXT DIRECTION CHANGE
	CMA
	DAC	DTBLNC
/
/THIS ROUTINE INSURES CORRECT SETTING OF DTBLC
/ON 1ST ENTRY INTO END ZONE
	LAC	DTEOTS		/END ZONE ENTERED SWITCH
	SMA
	JMP	DCHKC4		/NOT ENTERED
	ISZ	DTEOTZ		/DOUBLE END ZONE SWITCH SET
	JMP	DCHKC4		/NO
	LAC	DTNXBK		/STORE BL# TO TRANSFER
	DAC	DTBLC		/INTO BL# TO SEARCH FOR
DCHKC4	LAC	DCHKC		/SMA!CLA TO SPA!CLA
	XOR	(1000		/OR VICE VERSA
	DAC	DCHKC		/EXECUTABLE SWITCH
	LAC	DTEOTS		/EOT SWITCH
	RAL			/INTO LINK (1=EOT)
	LAC	(40000		/DIRECTION BIT
	SZL			/NO EOT
	XOR	(20000		/EOT-SET GO BIT
	DZM	DTEOTS		/CLEAR EOT SWITCH
	JMP	DTXIOT		/CHANGE SEARCH DIRECTION
/
	.EJECT
/SET UP FOR SEARCH MODE.
DTSRCH	0
	LAC	TV2		/SET UP CA
	DAC*	(31		/AND WC FOR
	DZM*	(30		/SEARCH
	LAC	(JMP DTSRCK		/SET UP
	DAC	DTDIS		/INTERRUPT
	LAC	(JMP DTERS		/HANDLER
	DAC	DTERJ		/FOR SEARCHING.
	JMP*	DTSRCH
DCHKF	LAC	DTDTR
	XOR	DTBLNC
DLITSM	SMA!CLA			/SEARCH DIRECT.=TRANSF. DIR.
	JMP	DCHKC3		/CHANGE SEARCH DIR. AGAIN
	LAC	DTWC		/SET UP-WC
	DAC*	(30
	LAC	DTCCA		/CA-1
	DAC*	(31		/FOR TRANSFER
	LAC	(JMP DTRDWT
	DAC	DTDIS
	LAC	(JMP DTERT
	DAC	DTERJ
	LAC	(13000		/READ (13000)
DTXIOT	DTXA
DTDISM	LAC	(JMP DTPIC	/RESTORE PIC INTERR. ENTRY
	DAC	DTINT
	LAC	DTAC
DTDVSW	XX		/ION IF PIC, LAC DTAC IF API
	DBR
	XCT .+1
	XCT .+1
	JMP*	DOUT		/INTERR. EXIT
/
	.EJECT
/INIT DTA ROUTINE - MAINSTREAM
DTIN	ISZ	DTARGP		/INDEX TO BUF. SIZE ARG.
	LAC	(377		/RETURN 255 AS BUF. SIZE
	DAC*	DTARGP
	ISZ	DTARGP		/INDEX TO NORM. EXIT
DTONCE	JMP	BNKBTS		/API CORE ADDR.-MODIFIED OR JMP DTSTOP
DTAC	16			/.SETUP
DOUT	DTDF			/DONE FLAG
DTT2	DTINT			/DTA INT. SERV. ADDR.
DTBCA	CAL	44
/
/DTONCE+1 TO 11 USED FOR TEMP. STOR. AFTER 1ST INIT
DTERCT	16
DTBLC	DTEF			/ERR. FLAG
DTBLNC	DTINT
DTNXBK	LAC	DJSTOP
DTDTR	DAC	DTONCE
/STOP DTA ROUTINE
DTSTOP	DZM	DTEOF		/CLEAR EOF SWITCH
	DZM	DTCLSS		/SET .CLOSE SWITCH
	JMP DTDBK
/WAIT DTA ROUTINE
DTWAIT	LAW 7000
	AND* DTCALP	/BIT 8=0 IF .WAIT
	SNA		/BIT 8=1 IF .WAITR
	JMP DTDBK-1
	LAC (700000	/GET LINK, ETC
	AND DTCALP
	DAC DTCALP
	LAC* DTARGP	/15 BIT BUSY ADDR
	AND (77777
	XOR DTCALP
	ISZ DTARGP
	DAC DTCALP
	JMS	DTIOU		/CHECK I/O UNDERWAY
DTDBK	DBR
	XCT .+1
	XCT .+1
	JMP*	DTARGP		/NORM. EXIT
/
	.EJECT
/SET UP CA,WC SUBR AND BEGIN READ
DTWCS	0
	DAC	DTCCA		/TRANSFER ADDR.-1
DTUMSK	LAW	-400
	DAC	DTWC		/WC=-400 (1 DTA BLOCK)
	LAW	-10
	DAC	DTERCT		/PARITY ERROR RETRY COUNT
	DAC	DTUND		/SET I/O UNDERWAY
	LAC	DTDTR		/TRANS. DIRECT. SWITCH
	AND	(1000
	XOR	DLITSM		/SMA!CLA=SEARCH FORW.
	DAC	DCHKC		/SPA!CLA=SEARCH REV.
	LAC	DTNXBK
	DAC	DTBLC		/BL.# TO SEARCH FOR
	LAC	DTDTR
	SMA!CLA			/-2 ON TRANSFER FORW.
	LAW	-4		/+2 ON TRANSFER REV.
	TAD	(2
	DAC	DTBLNC		/SEARCH BLOCK INCREMENT
	JMS	DTSRCH		/SETUP FOR  SEARCH MODE
	LAC	DTDTR		/DIRECTION (FORWARD 0, REVERSE 777777)
	AND	(40000
	XOR	(21400		/UNIT+21400=SEARCH FORW.
	XOR	DTUNIT		/UNIT+61400=SEARCH REV.
	DTLA			/LOAD STATUS REGISTER A.
	JMP*	DTWCS		/EXIT SUBR
/
/
/DTA SEEK FILE SUBR
DTSEEK	LAC	DTCLSS		/PREVIOUS FILE CLOSED
	SZA!CLA
	JMP	DTER10		/NO-FILE STILL ACTIVE
	LAC	(100		/BL# TO TRANSFER
	SAD	DTNXBK		/ALREADY SELECTED
	JMP	DTSEK1
	DAC	DTNXBK
	DZM	DTDTR		/DIRECTION=FORWARD
	LAC	DLTDR1		/(DTDIR-1
	JMS	DTWCS		/SET UP WC, CA AND START I/O
DTSEK1	JMS	DTIOU		/WAIT FOR DIRECTORY
	LAC	DTERCT		/PARITY RETRY COUNT OVERFLOW?
	SZA!CLC			/YES
	JMP	DTSEK3		/NO
	LAW	61		/DIRECORY UNACCEPTABLE WITH PARITY ERRORS
	JMP	DTEROT
/
	.EJECT
DTUDRP=DTCKSM
DTCTS=DTCCA
DTCT1S=DTWC
DTDES=DTWCS
DTUWC=DTCCA
DTWPC=DTWC
/
/DIRECTORY SEARCH ROUTINE
DTSEK3	XOR* DLTSYS	/WD 3 OF SYS BIT MAP
	SNA!CLA		/NO, 56 FILES
	LAW -30		/YES, 24 FILES
	SMA
	LAW -70
	DAC	DTBFCT
	LAC	DLTD40		/DTDIR+40
	DAC	DTDES		/ENTRY SECTION POINTER
/
/NEXT FILE NAME ENTRY
DTSK3	LAC*	DTARGP		/USER DIR. ENTRY POINTER
	DAC	DTUDRP
	LAW	-4
	DAC	DTCT1S		/MATCH COUNT
	DAC	DTCTS		/COUNT OF ENTRY WDS TO COUNT
	ISZ	DTCTS
/
/NEXT WORD OF CURRENT ENTRY
DTSK5	LAC*	DTDES		/DTA DIR. ENTRY (D.E.)
	SAD*	DTUDRP		/USER D.E.
	ISZ	DTCT1S		/WD N OF ENTRY MATCHES
	ISZ	DTDES		/NEXT WD OF DTA ENTRY
	ISZ	DTUDRP		/NEXT WD OF USER ENTRY
	ISZ	DTCTS		/ENTRY WD COUNT
	JMP	DTSK5		/CONT. MATCH CHECK
	ISZ	DTCT1S		/MATCH
	JMP	DTSK6		/NO
	XCT	DTSK5		/GET 4TH WD
DTSEK2	DAC	DTCLSS		/SET CLOSE SWITCH
	AND	(77777		/CLEAR SIGN BIT
	JMP	DTRNX1		/TRANSFER 1ST BLOCK
DTSK6	ISZ	DTDES		/INDEX TO NEXT ENTRY
	ISZ	DTBFCT		/INDEX FILE ENTRY CT.
	JMP	DTSK3		/NEXT ENTRY
DTER13	LAC	(1		/FILE NOT FOUND
DTER12	TAD	(2		/IRREC. DTA ERR. MK. TK, EOT DURING TRANSFER
				/.SEEK NOT EXECUTED (DTER11)
DTER10	TAD	(10		/FILE STILL ACTIVE
				/ILL. DATA MODE (DTER7)
DTER6=.
DTEROT	DZM	DTUND		/CLEAR SO CAN RESTART ON ^P.
	JMP*	(.MED+1		/KM-9 ERR LOC.
	.EJECT
/.READ IOPS ASCII OR BIN ROUTINE
DTREAD	LAC	DTCLSS		/SEEK EXECUTED
	SNA!CLA!CMA
	JMP	DTER12		/NO
	LAC	DTEOF		/EOF SWITCH SET
	SZA
	JMP	DTEFX		/YES - IGNORE CALL
	JMS	DTIOU		/I/O UNDERWAY CHECK
	LAC*	DTARGP		/USER L.B. POINTER
DTUDP=DTIOU
DTUHP=DTTABL
	DAC	DTUHP
	DAC	DTUDP
	AND (700000)		/(RCHM-103) EXTRACT EXTENDED MEMORY BITS.
	SZA			/(RCHM-103) ARE ANY OF THEM ON?
	JMP IOPS67		/(RCHM-103) YES, GO GENERATE ERROR MESSAGE.
	LAC*	DTHPT
	RTR			/SHIFT W.P.C. TO FORM W.C.
	RTR
	RTR
	RTR
	AND	(776
	DAC	DTWPC
	SNA
	JMP DTER23	/0 WPC
	AND (400
	SNA!CLA		/WPC GREATER THAN 177
	JMP	DTATOK
DTER23	LAW	23		/ILL. WPC, IOPS 23
	JMP	DTEROT
IOPS67	LAW 67			/(RCHM-103) FETCH ERROR NUMBER.
	JMP DTEROT		/(RCHM-103) GO PRINT ERROR.
DTATOK	ISZ	DTARGP
	LAC*	DTARGP		/USER-W.C.
	DAC	DTUWC
	LAW	7000		/DATA MODE
	AND*	DTCALP
	SAD	(2000		/IOPS ASCII
	CLA			/O.K.
	SZA!CLC			/IOPS BIN-O.K.
	JMP	DTER10		/ILL. DATA MODE
	TAD	DTWPC
	TAD	DTUWC
	DZM	DTDVS		/CLEAR SHORT LINE FLAG.
	SMA!CLC
	DAC	DTDVS		/SET SHORT LINE FLAG.
	TAD	DTWPC
	CMA			/2'S COMP HEADER WORD COUNT
	DAC	DTWPC
	DZM	DTCKSM
/TRANSFER LINE TO USER L.B.
DTWT2	LAC*	DTHPT		/DTA BUF. POINTER.
	DAC*	DTUDP		/USER L.B. POINTER.
	JMS	CALCHK		/ADD TO CHECKSUM.
	ISZ	DTUDP
	ISZ	DTUWC		/DONE
	JMP	DTWT2		/NO
	.EJECT
DTWT3	LAC*	DTHPT		/BYPASS EXCESS
	JMS	CALCHK		/DATA.
	JMP	DTWT3
CALCHK	0
	TAD	DTCKSM		/ADD TO CHECKSUM.
	DAC	DTCKSM
	ISZ	DTHPT		/INDEX DTA BUF. POINTER.
	ISZ	DTBFCT		/INDEX BUF. SIZE COUNT
	ISZ	DTWPC
	JMP*	CALCHK
	LAC*	DTUHP		/HEADER WD0-IOPS
	AND	(7
	SAD	(5		/EOF?
	JMP	DTREOF		/YES
	ISZ	DTDVS
	JMP	DTRDE1
	LAC	(60		/SHORT LINE.
	JMS	DTDVS
DTRDE1	LAC	DTERCT		/PARITY RETRY COUNT
	SMA!CLA
	JMP	DTRDP		/SET D.V. BITS=PARITY
	LAC	DTCKSM
	SNA
	JMP	DTRDN		/SET D.V. BITS=CKSUM ERROR
	LAC	(20		/CKSUM ERR. IN LINE
DTRDP	TAD	(20		/PARITY ERROR IN DTA BLOCK,12,13=01
	JMS	DTDVS		/12,13=10
DTRDN	LAC*	DTHPT
	SNA!CLC
	JMP	DTRNEX		/NO MORE DATA-GET NEXT BL.
	ISZ	DTBFCT		/DATA BUF. CT = GET NEXT BL.
	JMP	DTRNOR		/NORM EXIT WITH AC=-0 TO DECR. DTBFCT
DTRNEX	SAD	DTBUF+377		/DATA LINK=-0?
	JMP	DTREOF		/LAST BLOCK -SET EOF SWITCH
	LAC	DTNXBK
	CMA
	TAD	DTBUF+377
	SPA!CLA			/READ FORW
	CLC			/READ REV.
	DAC	DTDTR		/TRANSF. DIRECTION SWITCH
	LAC	DTBUF+377
DTRNX1	DAC	DTNXBK		/DATA LINK INTO NEXT BLOCK
	LAC	DLTDIR		/INIT DTA BUF. (DTBUF
	DAC	DTHPT		/POINTER
	LAW	-400		/BUF. SIZE
	DAC	DTBFCT
DTCOUB	LAC	DLTDR1		/TRANSFER (DTBUF-1
	JMS	DTWCS		/SET UP WC,CA AND BEGIN TRANSFER
DTAPE1	ISZ	DTARGP		/INDEX TO NORM .EXIT
	JMP	DTDBK
	.EJECT
DTDVSM=DTCALP
/
/SUBR. TO SET DATA VALIDITY BITS
DTDVS	0
	DAC	DTDVSM		/SAVE MASK
	LAW	17717		/MASK ALL BUT BITS 12,13
	AND*	DTUHP
	XOR	DTDVSM
	DAC*	DTUHP
	JMP*	DTDVS
DTEFX	ISZ	DTARGP		/EXECUTE NEXT 3 LINES ONLY TO GET TO DTAPE1
DTREOF	DAC	DTEOF		/SET EOF SWITCH (-0) ONLY IF ENTERED FROM DTRDN1+3
DTRNOR	TAD	DTBFCT		/DECR. (BY 1) DTFCT
	DAC	DTBFCT
	JMP	DTAPE1		/NORM EXIT
/
DTDIR	60000			/DTA DIRECTORY AND DTA BUF.
L44	CAL	44
BNKBTS	JMS	.		/BANK BIT INIT.
	LAC	BNKBTS
	XOR	DTT2
	AND	DTDIR
	XOR	DTT2
	DAC	DTT2
	DAC	DTBLNC
	XOR	TV1
	AND	DTDIR
	XOR	TV1
	DAC	TV1
	XOR	TV2
	AND	DTDIR
	XOR	TV2
	DAC	TV2
	XOR	DLTDR1
	AND	DTDIR
	XOR	DLTDR1
	DAC	DLTDR1
	DAC	DLTDIR
	ISZ	DLTDIR
	TAD	DLTD40
	DAC	DLTD40
	TAD	DLTSYS
	DAC	DLTSYS
	LAC	L44
	DAC	DTONCE
	JMP	DTONCE
	.LOC	DTDIR+400		
DLTDIR	DTDIR			/DIRECTORY POINTER
DLTDR1	DTDIR-1			/DIRECTORY POINTER-1 (FOR LOADING C.A.)
DLTSYS	203-40			/WD 3 OF SYS BIT MAP
DLTD40	41			/DIRECTORY ENTRY SECTION POINTER
DTARGP	0			/ENTRANCE ARG. POINTER
DTCCA	0			/CURRENT ADDR. POINTER FOR TRANSFER
DTCALP	0			/USER CAL POINTER
DTEOF	0			/EOF SWITCH, -0=EOF
DTHPT	0			/DTA BUF. LINE HEADER POINTER (INDEXED)
DTUND	0			/I/O UNDERWAY SWITCH, 0=NOT BUSY, NOT EQUAL 0=BUSY
DTUNIT	0			/(0-2)=DTA UNIT FOR TRANSFER
DTWC	0			/2'S COMP TRANSFER WORD COUNT
DTCKSM	0			/LINE CHECKSUM (2'S COMP)
DTCLSS	0			/FILE OPEN CLOSE SWITCH (NON 0=OPEN, 0=CLOSED)
DTBFCT	0			/DTA BUF. COUNT (INIT=-377)
DTEOTS	0			/END ZONE (EOT) ENTERED SWITCH (-=EOT)(0=NO EOT)
DTEOTZ	0			/DOUBLE END ZONE SWITCH (0=SET,-0=CLEAR)
TV1	DTRYAG
TV2	DTBCA
	.END
DTCCA	0			/CURRENT ADDR. POINTER FOR TRANSFER
DTCALP	0			/USER CAL POINTER
DTEOF	0			/EOF SWITCH, -0=EOF
DTHPT	0			/DTA BUF. LINE HEADER POINTER (INDEXED)
DTUND	0			/I/O UNDERWAY SWITCH, 0=NOT BUSY, NOT EQUAL 0=BUSY
DTUNIT	0			/(0-2)=DTA UNIT FOR TRANSFER
DTWC	0			/2'S COMP TRANSFER WORD COUNT
DTCKSM	0			/LINE CHECKSUM (2'S COMP)
DTCLSS	0			/FILE OPEN CLOSE SWITCH (NON 0=OPEN, 0=CLOSED)
DTBFCT	0			/DTA BUF. COUNT (INIT=-377)
DTEOTS	0			/END ZONE (EOT) ENTERED SWITCH (-=EOT)(0=NO EOT)
DTEOTZ	0			/DOUBLE END ZONE SWITCH (0=SET,-0=CLEAR)
	.END
