Trailing-Edge
-
PDP-10 Archives
-
decus_20tap2_198111
-
decus/20-0027/tty.mac
There are 2 other files named tty.mac in the archive. Click here to see a list.
00100 TITLE TTY (ROUTINES FOR CONSOL TELETYPE SERVICE) VERSION #2 SEPT. 1 '69
00200 SUBTTL DAVE MCCLURE'S MODIFICATIONS TO ORIGINAL BY DON WITCRAFT (JULY 1969)
00300
00400
00500 ;KEYBOARD DATA BLOCK
00600
00700 ENTRY KDATA
00800
00900 KDATA: EXP 4*^D100000 ;10 CPS
01000 4*^D100000 ;TRY FOR THE FIRST CHAR IN .1 SECONDS
01100 XWD KACTIV,KFLG
01200 XWD 400000,GETCHR ;ROUTINE TO CALL WHEN DEVICE TIME OUT
01300
01400
01500 KIB: 0 ;KEYBOARD INPUT BUFFER
01600
01700 ;KEYBOARD IOTS
01800
01900 INTERNAL KSF,KCC,KRS,KRB
02000 EXTERNAL NTIME,TIME,DRDATA,ALPHA
02100
02200
02300 KSF: TRNE FLAGS,KFLG ;<6031> SKIP ON KEYBOARD FLAG.
02400 AOS PC ;<6032> FLAG IS ON. SKIP.
02500 POPJ PDP,
02600
02700 KCC: SETZM AC ;CLEAR KEYBOARD FLAG
02800 KCC1: TRZ FLAGS,KFLG ;0=>AC.0=>KEYBOARD FLAG
02900 POPJ PDP,
03000
03100 KRS: OR AC,KIB ;<6034> READ KEYBOARD BUFFER STATIC
03200 JRST KCC1
03300
03400 KRB: MOVE AC,KIB ;<6036> READ KEYBOARD BUFFER DYNAMIC
03500 JRST KCC1
03600
03700 ;GETCHR IS CALLED WHEN KEYBOARD IS ACTIVE AND KTIME GOES NEGATIVE.
03800
03900 GETCHR: SETZM AC2 ;ZERO WORD TO AVOID CONFUSION
04000 INCHRS AC2 ;TRY TO PICK UP A CHARACTER
04100 JRST NODATA ;NO CHARACTER WAS PRESENTED
04200 CAIN AC2,136 ;WAS CHARACTER A "^"?
04300 JRST INTERRUPT ;YES SO TELL DRIVER
04400 RECVD: TRO FLAGS,KFLG ;CHARACTER RECEIVED SO SET FLAG
04500 IORI AC2,200 ;ADD LEADING BIT TO CHAR
04600 MOVEM AC2,KIB
04700 JRST .+2 ;SET ACTIVE AGAIN
04800 NODATA: TRZ FLAGS,KFLG ;TURN OFF KEYBOARD FLAG
04900 TLOE FLAGS,KACTIV ;SET KEYBOARD ACTIVEEXIT
05000 JRST EXIT ;ALREADY TIMING OUT SO EXIT
05100 HALT
05200 EXIT: POPJ PDP,
05300 INTERR: INCHRW AC2 ;GET THE NEXT CHARACTER
05400 CAIN AC2,136 ;ALSO A "^"?
05500 JRST RECVD ;YES SO IT WAS A "^"
05600 PUSHJ PDP,ALPHA+4 ;CHECK TO SEE IF IT WAS ALPHABETIC
05700 JRST .+3 ;IT WASN'T
05800 SUBI AC2,100 ;CONVERT IT TO A CONTROL CHAR.
05900 JRST RECVD
06000 CAIN AC2,137 ;"_"
06100 JRST .+3 ;YES SO INTERRPRET AS A RUBOUT
06200 SETZM DRDATA+1 ;HAVE THE DRIVER INTERRUPT
06300 JRST NODATA ;NOTE THAT NO DATA RECIEVED
06400 MOVEI AC2,377 ;RUBOUT
06500 JRST RECVD ;NOTE WE GOT A CHAR
06600
06700
06800
06900 ;TELEPRINTER DATA BLOCK
07000
07100 ENTRY TDATA
07200
07300 TDATA: EXP 4*^D100000 ;10 CPS
07400 Z
07500 XWD TACTIV,TFLG
07600 Z
07700
07800 TOB: 0 ;TELEPRINTER BUFFER
07900
08000 ;TELEPRINTER IOTS
08100
08200 INTERNAL TSF,TPC,TCF,TLS
08300 EXTERNAL FCLOSE,NTIME,TIME
08400
08500 TSF: TRNE FLAGS,TFLG ;<6041> SKIP ON TELEPRINTER FLAG.
08600 AOS PC
08700 POPJ PDP,
08800
08900 TLS: TRZ FLAGS,TFLG ;<6046>
09000 ;<6044> LOAD TELEPRINTER BUFFER, SELECT AND PRINT
09100 TPC: MOVE AC0,AC ;LOAD CHARACTER FROM THE AC
09200 ANDI AC0,377 ;REDUCE TO 8BITS
09300 MOVEM AC0,TOB
09400 TLO FLAGS,TACTIV ;SET TELEPR ACTIVE FLAG
09500 MOVE AC1,TIME
09600 ADD AC1,TDATA ;ADD DELAY TIME
09700 MOVEM AC1,TDATA+1 ;SET TIME TO RAISE FLAG
09800 CAMGE AC1,NTIME ;NEXT FLAG TO SET?
09900 MOVEM AC1,NTIME ;YES
10000 MOVE AC0,AC ;LOAD CHARACTER TO BE TYPED
10100 ANDI AC0,377 ;REDUCE TO 8 BITS
10200 OUTCHR AC0 ;TYPE IT
10300 POPJ PDP, ;EXIT
10400
10500 TCF: TRZ FLAGS,TFLG ;<6042> CLEAR TELEPRINTER FLAG.
10600 POPJ PDP,
10700
10800 TTOB: BLOCK 3
10900
11000 END