/RF08/DF32 DRIVER FOR RTS8 V2			8/30/74
/
/
/
/
/
/
/
/
/
/COPYRIGHT  (C)  1974,1975 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.
/
/
/
/
/
/
/
/
/
/
/ACCEPTS STANDARD RTS-8 MASS STORAGE MESSAGE FORMAT

	IFDEF	DF32	<TASK=	DF32>
	IFNDEF	DF32	<TASK=	RF08>

INIWT=	0
CUR=	0

DIML=	6615
DIMA=	6616
DFSE=	6621
DFSC=	6622
DISK=	6623
DXAL=	6643
DMAR=	6603
DMAW=	6605
DCMA=	6601

RFWC=	7750
RFCA=	7751

	FIELD	CUR%10
	*4400
TMP,
START,	CAL
DONEFG,	SKPINS
TRYCT,	INTRPT

LOOP,	CAL
	RECEIV		/GET A MESSAGE
ADDR,	0
	DCA	FLD
	ISZ	DONEFG	/INITIALIZE EVENT FLAG
	STA
DOAGIN,	TAD	ADDR
	IOF
	JMS	INIT	/START UP THE OLE DISK
	TAD	(FSTINT
	DCA	IDISP	/INITIALIZE INTERRUPT DISPATCH
	AC7775
	ION
	DCA	TRYCT	/TRY 3 TIMES
	CAL
	WAITE
PDONFG,	DONEFG		/WAIT FOR COMPLETION
	TAD	DONEFG
	SNA CLA
	JMP	NOPFAL	/EVENT FLAG 0 - NORMAL END
	TAD	(-4	/EVENT FLAG NOT 0 - POWER FAILURE MUST HAVE
	JMP	DOAGIN	/OCCURRED WHILE WE WERE WAITING.
NOPFAL,	JMS	GET	/THIS JUST SETS THE DF AND ADDR
P7600,	7600
	TAD	STATUS
	DCA  I	ADDR
	TAD	FLD
	DCA	PFLD
	TAD	ADDR
	TAD	(-7	/GET POINTER TO MESSAGE EVENT FLAG
	CAL
	POST
STATUS,
PFLD,	HLT
	JMP	LOOP	/GET ANOTHER MESSAGE

GET,	0
FLD,	HLT
	ISZ	ADDR
	TAD I	ADDR
	JMP I	GET
/RF08 STARTUP SUBROUTINE - CALLED WITH IOF
INIT,	0
	DCA	ADDR	/ADDRESS OF PARAMETER BLOCK -1 IN AC
	DCMA		/CLEAR DISK
	JMS	GET
	CLA		/IGNORE UNIT
	JMS	GET
	AND	(70
	DCA	TMP	/SAVE FIELD
	TAD I	ADDR
	CLL RAL
	AND	P7600
	SZA
	CIA		/FORM WORD COUNT FOR OPERATION
	CDF 0
	DCA I	(RFWC	/SAVE IN WC LOC
	RTL
	TAD	(DMAR	/GET READ OR WRITE INST
	DCA	INST
	STA
	JMS	GET
	CDF 0
	DCA I	(RFCA	/STORE CURRENT ADDRESS LOC
	JMS	GET
	IFNDEF	DF32	<
	CLL RTR
	RTR
	AND	(377	/GET HIGH ORDER DISK ADDRESS
	DXAL		/INTO EXTENDED REGISTER
	TAD	(500	/ENABLE COMPLETION AND ERROR INTERRUPT
	>
	IFDEF	DF32	<
	CLL RTL
	AND	(3700	/GET HIGH ORDER DISK ADDRESS
	>
	TAD	TMP	/ADD IN FIELD
	DIML		/LOAD EXTENDED ADDRESS REG
	CLA		/FOR DF32
	TAD I	ADDR
	CLL RTR
	RTR
	RAR
	AND	P7600	/ACTUALLY 7400 SINCE 200 BIT CLEAR!
INST,	HLT		/READY, STEADY, GO!
	JMP I	INIT
INTRPT,	0;0		/SKIP CHAINING GOES HERE
	IFNDEF	DF32	<DISK>	/SKIP ON COMPLETION OR ERROR
	IFDEF	DF32	<
	DFSC		/SKIP ON COMPLETION
	DFSE		/SKIP ON NO ERROR
	SKP		/COMPLETION OR ERROR - SKIP AGAIN
	>
	JMP I	INTRPT
	CDF CIF CUR	/SET DF AND IF CORRECTLY
	JMP I	.+1
IDISP,	HALT
	CIF 0		/IDISP IS A COROUTINE WITH
	POSTDS		/THE RTS-8 INTERRUPT SYSTEM

/RF08 INTERRUPT SERVICE

FSTINT,	DFSE		/ERROR?
	IFDEF	DF32	<SKP>	/SKIP IS REVERSE-SENSE
	JMP	DKOVER	/NO - WE'RE DONE
	ISZ	TRYCT	/ITS A MORE SERIOUS ERROR - HOW MANY
	JMP	TRYAGN	/TIMES HAVE WE HIT IT?
	DIMA		/TOO MANY - RETURN DISK STATUS REGISTER
DKOVER,	DCA	STATUS
	DCMA		/CLEAR NASTY FLAGS
	TAD	PDONFG	/GOING TO POSTDS WITH THE AC NON-ZERO
	JMS	IDISP	/WAKES UP THE HANDLER TO CLEAN UP
HALT,	HLT		/FOR GOOD LUCK

TRYAGN,	TAD	ADDR
	TAD	(-4	/BACK UP THE ADDRESS POINTER
	JMS	INIT
GOAWAY,	JMS	IDISP
	JMP	FSTINT
	PAGE
	$$
