Google
 

Trailing-Edge - PDP-10 Archives - -
There are no other files named in the archive.
        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:   Z
        TTCALL  0,@0(16)        ;INPUT ONE CHAR FROM TTY
        JRA     16,1(16)        ;RETURN
;
;CALL CHOUT(N) -- SENDS CHARACTER SPECIFIED BY ASCII CODE N
;
CHOUT:  Z
        TTCALL  15,@0(16)       ;OUTPUT IMAGE MODE CHAR TO TTY
        JRA     16,1(16)
;
;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: Z
        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
        JRA     16,2(16)        ;RETURN
;
;CALL NECHO -- SUPPRESS COMPUTER ECHO OF KEYBOARD INPUT
;
NECHO:  Z
        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
        JRA     16,0(16)        ;RETURN
;
;CALL ECHO -- RESTORE COMPUTER ECHO OF KEYBOARD INPUT
;
ECHO:   Z
        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
        JRA     16,0(16)        ;RETURN
TEMP:   0
        END
IIIAAAA>>AAA>						AA@@@@IIIAx>AAA>			FIII1``~~>AAAAxx*U*+?!-