.title KRTTRA ASCII transfer to remote .ident "V03.62" ; /62/ 27-Jul-93 Billy Youdelman ; ; now called direct instead of through KRTCM1 ; /BBS/ 1-Dec-91 Billy Youdelman V03.61 ; ; after each byte sent the response from the receiver is echo'd ; this makes it handy for reading text files into a called system's ; message editor, etc.. speed is locked at 1 byte/tick, which is ; 600 baud in 60Hz land ; ; added code at EOF so last char(s) echo'd by remote are displayed ; modified action on EOF to reconnect, also suppress CONNECTs sign-on ; message for a cleaner return ; 07-Mar-84 11:42:22 Brian Nelson ; ; Copyright 1984 Change Software, Inc. .include "IN:KRTMAC.MAC" .iif ndf KRTINC .error <; .include for IN:KRTMAC.MAC failed> .mcall .TTYOUT ,.TWAIT .psect $pdata fifteen:.word 0 ,15 ; wait fifteen ticks after EOF short: .word 0 ,1 ; wait up to 1 tick for remote to echo twarea: .word 0 ,0 ; .twait work area .psect $code .sbttl The real work of TRANSFER ; /BBS/ heavily hacked.. .enabl lsb ; input: (r5) = address of the .asciz file name to send ; output: r0 = if <>, error code c$tran::tst remote ; /62/ disallow to TT beq 1$ ; prevents typing TSX lead-in! direrr #er$pls ; please SET LINE first return 1$: clr r2 ; input_open := false clr r3 ; terminal_set := false upcase argbuf ; /62/ upper case all args calls fparse , ; /62/ parse the file name please tst r0 ; did the $parse work ok? bne 90$ ; no calls iswild ,<#srcnam> ; check for wildcarded file spec tst r0 ; is it? bne 90$ ; ya.. call opentt ; open the link tst r0 ; did it work? bne 90$ ; no mov sp ,r3 ; ya, flag TT is init'd.. calls open ,<#srcnam,#lun.in,#text> ; open the input file tst r0 ; did it work? bne 90$ ; no mov sp ,r2 ; ya, flag the file is open 30$: tst cccnt ; ^C typed? bne 100$ ; ya, exit calls getc ,<#lun.in> ; no, get the next char in the file tst r0 ; did that work? bne 90$ ; no cmpb r1 ,#lf ; a line feed we don't need? beq 30$ ; ya, skip it mov r1 ,-(sp) ; one word buffer mov sp ,r1 ; point to it please calls binwri , ; simple to put a single char tst (sp)+ ; pop the tiny buffer now .twait #twarea ,#short ; wait one tick 53$: calls xbinrea ,<#-1> ; now try for the echo please tst r0 ; get anything back? bne 30$ ; no, continue sending tst tsxsav ; running under TSX? beq 60$ ; no cmpb r1 ,m.tsxr ; /62/ ya, don't type beq 53$ ; the lead-in char 60$: mov r1 ,r0 ; pass char to .ttyout .ttyout ; dump it to the terminal br 53$ ; and see if another can be had 90$: mov r0 ,r4 ; save a copy of the error cmp r0 ,#er$eof ; end of file? beq 100$ ; yes, that's ok direrr r0 ; no, print the error out and exit 100$: tst r2 ; input file still open? beq 110$ ; no .twait #twarea ,#fifteen ; after EOF, wait 15. ticks 153$: calls xbinrea ,<#-1> ; now clean up echo at end tst r0 ; get anything back this time? bne 109$ ; no, all done tst tsxsav ; running under TSX? beq 160$ ; no cmpb r1 ,m.tsxr ; /62/ ya, don't type beq 153$ ; the lead-in char 160$: mov r1 ,r0 ; pass char to .ttyout .ttyout ; dump it to the terminal br 153$ ; see if another can be had 109$: calls close ,<#lun.in> ; close the input file 110$: cmp r4 ,#er$eof ; end of file today? beq 130$ ; ya, reconnect with link open tst r3 ; should we put the terminal back? beq 112$ ; no call clostt ; close the link device 112$: tst r2 ; ever get file open? beq 120$ ; no, so skip the newline .newline ; for prompt 120$: clr r0 ; /62/ error already handled.. return 130$: mov #bell ,r0 ; load a beep .ttyout ; ring the bell when done mov sp ,conmsg ; suppress CONNECT sign-on msg jmp c$conn ; and connect automatically.. .dsabl lsb .end