Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99m-bb - dncddp.p11
There are 10 other files named dncddp.p11 in the archive. Click here to see a list.
.SBTTL	DNCDDP - DP11 ROUTINES  28 MAR 79

;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,1984 BY DIGITAL EQUIPMENT CORP., MAYNARD, MASS.

VRCDDP=005			;FILE EDIT NUMBER

.SBTTL	DP11 ROUTINES
.IF NE DPN	;IF SYNCHRONOUS LINES PRESENT, AND THEY HAVE DP11S
.IF NE FTDP11


;HERE TO INITIALIZE A DP11 LINE
DPDINI:
;	MOV	LB.SLA(J),DQ		;GET DP11 HDW REG ADR
	CLR	@DQ			;CLEAR RECEIVE REGISTER
	MOVB	#SYN,3(DQ)		;SET SYNCH CHARACTER
	MOV	#DP.DTR,4(DQ)		;SET TERMINAL READY
	RTS	PC
;HERE TO ENABLE DP11 RECEIVER

DPRBEG:	BIS	#LS..RG,@J		;FLAG RECEIVER HAS BEEN ENABLED
	MOV	LB.SLA(J),DQ		;GET DP11 HDW ADR
	MOV	LB.IPT(J),R0		;GET RELATIVE INPUT BUFFER ADDR
	ADD	J,R0			;MAKE INPUT BUFFER ADR ABS
	TRACE	DP
	MOV	R0,LB.SRR(J)		;SAVE RECEIVE ADR
	MOV	#-4,LB.SRR+2(J)		;SAVE RECEIVE COUNT
	ADD	#4,R0
	MOV	R0,LB.SRR+4(J)		;SAVE 2NDDARY BUF ADR
	MOV	#-4,LB.SRR+6(J)		;AND COUNT
	MOV	#DDRJNK,LB.RDN(J)	;WHERE TO GO WHEN HAVE RECEIVED MSG
	MOV	#DP..SS!DP.RIE,@DQ	;ENABLE RECEIVER
	BIC	#LS.SSY,(J)		;RESET REQUEST STRIP SYNCH FLAG
	RTS	PC
;HERE TO ENABLE TRANSMITTER
;  MUST BE CALLED WITH INTERRUPTS DISABLED
; CALL:	MOV	<BLK ADR>,J
;	JSR	PC,DPXBEG

DPXBEG:	MOV	LB.SLA(J),DQ		;GET DP11 HDW ADR
	TRACE	DP			;FOR THOSE WHO FOLLOW HDW
	MOV	#SYNCHS,LB.SXR(J)	;SET PRIMARY ADR
	MOV	#-FTNSYN,LB.SXR+2(J)	;SET PRIMARY WC
	JSR	PC,@LB.XDN(J)		;GET WHAT TO SEND NEXT
	MOV	R0,LB.SXR+4(J)		;SET 2NDARY ADR REG
	MOV	R1,LB.SXR+6(J)		;SET 2NDARY COUNT REG
	BIS	#LS..XG,@J		;SET FLAG TRANSMITTER IS GOING
	;BIS	#DP.RTS!DP.SIE,4(DQ)	;SET REQUEST TO SEND
	BIS	#DP.SIE!DP.TIE,4(DQ)	;START TRANSMITTER
	MOVB	#SYN,6(DQ)		;PRIME WITH A SYNCH CHAR
	RTS	PC
.MACRO	X	Q
DPVA'Q:
DPA.'Q:	SAVE	<J>
	MOV	#FLBDP+<LB.SIZ*'Q>,J
.ENDM	X
	Z=DPN-1
.REPT	DPN
	X	\Z
.IIF NE Z,	BR	DPAINT
Z=Z-1
.ENDR

;DP11 VECTOR A INTERRUPT - RECEIVE
DPAINT:	SAVE	<R0,R1,R2,DQ>
	MOV	LB.SLA(J),DQ		;GET DP11 HDW ADR
	TSTB	@DQ			;CHAR READY ?
	BPL	90$			;IF NOT WE ARE DONE
	BIC	#DP..SS,@DQ		;CLEAR STRIP SYNC FLAG
	MOVB	2(DQ),@LB.SRR(J)	;SAVE CHAR IN BUFFER
.IF NE FTRACE
	SAVE	<R0>
	MOVB	@LB.SRR(J),R0
	TRACE	DP			;FOR THOSE WHO WATCH HDW
	RESTORE <R0>
