
	/TC01 SUB-ROUTINES	REV. 7/67

DTXA=6764	/XOR AC TO STATUS A
DTRB=6772	/READ STATUS B
DTCA=6762	/CLEAR STATUS A
DTRA=6761	/READ STATUS A
DTLA=6766	/LOAD STATUS A (CLEAR AND XOR)
DTLB=6774	/LOAD STATUS B
DTSF=6771	/SKIP ON TC01 FLAGS

R128,	0		/READ 128 WORDS
	JMS DWAIT	/WAIT IF MOTION IS ON
	TAD R128
	DCA W128
	CLA IAC		/SET TO WRITE
	JMP DGR-2

W128,	0		/WRITE 128 WORDS
	JMS DWAIT	/WAIT IF MOTION IS ON
	TAD DR128C	/DR128
	DCA DRET	/READ WRITE RETURN AFTER SEARCH
DGR,	CLA CMA
	JMS DGET
	DCA R128	/FIRST CORE LOCATION-1 OF TRANSFER
	JMS DGET
	DCA DUF		/UNIT AND FIELD
	JMS DGET
	DCA DNCB	/ -NUMBER OF BLOCKS TO BE TRANSFERRED
	TAD DCRET
	DCA DSERH
	DCA DSTOP	/DON'T STOP TRANSPORT AFTER SEARCH
	JMS DGET	/GET BLOCK NO.
	DCA DTEM	/AND STORE
	JMP DTS1	/INITIATE SEARCH
DRET,	0		/DR128 IF WRITE,  OR DR128+1 IF READ
DUF,	0		/UNIT AND FIELD
	JMP I W128


DTEMP,
DTEMX,
DGET,	0		/PICK UP ARGUMENTS
	TAD I W128
	ISZ W128
	JMP I DGET
DCRET,	DRET
DR128,	TAD D20		/WRITE (NOT READ),(40-20)
	TAD D30		/READ,CANCEL SEARCH (20+10)
	DTXA		/SET FUNCTION
	TAD R128	/1ST CORE LOC.-1 OF TRANSFER
	DCA I DCAA	/TO 7755(CA)
	ISZ MCOM	/POINT INTERRUPT RETURN TO DATA

/PAGE 2

DR127,	DTXA		/SEND READ OR WRITE
	TAD D7600	/SET WORD COUNT FOR 1 PAGE
	DCA I DWC	/-128 TO 7754 (WC)
	JMP I DIS	/EXIT

	JMP DTS3A
DINT,	DTRB		/READ STATUS B
	SPA CLA
	JMP DER		/ERROR FLAG
	ISZ DNCB	/COUNT BLOCKS
	JMP DR127	/CONTINUE OPERATION
DTURNX,	TAD D200	/COMPLEMENT MOTION AND DIRECTION
	TAD D400
	JMP DR127

DR128C,	DR128
DCAA,	7755		/POINTER TO CURRENT ADDRESS
DWC,	7754		/POINTER TO WORD COUNT
DNCB,	0
D30,	30
DCINT,	DINT-1
D20,	20
DTEM,	0		/HOLDS REQUIRED BLK NO.
DBLK,	DTBLK
D400,	400		/CHANGE DIRECTION
D614,	614		/REVERSE, GO, SEARCH INTERRUPT ENABLE
DTBLK,	0		/BLOCK NUMBER DEPOSITED HERE BY CONTROL
D200,	200		/CHANGE STOP/GO

DSERH,	0
	DCA DTEM	/STORE BLOCK NO
	JMS DWAIT
	TAD DTURNX
	DCA DSTOP	/STOP TRANSPORT AFTER SEARCH
DTS1,	TAD DBLK	/DTBLK TO 7755 (CA)
	DCA I DCAA
	TAD DCINT	/DINT-1
	DCA MCOM	/INTERRUPT RETURN
DTS2,	CLA IAC
	TAD DSERH	/DRET
	DCA DTEMP
	TAD I DTEMP
	AND D7000	/PICK UP UNIT NUMBER
	TAD D614	/SET TO SEARCH,NORMAL,REVERSE
	DTLA		/LOAD STATUS A
	DTLB		/FIELD 0
	ISZ DTEMP
	ION		/ENABLE INTERRUPT
	JMP I DTEMP	/DUF+1, RETURN TO USER

/PAGE 3

DTS3A,	DTRB		/READ STATUS B
	RTL		/LOOK AT BIT 2
	SPA CLA		/END ZONE?
	JMP DTURNX	/YES (MOTION BIT=0), TURN
	DTRB
	SPA CLA
	JMP DER		/ERROR FLAG BIT 0=1
	DTRA
D7000,	RTL
	RTL		/FOR-REV STATUS (BIT 3) IN LINK
D7600,	7600		/GROUP 2 CLA
	TAD DTBLK
	CMA IAC
	TAD DTEM	/LINK COMP. IF REQUIRED BLK NO.
	SNA		/IS BIGGER I.E. MUST GO FORWARD
	JMP DTFIND	/FOUND BLOCK CHECK DIRECTION
	CMA IAC
	SNL
	IAC 		/GO 2 MORE BLOCKS BEFORE TURNING
	SNL CLA
DTURN,	TAD D400	/TURN IF HERE
	JMP DR127	/XOR TO A STATUS AND DISMIS
DER,	DTRA		/ERROR ROUTINE, READ STATUS A
	AND D200	/STOP TAPE IF RUNNING,  I.E. SET BIT 4 TO 0
	TAD D2		/DON'T CLEAR ERRORS	BIT 10=1
	DTXA
	DTRB		/ERROR STATUS B
	JMP I DTERR
DTFIND,	SNL CLA		/TEST DIRECTION
	JMP DR127	/DONT TURN YET, STILL IN REVERSE
	TAD I DSERH	/DRET, GET COMPLETION RETURN
	DCA DSERH	/SINCE MOTION IS FORWARD
DSTOP,	0		/EITHER 0 (NOP) OR TAD D200 (STOP)
	DTXA		/CLEAR FLAG
	TAD DUF
	DTLB		/SET MEMORY FIELD
	JMP I DSERH	/EXIT TO COMPLETION RETURN
D2,	2


DWAIT,	0		/WAIT FOR NO MOTION
	DTRA		/IOR STATUS A
	DTRA		/AGAIN, IN CASE MOTION BIT
	AND D200	/WAS 0 DUE TO END ZONE
	SZA CLA
	JMP .-4
	JMP I DWAIT

PAUSE
