,65$ ; Keep going 75$: mov (sp)+ ,r5 ; Restore the buffer pointer. writett buffer=r5,lun=#LUN.CO,size=r1 call dumplog ; May need to dump to log file clc ; Success flag 80$: bcs 90$ ; If set, it's time to EXIT tst ioseen ; Not set, do we really want to bne 85$ ; take a short nap ? If ne, no. CLRXRB ; Yes, insure future rsts/e's ok mov #1 ,XRB+0 ; One second sleep .SLEEP ; Do it 85$: clr ioseen ; No more i/o has been seen br 10$ ; Next please 90$: call ttrst ; Restore terminal chars 100$: return .dsabl lsb .sbttl misc support routines .enabl lsb init: clr eseen ; No escape seen clr xkio ; No remote I/O seen clr ttio ; No local I/O seen clr ioseen ; No I/O at all happened clr ttsdon ; No terminal settings done yet clr xksdon ; No terminal settings done yet CLRFQB ; Zap the firqb please movb #UU.PRV ,FIRQB+FQFUN ; Execute a V9 only call so we .UUO ; can see if this is still v8 clr v9flag ; Assume v8 tstb FIRQB ; Did this call succeed? bne 10$ ; No mov sp ,v9flag ; Yes, this is 9.0 or later 10$: tstb ttname ; Any line previously defined? bne 30$ ; Yes tstb @argbuf ; Any name on the command line? bne 20$ ; Yes message ,cr jmp 90$ ; Error exit 20$: strcpy #ttname ,argbuf ; No name, copy from command line 30$: CLRFQB ; Get our console terminal unit # movb #UU.SYS ,FIRQB+FQFUN ; Do the systat call now .UUO ; Simple movb FIRQB+5 ,ttunit ; Save our terminal unit number mov #XRB ,r3 ; Get the unit number next mov #ttname ,r2 ; Load up the XRB CLRFQB ; Insure no odd defaults around CLRXRB ; Ditto STRLEN r2 ; Get the length of the device name mov r0 ,(r3)+ ; Copy the length of the name mov r0 ,(r3)+ ; ...Copy the length of the name mov r2 ,(r3)+ ; Copy the device name address .FSS ; Do a filename string scan now movb FIRQB ,r0 ; Successfull? bne 80$ ; No, exit movb FIRQB+FQDEVN,xkunit ; Save the connected line unit# bit #20000!40000,XRB+10 ; Did we REALLY get a devicename? bne 40$ ; Yes movb #6 ,r0 ; No, preload bad device name br 80$ ; And exit with error message 40$: cmpb xkunit ,ttunit ; Are they one and the same ? bne 50$ ; No, it's ok message ,cr br 90$ ; Error if so 50$: CLRFQB ; Insure outgoing line is assigned movb #UU.ASS ,FIRQB+FQFUN ; Subfunction code mov #"KB ,FIRQB+FQDEV ; KB movb xkunit ,FIRQB+FQDEVN+0 ; Unit number movb #377 ,FIRQB+FQDEVN+1 ; Unit number is real .UUO ; Simple calls ttspeed ,<#ttname> ; Get interface speed mov r0 ,r2 ; Save the speed message ; Dump the data print #ttname ; And the connect line name tst r2 ; Any speed info available? beq 60$ ; No message < Speed: > ; Yes, dump the speed decout r2 ; Simple message ; A crlf message ; How to return to the local kermit clr -(sp) ; .... bisb conesc ,(sp) ; The current control escape char. add #100 ,(sp) ; Convert to printable representation mov sp ,r0 ; ..... print r0 ; ..... message ,cr ; All done. tst (sp)+ ; Pop this 60$: message ; A final CR/LF ; 70$: clc ; Success br 100$ ; Exit 80$: direrr r0 ; Print RSTS/E error text 90$: sec ; Failure 100$: return ; Exit .dsabl lsb .sbttl save/set/restore terminal characteristics .enabl lsb ttinit: movb #377 ,r0 ; Console terminal first call 200$ ; Get term chars, part 0 FQCOPY #savtt+0,#FIRQB ; Save the characteristics movb xkunit ,r0 ; Now for the CONNECTED terminal call 200$ ; Ditto... FQCOPY #savxk+0,#FIRQB ; Copy this also tst v9flag ; Will the second part of the beq 10$ ; get terminal chars succeed? clrb bufqxk ; Clear buffer quota outz CLRFQB ; Yes, read the buffer quota movb #UU.TRM ,FIRQB+FQFUN ; Again ... incb FIRQB+4 ; Subfunction = 1 movb xkunit ,FIRQB+5 ; Unit number of conneK11ECOMAC[.050032]K11ECO.MAC[.050032]    X14|H [4;Ik(&'( k ߫H&P` \RrPP2PPzPP{PPPPP2P~\$\\TD 0D \~ hi) +\ ^( n ^( np\^txY\^ˀ\!kVk<\F˰<˴ˬ\VVkˤ1`@lP ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789<@<SЬTЬ UQS>?\\\\\\\\\`:#@'="\abcdefghi\\\\\\\jklmnopqr\\\\\\\~stuvwxyz\\\\\\\\\\\\\\\\\\\\\\{ABCDEFGHI\\\\\\}JKLMNOPQR\\\\\\\\STUVWXYZ\\\\\\0123456789\\\\\  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~@ggh<i|o<m<4p<p<k|Zn<l fr rwx<x<x<x޺<w@]@@fjnr]Ze@@|> | |v<H|  |  |xz|  |zt f r   < &^ @&@'*/V,"?Lh:hmBmz|z{x`y~|fN|@@|@͂|@ ݃ƃ<ns<|Ŏ |️|ep|u|-@率|<ᄇ2ֻr||ZRM | ntB|xyvZw|J=|R>|J? nnaa|bddf0(sp) ,(r0) ; No, SLEEP instead of TIMEOUT .SLEEP ; Sleep until tmo or something 10$: mov 4(sp) ,(r0)+ ; is typed. Stuff a buffer size bne 20$ ; Make sure the buffer size is ok inc -2(r0) ; Not ok, make it one character 20$: clr (r0)+ ; Clear returned byte count mov 2(sp) ,(r0)+ ; Buffer address movb 6(sp) ,(r0) ; Channel number aslb (r0)+ ; Times two clrb (r0)+ ; Unused (byte) clr (r0)+ ; Unused (word) clr (r0)+ ; No timeouts with binary mode mov #8192. ,(r0)+ ; No stalling please .READ ; Do it clr r1 ; Assume no data movb FIRQB ,r0 ; Success? bne 100$ ; No mov XRB+XRBC,r1 ; Yes, return byte count 100$: mov (sp) ,10(sp) ; Move return address up add #4*2 ,sp ; Pop parameters and exit return ; Bye $writet:mov r1 ,-(sp) ; Save it mov 4+2(sp) ,r0 ; Size of the write bne 10$ ; It's ok mov 2+2(sp) ,r1 ; No, get the asciz size now strlen r1 ; .... 10$: mov #XRB ,r1 ; Point to XRB please mov r0 ,(r1)+ ; Byte count mov r0 ,(r1)+ ; Byte count again mov 2+2(sp) ,(r1)+ ; Buffer address movb 6+2(sp) ,(r1) ; Channel number aslb (r1)+ ; Times two clrb (r1)+ ; Unused (byte) clr (r1)+ ; Unused (word) clr (r1)+ ; Unused (word) again mov #4096. ,(r1)+ ; IO.WAL .WRITE ; Do it mov (sp)+ ,r1 ; Restore this one mov (sp) ,6(sp) ; Move return address up add #3*2 ,sp ; Ignore parameters return $fqcopy:save ; Copy a block of data mov 2+6(sp) ,r2 ; Destination mov 4+6(sp) ,r1 ; Source mov #40 ,r0 ; Size of a FIRQB 10$: movb (r1)+ ,(r2)+ ; Copy a byte sob r0 ,10$ ; Next please unsave ; Pop registers mov (sp) ,4(sp) ; Move return address cmp (sp)+ ,(sp)+ ; Pop stack return ; Exit .enabl lsb iocheck:cmpb r0 ,#DETKEY ; I/O to detached Keyboard? beq 80$ ; Yes, it's fatal cmpb r0 ,#NODATA ; Simply no data present? beq 70$ ; Yes, that one is ok movb #ERRFQ ,FIRQB+FQFUN ; Dump error text out next movb r0 ,FIRQB+4 ; Pass the error code also CALFIP ; Simple to do clrb FIRQB+37 ; Insure .asciz writett buffer=#FIRQB+4,lun=#LUN.CO writett buffer=#220$,lun=#LUN.CO; A finishing CRLF 70$: clc ; Not fatal return ; Exit 80$: writett buffer=#210$,lun=#LUN.CO; Dump an error message please sec ; This is FATAL return ; Bye .save .psect rwdata ,d,lcl,rel,con,rw 200$: .asciz /%Read error - / 210$: .asciz /??DETKEY error - DTR not present or has been lost/ 220$: .byte CR,LF,0 .even .restore .dsabl lsb .sbttl concmd terminal emulation escape commands .enabl lsb concmd::mov r1 ,-(sp) ; Save it movb @r4 ,r1 ; Get the character to check bicb #^C177 ,r1 ; Must drop parity scan r1 ,#200$ ; look for a match here asl r0 ; word offsets jsr pc ,@210$(r0) ; dispatch to the correct routine 100$: mov (sp)+ ,r1 ; Pop R1 and exit return .save .psect rwdata ,rw,d,lcl,rel,con 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 .restore ; Pop code psect context .dsabl lsb ; Turn off current symbol block con.$: writett buffer=#$bel,lun=#LUN.CO; Send a beep out for unknown clc ; commands. Say it is not fatal. return ; Bye con.c: sec ; Exit connection return ; And return con.i: calls ttydtr ,<#ttname> ; try to force DTR up on the line clc ; AnK11ECOMAC[.050032]K11ECO.MAC[.050032]    X14|H [4;Ik(&'( k ߫H&P` \RrPP2PPzPP{PPPPP2P~\$\\TD 0D \~ hi) +\ ^( n ^( np\^txY\^ˀ\!kVk<\F˰<˴ˬ\VVkˤ1`@lP ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789<@<SЬTЬ UQS>?\\\\\\\\\`:#@'="\abcdefghi\\\\\\\jklmnopqr\\\\\\\~stuvwxyz\\\\\\\\\\\\\\\\\\\\\\{ABCDEFGHI\\\\\\}JKLMNOPQR\\\\\\\\STUVWXYZ\\\\\\0123456789\\\\\  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~@ggh<i|o<m<4p<p<k|Zn<l fr rwx<x<x<x޺<w@]@@fjnr]Ze@@|> | |v<H|  |  |xz|  |zt f r   < &^ @&@'*/V,"?Lh:hmBmz|z{x`y~|fN|@@|@͂|@ ݃ƃ<ns<|Ŏ |️|ep|u|-@率|<ᄇ2ֻr||ZRM | ntB|xyvZw|J=|R>|J? nnaa|bddfd say it's NOT fatal return ; Exit con.q: bic #log$co ,trace ; turn off console logging clc ; Successfull return ; Exit con.r: bit #log$op ,trace ; if the file is open do it beq 100$ ; no bis #log$co ,trace ; yes, enable this 100$: clc ; Success return ; Exit con.x: writett buffer=#$xon,lun=#LUN.XK; Try hard to send an xon done calls ttxon ,<#ttname> ; and try to clear our xoffed state clc ; Success return ; Exit con.br: calls senbrk ,<#ttname,#lun.ti> clc return con.hl::writett buffer=#hlptxt,lun=#LUN.CO clc return .save .psect rwdata ,rw,d,lcl,rel,con hlptxt: .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 .restore .sbttl dump i/o to a log file ? ; Passed: R5 buffer address ; R1 buffer size dumplo: bit #LOG$CO ,trace ; Is this enabled ? beq 100$ ; No bit #LOG$OP ,trace ; Is it open beq 100$ ; No save ; Save work registers mov r1 ,r2 ; Get the number of characters beq 90$ ; Nothing to do ? 10$: clrb r0 ; Avoid sign extension bisb (r5)+ ,r0 ; Get the next character mov #LUN.LO ,r1 ; Unit number call putcr0 ; Thats it folks sob r2 ,10$ ; Next please 90$: unsave ; Pop registers and exit 100$: clc ; May as well say it worked return ; Bye .save .psect rwdata $xon: .byte 'Q&37,0 $xoff: .byte 'S&37,0 $bel: .byte 'G&37,0 .even .restore .end