.ENDC
	INC	LB.SRR(J)		;ADVANCE BUFFER POINTER
	INC	LB.SRR+2(J)		;ADVANCE COUNT
	BNE	80$			;IF DIDN'T OVERFLOW WE ARE DONE
	MOV	LB.SRR+4(J),LB.SRR(J)	;2NDARY BECOMES PRIMARY
	MOV	LB.SRR+6(J),LB.SRR+2(J)
	BIT	#LS.SSY,@J		;TIME TO STRIP SYNC AGAIN ?
	BEQ	30$
	BIS	#DP..SS,@DQ		;YES
	BIC	#LS.SSY,@J		;HAVE SET IT NOW
30$:	JSR	PC,@LB.RDN(J)		;ASK DDCMP FOR WHAT TO DO
	MOV	R0,LB.SRR+4(J)		;SAVE NEXT ADR
	MOV	R1,LB.SRR+6(J)		;SAVE NEXT COUNT
	BEQ	40$			;IN CASE WANTS TO STOP
80$:	BIT	#DP..RA,@DQ		;IS RECEIVER STILL ACTIVE ?
	BEQ	40$			;IF NOT STOP IT
90$:	RESTORE	<DQ,R2,R1,R0,J>
	RTI

;HERE TO STOP THE DP11 RECEIVER
40$:	CLR	@DQ			;CLEAR RECEIVER
	BIC	#LS..RG,@J		;FLAG RECEIVER NOT RUNNING
	QUEPUT	QI 89$
	JSR	PC,DDCIGO		;RESTART THE RECEIVER SO WE DON'T
					;LOSE SOMETHING VALUABLE
	BR	90$			;AND EXIT
.MACRO	X	Q
DPVB'Q:
DPB.'Q:	SAVE	<J>
	MOV	#FLBDP+<LB.SIZ*'Q>,J
.ENDM	X
	Z=DPN-1
.REPT	DPN
	X	\Z
.IIF NE Z,	BR	DPBINT
Z=Z-1
.ENDR

;DP11 VECTOR B INTERRUPT - XMIT
DPBINT:	SAVE	<R0,R1,DQ>
	MOV	LB.SLA(J),DQ		;GET DP11 HDW ADR
	MOV	4(DQ),R0		;GET TRANSMIT STATUS
	TRACE	DP			;FOR THOSE WHO WATCH HDW
	BIT	#DP..TD,R0		;TRANSMIT DONE ?
	BEQ	30$
;HERE WHEN READY TO TRANSMIT THE NEXT CHARACTER
	MOVB	@LB.SXR(J),6(DQ)	;SEND NEXT CHAR
	INC	LB.SXR(J)		;ADVANCE ADR POINTER
	INC	LB.SXR+2(J)		;COUNT BYTE OUT OF BUFFER
	BNE	80$
	MOV	LB.SXR+4(J),LB.SXR(J)	;2NDARY IS NOW PRIMARY
	MOV	LB.SXR+6(J),LB.SXR+2(J)
	JSR	PC,@LB.XDN(J)		;GO GET WHAT TO SEND NEXT
	MOV	R0,LB.SXR+4(J)		;SAVE ADR
	MOV	R1,LB.SXR+6(J)		;SAVE COUNT
	BEQ	60$			;BRANCH TO STOP DP11
80$:
90$:	RESTORE	<DQ,R1,R0,J>
	RTI

;HERE WHEN NOT TRANSMIT DATA INTERRUPT
30$:	BIT	#DP.ROF,R0		;RECEIVE OVERRUN ?
	BNE	40$			;BRANCH FOR RECEIVE OVERFLOW
	BIT	#DP..CF!DP.RNG,R0	;STATUS INTERRUPT ?
	BEQ	90$
	BIC	#DP..CF!DP.RNG,4(DQ)	;CLEAR FLAG
	BR	90$
40$:	BIC	#DP.ROF,4(DQ)		;CLEAR FLAG
	BIC	#DP..RA,@DQ		;CLEAR RECEIVE ACTIVE
	BIC	#LS..RG,@J		;AND FLAG WE ARE GOING
	QUEPUT	QI 89$			;PUT INTO QUEUE
	BR	90$

;HERE TO STOP THE DP11 TRANSMITTER
60$:	BIC	#DP.TIE!DP.RTS,4(DQ)	;DISABLE INT ENAB + REQ TO SEND
	BIC	#LS.XCT!LS.XDT!LS..XG,@J	;FLAG NOT ACTIVE
	QUEPUT	QO 87$
	BR	90$

.ENDC	;.IF NE FTDP11
.ENDC ;.IF NE DPN