	.TITLE DPC.
/	6-22-70	(EDIT6)
/COPYRIGHT 1969,1970, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/"EQUAL LENGTH DISK UNITS" MODS 6-9-70
/MULTICORE VERSION 5-21-70
/RP09/25 DISK ADAPTION (W.A. DESIMONE) RP EDIT 3 9-14-70
/8-26-70
/M. SIFNAS   10-21-67 (.WAITR 3-25-68) (IOPS 23 5-8-68)
/(56 FILES 5-15-68)
/DPC.=IOPS DISK/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	DPC.
/IOT ASSIGNMENTS
DPCS=706324			/CLEAR STATUS  (BITS 13,17,18 OF ST.A)
				/(BITS 9-15 OF ST.B)
DPSJ=706341			/SKIP ON JOB DONE FLAG
DPSE=706361			/SKIP ON ERROR FLAG
DPLF=706464			/LOAD ST.A (BITS 0-8)
DPLA=706304			/LOAD CYA,HA,SA FROM AC.
DPCA=706344			/LOAD CA REGISTER FROM AC (3-17)
DPWC=706364			/LOAD WC REGISTER FROM AC
DPRSA=706312			/READ ST. A INTO AC
DPRU=706412			/READ CA INTO AC (10-17)
DPCN=706454			/EXECUTE FUNC. REG.-AC CLEARED
DPRA=706432			/READ CYA,HA,SA INTO AC
DPRC=706452			/READ CA REGISTER INTO AC (3-17)
DPRW=706472			/READ WC REGISTER INTO AC
DPRSB=706332			/READ STATUS B INTO AC
DPLO=706444			/LOAD AC ONES INTO ST. A (BITS 0-8)
DPSA=706321			/SKIP ON ATTENTION FLAG
DTBUF=DTDIR
DPC.	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
	CLA
DTTABL	XX
	JMP	DTIN		/1=.INIT
	JMP	DTER6		/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.)
/
/I/O UNDERWAY CHECK SUBR.
DTIOU	0
	LAC	DTUND		/I/O UNDERWAY
	SNA			/YES
	JMP*	DTIOU		/OK-EXIT
DTBUSY	LAC	DTCALP		/BUSY-DTA I/O GOING ON
	DAC	DTARGP		/RETURN TO USER CAL
	JMP	DTDBK
/
	.EJECT
