Trailing-Edge
-
PDP-10 Archives
-
bb-bt99g-bb
-
scnser.c09
There is 1 other file named scnser.c09 in the archive. Click here to see a list.
REP 4/3 ;09C1
ND TTIBRK,^D132 ;MAX CHARS BEFORE BREAK CONDITION
ND TTIWRN,TTIBRK+^D40 ;MAX CHARS BEFORE WE SEND AN XOFF
ND TTIMAX,^D300 ;MAX CHARS BEFORE WE START TO SSIN??
WIT
;TERMINAL CHARACTER BUFFERING PARAMETERS
ND TTYMIC,^D60 ;MAX CHARS BUFFERED IN DN8X
; (SHOULD MATCH "TTYMIC" IN DN8X CODE)
; ASCII & IMAGE MODES
ND TTIBRK,^D132 ;MAX CHARS BEFORE BREAK CONDITION
ND TTIWRN,^D200 ;MAX CHARS BEFORE WE SEND AN XOFF
ND TTIMAX,TTIWRN+<5*TTYMIC>;MAX CHARS BEFORE WE START TO DISCARD
; PIM MODE
ND TTPBRK,^D132 ;MAX CHARS BEFORE WAKEUP (PIM MODE)
ND TTPWRN,^D500 ;MAX CHARS BEFORE XOFF (PIM MODE)
ND TTPMAX,TTPWRN+<5*TTYMIC>;MAX CHARS BEFORE DISCARD (PIM MODE)
DEL 10/3 ;09C2
;SIZE OF CHUNKS
REP 16/53 ;09C3
CAMG T2,RPIMWN ;TIME TO WARN HIM?
JRST REPIM2 ;NO, NOT YET
SUBI T2,^D20 ;IS HE OVER 20 CHARS?
CAMLE T2,RPIMWN ;OVER CURRENT LIMIT?
JRST [MOVE T1,LDBPAG(U)
TLNN T1,LPLXOF ;SENT XOF YET?
JRST RPIM25 ;NO, DO IT NOW
JRST RCHLT1] ;YES, EAT CHAR
RPIM25: PUSHJ P,SNDXOF ;SEND XOFF
PUSHJ P,RCVWAK
REPIM2: SKIPG TTFREN## ;ROOM IN CHUNK SPACE?
JRST RCHLT2 ;NO, SHUT IT DOWN
WIT
CAILE T2,TTPWRN ;TIME TO WARN HIM?
JRST [CAILE T2,TTPMAX ;YES, OVER CURRENT LIMIT?
JRST RCHLT1 ;YES, PIM LIMIT EXCEEDED, EAT CHAR
PUSHJ P,SNDXOF ;NO, STILL HOPE, SEND XOFF
PUSHJ P,RCVWAK ;AND GET USER'S ATTENTION
JRST REPIM2] ;ACCEPT THIS CHARACTER
REPIM2: SKIPG TTFREN## ;ROOM IN CHUNK SPACE?
JRST RCHLT1 ;NO, SHUT IT DOWN
REP 31/53 ;09C4
AOS LDBTIC(U) ;INCREMENT COUNT
WIT
AOS T1,LDBTIC(U) ;INCREMENT COUNT
INS 36/53 ;09C5
CAIE T1,TTPBRK ;TIME FOR A WAKEUP ON G.P.S?
REP 2/54 ;09C6
TDNE T1,LDBPAG(U) ;HAVE WE SENT ONE?
POPJ P, ;IF SO, DON'T SEND TWO
IORM T1,LDBPAG(U) ;SET THE BIT SO WE DON'T SEND ANOTHER
WIT
TDNN T1,LDBPAG(U) ;HAVE WE SENT ONE?
JRST SNDXF2 ;NO, ALWAYS SEND THE FIRST XOFF
MOVE T1,LDBTIC(U) ;INPUT CHARACTER COUNT
ADD T1,LDBECC(U) ;PLUS THOSE NOT-QUITE-FULLY-INPUT
TRNE T1,<-1_-<^L<TTYMIC>>> ;ROUGHLY-MODULO TTYMIC?
POPJ P, ;NO, DON'T SEND GOBS OF XOFFS
MOVSI T1,LPLXOF ;YES, SEND ANOTHER XOFF
; (IN CASE THE UGLY RACE BIT US THE FIRST
; TIME AND THE PREVIOUS XOFF GOT LOST -
; SUCH ARE THE VAGARIES OF REALITY)
SNDXF2: IORM T1,LDBPAG(U) ;SET THE BIT SO WE DON'T SEND TOO MANY
REP 32/84 ;09C7
CAIGE T1,^D80
MOVEI T1,^D80
EXCH T1,TIWRNN ;STORE NEW LIMIT AND GET PREVIOUS
MOVEM T1,TIWRN1 ;STORE PREVIOUS
MOVE T1,TIWRNN ;GET NEW BACK
CAIGE T1,^D600 ;IF IT ISN'T AT LEAST 600
MOVEI T1,^D600 ; THEN MAKE IT 600
MOVEM T1,RPIMWN ;AND SAVE
WIT
CAIGE T1,TTIBRK
MOVEI T1,TTIBRK
MOVEM T1,TIWRNN ;STORE NEW LIMIT
REP 39/125 ;09C8
JRST TOPXF2 ;NO
WIT
JRST CPOPJ1## ;NO
INS 56/125 ;09C9
PUSHJ P,SETCHP ;MAKE SURE THE FRONT END KNOWS ABOUT THE CHANGE
REP 17/207 ;09C10
RPIMWN::EXP ^D600 ;(5) PIM BUFFER SIZE
WIT
EXP TTPWRN ;(5) PIM BUFFER SIZE (BEFORE XOFF)
SUM 60832