Google
 

Trailing-Edge - PDP-10 Archives - BB-M081Y-SM - monitor-sources/cdkldv.mac
There are 45 other files named cdkldv.mac in the archive. Click here to see a list.
; UPD ID= 8483, RIP:<7.MONITOR>CDKLDV.MAC.2,   9-Feb-88 12:17:13 by GSCOTT
;TCO 7.1218 - Update copyright notice.
; UPD ID= 2051, SNARK:<6.1.MONITOR>CDKLDV.MAC.4,   3-Jun-85 14:17:27 by MCCOLLUM
;TCO 6.1.1406  - Update copyright notice.
; UPD ID= 4503, SNARK:<6.MONITOR>CDKLDV.MAC.3,  12-Jul-84 20:07:35 by PURRETTA
; UPD ID= 2050, SNARK:<6.MONITOR>CDKLDV.MAC.2,  21-Mar-83 18:01:42 by MURPHY
;GET RID OF ANCIENT SEARCH PROKL
;<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

;	COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1976, 1988.
;	ALL RIGHTS RESERVED.
;
;	THIS SOFTWARE IS FURNISHED UNDER A  LICENSE AND MAY BE USED AND  COPIED
;	ONLY IN  ACCORDANCE  WITH  THE  TERMS OF  SUCH  LICENSE  AND  WITH  THE
;	INCLUSION OF THE ABOVE  COPYRIGHT NOTICE.  THIS  SOFTWARE OR ANY  OTHER
;	COPIES THEREOF MAY NOT BE PROVIDED  OR OTHERWISE MADE AVAILABLE TO  ANY
;	OTHER PERSON.  NO  TITLE TO  AND OWNERSHIP  OF THE  SOFTWARE IS  HEREBY
;	TRANSFERRED.
;
;	THE INFORMATION IN THIS  SOFTWARE IS SUBJECT  TO CHANGE WITHOUT  NOTICE
;	AND SHOULD  NOT  BE CONSTRUED  AS  A COMMITMENT  BY  DIGITAL  EQUIPMENT
;	CORPORATION.
;
;	DIGITAL ASSUMES NO  RESPONSIBILITY FOR  THE USE OR  RELIABILITY OF  ITS
;	SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY DIGITAL.
	RESCD

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