Google
 

Trailing-Edge - PDP-10 Archives - AP-D543V_SB - cciint.mac
There are 8 other files named cciint.mac in the archive. Click here to see a list.
SUBTTL R CLEMENTS /RCC/DAL -11 JAN 77 - V527
	SEARCH	F,S
	$RELOC
	$HIGH

;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1973,1974,1975,1976,1977,1978 BY DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
XP VCCIIT,527

;BITS IN T3 TO COMMUNICATE WITH THE HARDWARE (CONSIDERING 680 AS HARDWARE)

RCVBIT==400				;DATAI FROM 680 WAS RECEIVE
					;INT, NOT XMT DONE

;CODES USED FOR SCNSER-DLSTYP INTERFACE, IN CH.

EXTERN	DSTOFF,DSTON,DSTRNG,DSTREQ	;THESE ARE SOFTWARE, SINCE HARDWARE VARIES

;CODES BETWEEN THIS ROUTINE AND THE 680 SOFTWARE FOR DATAPHONES
;THESE MUST AGREE WITH THOSE IN THE 680 SOFTWARE
;THESE HAVE SIGN BIT OF PDP8 ON FOR CHECKING EASILY IN THE 8
;IT IS ASSUMED THAT THESE ARE DSTXXX+4000

XP CCHOFF,4001				;TURN OFF MODEM (IT WENT OFF)
XP CCHON,4002				;TURN ON MODEM(IT CAME ON)
XP CCHRNG,4003				;(MODEM IS RINGING)
XP CCHREQ,4003				;WHAT IS STATE OF MODEMS CARRIER?


;CODES FOR SPECIAL LINE CONTROL ARE DENOTED WITH
;  6000+CODE.  THEY ARE SIMILAR TO DATA-SET CONTROL CODES
;  EXCEPT THAT THEY CONCERN THE DATA-SIDE OF THE LINE AND
;  ARE HANDLED BY LNCREC IN SCNSER.

;TO-10 CODES IN USE:
;	1	ENABLE HUNG CHECKING (IRMA CATCHED)
;	2	DISABLE HUNG CHECKING
;
;FROM-10 CODES IN USE:
;	NONE


DEFINE	ISRNAM(N),<	;SEPERATE ROUTINE FOR EACH CCI

TITLE	CC'N'INT -- INTERRUPT SERVICE FOR DA10/DC68A NUMBER N

IFE N,<	CCI==14		;DEVICE ADDRESS FOR CCI>
IFE <N-1>,<CCI==20	;DEVICE ADDRESS FOR CCI2>

	ENTRY	CC'N'INT

CC'N'INT:CONSO	CCI,240
	JRST	.-1
	JRST	CCIINT


CC'N'DSP::
	JRST	SCNTYP	;OUTPUT DATA
IFN FTMODM,<
	JRST	DSCTYP	;DATASET CONTROL
>
IFE FTMODM,<
	POPJ	P,0
>
	JRST	SCNCHK	;TEST PIA STILL SET
	JRST	CCIINI	;INIT CCI
	POPJ	P,	;CHANGE HARDWARE PARMS
	POPJ	P,	;LINE PARM CONTROL
	POPJ	P,	;SET ELEMENT
	POPJ	P,	;REMOTE STATION STUFF
	JRST	CCIOFL	;680 UP TEST
	CCIOFS==CC'N'OFS##	;OFFSET FROM LINE PHYSICAL LINE 0 TO
				; SOFTWARE LINE NUMBER.
	CCIMAX==M.68L'N##	;NUMBER OF LINES ON THIS 680
IFN FTMODM,<
	CCIDSO==CC'N'DSO##	;OFFSET INTO DSCTAB FOR THIS 680
>>

IFNDEF	CCINUM,<CCINUM==0>

	ISRNAM(\CCINUM)
;DEVICE-DEPENDENT PORTION OF INITIALIZATION CODE
;CALL:	PUSHJ P,SCNINI

