Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99g-bb - glxkbd.c08
There is 1 other file named glxkbd.c08 in the archive. Click here to see a list.
 REP 2/1	;08C1
	SUBTTL	AUTHOR: Irwin Goverman/ILG/LSS/MLB/WLH/DC     1-Jan-82
 WIT
	SUBTTL	AUTHOR: Irwin Goverman/ILG/LSS/MLB/WLH/DC/NT/LWS 9-Feb-84
 REP 29/1	;08C2
			KBDEDT==56		;VERSION OF MODULE
 WIT
			KBDEDT==62		;VERSION OF MODULE
 INS 92/3	;08C3
	0057		Make K%SUET use new format of TRMTYP macro so it can handle
			setting of keypad mode on all terminals. 24-Oct-83/NT
	0060		Make sure controlling TTY is opened as physical TTY in K%INIT.
			SPR 10-33713  7-Nov-83 /LWS
	0061		Set BATFLG positive if MIC controlled and check before
			each input of a character to see if still under MIC's
			control.
			SPR 10-34367  19-Jan-83 /LWS
	0062		Fix "delete char" problem for hard copy.
			9-Feb-84 /NT
 REP 18/7	;08C4
		JRST	[SETZ	S1,		;NO FUNNY STUFF
			 $CALL	K%OPEN		;GO OPEN THE TTY
			 JRST	KINI.3]		;AND CONTINUE WITH REST OF K%INIT
		SETOM	CHNJFN			;NO, SET WORD SO WE KNOW
 WIT
	;**;[60] Change 1 line and delete 1 line at K%INIT+7L. 7-Nov-83 /LWS
		JRST	[MOVSI	S1,200000	;[60] TELL K%OPEN TO USE UU.PHS
			 $CALL	K%OPEN		;GO OPEN THE TTY
			 JRST	KINI.3]		;AND CONTINUE WITH REST OF K%INIT
 REP 36/7	;08C5
		MOVE	TF,[3,,1]		;SET UP AC
 WIT
	;**;[61] Change 2 lines - 1 at KINI.3+11L and 1 at KINI.3+17L. /LWS
		MOVE	TF,[2,,S1]		;[61] SET UP AC
 REP 42/7	;08C6
		SETOM	BATFLG			;YES - TREAT IT LIKE A BATCH PTY
 WIT
		AOS	BATFLG			;[61] YES - INDICATE MIC CONTROLLED
 REP 12/13	;08C7
	K%SUET:	MOVEM	S1,UESCTB		;SAVE THE ESCAPE TABLE ADDRESS
		SETZM	CURESC			;CLEAR CURRENT STATE
		MOVE	S1,TRMTY		;GET TERMINAL TYPE
		CAXN	S1,.TT100		;VT100
		JRST	SUET.1			;SETUP THE TERMINAL
		CAXE	S1,.TTV50		;IS IT A VT50?
		CAXN	S1,.TTV52		;OR A VT52?
		SKIPA				;YES, SET IT UP
		$RETT				;RETURN

	SUET.1:	MOVX	S1,.CHESC		;LOAD AN ESCAPE
		PUSHJ	P,K%BOUT		;AND TYPE IT
		MOVEI	S1,"="			;THIS SETS THE MODE
		SKIPN	UESCTB			;PROGRAM IS CLEARING IT
		MOVEI	S1,76			;CLEAR IT
		PUSHJ	P,K%BOUT		;PUT OUT THE CHARACTER
		$RETT				;AND RETURN
 WIT
	;**;[57]REVAMP K%SUET			24-OCT-83/NT
	K%SUET:	PUSHJ	P,.SAVE1		;[57]Save P1
		MOVEM	S1,UESCTB		;SAVE THE ESCAPE TABLE ADDRESS
		SETZM	CURESC			;CLEAR CURRENT STATE
		MOVE	S1,TRMTY		;[57]Get the terminal type
		MOVE	P1,[XWD -<.TIMAX+1>,TTTAB] ;[57]Point to the terminal table
	SUET.1:	HLRZ	S2,(P1)			;[57]Get the entry
		CAME	S1,S2			;[57]Is it what we have?
		 AOBJN	P1,SUET.1		;[57]No, loop for the whole table
		SKIPL	P1			;[57]Did we find one
		$RETT				;[57]No, MAke belive we did
		HRRZ	S2,(P1)			;[57]Get the table address
		MOVE	S1,.TCKBA(S2)		;[57]Assume we're setting it
		SKIPN	UESCTB			;[57]Are we?
		 MOVE	S1,.TCKBN(S2)		;[57]No, we're clearing
		PUSHJ	P,K%SOUT		;[57]Output the string
		$RETT				;[57]And return
 REP 44/14	;08C8
		SKIPN	S2			;ANY SETUP NEEDED?
 WIT
		HRRZ	S1,(S1)			;[62] See if hardcopy
		MOVE	S1,@(S1)		;[62]  .  .  .
		JUMPN	S1,STYP.4		;[62] It isn't
		MOVEI	S1,[0]			;[62] It is, point to a zero
		HRRZM	S1,TRMPTR		;[62]  .  .  .
	STYP.4:	SKIPN	S2			;[62] ANY SETUP NEEDED?
 REP 9/15	;08C9

	;DEFINE THE EXPANDER MACRO
	DEFINE X(PARNAM,SIXNAM,SUF,EOLSEQ),<
	IFNB <EOLSEQ>,<	$SET	(.TI'SUF,,<.TT'SUF,,[[BYTE (7)'EOLSEQ']]>)>
	IFB  <EOLSEQ>,<	$SET	(.TI'SUF,,<.TT'SUF,,0>)>
 WIT
	;**;[57]REVAMP CODE			24-OCT-83/NT
		.TCKBA==.TCEOL+1		;[57]Set keypad application
		.TCKBN==.TCKBA+1		;[57]Set keypad numeric

	;DEFINE THE EXPANDER MACRO

	DEFINE X(PARNAM,SIXNAM,SUF,INIT,EOLSEQ,KBDSET,KBDCLR),<
	DEFINE EOLGEN<
	IFNB <EOLSEQ>,<BYTE (7)'EOLSEQ>
	IFB  <EOLSEQ>,<EXP 0>
	>
	DEFINE SETGEN<
	IFNB <KBDSET>,<BYTE (7)'KBDSET>
	IFB  <KBDSET>,<EXP 0>
	>
	DEFINE CLRGEN<
	IFNB <KBDCLR>,<BYTE (7)'KBDCLR>
	IFB  <KBDCLR>,<EXP 0>
	>
	$SET	(.TI'SUF,,<.TT'SUF,,[[EOLGEN]
				     [SETGEN]
				     [CLRGEN]]>)
 REP 20/15	;08C10
	;	.TT33,,0			;MODEL 33 TTY
	;	.TT35,,0			;MODEL 35 TTY
	;	.TTV05,,[[BYTE (7)37,177,177,177]];VT05
	;	.TTV50,,[[BYTE (7).CHESC,"J"]]	;VT50
	;	.TTL30,,0			;LA30
	;	.TTL36,,0			;LA36
	;	.TTV52,,[[BYTE (7) .CHESC,"J"]]	;VT52
	;	.TTV52,,[[BYTE (7) .CHESC,"J"]]	;AND ONE FOR PATCHING
	;	  TTTABL==.-TTTAB

	;BUILD A TABLE OF SIXBIT NAMES TO MATCH AGAINST THE TRMOP. RETURNED CODES

	DEFINE X(PARNAM,SIXNAM,SUF,EOLSEQ),<
 WIT
	;BUILD A TABLE OF SIXBIT NAMES TO MATCH AGAINST THE TRMOP. RETURNED CODES

	DEFINE X(PARNAM,SIXNAM,SUF,INIT,EOLSEQ,KBDSET,KBDCLR),<
 DEL 40/15	;08C11

 REP 45/15	;08C12
	TTSET:	$BUILD	(.TIMAX+1)
		$SET	(.TIV50,,SETVT5)
		$SET	(.TIV52,,SETVT5)
	TOPS10<	$SET	(.TTV61,,SETVT5)>
		$EOB

	;	EXP	.RETT			;MODEL 33 TTY
	;	EXP	.RETT			;MODEL 35 TTY
	;	EXP	.RETT			;VT05
	;	EXP	SETVT5			;VT50
	;	EXP	.RETT			;LA30
	;	EXP	.RETT			;LA36
	;	EXP	SETVT5			;VT52
	;	EXP	SETVT5			;PATCH SPACE


	;TERMINAL SETUP ROUTINES
	SETVT5:	MOVE	S1,[3,,P1]		;GET TRMOP ARG POINTER
 WIT
	DEFINE X(PARNAM,SIXNAM,SUF,INIT,EOLSEQ,KBDSET,KBDCLR),<
	$SET	(.TI'SUF,,INIT)
	>

	TTSET:	$BUILD	(.TIMAX+1)
		TRMTYP
		$EOB

	;TERMINAL SETUP ROUTINES
	SETTLC:	MOVE	S1,[3,,P1]		;GET TRMOP ARG POINTER
 REP 14/19	;08C13
	BIN.1:	SKPINC				;CHECK FOR CHARACTER
		SKIPF	BATFLG			;[45] NONE..SLEEP IF NOT BATCH
		JRST	BIN.2			;ELSE GET THE CHARACTER
		MOVX	S1,HB.RTC		;SLEEP FOR CHARACTER
		$CALL	I%SLP			;Sleep till character input
		JRST	BIN.1			;TRY AGAIN
	BIN.2:	SKIPGE	INTCHR			;Do we have a character yet?
 WIT
	;**;[61] Redo code at BIN.1. /LWS
	BIN.1:	SKPINC				;CHECK FOR CHARACTER
		SKIPE	BATFLG			;[61] NONE..SLEEP IF NOT BATCH OR MIC
		JRST	BIN.2			;ELSE GET THE CHARACTER
		MOVX	S1,HB.RTC		;SLEEP FOR CHARACTER
		$CALL	I%SLP			;SLEEP TILL CHARACTER INPUT
		JRST	BIN.1			;TRY AGAIN
	BIN.2:	SKIPG	BATFLG			;[61] MIC CONTROLLED?
		JRST	BIN.3			;[61] NO, GO READ A CHARACTER
		MOVE	TF,[XWD 2,S1]		;[61] YES, SEE IF MIC STILL THERE
		MOVX	S1,.TOGMS		;[61] "GET" MIC STATUS FUNCTION
		MOVE	S2,TRMUDX		;[61] UDX OF TTY
		TRMOP.	TF,			;[61] ASK ABOUT MIC STATUS
		SETZM	TF			;[61] SHOULD NEVER HAPPEN
		JUMPN	TF,BIN.3		;[61] JUMP IF MIC STILL IN CONTROL
		SETZM	BATFLG			;[61] MIC NO LONGER IN CONTROL
		JRST	BIN.1			;[61] DON'T GO INTO TI STATE
	BIN.3:	SKIPGE	INTCHR			;[61] DO WE HAVE A CHARACTER YET?
 INS 1/39	;08C14

 SUM 155381