Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-02 - 43,50224/dlsint.mac
There are 9 other files named dlsint.mac in the archive. Click here to see a list.
TITLE	DLSINT - INT. SERV. FOR DLS (DATA LINE SCANNER DC10)
SUBTTL	M. FREDRIKSEN/RCC TS  27 OCT 69 V010
XP	VDLSIT,010
		;PUT VERSION NUMBER IN GLOB LISTING AND LOADER STORAGE MAP

;MODULAR HARDWARE INTERFACE WITH EITHER SCNSER OR TTYSER

EXTERNAL TYPX

IFE FTTTYSER,<XP FULTWX,200000>

IFN FTTTYSER,<XP FULTWX,4>

;ACCUMULATOR ASSIGNMENTS

	CHREC=TEM	;AC FOR CHARACTER
	DDB=DEVDAT	;ADDRESS OF DEVICE DATA BLOCK
	LINE=TAC1	;SCANNER LINE NUMBER
	HPOS=DAT	;HORIZONTAL POSITION OF TTY.(0-71)

;BYTE POINTERS


EXTERNAL PLASTC




DLS=240				;DC10 DEVICE NUMBER
;BITS IN CHREC TO COMMUNICATE WITH DLS

USDRLN=100			;USE DIRECTED LINE NUMBER
TDSABL=400			;TRANSMIT DISABLE
RCVBIT=400			;RECEIVE BIT AFTER DATAI DLS,CHREC
DLSOHE=100			;OFF HOOK ENABLE IN DC10E
DLSART=200			;REQUEST ARTIFICIAL INTERRUPT IN DC10E
DLSCAR=4			;CARRIER ON, IN DC10E DATAI
DLSRNG=2			;LINE RINGING, IN DC10E DATAI
;DEVICE DEPENDENT PORTION OF INITIALIZATION CODE
;CALL:	MOVEI	TAC,CHANNEL NUMBER
;	PUSHJ	PDP,SCNINI

INTERNAL SCNINI

DLSINI:
SCNINI:	CONO	DLS,40		;INIT DLS COMPLETELY (I/O RESET)
	CONO	DLS,(TAC)	;ASSIGN PI CHANNEL NUMBER
DSCINI:	SKIPL TAC,DSCPTR	;GET DATASET POINTER
	POPJ PDP,0		;NO DATASETS. RETURN.
DSCILP:	MOVEI TEM,DSCOFS(TAC)	;TABLE ADDRESS + OFFSET = HARDWARE
	MOVSI DAT,USDRLN(TEM)	;DIRECTED PHYSICAL LINE
	HRRI DAT,DLSOHE+DLSART	;REQUEST FLAGS, LEAVING ENABLE ON.
	DATAO DLS,DAT		;SEND TO DC10E
	MOVEI	TAC1,1000	;A TIMEOUT, IN CASE NO FLAG
DSCIL2:	CONSZ DLS,30		;ANYTHING YET?
	JRST DSCI1		;YES. GO SEE WHAT
	SOJG TAC1,DSCIL2	;NO. WAIT (OR TIME OUT)
DSCINX:	AOBJN TAC,DSCILP	;ON TO NEXT DATASET
	POPJ PDP,0		;NONE LEFT. RETURN FROM SCNINI

DSCI1:	DATAI DLS,DAT		;SEE WHAT FLAGS WE GOT
	TRNE DAT,RCVBIT		;FIRST MAKE SURE RCV FLAG
	JRST DSCI2		;WAS. OK.
	DATAO DLS,[TDSABL]	;RANDOM XMT INT. DISMISS IT.
	JRST DSCIL2		;AND WAIT FOR REAL DATA.