EXTERN SCNCHN
CCIINI:	CONO	CCI,2510+SCNCHN	;CLEAR DA10 AND ASSIGN PI
	SETZM	CCIERR		;CLEAR COUNT OF LOST PI ERRORS
	POPJ	P,0		;RETURN FROM SCNINI
EXTERN SCNSAV,TCONLN,XMTINT,RECINT,CCIRWD

CCIOFL:	CONSZ	CCI,7
	JRST	CPOPJ1##
	PUSHJ	P,SCNCHK
	CONSZ	CCI,7
	AOS	(P)
	POPJ	P,0

CCIINT:	CONSO	CCI,40		;YES. WHICH ONE?
	JRST	CCIDSM		;JUST FLAG THAT 8 ATE DATA
	JSR	SCNSAV		;RECEIVE. GET SOME AC'S AND P
	DATAI	CCI,T3		;SEE WHAT THE 8 HAD TO SAY
	LDB	U,PCCILN	;GET THE PSEUDO LINE NUMBER
	CAILE	U,CCIMAX	;MAKE SURE USABLE LINE
	POPJ	P,0		;TOO BIG. IGNORE IT.
	ADDI	U,CCIOFS	;ADD IN OFFSET
	TRZN	T3,RCVBIT	;IS 8 SAYING KEYBOARD?
	JRST	XMTINT		;NO. TRANSMIT INTERRUPT.
IFN FTMODM,<
	TRZN	T3,4000		;DATASET TRANSACTION CODE?
>
	JRST	RECINT		;NO. RECEIVE INTERRUPT.
IFN FTMODM,<
IFN FTSCLC,<
	ANDI	T3,3777		;REMOVE LINE FIELD
	TRZE	T3,2000		;SPECIAL LINE CONTROL?
	JRST	LNCREC##	;YES
>
IFE FTSCLC,<
	ANDI	T3,1777		;REMOVE LINE FIELD & POSSIBLE 2000 BIT
>
	SUBI	U,CCIOFS	;CONVERT LINTAB INDEX TO 680 LINE #
	ADDI	U,CCIDSO	;CONVERT TO DSCTAB INDEX
	JRST	DSCREC		;AND PROCESS CODE.
;STILL IN FTMODM
EXTERN DSCREC,DSTRNG,DSTOFF,DSTON

;HERE TO EXERCISE CONTROL OVER A DATASET. TRANSACTION CODE IN T3,
; DSCTAB INDEX IN U. ENTERED FROM SCNSER ONLY.

EXTERN DSTON,DSTOFF,DSTREQ,DSTRNG,SCNCHN

DSCTYP:	CAIN	T3,DSTON	;IS CODE FOR ON?
	JRST	DSDON		;YES. DRIVEN ON FLAG
	CAIN	T3,DSTOFF	;NO. FOR OFF?
	JRST	DSDOFF		;YES. DISPATCH.
	CAIE	T3,DSTREQ	;REQUEST STATUS?
	POPJ	P,0		;NO. ERRONEOUS CODE. DISMISS.

DSDREQ:	;HERE TO REQUEST STATUS OF A LINE, ONLY DURING TTYINI. THUS
; IT IS OK TO GO INTO A WAIT-LOOP TO ACCOMPLISH THIS, AND TO IGNORE 
; ANY OTHER ACTIVITY.

CCIREQ:	MOVEI	T3,CCHREQ	;CORRECT CODE FOR 680 SOFTWARE
	HRRZ	T1,DSCTAB##(U)	;LINE NUMBER TO RIGHT AC
	PUSHJ	P,CCITYP	;SEND TO DA10
	MOVE	T1,CCITIM	;TIMEOUT IN CASE 680 DEAD