/DTA-DISK-INTERRUPT SERVICE
DTPIC	DAC	DTAC		/SAVE AC
	LAC*	(0
	DAC	DOUT		/SAVE PC, LINK, EXT. MODE, MEM. PTCT.
	LAC	DTION
	JMP	DTSTON
DTINT	JMP	DTPIC		/PIC ENTRY
	DAC	DTAC		/API ENTRY, SAVE AC
	LAC	DTINT		/SAVE PC, ETC.
	DAC	DOUT
	IORS			/CHECK PIC STATUS
	SMA!CLA			/FOR RESTORATION AT DISMISSAL
	LAW 17740			/PIC OFF, BUILD IOF
	TAD	DTION		/PIC ON, BUILD ION
DTSTON	DAC	DTDVSW
/
/RP15 DISK STATUS REGISTER "A" BIT ASSIGNMENTS
/	0-2=SELECTED UNIT
/	3-5=FUNCTION
/	0=IDLE,1=READ,2=WRITE,3=RECALIBRATE
/	4=SEEK,5=READ ALL,6=WRITE ALL, 7=READ COMPARA
/	6=DONE AND ERROR FLAG INTERRUPT ENABLED
/	7=ATTENTION FLAG INTERRUPT ENABLED
/	8=GO
/	9=WRITE PROTECT ERROR
/	10=NON-EXISTENT CYLINDER ADDRESS
/	11=NON-EXISTENT SURFACE ADDRESS
/	12=NON-EXISTENT SECTOR ADDRESS
/	13=HEADER NOT FOUND
/	14=SELECTED UNIT IS WRITE PROTECTED
/	15=SELECTED UNIT IS SEEK INCOMPLETE
/	16=JOB DONE FLAG
/	17=ERROR FLAG
/RP15 DISK STATUS REGISTER "B" BIT ASSIGNMENTS
/	0-7=ATTENTION UNITS 0-7
/	8=SELECTED UNIT IS UNSAFE
/	9=PROGRAM ERROR
/	10=END OF PACK
/	11=TIMING ERROR
/	12=FORMAT ERROR
/	13=WRITE CHECK ERROR
/	14=WORD PARITY ERROR
/	15=LONGITUDINAL PARITY ERROR
/	16=SELECTED UNIT SEEK UNDERWAY
/	17=SLECTED UNIT NOT READY
/
	DPRSA			/READ DISK STATUS
	DAC DKSET			/TEMP.
	CLL!RAR
	SZL
	JMP	DTERT		/ERR. FLAG
RFRDWT	DPCS			/CLEAR DISK STATUS
	LAC DKSET	/GET ST A FOR RP UNIT#
	AND (700000)		/MASK AND ISSUE AND IDLE
	DPLF		/TO CLEAR JOB AND ERR INTERR. ENABLE
DTION	ION			/ION TO ALLOW OTHER INTERRUPTS
	DZM	DTUND		/CLEAR I/O UNDERWAY
	JMP	DTDISM		/DATA OK, DISMISS
DTERT	LAC	DKSET		/RELOAD ST A.
	AND	(24)
	SZA			/AC70 IF SEEK INCOMP. OR HEADER
	JMP	RPRCL		/NOT FOUND-RECALIBRATE + RETRY
	LAC	DKSET
	AND	(340)		/AC70 IF NON-EXISTENT DISK ADDR.
	SZA
	JMP	DTER21
	DPRSB			/LOAD STATUS B
	DAC	RPSTB		/STORE
/CHECK STATUS B.
/
	AND	(34)		/AC>0 IF LONG., WORD PARITY, WRITE CHK.,
	SZA			/WRITE CHECK SHOULD NEVER HAPPEN
	JMP	DPARIT		/RETRY AND PASS DATA ANYWAY
	LAC	RPSTB
	AND	(140)		/AC>0 IF FORMAT ERR OR TIMING ERR.
	SZA			/RETRY.IF FAILS, IOPS 12 PLUS
	JMP	RP12RT		/STATUS B
	LAC	RPSTB
	AND	(200)		/END OF PACK
	SZA			/IF AC>0-IOPS-21
	JMP	DTER21
RPER12	LAC	RPSTB		/FALLS THROUGH HERE
	DAC*	DLIT3		/ON PROGRAM ERROR OR
	CLA			/SELECTED UNIT UNSAFE
	JMP	DTER12		/IOPS 12
RPRCL	LAC	(30000		/LOAD RECALIBRATE FUNCT.
	XOR	RPUNIT		/AND RETRY.
	DPLF
	DPRSB		/2 INSTRUS. FOR 4 MICROSEC. DELAY
	DPRSB
	DPSA			/TEST ATTENTION FLAG
	JMP	.-1
	ISZ	DTERCT
	JMP	DRETRY		/GO RETRY
	JMP	DKER20		/DISK FAILURE
RP12RT	ISZ	DTERCT		/RETRY ROUTINE FOR FORMAT
	JMP	DRETRY		/OR TIMING ERROR
	JMP	RPER12
DKER20	LAC DKSET			/DISK HARDWARE OR ADDR. PARITY ERROR.
	DAC*	DLIT3 		/(.MED
	LAW	20
	JMP*	DLIT4		/DISK FAILURE. (.MED+1
DTER21	LAC DKSET
DTR21A	DAC* DLIT3
	LAW	21		/ILLEGAL DISK ADDRESS.
	JMP* DLIT4
DPARIT	ISZ	DTERCT		/IF OVERFLOW, TAKE DATA ANYWAY
	SKP
	JMP RFRDWT
DRETRY	JMS	DKSET		/REISSUE DISK READ
DNRET	LAC DTERCT		/0 IF TRY COUNT OVERFLOWS
	DAC DTUND			/I/O UNDERWAY SW/
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
/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
/
/DTONCR+1 TO DTSTOP EXCLUSIVE USED FOR TEMP STORAGE AFTER FIRST INIT.
/DTAC - AC STORAGE CELL DURING INTERRUPT.
/DOUT - INTERRUPTED RETURN ADDRESS.
/DTERCT - PARITY COUNTER (INIT TO -10).
/DTBLC - BLOCK # BEING SEARCHED FOR.
/DTDTR - TRANSFER DIRECTION SWITCH
/RPCABS=STORAGE FOR BASE SUPERUNIT ADDRESS.
/RPUNIT=PHYSICAL DISK PACK DRIVE #
/RPSTB=STORAGE FOR STATUS B
/RPCACK=TEMP STORAGE FOR CHECK BLK# 100 ROUTINE
/DTNXBK - BLOCK # TO BE TRANSFERRED.
/DKNUM - DISK NUMBER.
/DKUNIT - NUMBER PLATTERS ON SYSTEM.
/DTCCA - CURRENT ADDRESS (CA) POINTER FOR TRANSFER.
/DTEOF - EOF SWITCH: -0=EOF.
/DTHPT - DTA BUFFER LINE HEADER PNTR (INDEXED).
/DTWC - 2'S COMP TRANSFER WORD COUNT.
/DTCKSM - LINE CHECKSUM (2'S COMP).
/DTCLSS - FILE OPEN CLOSE SWITCH (NON-0=OPEN, 0=CLOSED).
DTAC	16			/.SETUP
DOUT	DPSJ			/DISK DONE AND ERROR FLAG
DTERCT	DTINT			/DISK INT. SERV. ADDR.
RPCABS	CAL	64
RPUNIT	16
RPSTB	DPSE			/SKIP ON ERROR FLAG
RPCACK	DTINT
DTBLC	LAC DJSTOP
DTDTR	DAC	DTONCE
DTNXBK	LAS			/READ AC SWITCHES
DTCCA	AND	(770)		/DRIVE #(9-11) SUPER UNIT# (12-14)
DKNUM	DAC	DTNXBK		/MASK BITS 9-14 AND STORE
DKUNIT	AND	(700)		/MASK BITS 9-11
DTWC	JMS	RPR9		/AND SET UP RP UNIT#
DTCKSM	DAC	RPUNIT		/TOTAL ROT LEFT 9 AND STORE
DTCLSS	LAC	DTNXBK
DTHPT	AND	(70)		/MASK BITS 12-14
DTEOF	DAC	DTNXBK		/STR SUPUNT# TIMES 10(8)
RPTEMP	RAL!CLL			/NOW TIMES 20(8)
	TAD	DTNXBK		/NOW TIMES 30(8) - THAT IS
	JMS	RPR9		/30(8)*SUPUNT#=20(8)*SUPUNT#+10(8)*SUPUNT#
	RAL			/TOTAL OF 10 SHIFTS
	DAC	RPCABS		/STORE BASE CTL. ADDR.
	JMP	DTSTOP
RPR9	0
	RAL!CLL
	RTL
	RTL
	RTL
	RTL
	JMP*	RPR9
/STOP DTA ROUTINE
DTSTOP	DZM	DTEOF		/CLEAR EOF SWITCH
	DZM	DTCLSS		/SET .CLOSE SWITCH
	JMP DTDBK-1
/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
/
/SET UP CA,WC SUBR AND BEGIN READ
DTWCS	0
	DAC	DTCCA		/TRANSFER ADDR.
	LAW	-5
	DAC	DTERCT		/PARITY ERROR RETRY COUNT
	DAC	DTUND		/SET I/O UNDERWAY
	LAC	DTUNIT		/CHECK FOR LEGALITY OF
	CLL			/
	AND	(700000		/MASK BITS 0-2
	RTR; RTR
	DAC	RPTEMP		/STORE 2* UNIT# IN BITS 0-7
	RAR
	TAD	RPTEMP		/NOW 3* UNIT# IN BITS 0-7
	TAD	RPCABS		/BASE CYL. ADDR FROM .INIT
	DAC	DTBLC		/ABSOLUTE CYLA IN (0-7)
	LAC	DTNXBK		/LOGICAL BLOCK NUMBER
	TAD	(-1100		/-1100(8)
	SPA			/CHECK FOR ILLEGAL BLOCK NUMBER
	JMP	DTWCS1		/GO ON AND FINISH CONVERSION
	LAC	DTNXBK		/ILLEGAL BLOCK NUMBER
	JMP	DTR21A		/OUTPUT BAD BLOCK# WITH ERROR
DTWCS1	LAC	DTNXBK		/CONVERT LOGICAL BLK# TO
	DAC	RPTEMP		/ABSOLUTE PACK ADDR.
DTWCS2	TAD	(-310
	SPA			/BLK# < 310(8)?
	JMP	DTWCS3		/GO GET HEAD ADDR
	DAC	RPTEMP		/STORE REMAINDER
	LAC	DTBLC
	TAD	(2000)		/ADD ONE TO CA
	DAC	DTBLC
	LAC	RPTEMP
	JMP	DTWCS2
DTWCS3	LAC	RPTEMP
DTWCS4	TAD	(-12
	SPA
	JMP	DTWCS5
	DAC	RPTEMP
	LAC	DTBLC
	TAD	(40)		/BUMP HEAD ADDRESS
	DAC	DTBLC
	LAC	RPTEMP
	JMP	DTWCS4		/RECYCLE
DTWCS5	LAC	DTBLC
	TAD	RPTEMP		/INCLUDE SECTOR ADDRESS
	DAC	DTBLC
	JMS	DKSET
	JMP*	DTWCS
	LAC	DTNXBK		/LOGICAL BLOCK NUMBER.
/SUBR TO SET UP DISK I/O AND EXECUTE IOT'S
DKSET	0
DKSET2	LAC	DTCCA
	DPCA			/LOAD CA
	LAW	-400
	DPWC			/LOAD WC
	LAC	DTBLC
	DPLA			/LOAD CYL. ADDR,HA,SA
	LAC	RPUNIT		/DESELECT CURRENTLY ACTIVE DRIVE
	TAD	(400000		/TO ALLOW READ ONLY SWITCHES
	DPLF			/TO ACTIVATE ALSO UNIT OFF LINE
	DPRSB		/FOR 4 MICROSECOND DELAY
	LAC	(10000		/INPUT ONLY HANDLER
	XOR	RPUNIT		/LOAD PACK PHYS. UNIT#
	DPCS			/CLEAR STATUS
	DPLF			/LOAD FUNCTION LESS GO BIT TO TEST UNIT
	DPRSB			/READY.
	NOP			/ADDED INSTR. FOR 4 MICRS. DELAY
	DPRSB			/ADDED INSTR. FOR 4 MICRS. DELAY
	RAR
	AND	(400)
	SZL			/L=1 IF SELECTED UNIT NOT READY
	JMP	RPUOFL
	LAC	(5000		/JAM GO BIT, JB. DONE AND ERR INTERP.
	DPCS			/ENABLE-CLEAR STATUS
	DPLO			/LOAD GO BIT+INTERRUPT ENABLES
	ION			/ALLOW OTHER INTERRUPTS
	JMP*	DKSET
RPUOFL	LAC	(DKSET1		/IOPS4 ON UNIT OFF LINE
	DAC*	DLIT3
	LAC	DLIT4
	JMP	DTM4
DKSET1	LAC	DTERCT
	DAC	DTUND		/RESET I/O UNDERWAY SWITCH
	JMP	DKSET2
/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	DLTDIR		/(DTDIR
	JMS	DTWCS		/SET UP WC, CA AND START I/O
DTSEK1	JMS	DTIOU		/WAIT FOR DIRECTORY
DTUDRP=DTCKSM
DTCTS=DTCCA
DTCT1S=DTWC
DTDES=DTWCS
DTUWC=DTCCA
DTWPC=DTWC
/DIRECTORY SEARCH SUBR.
DTSK2	CLC			/SYSTEM TAPE?
	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
	SPA			/INCOMPLETE FILE
	JMP	DTSEK2		/YES-1ST BL# IN AC
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	(2		/FILE STILL ACTIVE
				/ILL. DATA MODE (DTER7)
DTER6	TAD	(6		/ILL. HANDLER FUNCTION
DTM4	DZM	DTUND
	JMP*	DLIT4		/KM-9 ERR. LOC.
DTSEK2	DAC	DTCLSS		/SET CLOSE SWITCH
	XOR	(400000		/CLEAR SIGN BIT
	JMP	DTRNX1		/TRANSFER 1ST BLOCK
/.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
	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
	JMP*	DLIT4		/IOPS 23
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
DTRDE	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
DTRDC	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
DTRDN1	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
DTUMSK	LAW	-400		/BUF. SIZE
	DAC	DTBFCT
DTCOUB	LAC	DLTDIR		/TRANSFER (DTBUF
	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.
L63	CAL	63		/CONSTANT
BNKBTS	JMS	.		/GET BANK BITS
	LAC	BNKBTS		/BANK BIT INIT. OF HANDLER DONE ONCE
	XOR	DTERCT
	AND	DTDIR
	XOR	DTERCT
	DAC	DTERCT
	XOR RPCACK
	AND DTDIR
	XOR RPCACK
	DAC RPCACK
	XOR	DLTDIR
	AND	DTDIR
	XOR	DLTDIR
	DAC	DLTDIR
	TAD	DLTD40
	DAC	DLTD40
	TAD	DLTSYS
	DAC	DLTSYS
	LAC	(64)
	DAC	DTONCE
	JMP	DTONCE
	.LOC	DTDIR+400		
DLTDIR	DTDIR			/DIRECTORY POINTER
DLTSYS	203-40			/WD 3 OF SYS BIT MAP
DLTD40	40			/DIRECTORY ENTRY SECTION POINTER
DTARGP	0			/ENTRANCE ARG. POINTER
DTCALP	0			/USER CAL POINTER
DTUND	0			/I/O UNDERWAY: 0=NOT BUSY;NON-0=BUSY.
DTBFCT	-377			/DTA BUFFER COUNT.
DTUNIT	0			/(0-2)=DTA UNIT FOR TRANSFER
DLIT4	4
DLIT3	3
	.END