DSCI2:	MOVSS DAT		;NOW SEE IF IT IS RIGHT LINE NUMBER
	CAIE TEM,0(DAT)		;IS IT?
	JRST DSCIL2		;NO. FORGET THIS ONE.
	MOVSI TAC1,DSCHWC	;RIGHT DATA. PREPARE FOR CORE
	TLNE DAT,DLSCAR		;CARRIER STILL THERE?
	JRST DSCI3		;YES. GO SAVE HIM
	ANDCAM TAC1,DSCTAB(TAC)	;NO. TURN OFF TABLE BIT
	MOVSI TAC1,USDRLN(TEM)	;AND HARDWARE TOO
	DATAO DLS,TAC1		;TURN OFF THIS DATASET
	JRST DSCINX		;ON TO NEXT DATASET.
DSCI3:	IORM TAC1,DSCTAB(TAC)	;THIS GUY IS ON. MARK HIM IN CORE.
	JRST DSCINX		;AND GO ON TO NEXT GUY
;SCANNER INTERRUPT SERVICE ROUTINE.

ENTRY DLSINT

INTERNAL SCNINT
EXTERNAL SCNSAV,TTYTAB,XMTINT,TYPE,INUS2,TCONLN
EXTERNAL RECINT,DSCOFS,DLSMXD,DLSMXL,DSCTAB,DSCHWC,STATES,DSCPTR

DLSINT:
SCNINT:	CONSO DLS,30		;FLAG FOR SCANNER?
	JRST .-1		;NO. GO ON IN CHAIN
	JSR SCNSAV		;YES. SET UP AC'S
	DATAI DLS,CHREC		;FIND OUT WHAT SCANNER WANTS
	HLRZ LINE,CHREC		;THE LINE NUMBER CAUSING INT
	TRNE CHREC,RCVBIT	;WAS IT RCV OR XMT?
	JRST SCNREC		;RECEIVE
	DATAO DLS,[TDSABL]	;TRANSMIT. FIRST CLEAR FLAG.
	CAIN LINE,6
	PUSHJ PDP,XTTY6
	CAIG LINE,DLSMXD	;LEGAL DATA LINE?
	JRST XMTINT		;YES. GO PROCESS IT.
	POPJ PDP,0		;NO. DISMISS INTERRUPT.

SCNREC:	CAIN LINE,6
	PUSHJ PDP,TTY6
	CAIG LINE,DLSMXD	;DATASET CONTROL OR JUST DATA
	JRST RECINT		;DATA. GO PROCESS CHAR
	CAILE LINE,DLSMXL	;LEGAL HARDWARE LINE?
	POPJ PDP,0		;NO. DISMISS.
DLSRCV:	MOVE DAT,LINE		;GET LINE NUMBER OF DC10E, AND
	SUBI DAT,DSCOFS	;CONVERT TO TABLE INDEX
	MOVE TAC,DSCTAB(DAT)	;GET TABLE ENTRY
	TRNE CHREC,DLSCAR	;CARRIER ON IN HARDWARE?
	JRST DSCON		;YES.
	TLZE TAC,DSCHWC		;NO. CLEAR CORE BIT. WAS IT ON?
	JRST CHGOFF		;YES. CHANGED TO OFF (HUNG UP)
DSCNCC:	TRNE CHREC,DLSRNG	;NO CHANGE IN CARRIER. RING?
	TRNE CHREC,DLSCAR+DLSOHE	;YES. ALREADY ALLOWING IT ON?
	POPJ PDP,0		;NO NEED TO ENABLE AGAIN.
NEWRNG:	MOVE TAC,STATES		;RINGING. ALLOWED ON BY OPERATOR?
	TRNE TAC,1B34		;2 BIT ON IN STATES?
	POPJ PDP,0		;BIT ON. CANT ANSWER PHONE.
	MOVE TAC,DSCTAB(DAT)	;GET TABLE ENTRY
	TLON TAC,17		;SET FOR FIFTEEN SECONDS
	MOVEM TAC,DSCTAB(DAT)	;UNLESS ON ALREADY, STORE.
	MOVSI TAC,USDRLN(LINE)	;NOW ALLOW ANSWER
	HRRI TAC,DLSOHE		;ENABLE OFF-HOOK STATE
	DATAO DLS,TAC		;SEND TO SCANNER
	POPJ PDP,0		;DISMISS INTERRUPT
