Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-03 - decus/20-0077/ttyops.mac
There is 1 other file named ttyops.mac in the archive. Click here to see a list.
        TITLE   TTYOPS
;
;SUBROUTINES TO PERFORM TTY INPUT/OUTPUT OF SINGLE CHARACTERS
;IN IMAGE MODE
;
        ENTRY   CHIN,CHOUT,TTYTST,NECHO,ECHO
;
;CALL CHIN(N) -- SETS N TO DECIMAL ASCII CODE FOR CHARACTER FOUND
;
CHIN:   TTCALL  0,@0(16)        ;INPUT ONE CHAR FROM TTY
	POPJ	17,		;RETURN
;
;CALL CHOUT(N) -- SENDS CHARACTER SPECIFIED BY ASCII CODE N
;
CHOUT:  TTCALL  15,@0(16)       ;OUTPUT IMAGE MODE CHAR TO TTY
	POPJ	17,
;
;CALL TTYTST(N,K) -- TEST FOR CHARACTER AVAILABLE FROM TTY
;               N = CODE OF CHARACTER FOUND, ELSE NOT CHANGED
;               K = -1 IF CHARACTER FOUND, ELSE ZERO
;
TTYTST: SETOM   @1(16)          ;PRESET TO -1 TO DENOTE CHAR FOUND
        TTCALL  2,@0(16)        ;INPUT CHARACTER AND SKIP
        SETZM   @1(16)          ;ELSE SET K TO ZERO
	POPJ	17,		;RETURN
;
;CALL NECHO -- SUPPRESS COMPUTER ECHO OF KEYBOARD INPUT
;
NECHO:  MOVEM   2,TEMP          ;SAVE AC2
        SETO    2,              ;AC2=-1 TO SPECIFY USER'S TTY LINE
        GETLCH  2               ;GET TTY LINE CHARACTERISTICS
        TLO     2,4             ;SET BIT 15 TO 1
        SETLCH  2               ;SET TTY LINE CHARACTERISTICS
        MOVE    2,TEMP          ;RESTORE AC2
	POPJ	17,		;RETURN
;
;CALL ECHO -- RESTORE COMPUTER ECHO OF KEYBOARD INPUT
;
ECHO:   MOVEM   2,TEMP          ;SAVE AC2
        SETO    2,              ;AC0=-1 TO SPECIFY USER'S TTY LINE
        GETLCH  2               ;GET TTY LINE CHARACTERISTICS
        TLZ     2,4             ;SET BIT 15 TO 0
        SETLCH  2               ;SET TTY LINE CHARACTERISTICS
        MOVE    2,TEMP          ;RESTORE AC2
	POPJ	17,		;RETURN
TEMP:   0
        END