Google
 

Trailing-Edge - PDP-10 Archives - BB-Y393G-SM - monitor-sources/cdkldv.mac
There are 45 other files named cdkldv.mac in the archive. Click here to see a list.
;<4-1-FIELD-IMAGE.MONITOR>CDKLDV.MAC.2, 25-Feb-82 20:12:48, EDIT BY DONAHUE
;UPDATE COPYRIGHT DATE
;<4.MONITOR>CDKLDV.MAC.5,  3-Jan-80 08:08:20, EDIT BY R.ACE
;UPDATE COPYRIGHT DATE
;<4.MONITOR>CDKLDV.MAC.4,  4-Mar-79 14:37:31, Edit by KONEN
;UPDATE COPYRIGHT FOR RELEASE 4
;<4.MONITOR>CDKLDV.MAC.3,  1-Jan-79 15:19:46, EDIT BY DBELL
;TCO 4.2139 - DON'T READ AHEAD CARDS IF ANY ERROR IS DETECTED.
;<4.MONITOR>CDKLDV.MAC.2, 15-Dec-78 13:21:25, EDIT BY ENGEL
;AT CDVTFE+4 CHANGE TO KLRSTS

;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1976,1977,1978,1979,1980,1981,1982 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

	RESCD
	SEARCH PROKL

CDRDTV::CDRHSD			;STRING DATA
	R			; JUST RETURN
	CDRTLS			;STATUS
	0			;NO LINE ALLOCATION
	CDRSER			;SYSERR ENTRY
	CDRRLD			;RELOAD ACTION

ASCBSZ:	POINT 16,0		;BYTE POINTER FOR ASCII CHARACTERS

CDVTFE==.
	IFIW!CDRDC		;READ A CARD
	IFIW!CDRFLS		;CLOSE
	IFIW!R			;RESTART
	IFIW!R			;INIT
	IFIW!KLRSTS		;RETURN STATUS
	IFIW!R			;BYTE SWAP
; ROUTINE CALLED FROM DTE SERVICE ON AN -11 RELOAD

CDRRLD:	CAME A,MSTRDT		;IS THIS THE MASTER?
	RET			;NO
	SAVET			;PRESERVE TEMPORARY AC'S
	MOVSI A,-CDRN		;GET AOBJN POINTER WITH UNIT # IN RH

CDRRL2:	SETONE CDER,(A)		;INDICATE THIS CARD READER HAD AN ERROR
	SETONE CDRLD,(A)	;MARK THAT THIS FRONT END WAS RELOADED
	SETZRO CDBLK,(A)	;NO NEED TO BLOCK
	AOS CARDER(A)		;BUMP ERROR COUNT
	AOBJN A,CDRRL2		;LOOP OVER ALL CARD READERS
	RET			;RETURN
;ROUTINE CALLED FROM THE PROTOCOL SERVICE TO DETERMINE THE OWNING
;PROCESS FOR A CDR. CALL IS:
;	B/ UNIT,,DEVICE-CODE
;RETURNS:
;	+2 ALWAYS WITH A=OWNING PROCESS OR -1

CDRSER:	HLRZS B			;GET UNIT
	JE CDOPN,(B),[		;IS IT OPENED?
		MOVEI A,-1	;NO. SAY UNASSIGNED
		RETSKP]		;AND GO BACK
	LOAD A,CDFRK,(B)	;GET FORK ID
	RETSKP			;AND GO TO IT
	RESCD
;DTE INTERRUPT SERVICE

	RESCD			;MUST BE RESIDENT

CDRHSD::JSP CX,CHKCDR		;GO VERIFY ARGS
	JE CDOPN,(B),R		;IF NOT OPENED, RETURN
	SAVEQ			;SAVE REGS
	MOVE U,B		;UNIT NUMBER
	MOVEI C,0(A)		;MOVE THE COUNT
	LOAD A,CDWRD,(B)	;WHERE IT IS GOING
	HRLI A,0(D)		;SOURCE
	MOVEI D,0(A)		;DEST AGAIN
	LSH C,-2		;WORDS TO COPY
	ADDI D,0(C)		;WHERE WE WILL WIND UP
	STOR D,CDWRD,(B)	;WHERE TO BEGIN NEXT
	BLT A,-1(D)		;COPY THE DATA
	LSH C,2			;RESTORE BYTE COUNT FOR COMPUTATION
	LOAD A,CDCNT,(B)	;GET CURRENT COUNT
	ADDI A,0(C)		;NEW COUNT AFTER THIS TRANSFER
	STOR A,CDCNT,(B)	;SAVE IT
	CAIGE A,^D160		;A FULL CARD ARRIVED?
	RET			;NO. ALL DONE
	AOS CARDCT(B)		;ANOTHER CARD ARRIVED
	AOS CDRCT1(B)		;ONE MORE BUFFER FILLED
	SETZRO CDBLK,(B)	;NOT WAITING FOR A CARD ANYMORE
	CALL SETBF1		;GO FIND INT BUFFER
	LOAD C,CDBFI,(U)	;GET INTERRUPT LEVEL BUFFER BIT
	XORI C,1		;TOGGLE IT
	STOR C,CDBFI,(U)	;READ INTO THIS ONE NEXT
	JN CDAII,(U),[	LDB A,[POINT ^D16,0(A),15]
			TRC A,7417 ;SEE IF THIS IS AN EOF
			TRCE A,17 ;IS IT?
			TRCN A,7400 ;OR THIS FLAVOR?
			RET	 ;IS AN EOF
			JRST .+1] ;NOT AN EOF
	LOAD A,CDERR,(U)	;GET HARDWARE STATUS
	SKIPG CDRCT1(U)		;ANOTHER PI BUFFER AVAILABLE?
	TXNE A,MO%HE!MO%OL!MO%SFL!MO%HEM!MO%SCK!MO%PCK!MO%RCK	;STATUS OK?
	RET			;NO, DON'T DO NEXT READ THEN
	CALLRET RDCARD		;DO READ AHEAD
;ROUTINE TO GET STATUS OF CDR

KLRSTS:	MOVE A,MSTRDT		;NO POST
	MOVE B,[.DFRDS,,.FECDR]	;REQUEST STATUS
	MOVSI C,0(U)		;THE UNIT, DIRECT
	MOVEI D,0(U)		;UNIT
	CALL DTEQ		;REQUEST STATUS
	 JFCL
	RET			;AND DONE

CDRFLS:	MOVE A,MSTRDT		;SEND FE ABORT
	MOVE B,[.DFFDO,,.FECDR]	;FLUSH THE OUTPUT
	SETZ C,			;IMMEDIATE REQUEST
	MOVEI D,0(U)		;THE UNIT TO DO
	CALLRET DTEQ		;TELL HIM


CDRDC:	MOVE A,MSTRDT		;NO POST
	STOR A,CDCNT,(U)	;NO BYTES IN PI BUFFER YET
	MOVE B,[.DFLBE,,.FECDR]	;SEND AN ACK
	SETZ C,			;IMMEDIATE
	MOVEI D,0(U)		;UNIT
	CALLRET DTEQ		;SEND IT
	END