TITLE UTLITY Kermit-10 miscellaneous support routines SEARCH KERMIT,FILIO,UUOSYM,MACTEN,SCNMAC TWOSEG 400000 SALL ;++ ; FACILITY: ; ; KERMIT-10 (Protocol Version IV) ; ; ; ABSTRACT: ; ; Miscellaneous support routines ; ; ; This program is used to implement version 4.0 of the KERMIT protocol ; for the DECsystem-10 (TOPS-10 monitor 6.03). ; ; The KERMIT protocol was developed at the Columbia University Center ; for Computing Activities and is copyrighted by the Trustees of ; Columbia University, New York, NY 10027. Columbia University has ; given permission for any individual or institution to use the proto- ; col, except for explicitly commercial purposes. ; ; ; ; ENVIRONMENT: ; ; TOPS-10 monitor 6.03 ; ; ; AUTHOR: ; ; Charles E. Boyd, Created: 03-Apr-1984 ; Computer Research Center ; University of New Orleans ; Lakefront ; New Orleans, LA 70148 ; ; ; MODIFICATIONS: ; ; 001 CEB, 10-Apr-1984 - Original ; 012 CEB, 28-May-1984 ; Add timing for data transfer rates. ; 014 CEB, 31-May-1984 ; Add ^X, ^Y interception handling ; 027 CEB, 11-Jul-1984 ; Routine PUTC. wasn't preserving register T2 which was being used ; by calling routines. It caused only the first character of each ; packet to be stored rather than the entire packet. Use register ; P2 instead. ; 032 CEB, 17-Jul-1984 ; Modification number 17 hurt repeat character processing, fixed it. ;-- SUBTTL SPACKT ;++ ; DESCRIPTION: ; ; This routine is used to send a packet of information to the receiving ; host. It handles all the quoting, repeating, checksum calculations, ; etc. ; ; ; CALLING SEQUENCE: ; ; PUSH P,[packet-type] ; PUSH P,[ packet-no ] ; PUSH P,[packet-leng] ; PUSH P,[ data-addr ] ; pushj p,spackt ; return ; ; ;-- SPACKT::MOVEI AP,-4(P) ;[017]Get start of arglst PUSH P,P1 ;[017]Save register P1 MOVEI P1,PUTC.## ;[017]Get default output routine TLNE F,F.DEBU ;[017]Debugging? PUSHJ P,DISPAK## ;[017]Sho debugging MOVE T1,(AP) ;Get packet type CAIE T1,TY.BRK ;Break? CAIN T1,TY.ERR ;or Error? MOVEI P1,OUTC.## ;[017]Replace default output UUO MOVE T4,R.NPAD## ;[017]Set up for padding JRST SPAC15 ;... SPAC10: HRR T1,R.PADC## ;...No HRLI T1,TTY ;... PUSHJ P,(P1) ;Write pad char JFCL ;... SPAC15: SOJGE T4,SPAC10 ;Continue SETZM CHKSUM## ;Clear checksum HRR T1,MARKER ;[017]Start off packet HRLI T1,TTY ;[017] PUSHJ P,(P1) ;... JFCL ;... MOVE T1,CHKT## ;Get checksum length ADD T1,2(AP) ;Add on the data length MOVEI T1,CHR%+2(T1) ;Plus overhead and CHAR(x) it ADDM T1,CHKSUM ;Add to check sum HRLI T1,TTY ;[017]Write it PUSHJ P,(P1) ;... JFCL ;... MOVE T1,1(AP) ;Get packet number IDIVI T1,100 ;Modulus 64 ADDI T2,CHR% ;CHAR(pack-no) ADDM T2,CHKSUM ;Add to checksum HRRI T1,(T2) ;[017]Write it HRLI T1,TTY ;[017] PUSHJ P,(P1) ;... JFCL ;... MOVE T1,(AP) ;Get packet type ADDM T1,CHKSUM ;Add to checksum HRLI T1,TTY ;[017]Write it PUSHJ P,(P1) ;... JFCL ;... SKIPG T4,2(AP) ;Get data length JRST SPAC30 ;None MOVNS T4 ;Make pseudo IOWD word HRLS T4 ;... HRR T4,3(AP) ;...to data SPAC20: MOVE T2,(T4) ;Get a character ADDM T2,CHKSUM ;Add to checksum HRRI T1,(T2) ;Write the character HRLI T1,TTY ;[017] PUSHJ P,(P1) ;... JFCL ;... AOBJN T4,SPAC20 ;loop SPAC30: MOVE T1,CHKT## ;Get checksum type CAIE T1,2 ;Two-char? JRST SPAC40 ;...No MOVEI T1,7700 ;Make mask for 1st char AND T1,CHKSUM ;and get 1st chk sum char LSH T1,-6 ;... ADDI T1,CHR% ;CHAR(1st) HRLI T1,TTY ;[017] PUSHJ P,(P1) ;... JFCL ;... HRRZ T1,CHKSUM ;Get 2nd character JRST SPAC45 ;merge SPAC40: MOVE T1,CHKSUM ;Get checksum ANDI T1,300 ;plus bits 7&8 LSH T1,-6 ;... ADD T1,CHKSUM ;... SPAC45: ANDI T1,77 ;Need only 6 bits ADDI T1,CHR% ;CHAR(x) it HRLI T1,TTY ;[017] PUSHJ P,(P1) ;... JFCL ;... HRR T1,R.EOL## ;Get remotes EOL char HRLI T1,TTY ;[017] PUSHJ P,(P1) ;Write it JFCL ;... HLRZS P1 ;...Did we buffer it? CAIE P1,OUTC.## ;[017]... OUTPUT TTY, ;...Yes PUSHJ P,DISPBN## ;Display packet, block numbers POP P,P1 ;[017]Restore P register SUB P,[5,,5] ;[017]Pop off arglst JRST @5(P) ;[017]Leave SUBTTL RPACKT ;++ ; DESCRIPTION: ; ; This routine receives a packet sent from a remote host. ; ; ; CALLING SEQUENCE: ; ; call. 0,RPACKT ; error ; success ; ; ; RETURN VALUE: ; ; T1 - Packet type ; T2 - Packet number ; T3 - Data length ; T4 - Data address ;-- RPACKT::PUSHJ P,.SAVE2## ;Save a register ADD P,[4,,4] ;[017]Make some local space PUSHJ P,CHKXZ## ;[014]Check for interruption RPAC05: PUSHJ P,GCHAR ;Look for start of a packet JRST RPAC99 ;Nothing? CAME T1,MARKER## ;... JRST RPAC05 ;... RPAC10: PUSHJ P,GCHAR ;Get length JRST RPAC99 ;... CAMN T1,MARKER ;If its a ctrl-a JRST RPAC10 ;Start over again MOVEM T1,CHKSUM ;Start off check sum SUBI T1,CHR%+2 ;UNCHAR(length), minus overhead SUB T1,CHKT ;Minus the 1 or 2 for the checksum chars MOVEM T1,-1(P) ;Save data length PUSHJ P,GCHAR ;Get packet number JRST RPAC99 ;... CAMN T1,MARKER ;If its a ctrl-a JRST RPAC10 ;Start over again ADDM T1,CHKSUM ;Add to check sum SUBI T1,CHR% ;Convert to a number MOVEM T1,-2(P) ;Save packet number PUSHJ P,GCHAR ;Get packet type JRST RPAC99 ;... CAMN T1,MARKER ;If its a ctrl-a JRST RPAC10 ;Start over again ADDM T1,CHKSUM ;Add to check sum MOVEM T1,-3(P) ;Save packet type MOVN T4,-1(P) ;Get Negative data length HRLI T4,DATA## ;Get data MOVSS T4 ;Make in right order JUMPG T4,RPAC25 ;Skip if no data RPAC20: PUSHJ P,GCHAR ;Get a character JRST RPAC99 ;... MOVEM T1,(T4) ;Store byte ADDM T1,CHKSUM ;Add to check sum AOBJN T4,RPAC20 ;Loop thru data RPAC25: MOVE T4,CHKT ;Get current checksumming type CAIE T4,2 ;Is it type 2 checking? JRST RPAC30 ;No MOVEI T4,DATA ;Get address of data area PUSHJ P,GCHAR ;Get a character JRST RPAC99 ;Nothing to get SUBI T1,CHR% ;UNCHAR(checksum_character_1) LSH T1,6 ;Shift to proper position MOVE P1,T1 ;Save it PUSHJ P,GCHAR ;Get 2nd checksum character JRST RPAC99 ;... SUBI T1,CHR% ;UNCHAR(checksum_character_2) OR T1,P1 ;Combine both characters MOVE P1,CHKSUM ;Get my calculated checksum ANDI P1,7777 ;Only keep last 12 bits CAIE T1,(P1) ;Do they match? JRST RPAC40 ;No PUSHJ P,GCHAR ;Eat EOLN character JFCL ; JRST RPAC50 ;Finish up. RPAC30: MOVEI T4,DATA ;Re get data address PUSHJ P,GCHAR ;Get check sum JRST RPAC99 ;didn't get anything MOVE P2,T1 ;Save given checksum PUSHJ P,GCHAR ;Get the EOLN character JFCL ;Who cares if it didn't work MOVE P1,CHKSUM ;Get calculated checksum ANDI P1,300 ;Keep only bits 7 & 8 LSH P1,-6 ;Move em to the bottom ADD P1,CHKSUM ;add to check sum ANDI P1,77 ;Keep only last 6 bits CAIN P2,CHR%(P1) ;Check sum ok? JRST RPAC50 ;...Yes RPAC40: PUSH P,[TY.NAK] ;Send NAK on checksum error PUSH P,T2 ;... PUSH P,[0] ;... PUSH P,[0] ;... PUSHJ P,SPACKT ;Send it SUB P,[4,,4] ;Zap stack POPJ P, ;leave bad RPAC50: DMOVE T1,-3(P) ;Get packet type and number MOVE T3,-1(P) ;Get data length MOVEI T4,DATA## ;Get data address SUB P,[4,,4] ;Zap stack TLNN F,F.DEBU ;[017]Debugging? JRST .+5 ;[017]...No PUSH P,AP ;[017]...Yes MOVEI AP,T1 ;[017]... PUSHJ P,DISPAK## ;[017] POP P,AP ;[017] CAIE T1,"E" ;[21]Is it an error packet? PJRST .POPJ1## ;Nope alls ok PUSHJ P,.TCRLF## ;...Yes ERROR RMT, MOVEI T4,DATA ;Print message SOJL T3,.+3 ;... OUTCHR (T4) ;... AOJA T4,.-2 ;... MOVEI S,"A" ;Abort POPJ P, ;Leave RPAC99: SUB P,[4,,4] ;Pop old T1 from stack SKIPE T1 ;Zero means timeout MOVEI S,ST.A% ;Otherwise abort POPJ P, ;and leave SUBTTL BFILL ;++ ; DESCRIPTION: ; ; THis routine is used to fill a packet data buffer from an external file ; handling data compression. ; ; ; CALLING SEQUENCE: ; ; pushj p,bfill ; return ; ; ; RETURN VALUE: ; ; T1 - Buffer size ;-- BFILL:: PUSHJ P,.SAVE4## ;Preserve some registers MOVN P4,R.MAXL## ;Get maximum packet number ADDI P4,13 ;[22]minus overhead gives max data length HRLI P4,DATA ;Get start of data input area MOVSS P4 ;Swap order ;+ ; If anything saved from the last pass use it else start off from scratch. ;- SKIPG SAVCHR# ;Anything saved? JRST BFIL10 ;Nah HLRZ P1,SAVCHR# ;Yes reset to saved stuff HRRE P2,SAVCHR# ;... MOVE P3,SAVCNT# ;... JUMPL P2,BFIL60 ;No break character from last time JRST BFIL30 ;Continue from last pass BFIL10: SETZ P3, ;Repeat count zero PUSHJ P,@CHARIN## ;Get a character JRST BFIL70 ;Eof of file MOVEI P1,(T1) ;save it ;+ ; Get comparison character and test ;- BFIL20: PUSHJ P,@CHARIN## ;Get next character JRST BFIL60 ;None just put the previous one MOVEI P2,(T1) ;Save it CAIN P1,(P2) ;Are they the same AOJA P3,BFIL20 ;Yes keep looking BFIL30: PUSHJ P,PFCIB ;Process the character JRST BFIL50 ;Not enough room BFIL40: MOVEI P1,(P2) ;Get break char as new first SETZ P3, ;Clear count SKIPGE P4 ;Enough room for another? JRST BFIL20 ;...Yes PUSHJ P,@CHARIN## ;...No get another break char JRST BFIL60 ;Only the one char left MOVEI P2,(T1) ;... ;+ ; Buffer was filled while duplicating after a failing repeat test ; so save the current state and leave. ;- BFIL50: HRLM P1,SAVCHR# ;Save current duplicated char HRRM P2,SAVCHR# ;Save break character MOVEM P3,SAVCNT# ;Save dup count JRST BFIL80 ;Leave ;+ ; Only one character left ;- BFIL60: MOVEI P2,-1 ;Say no break character PUSHJ P,PFCIB ;Process the last char JRST BFIL50 ;No room save for next packet ;+ ; Set up to leave ;- BFIL70: SETOM SAVCHR# ;Nothing saved for this pass SETOM SAVCNT# ;... BFIL80: MOVEI T1,(P4) ;Calculate data length SUBI T1,DATA ;... POPJ P, ;Leave SUBTTL XBFILL ;++ ; DESCRIPTION: ; ; THis routine is used to fill a packet data buffer from an external area ; handling data compression. ; ; ; CALLING SEQUENCE: ; ; push sp,[ rout-addr ] ; call. 1,xbfill ; return ; ; ; RETURN VALUE: ; ; T1 - Buffer size ;-- XBFILL::PUSH P,AP ;[017]Save old argptr MOVEI AP,(T1) ;[017]Get new arg value DMOVEM P1,1(P) ;[017]Save some DMOVEM P3,3(P) ;[017] registers ADD P,[4,,4] ;[017] on the stack MOVN P4,R.MAXL## ;Get maximum packet number ADDI P4,13 ;[22]minus overhead gives max data length HRLI P4,DATA ;Get start of data input area MOVSS P4 ;Swap order ;+ ; If anything saved from the last pass use it else start off from scratch. ;- XBFI10: SETZ P3, ;Repeat count zero PUSHJ P,(AP) ;Get a character JRST XBFI80 ;Eof of file MOVEI P1,(T1) ;save it ;+ ; Get comparison character and test ;- XBFI20: PUSHJ P,(AP) ;Get next character JRST XBFI60 ;None just put the previous one MOVEI P2,(T1) ;Save it CAIN P1,(P2) ;Are they the same AOJA P3,XBFI20 ;Yes keep looking PUSHJ P,PFCIB ;Process the character JRST XBFI80 ;Not enough room XBFI40: MOVEI P1,(P2) ;Get break char as new first SETZ P3, ;Clear count JRST XBFI20 ;...Yes ;+ ; Only one character left ;- XBFI60: MOVEI P2,-1 ;Say no break character PUSHJ P,PFCIB ;Process the last char JFCL ;... ;+ ; Set up to leave ;- XBFI80: SETOM SAVCHR# ;Nothing saved for this pass SETOM SAVCNT# ;... MOVEI T1,(P4) ;Calculate data length SUBI T1,DATA ;... MOVE AP,-4(P) ;[017]Get old arg ptr DMOVE P1,-3(P) ;[017]Restore DMOVE P3,-1(P) ;[017] saved SUB P,[5,,5] ;[017] registers POPJ P, ;Leave SUBTTL XBEMPTY ;++ ; DESCRIPTION: ; ; This routine empties a data packet received from the remote host to ; an external output buffer. The address of a routine to actually ; store each character is passed when this routine is called. ; ; This routine here handles all conversion of prefix characters and ; data compression. ; ; ; CALLING SEQUENCE: ; ; movei t1,length ; movei t2,routine ; call. 2,xbempty ; return ; ; ; SIDE EFFECTS: ; ; Destroys T1 & T2 ;-- XBEMPT::PUSHJ P,.SAVE3## ;Save a p register DMOVE P2,T1 ;Save arguments SKIPN P2 ;[017]Leave if nothing to do POPJ P, ;... MOVN T2,P2 ;[017]Get data length HRLI T2,DATA ;And starting address MOVSS T2 ;Put in right order XBEM10: MOVE T1,(T2) ;Get character from data area MOVEI P1,1 ;Assume no repeating TLNE F,F.REPT ;Repeating? CAME T1,REPT## ;Do we have a repeat character? JRST XBEM15 ;No ADD T2,[1,,1] ;Skip over character MOVE P1,(T2) ;Get repeat count SUBI P1,CHR% ;UNCHAR(repeat_count) ADD T2,[1,,1] ;Skip over count XBEM15: MOVE T1,(T2) ;Get repeatted character SETZ T4, ;Assume no eight bit character TLNE F,F.QBIN ;8-bitting CAME T1,QBIN## ;Is it though? JRST XBEM20 ;Nah ADD T2,[1,,1] ;Skip over the quote MOVEI T4,200 ;Flag the 8'th bit to be set MOVE T1,(T2) ;Get next character XBEM20: CAME T1,L.QCTL## ;Is it a quote character JRST XBEM30 ;Nope just regular ADD T2,[1,,1] ;Incre past it MOVE T1,(T2) ;Get next character CAMN T1,L.QCTL## ;Is it also a quote JRST XBEM30 ;Yes TLNE F,F.QBIN ;8-bit mode on? CAME T1,QBIN ;and this is the 8-bit char? SKIPA ;...No JRST XBEM30 ;...Yes TLNE F,F.REPT ;Repeating on? CAME T1,REPT## ;and this the repeat char? XORI T1,100 ;Nope a control character XBEM30: TRO T1,(T4) ;Set the eighth bit if needed PUSHJ P,(P3) ;[017]Store the character JFCL ;... SOJG P1,.-2 ;Repeat if necessary AOBJN T2,XBEM10 ;Loop till empty POPJ P, SUBTTL PFCIB ;+ ; If repeat is enabled and there is enough to repeat then preform the ; data compression else just duplicate the repeated character. ;- PFCIB: CAIGE P3,3 ;Enough to repeat? JRST PFCI20 ;No TLNN F,F.REPT ;Repeate mode enabled? JRST PFCI20 ;No CAIL P3,136 ;Too many for one repeat sequence? SKIPA T2,[CHR%+136] ;...Yes set up for max MOVEI T2,CHR%+1(P3) ;...No get repeat count MOVE T1,REPT## ;Get repeat character DMOVEM T1,(P4) ;Store em ADD P4,[XWD 2,2] ;Increment buffer MOVEI T1,(P1) ;Get character PUSHJ P,PCIBX ;Store it JFCL ;... SUBI P3,136 ;Sub max for repeat sequence SKIPGE P3 ;More? AOSA (P) ;...No go home JUMPL P4,PFCIB ;...Yes if room go put it POPJ P, ;Leave PFCI20: MOVEI T1,(P1) ;Get character PUSHJ P,PCIB ;Write it to the buffer POPJ P, ;Leave SOJGE P3,PFCI20 ;Keep duplicating PJRST .POPJ1## ;Leave ok SUBTTL PCIB ;++ ; DESCRIPTION: ; ; This routine stores characters in the packet data buffer one at a time ; checking and handling every prefixing except data compression. ; ; ; CALLING SEQUENCE: ; ; pushj p,pcib ; error ; success ; ; ; Depends on the register values set up by the BFILL routine ;-- PCIB:: SKIPL P4 ;More room? POPJ P, ;Nope PCIBX: ANDI T1,377 ;Leave on 8-bits TLNN F,F.QBIN ;8-bit enabled JRST PCIB05 ;...No TRZN T1,200 ;Zap the 8'th bit JRST PCIB05 ;Wasn't set MOVE T2,QBIN## ;Get 8-bit character MOVEM T2,(P4) ;Quote the character ADD P4,[1,,1] ;Increment buffer PCIB05: MOVE T2,T1 ;Copy character TRZ T2,200 ;Zap 8th bit CAIL T2," " ;Printable? CAIN T2,.CHDEL ;...? JRST PCIB10 ;...No JRST PCIB20 ;Yes PCIB10: MOVE T2,R.QCTL## ;Get the quoting character MOVEM T2,(P4) ;Store in data area ADD P4,[1,,1] ;Increment count and address XORI T1,CTL% ;Make the character printable JRST PCIB30 ;COntinue PCIB20: TLNE F,F.QBIN ;8-bit quoting? CAME T1,QBIN## ;Is this the 8-bit char? SKIPA ;...No JRST PCIB25 ;...Yes TLNE F,F.REPT ;Rept enabled? CAME T1,REPT## ;Is this the repeat char? SKIPA ;...No JRST PCIB25 ;...Yes CAME T1,R.QCTL## ;Remote's quote char? JRST PCIB30 ;...No PCIB25: MOVE T2,R.QCTL ;Get quote character MOVEM T2,(P4) ;quote the eight bit quote ADD P4,[1,,1] ;Increment past it PCIB30: MOVEM T1,(P4) ;Store the character ADD P4,[XWD 1,1] ;Incre addr PJRST .POPJ1## ;Leave ok SUBTTL BEMPTY ;++ ; DESCRIPTION: ; ; This routine empties a data packet received from the remote host to ; the output file's output buffer. It handles all conversion of pre- ; fix characters and data compression. ; ; ; CALLING SEQUENCE: ; ; movei t1,data-length ; pushj p,bempty ; return ;-- BEMPTY::PUSHJ P,.SAVE3## ;Save a p register or three JUMPE T1,.POPJ## ;Leave if nothing to do MOVN P2,T1 ;[027]Get data length HRLI P2,DATA ;[027]And starting address MOVSS P2 ;[027]Put in right order BEMP10: MOVE T1,(P2) ;[027]Get character from data area MOVEI P1,1 ;Assume no repeating TLNE F,F.REPT ;Repeating enabled? CAME T1,REPT## ;Do we have a repeat character? JRST BEMP15 ;No ADD P2,[1,,1] ;[027]Skip over character MOVE P1,(P2) ;[027]Get repeat count SUBI P1,CHR% ;UNCHAR(repeat_count) ADD P2,[1,,1] ;[027]Skip over count BEMP15: MOVE T1,(P2) ;[027]Get repeatted character SETZ T4, ;Assume no eight bit character TLNE F,F.QBIN ;8-bit quoting enabled? CAME T1,QBIN## ;Is it though? JRST BEMP20 ;Nah ADD P2,[1,,1] ;[027]Skip over the quote MOVEI T4,200 ;Flag the 8'th bit to be set MOVE T1,(P2) ;[027]Get next character BEMP20: CAME T1,L.QCTL## ;Is it a quote character JRST BEMP30 ;Nope just regular ADD P2,[1,,1] ;[027]Incre past it MOVE T1,(P2) ;[027]Get next character CAMN T1,L.QCTL ;Is it too a quote? JRST BEMP30 ;...Yes TLNE F,F.QBIN ;8-bit quoting enabled? CAME T1,QBIN ;and is this it? SKIPA ;...No JRST BEMP30 ;...Yes TLNE F,F.REPT ;Repeating enabled? CAME T1,REPT## ;and is this it? XORI T1,100 ;Nope a control character BEMP30: TRO T1,(T4) ;Set the eighth bit if needed SKIPA P3,T1 ;[032]Save current character MOVEI T1,(P3) ;[032]Write current PUSHJ P,PFCHR ; character SOJG P1,.-2 ;[121]Repeat if necessary AOBJN P2,BEMP10 ;[027]Loop till empty POPJ P, SUBTTL GFCHR ;++ ; DESCRIPTION: ; ; This routine reads one character from an external file, handling null ; characters and line numbers optionally if the file is being read in ; ASCII mode of some kind. ; ; ; CALLING SEQUENCE: ; ; pushj p,gfchr ; error ; return ; ; ; RETURN VALUE: ; ; T1 - Character read ;-- GFCHR:: MOVE T4,CH.FCB##+CH ;[017]Get byte pointer MOVE T4,F%IBP(T4) ;[017] value MOVE T2,FTYPE## ;Get input file type CAIE T2,.IOIMG ;Binary? JRST GFCH10 ;...No LDB T3,[POINT 3,T4,2];Get last byte mask MOVEI T2,1 ;.. LSH T2,(T3) ;.. ANDI T2,17 ;... TDNE T2,(T4) ;Is this the last byte POPJ P, ;...Yes MOVEI T1,CH ;[017]Get a char PUSHJ P,GETC. ;[017]... POPJ P, ;...None PJRST .POPJ1## ;Leave GFCH10: MOVEI T1,CH ;[017]Get a character PUSHJ P,GETC.## ;[017] from the file POPJ P, ;Nothing CAIE T2,.IOBIN ;PDP-10 binary? PJRST .POPJ1## ;[040] No regular LDB T3,[POINT 6,T4,5];Get byte position CAIE T3,1 ;Last byte in the word? JRST .POPJ1## ;...No AND T3,(T4) ;...Yes Get bit 35 LSH T3,7 ;Shift to 8th bit ORI T1,(T3) ;of the final byte PJRST .POPJ1## ;Leave SUBTTL PFCHR ;++ ; DESCRIPTION: ; ; This routine stores one character in the output buffer, handling bit ; 35 of a pdp-10 binary file. ; ; ; CALLING SEQUENCE: ; ; MOVEI T1,"c" ; PUSHJ P,PFCHR ; return ; ; ; SIDE EFFECTS: ; ; Registers T3 and T4 destroyed. ;-- PFCHR:: TRNN T1,200 ;8th bit sett? JRST PFCH10 ;...No MOVE T4,FTYPE## ;...Yes CAIE T4,.IOBIN ;PDP-10 binary file? JRST PFCH10 ;...No MOVE T4,CH.FCB##+CH ;[017]Get output byte MOVE T4,F%OBP(T4) ;[017] pointer value LDB T3,[POINT 6,T4,5] ;Get last written position CAIE T3,10 ;4 chars already written? JRST PFCH10 ;...No MOVEI T3,1 ;...Yes ORM T3,(T4) ;Bit 35 should be on then TRZ T1,200 ;Clear 8th bit PFCH10: HRLI T1,CH ;[017]Write the PUSHJ P,PUTC.## ;[017] character JFCL ;... POPJ P, ;Leave SUBTTL GCHAR ;++ ; DESCRIPTION: ; ; This routine returns one character from the transmission line handling ; timeout. ; ; ; CALLING SEQUENCE: ; ; pushj p,gchar ; error ; success ; ; ; RETURN VALUE: ; ; T1 - Current character received ; On error return 0 means a timeout ;-- GCHAR:: MOVEI T1,TTY ;[017]Get a character PUSHJ P,GETC.## ;[017] from the tty line JRST GCHA10 ; CAIE T1,.CHCNC ;Ctrl-C? JRST .POPJ1## ;...No PJRST EXITER## ;Exit kermit GCHA10: STATZ TTY,IO.ERR!IO.EOF ;Alls ok? SKIPA T1,[-1] ;...No set EOF flag SKIPA ;...Yes continue POPJ P, ;...No finished MOVNI T1,1 ;Make sure we're awake WAKE T1, ;... JFCL ;... MOVE T1,R.TIME## ;Get timeout IMULI T1,^D1000 ;Convert to milli seconds HRLI T1,(HB.RIO) ;Wait awhile or till i/o completes HIBER T1, ;... JFCL ;... HIBER T1, ;... JFCL ;... MOVEI T1,TTY ;[017]Try one more time PUSHJ P,GETC.## ;[017] to be sure SKIPA T1,[0] ;Nope AOS (P) ;Ok POPJ P, ;Return RELOC SUBTTL Storage END