DSCON:	TLOE TAC,DSCHWC	;TURN CARRIER FLAG ON IN TAB
	JRST DSCNCC		;ON ALREADY.
	TLZ TAC,17		;DONT TIME OUT ANY MORE
	HLLM TAC,DSCTAB(DAT)	;UPDATE CORE TABLE
	JRST RCVSIM		;SIMULATE RCVING A CONTROL C

CHGOFF:	HLLM TAC,DSCTAB(DAT)	;UPDATE CORE TABLE
	MOVSI DAT,USDRLN(LINE)	;CHANGED OFF. CLEAR DATASET.
	DATAO DLS,DAT		;TO SCANNER
RCVSIM:	MOVEI CHREC,RCVBIT+"C"-100	;RECEIVED CONTROL C
	HRL CHREC,TAC		;LINE RECEIVED FROM
	HRRZ LINE,TAC		;AND TO LINE AC TOO
	JRST SCNREC		;GO TREAT AS RECEIVE INTERRUPT


;COMMON PARTS OF CTY AND SCANNER INTERRUPT SERVICE ROUTINES.

EXTERNAL INJEST,DDBSRC
INTERNAL TCOMM

TCOMM:
	SKIPE DDB,TTYTAB(LINE)	;DATA BLOCK ASSIGNED?
	JRST INUSE		;YES
	PUSHJ PDP,DDBSRC	;SEARCH FOR FREE TTY DEV. DATA BLOCK
	JRST TYPX		;NONE FOUND, TYPE X
	MOVEI HPOS,0		;ASSUME TTY IS AT BEGIN OF FORM
	CAILE LINE,TCONLN	;PSEUDO CONSOLE?
	JRST INJEST		;YES
	CAIN	LINE,TCONLN	;IS IT THE CTY ?
	JRST INUS2		;YES, ACCEPT CHAR AND PROCESS
	JRST TYPE		;NO, ECHO CHAR ON FULL DUPLEX
				;BEFORE PROCESSING IT
XTTY6:	SKIPN FLG6
	POPJ PDP,
	SETZM FLG6
	POP PDP,CHREC
	POPJ PDP,
FLG6:	Z
TTY6:	TRNE CHREC,177
	POPJ PDP,
	TRNN CHREC,200
	JRST .+3
	SETOM FLG6	;STOP OUTPUT
	POPJ PDP,
	SETZM FLG6	;CLEAR FLAG
	JRST XMTINT	;STRT OUTPUT
;COMMON TO RECEIVE AND TRANSMIT.

INUSE: HRRZS  DDB	;LINE DISABLED IF RH TTYTAB=-1
	CAIN DDB,-1
	POPJ PDP,
	MOVE IOS,DEVIOS(DDB)	;SETUP IOS
	CAIL	LINE,TCONLN	;CTY OR PTY ?
	JRST INUS2		;YES
	TLNE IOS,FULTWX		;IS THIS SELF ECHOEING FULL DUPLEX?
	JRST INUS2		;YES,(USER TYPED CONROL B)
	HRL	CHREC,LINE	;INSERT LINE NUMBER IN DATAO
	TLO	CHREC,USDRLN
	TRZ	CHREC,TDSABL
	DATAO	DLS,CHREC
	DPB CHREC,PLASTC
	POPJ PDP,		;DISMISS INTERRUPT

;ROUTINE TO OUTPUT A CHARACTER ON A LINE
;CALLED FROM TYP OR TYPL IN SCNSER

INTERNAL SCNTYP

SCNTYP:
DLSTYP:	HRL	CHREC,LINE	;SET UP LINE NUMBER IN CHREC
	TLO	CHREC,USDRLN		;USE THAT AS DIRECTED LINE#
	TRZ	CHREC,TDSABL		;INSURE TRANSMISSION NOT DISABLED
	DATAO	DLS,CHREC		;OUT IT GOES
	SKIPE	DDB
	DPB CHREC,PLASTC	;SAVE CHAR FOR FULL DUPLEX
	POPJ PDP,

	LIT
DLSEND:	END