;DLS DEBUGGING IOTS

.DEFINE SETLIN [ ] [D[MASK[8.]] DEST[Q] PUSHJ[DLS.SETLIN] NORM]

.DEFINE MJUMP[X] [D[AR] ALU[DORQ] DEST[Q] JUMP[X] NORM]

;;;;;  DWP 1/27/80:7600
DLS.DEB:
:DLSDISP2 + 20		;IOT DISPATCH FOR DEVICE 374

SETLIN $			;BLKI 374 = READ CR1
JUMP[DLS.RCR1] NORM $

SETLIN $			;DATAI 374 = READ CR2
JUMP[DLS.RCR2] NORM $

SETLIN $			;BLKO 374 = READ STAT
JUMP[DLS.RSTAT] NORM $

SETLIN $			;DATAO 374 = READ HOLD
JUMP[DLS.RHOLD] NORM $

SETLIN $			;CONO 374 = WRITE CR1
MJUMP[DLS.WCR1] $

SETLIN $			;CONI 374 = WRITE CR2
MJUMP[DLS.WCR2] $

SETLIN $			;CONSZ 374 = WRITE STAT (SYN,DLE)
MJUMP[DLS.WSTAT] $

SETLIN $			;CONSO 374 = WRITE HOLD
MJUMP[DLS.WHOLD] $

:DLS.DEB

DLS.SETLIN:	FIXM1 $			;SETUP LINE # IN Q
	D[MEM] ALU[D&Q] DEST[AR] NORM $
	D[MASK[4]] ROT[21.] DEST[Q] NORM $
	D[MEM] ROT[3] ALU[D&Q] DEST[Q] POPJ NORM $

DLS.RCR1:	DLSREAD[DLSCR1 AR 8.] JUMP[DLS.READ] $

DLS.RCR2:	DLSREAD[DLSCR2 AR 8.] JUMP[DLS.READ] $

DLS.RSTAT:	DLSREAD[DLSSTAT AR 8.] JUMP[DLS.READ] $

DLS.RHOLD:	DLSREAD[DLSHOLD AR 8.] JUMP[DLS.READ] $

DLS.READ:	D[MASK[8.]] DEST[Q] NORM $
	D[AR] ALU[D&Q] DEST[Q] NORM $
	D[MEM] SPEC[LEFT] ALU[DORQ] DEST[MEMSTO] MEMST $

DLS.WCR1:	DLSWRITE[DLSCR1] JUMP[MAIN] $

DLS.WCR2:	DLSWRITE[DLSCR2] JUMP[MAIN] $

DLS.WSTAT:	DLSWRITE[DLSSTAT] JUMP[MAIN] $

DLS.WHOLD:	DLSWRITE[DLSHOLD] JUMP[MAIN] $

DLS.INT:	JUMP[.] $
	JUMP[. + 1] $
	ALU[0] DEST[IOD] SPEC[IOB-OUT] NORM $
	MAPF[DLSCSR] CYLEN[IOB-OUT] $
	DEST[CLR-DEV-FROM-INTR] JUMP[MAIN] $

DLS.RINT:
: DLSDISP2 + 0	;BLKI 370 - GET INTERRUPT STATUS
	JUMP[.] $
	JUMP[DLS.RINT] $
: DLS.RINT
	D[CONST 1] ROT[26.] DEST[Q] NORM $
	MAPF[DLSNOSEL] SPEC[IOB-OUT] D[CONST 1] ROT[20.]
		ALU[D+Q+1] DEST[IOD] NORM $
	MAPF[DLSNOSEL] CYLEN[IOB-OUT] $
	MAPF[DLSIACK] LONG $
	MAPF[DLSIACK] LONG $
	MAPF[DLSIACK] LONG $
	MAPF[DLSIACK] LONG $
	MAPF[DLSIACK] SPEC[IOB-OUT] ALU[Q] DEST[IOD] LONG $
	MAPF[DLSIACK] SPEC[IOB-IN] LONG $
	MAPF[DLSIACK] CYLEN[IOB-IN] D[IOD] DEST[Q] $
	ALU[Q] DEST[MEMSTO] MEMST $

DLS.EINT:
: DLSDISP2 + 4	;BLKO 370 - ENABLE INTERRUPT
	JUMP[.] $
	JUMP[DLS.EINT] $
:DLS.EINT
	D[CONST 1] ROT[27.] DEST[IOD] SPEC[IOB-OUT] NORM $
	MAPF[DLSCSR] CYLEN[IOB-OUT] JUMP[MAIN] $
