Google
 

Trailing-Edge - PDP-10 Archives - AP-4178E-RM - swskit-sources/cdksdv.mac
There are 20 other files named cdksdv.mac in the archive. Click here to see a list.
;<3A.MONITOR>CDKSDV.MAC.57, 31-Aug-78 23:16:42, Edit by MCLEAN
;FIX MAP MASK FOR 21 PHYSICAL BITS AND FIX IMAGE MODE TO UPDATE ALL WORDS
;<3A.MONITOR>CDKSDV.MAC.56, 12-May-78 00:20:21, Edit by MCLEAN
;ANOTHER CHECK FOR NON-EX CARD READER
;<3A.MONITOR>CDKSDV.MAC.55, 22-Apr-78 18:02:47, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.54, 22-Apr-78 17:55:47, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.53, 22-Apr-78 17:14:08, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.52, 21-Apr-78 13:38:28, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.51, 21-Apr-78 12:55:30, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.50, 17-Apr-78 17:18:23, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.49, 17-Apr-78 16:09:59, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.48, 17-Apr-78 16:01:37, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.47, 17-Apr-78 15:59:23, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.46, 17-Apr-78 15:47:32, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.45, 17-Apr-78 15:23:42, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.44, 17-Apr-78 00:24:33, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.43, 15-Apr-78 18:14:39, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.42, 15-Apr-78 17:39:02, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.41, 15-Apr-78 17:38:29, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.40, 15-Apr-78 16:35:17, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.39, 15-Apr-78 15:49:31, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.38, 15-Apr-78 14:55:05, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.37, 15-Apr-78 14:52:45, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.36, 15-Apr-78 14:51:16, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.35, 13-Apr-78 01:17:48, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.34, 13-Apr-78 01:13:33, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.33, 12-Apr-78 19:02:33, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.32, 11-Apr-78 00:56:58, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.31, 11-Apr-78 00:53:40, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.30, 10-Apr-78 22:30:26, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.29, 10-Apr-78 18:16:43, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.28, 10-Apr-78 18:11:28, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.27, 10-Apr-78 18:09:02, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.26, 10-Apr-78 18:05:39, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.25,  9-Apr-78 15:31:55, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.24,  9-Apr-78 15:04:29, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.23,  9-Apr-78 14:33:10, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.22,  9-Apr-78 14:31:37, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.21,  9-Apr-78 14:27:15, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.20,  9-Apr-78 14:24:30, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.19,  9-Apr-78 14:21:17, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.18,  9-Apr-78 13:04:40, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.17,  9-Apr-78 01:14:31, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.16,  9-Apr-78 00:48:50, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.15,  7-Apr-78 00:58:35, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.14,  7-Apr-78 00:52:40, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.13, 19-Mar-78 21:48:00, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.12, 19-Mar-78 21:45:05, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.11, 19-Mar-78 21:40:06, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.10, 19-Mar-78 21:39:05, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.9, 19-Mar-78 21:24:32, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.8, 16-Mar-78 23:48:45, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.7, 11-Feb-78 19:16:33, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.6, 11-Feb-78 19:13:49, Edit by MCLEAN
;<3A.MONITOR>CDKSDV.MAC.5,  5-Feb-78 17:37:11, Edit by MCLEAN
;<3A.MONITOR>CDKLDV.MAC.6,  5-Feb-78 16:00:11, Edit by MCLEAN
;<3A.MONITOR>CDKLDV.MAC.5,  5-Feb-78 15:30:31, Edit by MCLEAN
;CARDREADER SERVICE FOR KS10
	RESCD
	SEARCH PROKS,PROKL,SERCOD


CDVTKS==.
	IFIW!KSRD		;READ A CARD
	IFIW!KSCLZ		;CLOSE
	IFIW!KSRST		;RESTART
	IFIW!KSINI		;INIT
	IFIW!CDKSST		;STATUS
	IFIW!KSSWP		;PUT BUFFER IN CORRECT FORMAT FOR KL

;KS10 RESIDENT STORAGE

ASCBSZ:	POINT 18,0		;ASCII POINTER FOR UNSWAPPED BUFFER


RS (CDIACS,20)			;INTERRUPT ACS
CDSTSZ=40			;SIZE OF CARDREADER STACK
RS (CDRSTK,CDSTSZ)		;CARD READER STACK

RS (CDRINB,4)

;CDRTBL ENTRY OF EXTERNAL PAGE ADDRESSES

