.title k11con terminal emu .ident /8.0.01/ .psect .enabl gbl ; Brian Nelson 29-Dec-83 16:00:09 initial version ; Brian Nelson 23-Jan-84 16:19:49 RSX mods ; Brian Nelson 16-Apr-84 08:01:57 Merge Bob Denny's changes for RSX ; John Pieper 840607 Fix TC.DLU for autocall modems (RSX) ; John Pieper 840614 Attach lun.ti (even though slaved!) ; Brian nelson 840616 Don't change TC.DLU, does not work for ; my system at any rate. .iif ndf, r$rt11, r$rt11 = 0 ; assume not rt11 today .include /IN:K11MAC.MAC/ .iif ndf ,k11inc ,.error ; missing INCLUDE for K11MAC.MAC locmod = ter$cc ! ter$bi ; for the 11's console (RSTS/E) remmod = ter$cc ! ter$bi ; for remote (RSTS/E) ; note: vt125's are a problem as they don't send xon when you type one .psect $code .sbttl connect code for kermit .enabl gbl .enabl lsb doconn::tstb ttname ; insure that a device name is set bne 1$ ; ok message ,cr ;jfp 840607 message ,cr return 1$: message ; Print the line and speed out print #ttname ; the link name calls ttspee ,<#ttname> ; get the speed now tst r0 ; not if we can't get it ble 5$ ; yes, do not print 0 or -1 baud message < at > ; and the speed sub #10 ,sp ; try to format the response a little mov sp ,r1 ; allocate a buffer and point to it deccvt r0,r1,#4 ; convert to decimal, 4 wide print r1 ,#4 ; print it add #10 ,sp ; pop the buffer message < baud>,cr ; and finish off the message 5$: message < Type CTRL > clr -(sp) ; allocate a text buffer bisb conesc ,(sp) ; get it add #100 ,(sp) ; convert it back to printable mov sp ,r0 ; point to it now print r0 ,#1 ; at last tst (sp)+ ; pop the buffer message < and then C to return to command level>,cr call getsys ; get the exec we are running today cmpb r0 ,#sy$rsts ; rsts today ? bne 10$ ; no call dorsts ; yes, call the correct routine br 100$ 10$: cmpb r0 ,#sy$rt bne 20$ call dort11 br 100$ 20$: call dorsx br 100$ 100$: return .dsabl lsb global .sbttl do the connect command for RSTS/E ; This is the module that handles the CONNECT command for a Kermit ; running in local mode on a RSTS or RT11 system. The method used is ; simply to try a read without stall on the remote's line, echo to ; the user's terminal if there was data, read without stall on the ; users local terminal and send that data to the remote if there was ; data to be read. If neither terminal had data to get, then Kermit ; will suspend itself for 1 second. For RT11, we will never stall. ; Also, for RT11, whenever we get 20 (8) characters, we will send ; the remote system an XOFF so we can catch up on the input due to ; the RT MT service overhead for single character i/o. chcount = 0 exectyp = 2 needxon = 4 locsize = 10 dort11:: dorsts::sub #locsiz ,sp ; allocate local r/w data mov sp ,r4 ; and a pointer to it please clr -(sp) ; allocate single character buffer mov sp ,r3 ; and point to it please call getsys ; get system type movb r0 ,exectyp(r4) ; save system type in exectype(r4) mov #10 ,chcount(r4) ; count down for rt11 to do an XOFF clr needxon(r4) ; don't need to send xon yet calls noecho ,<#ttname> ; don't want echoing please calls gttnam ,<#ttcons> ; get the 11's terminal name calls ttyini ,<#ttcons,#lun.co,#locmod> tst r0 ; did it work bne 5$ ; no, exit with error calls ttyini ,<#ttname,#lun.ti,#remmod> tst r0 ; did the initialization work ? beq 10$ ; no, exit 5$: jmp 90$ 10$: .iif ne,r$rt11 ,call contrp ; special ^C things for RT11 20$: clr r2 ; assume a short nap is needed calls xbinrea ,<#lun.ti,#-1> ; try to get a charater from remote call errchk ; insure error is correct one tst r0 ; did it work ? bne 30$ ; no, send an XON to the remote system clrpar r1 ; yes, drop any aprity bits please movb r1 ,@r3 ; yes, get the character and print calls binwri ,; it out on the local terminal call dumplo ; dump to a log file perhaps mov sp ,r2 ; and say we don't want to sleep dec chcount(r4) ; is it time to do a RT11 XOFF ? bne 40$ ; no, wait a while then cmpb exectype(r4),#sy$rt ; if not rt11, then skip the xoff bne 25$ mov #2 ,needxon(r4) ; will need to send xon later call sxoff ; yes, send an xoff please 25$: mov #10 ,chcount(r4) ; and reset the character counter br 40$ ; and look for local terminal input 30$: cmpb exectype(r4),#sy$rt ; if not rt, then skip the xon bne 40$ ; not rt tst needxon(r4) ; really send an xon today? beq 40$ ; no dec needxon(r4) ; don't overdo sending xon's please call sxon ; no data, send an xon please 40$: calls xbinrea ,<#lun.co,#-1> ; see if any input is pending from tst r0 ; the local terminal bne 70$ ; no movb r1 ,@r3 ; yes, get it and send it to the bic #^C177 ,r1 ; insure no high bits are set. cmpb r1 ,conesc ; other system unless it's the escape bne 50$ calls xbinrea ,<#lun.co,#20> ; char. get the next one please tst r0 ; but wait for it. did it work ? bne 70$ ; no bic #^C177 ,r1 ; insure no high bits are set. cmpb r1 ,conesc ; really send the escape ? beq 50$ ; yes call concmd ; yes, do the command tst r0 ; exit ? bgt 100$ ; yes, bye br 70$ ; no, next please 50$: setpar @r3 ,@r3 ; insure correct outgoing parity now calls binwri ,; the data is for the remote system tst duplex ; full or half duplex connection? beq 60$ ; full calls binwri ,; half, send it back please 60$: mov sp ,r2 ; flag that no wait is needed 70$: tst r2 ; should we take a short nap ? bne 80$ ; no cmpb exectype(r4),#sy$rt ; don't wait if rt11 beq 80$ ; yep, it's rt11 today calls suspend ,<#1,#0> ; yes, sleep 1 second for RSTS/E 80$: jmp 20$ ; and back for more 90$: direrr r0 ; problems in getting the connection 100$: tst (sp)+ ; pop the one byte buffer and exit calls ttyfin ,<#ttcons,#lun.co> calls ttyfin ,<#ttname,#lun.ti> .iif ne,r$rt11 ,call conrst ; for RT11 control C junk add #locsiz ,sp ; pop local r/w data return ; bye .sbttl RSX Connect code - Rev. Notes ; ; This is the terminal emulator for Kermit-11 on native RSX. It was ; rewritten because the original version developed on the RSTS emulator ; was unsuitable for native RSX. It wouldn't work reliably at baud ; rates over 1200 on a moderately busy system. ; ; ; Bob Denny 10-Mar-84 ; ; NOTE: vt125's are a problem as they don't send xon when you type one ; ; John Pieper 840607 fix for connecting to an autocall modem ; Note: Autocall modems are a pain under RSX. ; If the TTnn: is set /remote , ; the Terminal Handler will NOT let you talk to it until it senses ; DSR . This logic is based on the assumption that a remote line ; will be used only for incoming calls. ; If the TTnn: is set /noremote , ; then you can talk to it, but the Terminal Handler will drop DTR . ; Thus, unless your modem has a local DTR override, it thinks ; that you are not connected to it. ; Solution: RSX-11m V4.1 allows TC.DLU = 2 ; which holds DTR but allows you to talk without having DSR . ; Note -- this mechanism is NOT available from MCR level. ; Further, TC.DLU must be reset to 1 when KERMIT is done or else ; the system will not recognize the TT as really being remote -- ; things such as .IFF in an indirect command file will fail. ; ; John Pieper 840614 Slave Terminal Fix! ; Due to a change in the Terminal Handler, a slaved terminal must also ; be attached or else unsolicited input will NOT be kept in the ; typeahead buffer. (See Software Dispatch Dec. 1983). ; Terminal Emulation sure works better with this fix !! .sbttl RSX Connect code - Definitions ; .if eq ,r$rt11 .iff dorsx:: return .ift ; keep some sanity for the rt assembler ef.rem = 14. ; Remote event flag em.rem = 020000 ; Remote event flag mask ef.loc = 15. ; Local event flag em.loc = 040000 ; Local event flag mask ; ; LOCAL IMPURE DATA ; .psect $idata rw,d,lcl,rel,con ; ; Characteristics buffers ; ; Note: TC.SLV must be second in the list BDN 18-Apr-84 10:47:18 ; savti: .byte TC.FDX,0,TC.SLV,0 ; Original setting for remote savco: .byte TC.FDX,0 ; Original setting for local fdxchr: .byte TC.FDX,1,TC.SLV,1 ; Change to FDX if required ; Buffers for Autocall modem fix savti2: .byte TC.DLU,0,TC.ABD,0 ; TC.ABD maybe not needed - can't hurt sizti2 = .-savti2 ; in case we ever add more functions fixti2: .byte TC.DLU,2,TC.ABD,0 ; values we need for a modem rtab: .byte TC.TBF,0 ; #chars in remote typeahead ltab: .byte TC.TBF,0 ; #chars in local typeahead .mcall qio$ qiow$ ; ; Oft' used QIO DPB's ; remread: qio$ ,lun.ti,ef.rem,,remios,, locread: qio$ ,lun.co,ef.loc,,locios,, remwrite: qiow$ io.wal,lun.ti,ef.loc,,,, locwrite: qiow$ io.wal,lun.co,ef.rem,,,, locech: qiow$ io.wal,lun.co,ef.rem,,,, remtest: qiow$ sf.gmc,lun.ti,ef.rem,,remios,, remtab: qiow$ ,lun.ti,ef.rem,,remios,, ; ; Other stuff ; efbuf: .blkw 4 ; Event flags buffer rembf: .blkb 256. ; Remote data buffer locbf: .blkb 4. ; Local data buffer eseen: .word 0 ; 1 = escape seen locios: .word 0,0 remios: .word 0,0 .psect $code .endc ; for r$rt11 = 0 ; .sbttl RSX Connect Code -- Setup .if eq ,r$rt11 .ift .mcall qio$ qiow$ qiow$s dir$ wtlo$s .mcall alun$s dscp$s encp$s exit$s rdaf$s srex$s .sbttl Connect code for RSX kermit ; ; D O C O N N - Connect for native RSX ; ; Assumes that the remote device has been attached via the ; SET LINE command and its "asslun()" routine. .enabl lsb dorsx: tst altcon beq 1$ call xdorsx return 1$: clr eseen ; must do this for next connect cmd calls ttpars ,<#ttname> ; Get remote unit number srex$s #rsxabo ; abort perhaps alun$s #lun.ti,r1,r0 ; Assign it alun$s #lun.co,#"TI,#0 ; Assign our local terminal tst proflg bne 4$ ; yes, don't try to attach xk0: qiow$s #io.att,#lun.ti,#ef.rem ; and now Attach it. (jfp 840614) 4$: ; ; Save local and remote's /{NO}FULLDUPLEX settings, and ; set them to /FULLDUPLEX. Then DISABLE CHECKPOINTING ; so asynchronous buffered I/O is disabled and true full ; duplex communication can take place. ; BDN 18-Apr-84 10:41:51 Also force slave mode ; qiow$s #sf.gmc,#lun.ti,#ef.rem,,,,<#savti,#4> ; This is crude ... qiow$s #sf.gmc,#lun.co,#ef.loc,,,,<#savco,#2> qiow$s #sf.smc,#lun.ti,#ef.rem,,#remios,,<#fdxchr,#4> qiow$s #sf.smc,#lun.co,#ef.loc,,#remios,,<#fdxchr,#2> ; If lun.ti is currently /noremote (hard wire connection), leave it. ; Notify user to make sure correct TT number. ; If it is /remote , fix it for autocall. tst proflg beq 5$ qiow$s #IO.DEL,#LUN.CO qiow$s #IO.ATA,#LUN.CO,,,,,<,#0,#conast> jmp 10$ 5$: qiow$s #sf.gmc,#lun.ti,#ef.rem,,,,<#savti2,#sizti2> tstb savti2+1 ; currently /remote ? bne 6$ ; Yes message ,cr br 10$ ; that's all we do if local. 6$: cmpb savti2+1,tcdlu beq 10$ tstb tcdlu beq 10$ clr -(sp) ; /36/ allocate buffer for speed clr -(sp) ; /36/ ditto mov sp ,r2 ; /36/ pointer to it movb #tc.xsp ,@r2 ; /36/ want the current speed settings movb #tc.rsp ,2(r2) ; /36/ ditto qiow$s #sf.gmc,#lun.ti,#ef.rem,,,, movb tcdlu ,fixti2+1 qiow$s #sf.smc,#lun.ti,#ef.rem,,,,<#fixti2,#sizti2> ; fix it. tstb savti2+1 ; /37/ only on zero to nonzero trans bne 7$ ; /37/ re steve heflin message ,cr calls suspend ,<#6,#0> 7$: qiow$s #sf.smc,#lun.ti,#ef.rem,,,, cmp (sp)+ ,(sp)+ cmpb tcdlu ,#2 ; /37/ must use write with breakthru bne 8$ ; /37/ for M+ v3 and MicroRsx v3 if=2 mov #IO.WBT+TF.RAL,remwrite+Q.IOFN ; /37/ write with breakthru 8$: 10$: dscp$s ; **DISABLE CHECKPOINTING** .sbttl RSX Connect code - Remote Input ; ; Prime incoming and outgoing streams ; dir$ #remread dir$ #locread ; ; Main loop - Handle incoming and outgoing streams ; until escape character is detected on outgoing (local KB) ; 20$: wtlo$s 0,# ; Wait for a character on either rdaf$s #efbuf ; Read the event flags ; ; Handle character(s) on incoming stream ; bit #em.rem,efbuf+0 ; Anything coming in? beq 40$ ; (no) dir$ #remtest ; More in typeahead? movb remios ,r5 ; get the status of the read call iocheck ; and check for allowable errors bcs 100$ ; fatal (likely was IE.DNR) clr r0 ; m+ may have a lot ready to get bisb rtab+1,r0 ; r0 = # in typeahead beq 30$ ; (no) mov r0,remtab+q.iopl+2 ; Set # to read to drain dir$ #remtab ; Read 'em in 30$: inc r0 ; r0 = total # chars to show clrb rembf(r0) ; /39/ asciz tst con8bit ; should we pass 8 bits? bne 32$ ; yes mov r0 ,-(sp) ; no, clear out the high bit mov #rembf ,r1 ; for the entire buffer 31$: bicb #200 ,(r1)+ ; simple to do sob r0 ,31$ ; next please mov (sp)+ ,r0 ; restore the byte count now 32$: mov r0,locwrite+q.iopl+2 ; Write out this many mov locwrite+q.iopl+0,r2 ; now dump junk to logging file call mapid ; /39/ pro and identify esc seq bcs 35$ ; /39/ yes, mapid responded dir$ #locwrite ; /39/ normal writes 35$: movb (r2)+ ,r1 ; a character at a time call dumplo ; simple to do sob r0 ,35$ ; next please ;- dir$ #remread ; Re-issue read .sbttl RSX Connect code - Local Input ; Handle characters on outgoing (Local input) stream ; do this without fast-drain (yet) 40$: mov #cvtbuf ,cvtadr ; /39/ for converting pro/350 codes clrb cvtbuf ; /39/ nothing is there for now clrb cvtbuf+1 ; /39/ ... nothing is there for now bit #em.loc,efbuf+0 ; Anything typed locally? beq 90$ ; (no, loop back) clr r1 ; /39/ pass 8bit ctls for pro/350 bisb locbf ,r1 ; r1 = just typed character call proesc ; /39/ is this a pro/350 ESC or BS? bcs 45$ ; /39/ no movb @cvtadr ,locbf ; /39/ and setup send for first char movb @cvtadr ,r1 ; /39/ ditto beq 80$ ; /39/ nothing to do inc cvtadr ; /39/ point to the next character 45$: bic #^C177 ,r1 ; drop bit 7 if mark set (BDN) cmpb r1 ,conesc ; Console escape? bne 50$ ; (no) tst eseen ; Already seen one escape? bne 60$ ; (yes, send this one) inc eseen ; Yes, note it for now br 70$ ; And go read again 50$: tst eseen ; Character following conesc? beq 60$ ; (no, send it) call concmd ; Yup, process it clr eseen ; clear the flag tst r0 ; Exit CONNECT mode? bgt 100$ ; (yes, clean up etc.) blt 70$ ; no, but it was a command 60$: clr eseen ; clear the flag setpar locbf ,locbf ; set correctr outgoing parity dir$ #remwrite ; Transmit character to remote tst duplex ; ibm type things today? beq 70$ ; no dir$ #locech ; need half duplex duplex ? 70$: movb @cvtadr ,locbf ; /39/ anymore conversion chars to beq 80$ ; /39/ to transfer over? inc cvtadr ; /39/ no, get the next one please br 60$ ; /39/ next please 80$: dir$ #locread ; Re-issue local read mov #cvtbuf ,cvtadr ; /39/ reset conversion address clrb @cvtadr ; /39/ insure .asciz 90$: bit #em.rem ,efbuf beq 95$ dir$ #remread 95$: jmp 20$ ; Loop back .sbttl RSX Connect code - Clean Up and Exit ; ; Exit CONNECT mode ; 100$: call rsxrst ; restore terminal settings encp$s ;**ENABLE CHECKP** call setcc return rsxabo: call rsxrst ; called via requested exit srex$s ; disable further exits exit$s ; bye rsxrst: qiow$s #io.kil,#lun.ti,#ef.rem ; Kill incoming I/O qiow$s #io.kil,#lun.co,#ef.loc ; Kill incoming I/O qiow$s #sf.smc,#lun.ti,#ef.rem,,,,<#savti,#4> ; Restore lines qiow$s #sf.smc,#lun.co,#ef.loc,,,,<#savco,#2> qiow$s #sf.smc,#lun.ti,#ef.rem,,,,<#savti2,#sizti2> ;jfp qiow$s #io.det,#lun.ti,#ef.rem ; De-Attach remote line return .sbttl map pro/350 codes to vt100 codes .dsabl lsb ; Following code added edit 2.39 /39/ ; ; ; The following code, to (1) intercept 'DECID' and return a ; VT100 term type instead of P/OS's mess that few execs ; recognize, and (2) to map some of the upper row LK201 Pro/350 ; function keys into useable characters were made at the request ; of Bernie Eiben of DEC LDP (eiben@dec-marlboro.arpa, ; eiben%lsmvax.dec@decwrl.arpa). Currently, the mapping is as ; follows (as of 18-NOV-1985 14:08) ; ; F5 (break) --> send a 'real' break ala IO.BRK for XKdriver ; F6 (interupt) --> send \03 (control C) ; F10 (exit) --> send \032 (control Z) ; F11 (ESC) --> send \033 (esc) ; F12 (BS) --> send \010 (backspace) ; ; Since these settings may intfere with some editor functions keys ; they can be disabled via the SET TER VT200 command. The mapping ; of F11 is notable to TOPS20 users for command completion. In my ; opinion, the mods were well worth it, though mapping F10 to \032 ; does present some difficulties. A future version of this code ; would most likely access a global data structure to map settable ; codes (with defaults) to specified character sequences. Ie, we ; may end up rewritting PRO/COMM functionality for Kermit-11/POS. .save .psect mapdata ,rw,d,lcl,rel,con ; In the list specified in MAPSEQ, the translation of P/OS ; escape sequences from the upper row function keys is normally ; an ascii character string. The exceptions are (1) if the first ; character is a \0377 then the next character is assumed to be ; the argument of a connect mode 'escape' command, such as ^\B ; for sending a break, or perhaps a possible mapping of F8 (or ; F7) (\033[19\0176 and \033[18\0176) to a ^\C command. The ; mapping or a sequence to a NULL tells the mainline emulator ; code to do nothing (a NOP). INSEQ is simply the P/OS generated ; ecsape sequences. mapseq: .word 10$,20$,30$,40$,50$,60$,70$,80$,90$ .word 0 10$: .byte 10,0 ; /39/ return for F10 20$: .byte 33,0 ; /39/ return for F11 30$: .byte 3,0 ; /39/ return for F6 40$: .byte 'Z&37,0 ; /39/ return for F10 50$: .byte 377,'b,0 ; /39/ fake ^\b break cmd 60$: .asciz <33>/[?1;0c/ ; /39/ vt101 response 70$: .asciz <33>/[?1;0c/ ; /39/ vt101 response 80$: .asciz <33>/[?1;0c/ ; /39/ vt101 response 90$: .asciz <33>/[?1;0c/ ; /39/ vt101 response .even inseq: .word 10$,20$,30$,40$,50$,60$,70$,80$,90$ .word 0 10$: .byte '2,'4,176,0 ; /39/ generated code for BS (10) 20$: .byte '2,'3,176,0 ; /39/ generated code for ESC (33) 30$: .byte '1,'7,176,0 ; /39/ generated code for INT (3) 40$: .byte '2,'1,176,0 ; /39/ exit key 50$: .byte '1,'5,176,0 ; /39/ break 60$: .asciz /?21;0;0;/ ; /39/ part of response to DECID 70$: .asciz /?21;1;0;/ ; /39/ part of response to DECID 80$: .asciz /?21;2;0;/ ; /39/ part of response to DECID 90$: .asciz /?21;0;0;8;0c/ ; /39/ baseline p/os 2.0 system .even inid: .word 10$,40$ ; /39/ host strings to return ID .word 0 ; /39/ DECID is 'not recommended' 10$: .byte 33,'Z&137,0 ; /39/ but intil 52's are gone... 40$: .byte 33,'Z&137,15,0 ; /39/ just in case .even outid: .asciz <33>/[?1;0c/ ; /39/ vt101 response .even iosb: .word 0,0 ; /39/ a QIOW$S i/o status block smallb: .word 0 ; /39/ a QIOW$S buffer cvtbuf: .blkb 30 ; /39/ copy translated codes to cvtadr: .word cvtbuf ; /39/ a pointer to it .even .restore .sbttl DECID and PRO esc seq conversion code, continued... .mcall mrkt$s ,cmkt$s ,astx$s ,wtse$s mapid: save ; /39/ save register please tst proflg ; /39/ really on a pro/350? beq 100$ ; /39/ no cmpb vttype ,#VT100 ; /39/ iif we think we are a vt100 bne 100$ ; /39/ no cmpb @r2 ,#33 ; /39/ ESC ? bne 100$ ; /39/ no 5$: strlen r2 ; /39/ is there enough to look for? dec r0 ; /39/ well ? bne 20$ ; /39/ yes, go ahead with checks mrkt$s #20,#12,#1,#200$ ; /39/ time the read to be very short qiow$s #IO.RAL!TF.RNE,#LUN.TI,,,#iosb,,<#smallb,#1> cmkt$s #20,#200$ ; /39/ kill the timed read cmpb iosb ,#IS.SUC ; /39/ successfull read? bne 100$ ; /39/ no, exit on error inc locwrite+q.iopl+2 ; /39/ fix i/o count up movb smallb ,1(r2) ; /39/ yes, append the character now clrb 2(r2) ; /39/ insure asciz 20$: clr r3 ; /39/ yes 30$: tst inid(r3) ; /39/ done looking ? beq 100$ ; /39/ yes strcmp r2 ,inid(r3) ; /39/ check tst r0 ; /39/ found it? bne 40$ ; /39/ no strlen #outid ; /39/ yes qiow$s #IO.WAL,#LUN.TI,,,,,<#outid,r0> br 90$ ; /39/ exit 40$: tst (r3)+ ; /39/ not found, check again br 30$ ; /39/ next 90$: sec ; /39/ say we sent a response br 110$ ; /39/ exit 100$: clc ; /39/ say we never sent response 110$: unsave ; /39/ exit return ; /39/ bye 200$: qiow$s #IO.KIL,#LUN.TI ; /39/ abort the qio if timeout astx$s ; /39/ exit marktime ast proesc: save ; /39/ save a register please cmpb vttype ,#VT100 ; /39/ not is we really want pro bne 90$ ; /39/ exit mov #cvtbuf ,r4 ; /39/ get address of conversion buf clrb @r4 ; /39/ assume failure cmpb r1 ,#233 ; /39/ escape character typed 8bit? beq 10$ ; /39/ yes cmpb r1 ,#33 ; /39/ escape w/o bit 7 set bne 90$ ; /39/ no, exit with C set 10$: mrkt$s #20,#2,#1 ; /39/ insure we wait long enough wtse$s #20 ; /39/ to get all the data input qiow$s #SF.GMC,#LUN.CO,,,,,<#ltab,#2> ;/ 39/ yes, get typeahead count movb ltab+1 ,r2 ; /39/ check for typeahead count beq 90$ ; /39/ nothing to do qiow$s #IO.RAL!TF.RNE,#LUN.CO,,,,, clrb cvtbuf(r2) ; /39/ insure .asciz mov r4 ,r3 ; /39/ get address of data read cmpb @r3 ,#'[ ; /39/ esc [ or CSI ? bne 15$ ; /39/ must be CSI inc r3 ; /39/ must be ESC [ 15$: clr r2 ; /39/ look for a matching esc seq 20$: tst inseq(r2) ; /39/ all done beq 90$ ; /39/ exit with C set strcmp r3 ,inseq(r2) ; /39/ did we get a pro/350 esc seq? tst r0 ; /39/ ... bne 30$ ; /39/ no mov mapseq(r2),r3 ; /39/ yes, get the translation cmpb @r3 ,#377 ; /39/ fake emulator command? bne 25$ ; /39/ no inc eseen ; /39/ say we have a ctrl\ movb 1(r3) ,(r4)+ ; /39/ yes, return 1 char code clrb (r4)+ ; /39/ insure .asciz br 100$ ; /39/ exit success 25$: strcpy r4 ,r3 ; /39/ yes, copy the mapped string br 100$ ; /39/ and exit 30$: add #2 ,r2 ; /39/ not done, next please br 20$ ; /39/ 90$: sec ; /39/ failure br 110$ ; /39/ exit 100$: clc ; /39/ success 110$: unsave ; /39/ pop regs and exit return conast: qiow$s #IO.WAL,#LUN.TI,,,,,<#200$,#1> tst (sp)+ astx$s 200$: .byte 3,0 .sbttl check for allowable i/ o errors for RSX/ M+ and P/ OS iocheck:mov r0 ,-(sp) ; insure this is saved tstb r5 ; sucessesful read qio ? bpl 180$ ; yes scan r5 ,#200$ ; allowable error code ? tst r0 ; well bne 180$ ; yes, let it through neg r5 ; make > 0 for direrr macro direrr r5 ; simple sec ; failure, exit to command level br 190$ ; bye 180$: clc ; success, stay in connect code 190$: mov (sp)+ ,r0 ; restore old r0 please return 200$: .byte IE.BCC ,IE.DAO ,IE.IES ,IE.NOD ,IE.PES ,IE.VER ,IE.ABO ,0 .even global .dsabl lsb .endc ; for r$rt11 = 0 .sbttl errchk check for allowable errors on the link errchk: mov r0 ,-(sp) ; save the error code cmpb r0 ,#nodata ; check error codes out please beq 210$ ; that is what we wanted (no data) tst r0 ; any other kind of error ? beq 210$ ; no calls syserr , ; yes, get the error text please strlen #errtxt ; ok add #errtxt ,r0 ; get the length, point to the end movb #cr ,(r0)+ ; and stuff a carriage return and movb #lf ,(r0)+ ; a line feed in clrb @r0 ; insure .asciz please strlen #errtxt ; the length once again calls binwri ,<#errtxt,r0,#lun.co> ; try to print error on TI tst r0 ; did that also fail ? beq 210$ ; no mov @sp ,r0 ; yes direrr r0 ; yes, print on default TI: lun 210$: mov (sp)+ ,r0 ; pop saved r0 and exit return ; bye global .sbttl concmd terminal emulation escape commands concmd::save bicb #^C177 ,r1 scan r1,#200$ ; look for a match here tst r0 ; if no match, return 0 beq 100$ ; ok asl r0 ; word offsets jsr pc ,@210$(r0) ; dispatch to the correct routine tst r0 ; if not set then set to -1 bne 100$ ; already set dec r0 ; set to -1 100$: unsave ; pop r1 and exit return 200$: .byte 'C&137 ,'c!40 ; drop connection ctrl \ C .byte 'I&137 ,'i!40 ; init the line .byte 'Q&137 ,'q!40 ; quit logging but leave file open .byte 'R&137 ,'r!40 ; resume logging if file is open .byte 'X&137 ,'X!40 ; control Q and then thats all .byte 'B&137 ,'b!40 .byte '? ,177 ; help, rub for send break .byte 'H&137 ,'h!40 .byte 0 .even 210$: .word con.$ ; unknown escape command .word con.c ,con.c ; drop connection .word con.i ,con.i ; get modems attention .word con.q ,con.q ; turn console logging off .word con.r ,con.r ; turn it back on please .word con.x ,con.x ; send XON .word con.br ,con.br ; break .word con.hl ,con.br ; print out commands .word con.hl ,con.hl ; help con.$: calls binwri ,<#200$,#1,#lun.co> ; beep at user clr r0 return 200$: .byte 'G&37 ; [BEL] .even con.c: mov #1 ,r0 ; set flag to exit connect code return ; simple con.i: calls ttydtr ,<#ttname> ; try to force DTR up on the line clr r0 return con.q: bic #log$co ,trace ; turn off console logging clr r0 return con.r: bit #log$op ,trace ; if the file is open do it beq 100$ ; no bis #log$co ,trace ; yes, enable this 100$: clr r0 return con.x: calls binwri ,<#200$,#1,#lun.ti>; insure a control Q goes down calls ttxon ,<#ttname> clr r0 return 200$: .byte 'Q&37 .even con.br: calls senbrk ,<#ttname,#lun.ti> clr r0 return con.hl::strlen #200$ calls binwri ,<#200$,r0,#lun.co> clr r0 return 200$: .ascii /B Try to send a break to the remote/ .ascii /C Connect back to the local Kermit-11/ .ascii /I Drop and raise DTR (for RSTS only)/ .ascii /Q Quit console logging. See SET LOG/ .ascii /R Resume console logging. See SET LOG/ .ascii /X Send XON and cancel any active XONs/ .asciz /RUBOUT Try to fake a break to the remote/ .ascii /? Print this message/ .byte 0 .even .sbttl dump i/o to a log file ? dumplo: bit #log$co ,trace ; is this enabled ? beq 100$ ; no bit #log$op ,trace ; is it open beq 100$ ; no save ; yes, save temps please mov r1 ,r0 ; call simple version mov #lun.lo ,r1 ; unit number call putcr0 ; thats it folks unsave 100$: return sxon: tst conflow beq 100$ calls binwri ,<#xon,#1,#lun.ti> 100$: return sxoff: tst conflow beq 100$ calls binwri ,<#xoff,#1,#lun.ti> 100$: return .save .psect $pdata xon: .byte 'Q&37 xoff: .byte 'S&37 .even .restore global .end