/3 RK8 NON SYSTEM HANDLER
/
/
/
/
/
/
/
/
/
/COPYRIGHT  (C)  1974,1975,1977 BY DIGITAL EQUIPMENT CORPORATION
/
/
/
/
/
/
/
/
/
/
/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 RESPONSIBILITY
/FOR ANY ERRORS THAT MAY APPEAR IN THIS DOCUMENT.
/
/THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FURNISHED 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 PROVIDED IN WRITING BY DIGITAL.
/
/DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY FOR THE USE
/OR RELIABILITY OF ITS SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY
/DIGITAL.
/
/
/
/
/
/
/
/
/
/
	*0
	-4

DEVICE RK01;DEVICE RKA0;4050;20;ZBLOCK 2
DEVICE RK01;DEVICE RKA1;4050;21;ZBLOCK 2
DEVICE RK01;DEVICE RKA2;4050;22;ZBLOCK 2
DEVICE RK01;DEVICE RKA3;4050;23;ZBLOCK 2

	DLDC=6732
	DCLS=6742
	DRDS=6741
	DSKD=6745
	DSKE=6747
	DCLA=6751
	DLWC=6753
	DLCA=6755
	DLDR=6733

	RKVERSION="A&77

/V3 CHANGES:

/1.	VERSION # IS NOW 1
/2.	A FULL 4K READ OR WRITE IS NOW LEGAL

	*200
/THE ENTRY POINTS FOR RK8 ARE SET AT 20-23. VITAL!!

RLOC,	0		/FOR BUFFER ADDRESS
RREC,	0		/HOLDS RECORD NO.
R76,	76
RDLDR,	DLDR
RKANO,	0
RKAISZ,	ISZ RKANO
RBLKCT,	0		/HOLDS TOTAL WORD COUNT
RERRCT,	0		/# ERROR TRIES
R177,	177
R40,	40
RM3,	-3
R400,	400
R7400,	7400
RKA,	0		/HOLDS ARGUMENT ADDRESS
R34,	34
RZERO,	RKVERSION
	IFNZRO .-220 <ADRERR,QQQ>
RKA0,	ISZ RKANO
RKA1,	ISZ RKANO
RKA2,	ISZ RKANO
RKA3,	ISZ RKANO
R7600,	7600
	TAD RM3
	DCA RERRCT	/3 TRIES ON ERROR
	TAD RKANO	/THIS CODE RESTORES THE ISZ RKANO
	CMA		/WHICH WAS DESTROYED IN THE CALL
	TAD RKATAD
	DCA RFUNCT
	CLA CLL CML RTR
	TAD RFUNCT	/FORM DCA RKAN,WHERE RKAN WAS CALLED
	DCA RKADCA
	RDF
	TAD RCDIF	/RESTORE TO PROPER FIELD
	DCA REXIT
RFUNCT,	HLT		/CONTAINS TAD RKAN WHEN EXECUTED
	DCA RKA		/SO WE SAVE ADDRESS OF ARGUMENTS
	TAD RKAISZ	/AND NOW RESTORE THE ISZ RKANO
RKADCA,	HLT
	TAD I RKA	/FUNCTION WORD
	DCA RFUNCT
	ISZ RKA
	CLA CMA		/BUFFER ADDRESS -1
	TAD I RKA
	DCA RLOC
	ISZ RKA
	TAD I RKA	/RECORD NUMBER
	DCA RREC
	TAD RFUNCT	/NOW FORM RK8 IOT FROM FUNCTION.
	CLL RAL		/READ/WRITE TO LINK
	AND R7600	/ISOLATE WORD COUNT
	DCA RBLKCT
	RTL		/READ=6733,WRITE=6735
	TAD RDLDR
	DCA RINST
RLOOP,	TAD RLOC	/LOAD CURRENT ADDRESS
	DLCA
	TAD RBLKCT	/TEST WORD COUNT FOR SIZE.
RKATAD,	TAD R7600	/FULL=256, HALF=128
	SZA CLA
	TAD R7600
	TAD R7600
	DLWC		/LOAD WORD COUNT
	TAD RFUNCT	/LOADING COMMAND WORD WITH FIELD
	CMA RAR		/AND DISK SELECTION
	AND R34
	TAD RKANO
	CMA RAL
	AND R76
	DLDC
	DCLS		/CLEARS SELECT ERROR IF STILL UP
	TAD RREC
RINST,	HLT		/GETS DISK IOT
	DSKD		/TEST COMPLETION FLAG
	SKP CLA		/NOT DONE YET
	JMP RCTLC	/DONE. CHECK FOR ^C
	DSKE		/IS ERROR UP?
	JMP .-4
RERROR,	ISZ RERRCT	/ERROR BUMP COUNT
	JMP .+4
	DCA RKANO	/IT'S ALL OVER. CLEAR FOR RECALL
	CLA CLL CML RAR
	JMP RETRN+1	/FATAL ERROR
	DRDS		/LOOK AT STSTUS
	AND R40		/TRACK NOT FOUND BIT
	ISZ RZERO	/CARRY OVER FROM SYSTEM HANDLER
	JMP .-1
	SNA CLA
	JMP RLOOP	/TRY AGAIN
	DCLA		/RECALIBRATE
	DSKD
	JMP .-1
	JMP RLOOP	/AND TRY AGAIN
RNEXT,	DSKE		/TRANSFER DONE. IS ERROR UP?
	SKP
	JMP RERROR	/YEP.TOUGH LUCK
	ISZ RREC	/BUMP RECORD NUMBER
	TAD RLOC
	TAD R400	/BUMP CURRENT ADDRESS
	DCA RLOC
	TAD RBLKCT	/DONE WITH ALL TRANSFERS?
	SNA
	JMP RDONE	/V3  0 OK HERE
	CLL CML
	TAD R7400
	SZL SNA
	JMP RDONE
	DCA RBLKCT	/NO..UPDATE TOTAL WORD COUNT
	JMP RLOOP	/AND DO THE TRANSFER
RDONE,	CLA
	DCA RKANO	/CLEAR FOR RECALL
RETRN,	ISZ RKA
	ISZ RKA
REXIT,	HLT
	JMP I RKA

RCTLC,	KRS		/TEST FOR ^C IN KEYBOARD BUFFER
	AND R177	/WITH THE FLAG UP
	TAD RM3
	SNA CLA
	KSF
	JMP RNEXT	/NO ^C, KEEP GOING
RCDIF,	CIF CDF 0
	JMP I R7600
	$

