Trailing-Edge
-
PDP-10 Archives
-
bb-l014t-bm_tops20_v7_0_atpch20
-
autopatch/server.c20
There is 1 other file named server.c20 in the archive. Click here to see a list.
INS 1/1 ;20C1
; Edit= 15 to SERVER.MAC on 4-Oct-88 by JROSSELL, for SPR #21689
;When simulating binary mode, call MTOPR%/.MOANU to not flush NULs from the
;terminal input buffer.
; Edit= 14 to SERVER.MAC on 30-Aug-88 by JROSSELL, for SPR #21876
;Correct the way INPUT-COUNT messages are processed so as not to lose the
;first character of the input buffer. Also, ensure that 1 character reads echo
;the character if necessary.
REP 3/4 ;20C2
VEDIT==^D12
WIT
VEDIT==^D15
INS 18/11 ;20C3
;**;[15]At TM.TRM:+2L add 5 lines JCR 9/28/88
;[15]Disable control characters definitions in START-READ message
DC.NOT==0 ;[15]Parameter not present
DC.UAR==1 ;[15]Disable ^U and ^R only
DC.AED==2 ;[15]Disable all editing control characters
DC.ACT==3 ;[15]Disable all control characters except
;[15]XON and XOFF
INS 38/17 ;20C4
;**;[14]At ESCCHR:+1L add 1 line JCR 8/29/88
TYACHR: BLOCK 1 ;[14]Type ahead character
INS 8/21 ;20C5
;**;[15]At INPCTL:+1L add one line JCR 9/28/88
INPDAM: BLOCK 1 ;[15]"Restore ASCII mode on completion" flag
INS 51/34 ;20C6
;**;[14]At EXCSRT:-4L add 1 line JCR 8/29/88
SETOM TYACHR ;[14]No type ahead character yet
INS 37/48 ;20C7
;**;[14]At CTMCLI:+2L add 1 line JCR 8/29/88
SETOM TYACHR ;[14]Clear any type ahead character
REP 44/48 ;20C8
CTMUNR: SKIPN RDACTV ;Is there a READ active ?
WIT
;**;[14]At CTMUNR:+0L add 1 line JCR 8/29/88
CTMUNR: SETOM TYACHR ;[14]Clear any type ahead word
SKIPN RDACTV ;Is there a READ active ?
REP 18/65 ;20C9
RFMOD%
TXZE T2,TT%ECO ;Yes. Force echo off - was it on ?
SETOM INPECH ;Yes. Must restore it after the read completes.
SFMOD%
EXCH T2,T3 ;Save JFN mode word for use later
BIN% ;Get the first character &
; BKJFN% ;backup the pointer
EXCH T3,T2 ;Restore JFN mode word
SKIPE INPECH ;Is ECHO to be restored ?
TXO T2,TT%ECO ;Yes.
SFMOD% ;Restore mode.
ENDIF.
WIT
;**;[14]At CTMCKI:+13L replace 12 lines with 17 lines JCR 8/29/88
RFMOD% ;[14]Pick up the JFN mode word
ERJMP ERR ;[14]Quit on an error
TXZE T2,TT%ECO ;[14]Force echo off - was it on ?
SETOM INPECH ;[14]Yes, indicate echo forced off
SFMOD% ;[14]Turn echoing off
ERJMP ERR ;[14]Quit on an error
EXCH T2,T3 ;[14]Save JFN mode word for use later
BIN% ;[14]Pick up the first character
ERJMP ERR ;[14]Quit on an error
BKJFN% ;[14]Back up the pointer
ERJMP ERR ;[14]Quit on an error
MOVEM T2,TYACHR ;[14]Save the character for later echoing
EXCH T2,T3 ;[14]Place character in expected place
SKIPE INPECH ;[14]Was echoing forced off?
TXO T2,TT%ECO ;[14]Yes, indicate turn echoing back on
SFMOD% ;[14]Turn echoing back on
ERJMP ERR ;[14]Quit on an error
ENDIF. ;
REP 20/68 ;20C10
CAIE T1,INPORX ;Is it the TEXTI% ?
WIT
;**;[14]At PREOB1:+2L change 1 line JCR 8/29/88
CAIE T1,INPOR2 ;[14]Is it the TEXTI% ?
INS 25/68 ;20C11
;**;[14]At PREOB1:+6L add 1 line JCR 8/29/88
SETOM TYACHR ;[14]Clear any type ahead character
INS 45/68 ;20C12
;**;[14]At PREOB1:+26L add 1 line JCR 8/29/88
SETOM TYACHR ;[14]Clear any type ahead character
INS 15/70 ;20C13
;**;[14]At PRECTX:+2L add 1 line JCR 8/29/88
SETOM TYACHR ;[14]Clear any type ahead character
INS 29/89 ;20C14
;**;[15]At INPDEC:+20L add 19 lines JCR 9/28/88
SETZM INPDAM ;[15]Indicate don't restore ASCII NUL passthrough
LOAD T3,RDDCD,+INPFLG ;[15]Pick up disable control character definition
CAIG T3,DC.AED ;[15]Disabling control characters?
IFSKP. ;[15]
MOVE T3,INPFLG ;[15]Yes, pick up the START-READ flag word
TXC T3,RDNEC ;[15]Complement the no-echo bit
TXNE T3,RDNEC!RDTEC ;[15]Echoing any control or termination characters?
IFSKP. ;[15]
SETOM INPDAM ;[15]No, indicate ASCII NUL passthrough
MOVEM T1,JFN ;[15]Save the JFN
MOVEM T2,MODWRD ;[15]Save the JFN mode word
MOVEI T2,.MOANU ;[15]Pick up function code
MOVEI T3,.MOANY ;[15]Pick up function value
MTOPR% ;[15]Allow NULs to passthrough in ASCII mode
ERJMP .+1 ;[15]Ignore any errors
MOVE T1,JFN ;[15]Restore the JFN
MOVE T2,MODWRD ;[15]Restore the JFN mode word
ENDIF. ;[15]
ENDIF. ;[15]
INS 20/94 ;20C15
;**;[14]At INPEN1:+4L add 1 line JCR 8/29/88
SETOM TYACHR ;[14]Clear any type ahead character
REP 7/96 ;20C16
INPORD: MOVEI T1,.FHSLF ;Turn on interrupts
EIR%
WIT
;**;[14]At INPORD:+0L replace 2 lines with 23 lines JCR 8/29/88
INPORD: SKIPGE T3,TYACHR ;[14]Is there a type ahead character?
IFSKP. ;[14]
MOVEI T1,.PRIIN ;[14]Yes, prepare to pick up the JFN mode word
RFMOD% ;[14]Pick up the JFN mode word
ERJMP ERR ;[14]Quit on an error
TXNN T2,TT%ECO ;[14]Is echoing enabled?
IFSKP. ;[14]
IDIVI T3,^D32 ;[14]Yes, get word offset and bit offset
MOVE T4,BITS(T4) ;[14]Change bit offset to mask
TDNN T4,INPXBM(T3) ;[14]Is character in the TEXTI% break mask?
IFSKP. ;[14]
OPSTR <SKIPN>,RDTEC,+INPFLG ;[14]Yes, Is terminator to be echoed?
JRST INPOR1 ;[14]No, go reset type ahead word
ENDIF. ;[14]
MOVE T1,TYACHR ;[14]Yes, pick up the type ahead character
PBOUT% ;[14]Simulate an echo
ERJMP ERR ;[14]Quit on an error
ENDIF. ;[14]
INPOR1: SETOM TYACHR ;[14]Reset type ahead word
ENDIF. ;[14]
MOVEI T1,.FHSLF ;[14]Pick up the fork handle
EIR% ;[14]Turn on the interrupts
REP 12/96 ;20C17
INPORX: ERJMP ERR
WIT
;**;[14]At INPORX:+0L change 1 line JCR 8/29/88
INPOR2: ERJMP ERR ;[14]Quit on an error
REP 18/96 ;20C18
INPOR1: SKIPG INPBLK+.RDDBC ;Input buffer full ?
WIT
;**;[14]At INPOR1:+0L change 1 line JCR 8/29/88
INPOR3: SKIPG INPBLK+.RDDBC ;[14]Input buffer full ?
REP 9/97 ;20C19
JRST INPOR1 ;No. Finish up.
OPSTR <SKIPE>,RDTEC,+INPFLG ;Is terminator to be echoed ?
IFSKP.
RFMOD%
TXZE T2,TT%ECO ;Yes. Force echo off - was it on ?
SETOM INPECH ;Yes. Must restore it after the read completes.
SFMOD%
ENDIF.
MOVEI T1,.FHSLF ;Yes. Turn on interrupts
EIR%
PBIN% ;Get character
;Label is for out of band process detecting restart necessary
INPBIX: MOVE T3,T1 ;Save it.
MOVEI T1,.FHSLF ;Turn off interrupts
DIR%
IDPB T3,INPBLK+.RDDBP ;Put character into buffer.
SOS INPBLK+.RDDBC ;Account for it.
IDIVI T3,^D32 ;Get word offset and bit offset
MOVE T4,BITS(T4) ;Change bit offset to mask
TDNN T4,INPXBM(T3) ;Is this character in the TEXTI% break mask ?
JRST INPOR1 ;No. Must be buffer full.
MOVX T1,RD%BTM ;Yes. Terminate the read just like
JRST INPOFL ; INPORD does.
WIT
;**;[14]At INPBIN:+3L replace 23 lines with 59 lines JCR 8/29/88
JRST INPOR3 ;[14]No, finish up
RFMOD% ;[14]Pick up the JFN mode word
ERJMP ERR ;[14]Quit on an error
MOVE T4,T2 ;[14]Save for later
OPSTR <SKIPE>,RDTEC,+INPFLG ;[14]Is terminator to be echoed ?
IFSKP. ;[14]
TXZE T2,TT%ECO ;[14]No, force echo off - was it on ?
SETOM INPECH ;[14]Yes, restore it after the read completes.
SFMOD% ;[14]Update the JFN mode word
ENDIF. ;[14]
MOVEI T1,.FHSLF ;[14]Pick up the fork handle
EIR% ;[14]Enable interrupts
PBIN% ;[14]Get character
;[14]Label INPBIX is for the out of band interrupt handler (PREOOB) detecting
;[14]that a terminal input restart is necessary. Note: PREOOB resets the new
;[14]PC to INPREC. INPREC assumes that the top of the stack contains the
;[14]address after the input state dispatch call in routine INPENT.
;[14]Consequently, the SAVEAC must be placed after location INPBIX.
INPBIX: ERJMP ERR ;[14]Quit on an error
SAVEAC <Q1,Q2> ;[14]Need space for the break mask offsets
MOVE Q1,T1 ;[14]Save the character here
MOVE T3,T1 ;[14]and here
MOVEI T1,.FHSLF ;[14]Pick up handle
DIR% ;[14]Disable interrupts
IDPB T3,INPBLK+.RDDBP ;[14]Put character into buffer.
SOS INPBLK+.RDDBC ;[14]Account for it.
IDIVI Q1,^D32 ;[14]Get word offset and bit offset
MOVE Q2,BITS(Q2) ;[14]Change bit offset to mask
SKIPL TYACHR ;[14]Is there a type ahead character?
IFSKP. ;[14]
TDNE Q2,INPXBM(Q1) ;[14]No, is character in the TEXTI% break mask?
JRST INPBI1 ;[14]Yes, terminate the read as INPORD does
TXNE T4,TT%ECO ;[14]Was echoing originally on?
SKIPN INPECH ;[14]Yes, has it been forced off by this routine?
JRST INPOR3 ;[14]No, check if the input buffer is full
MOVE T1,T3 ;[14]Place character where expected
PBOUT% ;[14]Echo the character
ERJMP ERR ;[14]Quit on an error
JRST INPOR3 ;[14]Check if the input buffer is full
ELSE. ;[14]Character is a type ahead character
SETOM TYACHR ;[14]Reset the type ahead word
TXNN T4,TT%ECO ;[14]Was echoing originally on?
IFSKP. ;[14]
TDNN Q2,INPXBM(Q1) ;[14]Yes, is this a termination character?
IFSKP. ;[14]
SKIPE INPECH ;[14]Yes, was echoing forced off?
JRST INPBI1 ;[14]Yes, go terminate read as INPORD does
ENDIF. ;[14]
MOVE T1,T3 ;[14]Pick up the character
PBOUT% ;[14]Echo the character
ERJMP ERR ;[14]Quit on an error
ENDIF. ;[14]
ENDIF. ;[14]
TDNN Q2,INPXBM(Q1) ;[14]Is this character in the TEXTI% break mask?
JRST INPOR3 ;[14]No. Must be buffer full.
INPBI1: MOVX T1,RD%BTM ;[14]Yes. Terminate the read just like
JRST INPOFL ;[14] INPORD does.
REP 34/98 ;20C20
JRST INPOR1 ;Keep trying
WIT
;**;[14]At INPOFL:+29L change 1 line JCR 8/29/88
JRST INPOR3 ;[14]Keep trying
REP 40/98 ;20C21
JRST INPOR1 ;No. Keep trying
WIT
;**;[14]At INPOFL:+35L change 1 line JCR 8/29/88
JRST INPOR3 ;[14]No. Keep trying
INS 17/110 ;20C22
;**;[15]At INPTTY:+10L add 7 lines JCR 9/28/88
SKIPN INPDAM ;[15]Is ASCII NUL passthrough enabled?
IFSKP. ;[15]
MOVEI T2,.MOANU ;[15]Pick up function code
MOVEI T3,.MOANN ;[15]Pick up function value
MTOPR% ;[15]Don't allow NULs to passthrough in ASCII mode
ERJMP .+1 ;[15]Ignore any errors
ENDIF. ;[15]
SUM 63739