CDRTBL::CD11BA			;BASE ADDRESS OF CD11
KSINI:	SKIPN PROFLG		;IF PROFLG NOT SET DO NOTHING
	RET
	SETZ U,0		;DO ONLY UNIT 0 (ONLY ONE SUPPORTED)
	MOVE T1,CDRTBL(U)	;GET BASE ADDRESS OF THIS UNIT
	CALL UBGOOD		;CHECK FOR DEVICE
	RET			;NO DEVICE
	SETONE CDEXST,(Q2)	;INFORM WORLD WE EXIST
	MOVEM Q2,CDUNIT		;SAVE UNIT NUMBER
	MOVEI T1,KSTYP		;SET TYPE
	STOR T1,CDRTYP,(Q2)
	MOVE T1,[XPCW CDRINB]	;POINT TO INTERRUPT ROUTINE
	HLR T2,CDRTBL(U)	;GET UBA NUMBER
	MOVE T2,SMTEPT(T2)	;GET VECTOR TABLE
	MOVEM T1,CDRIVT(T2)	;STORE VECTOR
	MOVEI T1,CDRINT		;SET UP INTERRUPT VECTOR IN INTERRUPT BLOCK
	MOVEM T1,CDRINB+3
	SETZM CDRINB+2		;INSURE NEW FLAGS 0
	HLR T1,CDRTBL(U)	;GET UBA NUMBER
	MOVEI T2,1		;ONE WINDOW NEEDE
	CALL ALUBWA		;GET UNIBUS WINDOW
	BUG(HLT,NCDWA,<KSINI: NO CARDREADER UBA WINDOW>)
	MOVEM T1,CDUBAD(U)	;SAVE UBA ADDRESS
	MOVEM T2,CD11A(U)	;SAVE CONVERSION ADDRESS
KSRST:	MOVEI T2,CDPWR		;RESET THE DEVICE
	WRIO T2,@CDRTBL(U)
	MOVEI T2,CDIEN		;SET INTERRUPT ENABLE
	WRIO T2,@CDRTBL(U)
	RET			;RETURN
;INTERRUPT SERVICE ROUTINE FOR CARDREADER

CDRINT:	MOVEM 17,CDIACS+17	;SAVE A REGISTER
	MOVEI 17,CDIACS		;SAVE REST OF REGISTERS
	BLT 17,CDIACS+16
	MOVE P,[IOWD CDSTSZ,CDRSTK] ;INIT STACK
	MOVE T4,CDUNIT		;GET UNIT ADDRESS
	SETZ U,0		;SET UP FOR UNIT 0 (ONLY SUPPORTED UNIT FOR NOW)
	JE CDOPN,(T4),[	CALL CDINOK	;EXIT IF NOTHING OPEN
			JRST CDRIXT]
	RDIO T1,@CDRTBL(U)	;READ THE STATUS REGISTER
	TRNE T1,CDERR1		;CHECK FOR ERROR
	JRST [	CALL CDINOK	;ERROR GO DO STATUS REPORT
		JRST CDRIXT]	;AND EXIT
	LOAD T1,CDCNT,(T4)	;GET THE COUNT
	ADDI T1,^D160		;UPDATE COUNT
	STOR T1,CDCNT,(T4)
	AOS CARDCT(T4)		;INDICATE ANOTHER CARD HERE
	AOS CDRCT1(T4)		;ONE MORE BUFFER FILLED
	SETZRO CDBLK,(T4)	;NOT WAITING FOR A CARD ANYMORE
	CALL SETBF1		;FIND INT BUFFER
	LOAD C,CDBFI,(T4)	;GET INTERRUPT LEVEL BUFFER BIT
	XORI C,1		;TOGGLE IT
	STOR C,CDBFI,(T4)
	JN CDAII,(T4),[	LDB T1,[POINT ^D16,0(T1),15]
			TRC A,7417 ;SEE IF THIS IS AN EOF
			TRCE T1,17 ;IS IT?
			TRCN T1,7400 ;OR THIS FLAVOR?
			JRST CDRIXT	     ;IS AN EOF
			JRST .+1]    ;NOT AN EOF
	MOVEI T1,CDHCK		;HOPPER EMPTY?
	SKIPLE CDRCT1(T4)	;ANOTHER PI BUFFER AVAILABLE?
	JRST CDRIXT		;NOPE
	TION T1,@CDRTBL(U)	;CHECK FOR HOPPER EMPTY
	CALL RDCARD		;READ NEXT CARD
CDRIXT:	MOVSI 17,CDIACS		;RESTORE AC'S
	BLT 17,16
	MOVE 17,CDIACS+17