* 14 aug 85 esj attempt to use a queue structure to prevent dropping * characters in connect mode * 18-jul-85 pcc; fix so it compiles * *************************************** CVCOMMAND.KERMIT.SCONNECT ****** * E:F A:S(NWLS) E:O SCONNECT. * ************************************************************************ * * * Allows the local KERMIT to act as a dumb terminal connected to * another computer. * /INCLUDE BYU.PROG.KERMIT.SYM.EQU.KERCOM /INCLUDE BYU.PROG.KERMIT.SYM.EQU.KERDEF * EQU LCLQSIZ = 1000 EQU RMTQSIZ = 10 * I'R TISUNIT I'R TISTYPE I'R COUNT I'R CHBUF I'R STATUS G'L LCLCHQ(LCLQSIZ) ; char queues for local and remote devices I'R RMTCHQ(RMTQSIZ) I'R LCLQPTRI ; index to next empty spot in queue I'R RMTQPTRI I'R LCLQPTRO ; index to next char to be dumped in queue I'R RMTQPTRO *Formats to V:S V:S F101 = $ To exit from CHAT mode; type control-!$ * ******************* start of executable code *************************** * STATUS=YES E:E TYPMSG.(F101) CHBUF = CTL.(ESCHAR) E'E TYPE.(1,CHBUF.LSH.8) E'E TRANSPAR. ; start up the queue structures LCLQPTRI = LCLQPTRO = 0 RMTQPTRI = RMTQPTRO = 0 ; start up the io flags LOCALDEV(1) = -1 RMTDEV(1) = -1 ; r't ; w'r there is input ; input char ; did char come from localdev? ; yes --> is it the escape char? ; yes --> punt to exit ; no --> send to rmtdev queue ; no --> it came from the rmtdev ; send it to the localdev queue ; e'l ; w'r lcldev is not busy and lcldev queue is not empty ; send char to lcldev ; e'l ; w'r rmtdev is not busy and rmtdev queue is not empty ; send char to rmtdev ; e'l ; f'r R'T W'E CHKINPUT.(TISUNIT,COUNT) .E. 0 E'E INPUT.(TISUNIT, TISTYPE, COUNT, CHBUF) W'R TISUNIT .E. LOCALDEV W'R CHBUF .E. ESCHAR T'O DONE O'E ; E'E TPUTCH.(CHBUF, RMTDEV) ; put the char on the queue and ignore overflow condition for now RMTCHQ(RMTQPTRI) = CHBUF RMTQPTRI = (RMTQPTRI + 1) .MOD. RMTQSIZ # E'E HEXDMP.(1,11,1,RMTCHQ(RMTQPTRO)) E'L O'E ; E'E TPUTCH.(CHBUF, LOCALDEV) ; put the char on the queue and ignore overflow condition for now LCLCHQ(LCLQPTRI) = CHBUF LCLQPTRI = (LCLQPTRI + 1) .MOD. LCLQSIZ # E'E HEXDMP.(0,10,0,LCLCHQ(LCLQPTRO)) E'L E'W ; if the queue is not empty and there is no io in progress or ; this is the first time through the io loop, print a char W'R LCLQPTRI .NE. LCLQPTRO # E'E HEXDMP.(0,1,0,LOCALDEV) W'R LOCALDEV(1) .E. -1 ; this is for the first time through E'E TPUTCH.(LCLCHQ(LCLQPTRO), LOCALDEV) LCLQPTRO = (LCLQPTRO + 1) .MOD. LCLQSIZ # E'E HEXDMP.(0,1,0,LOCALDEV) O'R TESTIO.(LOCALDEV(1)) .NE. 0 ; this is for all of the other times through when io is done LOCALDEV(1) = -1 ; clear io flag E'E TPUTCH.(LCLCHQ(LCLQPTRO), LOCALDEV) LCLQPTRO = (LCLQPTRO + 1) .MOD. LCLQSIZ # E'E HEXDMP.(0,1,0,LOCALDEV) E'L E'L ; ditto W'R RMTQPTRI .NE. RMTQPTRO # E'E HEXDMP.(1,2,1,RMTDEV) W'R RMTDEV(1) .E. -1 ; this is for the first time through E'E TPUTCH.(RMTCHQ(RMTQPTRO), RMTDEV) RMTQPTRO = (RMTQPTRO + 1) .MOD. RMTQSIZ # E'E HEXDMP.(1,2,1,RMTDEV) O'R TESTIO.(RMTDEV(1)) .NE. 0 ; this is for all of the other times through when io is done RMTDEV(1) = -1 ; clear io flag E'E TPUTCH.(RMTCHQ(RMTQPTRO), RMTDEV) RMTQPTRO = (RMTQPTRO + 1) .MOD. RMTQSIZ # E'E HEXDMP.(1,2,1,RMTDEV) E'L E'L F'R DONE E'E OPAQUE. E'E TYPE.(0,0) F'N E'N