CCIRQL:	CONSO	CCI,240		;WAIT FOR DA10 FLAG
	SOJG	T1,.-1		; ..
	JUMPLE	T1,DSRQOF	;NO REPONSE. ASSUME OFF.
	CONSO	CCI,40		;WHICH FLAG IN DA10?
	JRST	CCIRQ1		;JUST FM 10 BFR EMPTY.
	DATAI	CCI,T3		;READ DATA FROM THE 8
	LDB	T2,PCCILN	;GET THE LINE NUMBER
	CAIE	T2,0(U)		;REQUESTED LINE?
	JRST	CCIRQL		;NO. KEEP WAITING.
	ANDI	T3,7777-RCVBIT	;JUST THE CHARACTER FIELD
	CAIE	T3,CCHON	;ON FLAG?
	JRST	DSRQOF		;NO. ASSUME OFF
DSRQON:	MOVEI	T3,DSTON	;YES. TELL SCNSER.
	POPJ	P,0		;RETURN FROM DSCTYP

DSRQOF:	MOVEI	T3,DSTOFF	;TELL SCNSER IT'S OFF.
	POPJ	P,0		;RETURN TO SCNSER

CCIRQ1:	CONO	CCI,400+SCNCHN	;CLEAR FROM-10 EMPTY FLAG
	JRST	CCIRQL		;AND WAIT FOR ANOTHER FLAG
;HERE TO DRIVE A DATASET ON.

DSDON:	MOVEI	T3,CCHON	;FLAG FOR 680
	JRST	DSDOF1		;SEE WHICH TO USE

;HERE TO DRIVE A DATASET OFF.

DSDOFF:	MOVEI	T3,CCHOFF	;FLAG FOR 680
DSDOF1:	HRRZ	T1,DSCTAB##(U)	;GET COPY OF LINE NUMBER
	JRST	CCITYP		;SEND TO 680

>	;FTMODM
EXTERN SCNCHN,SCNCHL

CCIDSM:	CONO	CCI,400+SCNCHN	;CLEAR DA10 SEND DONE FLAG
	JRST	12,@SCNCHL	;AND DISMISS

PCCILN:	POINT	12,T3,23	;SECOND PDP8 BYTE IN WORD

;ROUTINE TO OUTPUT A CHARACTER TO A LINE
;CALLED FROM TYPE IN SCNSER
;WITH 8-BITS OF CHARACTER IN T3

SCNTYP:	LDB	T1,LDPLNO##	;PICK UP LINE NUMBER
	ANDI	T3,377		;MAKE SURE NO JUNK
IFN FTHDPX!FTTRACK,<
	DPB	T3,LDPECK##	;SAVE FOR ECHO CHECK
>
CCITYP:	SUBI	T1,CCIOFS	;CONVERT BACK TO HARDWARE LINE #
	DPB	T1,PCCILN	;STORE IN THE OUTPUT WORD
	MOVE	T1,CCITIM	;A DELAY FOR THE SLOW 8 IF NEEDED
	CONSZ	CCI,1000	;SEE IF DA10 BUFFER IS EMPTY
	SOJG	T1,.-1		;IF NOT, 8 IS PROBABLY DEAD
	MOVEM	T1,CCITIM	;STORE UPDATED TIMEOUT
	DATAO	CCI,T3		;SEND TO EIGHT
	POPJ	P,0		;DONE.
SCNCHK:	PUSH	P,[1000]	;RESET TIMEOUT EACH SECOND
	POP	P,CCITIM	; SO WE DO NOT USE TOO MUCH TIME
	CONSZ	CCI,7		;ANY PI CHAN ON DA10?
	POPJ	P,0		;YES. RETURN
	CONO	CCI,2510+SCNCHN	;NO. GIVE IT BACK TO DA10
	AOS	CCIERR		;COUNT OCCURRENCE OF ERROR
	POPJ	P,0		;AND RETURN TO CLOCK ROUTINE

	$LOW
CCITIM:	1000		;TIMEOUT TIME FOR SLOW 8
CCIERR:	0		;COUNT OF LOST PI ERRORS ON CCI

	$LIT

CCIEND:	END