rxrb call $clrxr .endm clrxrb nodata == 13. ; no data for terminal read detkey == 27. ; i/o to detached tt line .psect $code xinit:: save call rmsini ; /53/ Setup SST mov #$phnum ,phnum ; /51/ mov #$albuf ,albuff ; /51/ Fill address in. clrb @phnum ; /51/ Clear clr @albuff ; /51/ Clear first word. mov #$lastli,r0 ; /52/ Setup the command recall mov #LN$CNT ,r1 ; /52/ buffers. The count. mov r1 ,lastcnt ; /52/ Save globally mov #lastli ,r2 ; /52/ The pointer array 5$: mov r0 ,(r2)+ ; /52/ Insert the buffer address clrb @r0 ; /52/ Insure the buffer is zapped add #LN$SIZE,r0 ; /52/ Get to the next one sob r1 ,5$ ; /52/ And loop mov #$cmdbuf,cmdbuf ; /53/ $CMDBUF defined in K11RMS mov #$argbuf,argbuf ; /53/ $ARGBUF defined in K11RMS mov sp ,infomsg ; /41/ msg displaying mov #doconn ,altcon ; /44/ clr df$rat ; stream ascii please for RSTS? movb #fb$stm ,df$rfm ; say so and exit mov #ttsave ,r1 ; initialize the terminal char mov #15 ,r0 ; save area now. 10$: movb #377 ,(r1)+ ; the ttysave area is set up for add #40 ,r1 ; saving up to 15 (8) settings. clrb bufqsav(r0) ; /40/ clear old buffer quotas sob r0 ,10$ ; makes it easy to save via LUN calls l$fss ,<#kb> ; open terminal on LUN.AS movb #opnfq ,FIRQB+FQFUN ; to fix things up if using movb #lun.tt ,FIRQB+FQFIL ; it's global please aslb FIRQB+FQFIL ; times 2 please CALFIP ; simple movb FIRQB ,r0 ; it can't fail !! beq 20$ ; ok direrr r0 ; oops 20$: call inqv9 ; /40/ global flag for version 9.x bcs 40$ ; /45/ Not version 9 or later clrfqb ; /45/ V9, get the JOB type movb #UU.SYS ,FIRQB+FQFUN ; /45/ Job stats, part 3 movb #2 ,FIRQB+5 ; /45/ Subfunction code .UUO ; /45/ Do it please mov #proctype,r0 ; /45/ Address of process_type clr (r0) ; /45/ Word sized movb FIRQB+20,(r0) ; /45/ Save our process type now clr jobtype ; /45/ Assume interactive cmpb (r0) ,#PRO$NET ; /45/ Is this a SET HOST job ? beq 30$ ; /45/ Yes, let it be INTERACTIVE cmpb (r0) ,#PRO$BAT ; /45/ Is this a BATCH job ? bne 30$ ; /45/ No, assume INTERACTIVE for now mov #JOB$BAT,jobtype ; /45/ Set BATCH access 30$: ; /45/ Maybe more kinds in the future 40$: call inqter ; /39/ get terminal type movb r0 ,vttype ; /39/ same terminal type clr r0 unsave return .save .psect $PDATA ,D kb: .asciz /_KB:/ .even .restore global global global global ; /44/ global ; /53/ global ; /53/ .assume JOB$INT eq 0 ; /45/ .sbttl terminal initialization .psect $code ; T T Y I N I ; ; ttyini( %loc device_name ,%val channel_number ,%val ccflag ) ; ; ; input: @r5 .asciz string of device name ; 2(r5) channel number ; 4(r5) bitfield for ter$cc and ter$bi ; ; if 4(r5) and ter$bi then use binary open ; else use multiple delimiters ; if 4(r5) and ter$cc then set control c as delimiter ; if 4(r5) and ter$xo then allow binary mode with XON ; ; output: r0 error codes ; ; ; Ttyini sets the appropiate terminal characteristics for ; the device name passsed and returns the device open (or ; attached) on the passed logical unit. Errors are returned ; in r0. For RSTS these could be the usual device not avail- ; able or missing monitor feature. ; ; useful things to add: device check for terminal .enabl lsb ttyini::save clr lokahd ; /44/ Clear lookahead call getprv ; will need for binary open mov 2(r5) ,r2 ; channel number asl r2 ; times two clr lpoint(r2) ; clear offset into local buffer clr linit(r2) ; we have not set fast packet mode clr lsize(r2) ; we have not read anyting yet also clrfqb ; insure FIRQB and xrb are cleared clrxrb ; of undesirable defaults mov @r5 ,r0 ; get address of device string tstb @r0 ; anything there ? bne 10$ ; yes calls l$fss ,<#kb> ; nK11E80MAC[.050032]K11E80.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|bddf tst r0 ; /19/ ge kb100: ? beq 10$ ; /19/ no add #'0 ,r0 ; /19/ convert the 100's part of unit movb r0 ,(r2)+ ; /19/ and copy it please 10$: clr r0 ; /19/ get the low two digits please div #10. ,r0 ; simple add #'0 ,r0 add #'0 ,r1 movb r0 ,(r2)+ movb r1 ,(r2)+ 90$: movb #': ,(r2)+ clrb @r2 unsave return .sbttl set delimiter bitmask up please ; S E T D L M ; ;! setdlm( %val channel_number ) ; ; input: @r5 channel number to use ; ; output: r0 error code (would be missing sysgen feature) .iif ndf, ttyhnd , ttyhnd = 2 global .save .psect $PDATA ,D pakmsk: .byte ^B11110111 .byte 377 .byte 377 .byte 377 .rept 13 .byte 0 .endr .rept 21 .byte 377 .endr dlmmsk: .byte ^B11110111 ; all chars except control C .byte ^B11111111 .rept 36 .byte 377 .endr .even dlmcc: .rept 40 .byte 377 .endr .even .restore .iif ndf,.spec ,.spec = emt + 14 snoecho:mov #xrb ,r0 ; pointer to parameter block mov #3 ,(r0)+ ; function to disable echo clr (r0)+ ; unused clr (r0)+ ; unused movb 2(sp) ,@r0 ; channel number aslb (r0)+ ; times 2 movb #ttyhnd ,(r0)+ ; driver index (ttdvr) clr (r0)+ ; unused clr (r0)+ ; unused clr (r0)+ ; unused .spec ; now do it movb FIRQB ,r0 ; return any errors mov (sp)+ ,(sp) ; pop arg list and exit return ; exit setdlm::mov @r5 ,-(sp) call snoecho mov #xrb ,r0 ; setup to set a private delim mov #11 ,(r0)+ ; mask now. function code is 11 mov #40 ,(r0)+ ; for .spec, 40 byte to copy mov #dlmmsk ,(r0)+ ; address of delimiter mask tst 2(r5) ; allow control c's to come in beq 10$ bmi 5$ mov #pakmsk ,-2(r0) br 10$ 5$: mov #dlmcc ,-2(r0) 10$: movb @r5 ,@r0 ; channel number aslb (r0)+ ; times 2 movb #ttyhnd ,(r0)+ ; device driver index clr (r0)+ ; default to console device clr (r0)+ ; unused mov #1 ,(r0)+ ; subfunction SET DELIMITER .spec ; and do it please movb FIRQB ,r0 ; did it work ? return clrdlm:: mov #xrb ,r0 ; point to it please mov #11 ,(r0)+ ; subfunction clr (r0)+ ; must be 0 clr (r0)+ ; also 0 movb @r5 ,@r0 ; channel number please aslb (r0)+ movb #ttyhnd ,(r0)+ ; device driver to call clr (r0)+ ; use channel number clr (r0)+ ; must be zero clr (r0)+ ; subfunction 0 .spec ; and call ttdvr 100$: return .sbttl special init for receiving files ; Due to what I would consider a RSTS terminal driver ; bug ( .ttddt isn't cleared if you do a read without ; wait and there was no data) we have to call this ; before we receive any files from a remote kermit. .save .psect $PDATA ,D xzmask: .byte ^B00100000 ; control E .byte 0 .byte 0 .byte ^B00000101 ; control X and control Z please .rept 34 .byte 0 .endr .RESTORE ttrini::mov #xrb ,r0 ; setup to set a private delim mov #11 ,(r0)+ ; mask now. function code is 11 mov #40 ,(r0)+ ; for .spec, 40 byte to copy mov #xzmask ,(r0)+ ; address of delimiter mask movb #lun.tt ,@r0 ; channel number aslb (r0)+ ; times 2 movb #ttyhnd ,(r0)+ ; device driver index clr (r0)+ ; default to console device clr (r0)+ ; unused mov #1 ,(r0)+ ; subfunction SET DELIMITER .spec ; and do it please return ttrfin::calls clrdlm ,<#lun.tt> return .sbttl other things like echo off and on ; N O E C H O ; ; ; input: @r5 terminal name or null or 0 for current terminal ; output: r0 error code noecho::save ; save a temp register clr r0 ; assume our terminal mov @r5 ,r1 ; passed address of 0 or a null string? beq 10$ ; no address, assume _KB: tstb @r1 ; null string passed ? beq 10$ ; yes, assume the console terminal call ttpars ; parse the terminal device name bcs 90$ ; oops cmpb r0 ,#377 ; own terminal ? bne 10$ ; no call myterm ; yes, get correct unit number then 10$: clrxrb ; insure no defaults mov #xrb ,r1 ; point to the xrb now mov #3 ,(r1)+ ; disableK11E80MAC[.050032]K11E80.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|bddf \0100 blo 80$ ; /44/ to \0137 ? cmpb r1 ,#137 ; /44/ Well ? bhi 80$ ; /44/ Yes, we can't control it then bisb #100 ,r1 ; /44/ In range, restore to CORRECT br 100$ ; /44/ format of CTL+0100 80$: incb lokahd+1 ; /44/ Invalid, set lookahead flag movb r1 ,lokahd+0 ; /44/ Save the data please movb #33 ,r1 ; /44/ Return( '\033' ) br 100$ ; /44/ for next read and exit 90$: clr r1 ; /44/ Setup for lookahead data bisb lokahd ,r1 ; /44/ Insert lookahead data 95$: clr lokahd ; /44/ No more lookhahead data clr r0 ; /44/ No errors 100$: return ; /44/ Exit .sbttl Really read next character in the buffer now doread: save ; save temp register 5$: mov @r5 ,r2 ; get the channel number asl r2 ; times 2 for word addressing tst linit(r2) ; has this lun ever been set beq 20$ ; up for a partial delimiter mask? tst lsize(r2) ; yes, is there any data waiting? bgt 10$ ; yes, get whats already there clr lpoint(r2) ; no, clear the pointer clr lsize(r2) ; insure buffer size is zero call rget ; and read a record if possible tst r0 ; if it fails, revert to 1 char bne 100$ ; i/o 10$: dec lsize(r2) ; one less character in buffer bmi 5$ ; if < 0, nothig was read. do it again mov lpoint(r2),r0 ; get the offset into the buffer inc lpoint(r2) ; and prime this for next time clr r1 ; avoid pdp-11 sign extension bisb lbuffer(r0),r1 ; get the character from the buffer clr r0 ; no errors br 100$ ; and exit 20$: call xbinrea ; 100$: unsave ; pop temp register and exit return ; rget: mov #xrb ,r0 ; address of xrb parameter block mov #MAXLNG ,(r0)+ ; /42/ buffer length clr (r0)+ ; must be zero mov #lbuffer,(r0)+ movb r2 ,(r0)+ ; channel number bne 5$ ; /52/ Not zero .TTECH ; /52/ Zero, insure echoing 5$: clrb (r0)+ ; unused clr (r0)+ ; unused cmp 2(r5) ,#-1 ; no wait ? bne 10$ ; no clr (r0)+ ; yes mov #8192. ,(r0)+ ; stuff return without wait in br 20$ ; and do it 10$: mov 2(r5) ,(r0)+ ; timeout clr (r0)+ ; unused 20$: .READ movb FIRQB ,r0 ; return error code and exit beq 30$ ; /45/ No errors cmpb r0 ,#DETKEY ; /45/ I/O to detached Keyboard ? bne 100$ ; /45/ No mov #1 ,XRB+0 ; /45/ Yes, sleep a moment .SLEEP ; /45/ ... br 100$ ; /45/ Exit 30$: mov xrb+xrbc,lsize(r2) clr lpoint(r2) 100$: return xbinre::mov #xrb ,r0 ; address of xrb parameter block mov #1 ,(r0)+ ; buffer length clr (r0)+ ; must be zero clr -(sp) ; allocate buffer on the stack mov sp ,(r0)+ ; address of the buffer movb @r5 ,@r0 ; channel number bne 5$ ; /52/ Not zero .TTECH ; /52/ Zero, insure echoing 5$: aslb (r0)+ ; times 2 clrb (r0)+ ; unused clr (r0)+ ; unused cmp 2(r5) ,#-1 ; no wait ? bne 10$ ; no clr (r0)+ ; yes mov #8192. ,(r0)+ ; stuff return without wait in br 20$ ; and do it 10$: mov 2(r5) ,(r0)+ ; timeout clr (r0)+ ; unused 20$: .READ movb FIRQB ,r0 ; return error code and exit clr r1 bisb (sp)+ ,r1 return ; Check for pending input on terminal (like ^X and ^Z) ; Note: .TTDDT should be cleared by TTDVR always. It's ; not, so for the time being lets forget about it and ; instead setup ^X and ^Z as delimiters. I would have ; preferred to use odt mode for this routine. chkabo::tst jobtyp ; /45/ Can't do from batch bne 110$ ; /45/ Exit then calls xbinrea ,<#5,#-1> ; simple read on console terminal tst r0 ; did it work ok ? bne 100$ ; no mov r1 ,r0 ; yes, return ch in r0 please return 100$: cmpb r0 ,#11. ; error EOFEOF? bne 110$ ; no movb #'Z&37 ,r0 ; yes, return ^Z as the character return 110$: clr r0 ; it failed return .assume JOB$INT eq 0 .assume JOB$BAT eq 1 read1c::CLRXRB ; Insure XRB is zapped .TTNCH ; No echo .TTDDT ; One shot ODT mode CLRXRB ; Insure XRB zapped clr -(sp) ; Allocate a buffer mov sp ,r1 ; A pointer mov r1 ,XRB+XRLOC ; Buffer address inc XRB+XRLEN ; One character size buffK11E80MAC[.050032]K11E80.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|bddf/ And compute a new buffer addr add r0 ,r2 ; /45/ buffer = buffer + (size-left) mov XRB+XRBC,r3 ; /45/ New write size ; /45/ Now try to XON the line clrfqb ; /45/ Try a UU.FCB to get the unit movb #UU.FCB ,FIRQB+FQFUN ; /45/ number. While it's acknowledged movb 4(r5) ,FIRQB+FQFIL ; /45/ that data strutures may change, .UUO ; /45/ its unlikely that terminal DDB's movb FIRQB ,r0 ; /45/ will change in the first few bne 100$ ; /45/ words. mov #XRB ,r0 ; /45/ Point to the XRB now mov #5 ,(r0)+ ; /45/ Xoffed, try to clear the line mov #1 ,(r0)+ ; /45/ One byte, an XON, to force. mov #$xon ,(r0)+ ; /45/ XRLOC, address of the buffer. mov #TTYHND*400,(r0)+ ; /45/ Low byte unused, high=driveridx movb FIRQB+7 ,(r0)+ ; /45/ Unit number to force to clrb (r0)+ ; /45/ Unused clr (r0)+ ; /45/ Unused clr (r0)+ ; /45/ Unused .SPEC ; /45/ At last ! mov #4 ,XRB+0 ; /45/ Take a short nap and then retry .SLEEP ; /45/ Wait a moment. br 10$ ; /45/ Go back, stalled write this time 100$: unsave return ; B I N W R I ; ; input: @r5 buffer address ; 2(r5) buffer size ; 4(r5) channel number ; output: r0 error code binwri::mov #xrb ,r0 ; address of xrb parameter block mov 2(r5) ,(r0)+ ; buffer length mov 2(r5) ,(r0)+ ; byte count for the i/o mov @r5 ,(r0)+ ; address of the buffer movb 4(r5) ,@r0 ; channel number aslb (r0)+ ; times 2 clrb (r0)+ ; unused clr (r0)+ ; unused clr (r0)+ ; unused mov #4096. ,(r0)+ ; modifier (ie, io.wal+nostall) .WRITE movb FIRQB ,r0 ; return error code and exit return .sbttl do a filename string scan ; L $ F S S ; ; input: @r5 .asciz string of the device or filename ; output: FIRQB the usual ; r0 error code if any l$fss:: clrfqb l$fssx::mov @r5 ,r0 ; get the filename address 10$: tstb (r0)+ ; and now get the length bne 10$ ; no null, keep going sub @r5 ,r0 ; now get the length dec r0 ; which is off by one of course mov r0 ,xrb+xrlen ; length of the string mov r0 ,xrb+xrbc ; once again mov #xrb+xrloc,r0 ; finish clearing out mov @r5 ,(r0)+ ; starting address of string clr (r0)+ ; unused clr (r0)+ ; unused clr (r0)+ ; unused clr (r0)+ ; unused .FSS ; now do it please movb FIRQB ,r0 ; return error return .assume eq .assume eq .sbttl normal i/o to the terminal ; S T T Y O U ; ; input: 2(sp) buffer address ; 4(sp) buffer length ; output: 'c' set on error ; 'c' clear on no error ; ; ; L $ T T Y O ; ; l$ttyou( %loc buffer, %val string_length ) ; ; input: @r5 buffer address ; 2(r5) buffer length l$ttyo::save ; save temps here please mov 2(r5) ,r0 ; string length bne 20$ ; length was passed mov @r5 ,r0 ; no length, assume .asciz 10$: tstb (r0)+ ; move along looking for a null bne 10$ ; none yet so far sub @r5 ,r0 ; get the length dec r0 ; off by one 20$: mov #xrb ,r1 ; address of xrb parameter block mov r0 ,(r1)+ ; buffer length mov r0 ,(r1)+ ; byte count for the i/o mov @r5 ,(r1)+ ; address of the buffer movb binmod ,@r1 ; perhaps we need to preserve aslb (r1)+ ; binary i/o modes here clrb (r1)+ ; unused clr (r1)+ ; unused clr (r1)+ ; unused clr @r1 ; unused tst binmod ; in binary mode? bne 25$ ; yes mov #40000 ,@r1 ; no, stuff xrmod with transparent mode 25$: .WRITE cmpb FIRQB ,#11 ; i/o channel not open ? bne 30$ ; no, exit please clr binmod ; yes, clear the binary i/o lun mov #xrb ,r1 ; address of xrb parameter block mov r0 ,(r1)+ ; buffer length mov r0 ,(r1)+ ; byte count for the i/o mov @r5 ,(r1)+ ; address of the buffer clr (r1)+ ; unused clr (r1)+ ; unused clr (r1)+ ; unused mov #40000 ,(r1)+ ; xrmod .WRITE 30$: unsave ; pop registers please tstb FIRQB ; any errors ? bne 90$ ; yes clc ; no return 90$: sec ; yes, set error flag and exit return sttyou::K11E80MAC[.050032]K11E80.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|bddfval paritycode ) ; ; input: @r5 address of terminal name ; 2(r5) parity code ; output: r0 error code .if ne ,0 ; we don't need this anymore .ift ttypar::call ttpars ; get the terminal unit number bcs 100$ ; oops clrfqb ; clear FIRQB out for defualts inc FIRQB+20 ; assume no parity cmpb 2(r5) ,#par$no ; really no parity ? beq 10$ ; yes inc FIRQB+20 ; try next for even parity cmpb 2(r5) ,#par$ev ; well ? beq 10$ ; yes inc FIRQB+20 ; not NONE or EVEN --> ODD cmpb 2(r5) ,#par$od ; must be beq 10$ ; yes movb #18. ,FIRQB ; no, return illegal sys usage br 100$ 10$: movb r0 ,FIRQB+5 ; stuff the terminal unit number movb #UU.TRM ,FIRQB+FQFUN ; terminal call today .UUO ; simple 100$: movb FIRQB ,r0 ; get any errors return .endc ; don't need hardware parity control chkpar::clr r0 return .sbttl hangup a terminal, set dtr on a terminal ; T T Y H A N ; ; ttyhan( %loc terminalname ) ; ; input: @r5 address of the terminal name ; output: r0 error code ttyhan::call ttpars ; the usual, parse the device name bcs 100$ ; oops clrfqb ; clear the FIRQB please movb #UU.HNG ,FIRQB+FQFUN ; terminal call today movb r0 ,FIRQB+4 ; unit number movb #1 ,FIRQB+5 ; do it asap .UUO ; simple 100$: movb FIRQB ,r0 ; return error code and exit return ; bye ; raise DTR on a terminal line ; ; T T Y D T R ; ; ttydtr( %loc terminalname ) ; ; input: @r5 address of the terminal name ; output: r0 error code ttydtr::call ttpars ; the usual, parse the device name bcs 100$ ; oops clrfqb ; clear the FIRQB please movb #UU.HNG ,FIRQB+FQFUN ; terminal call today movb r0 ,FIRQB+4 ; unit number movb #377 ,FIRQB+5 ; set dtr function .UUO ; simple 100$: movb FIRQB ,r0 ; return error code and exit return ; bye .sbttl inquire if DTR is up on a device ; INQDTR(ttname) ; ; Find out if DTR is up. ; ; On RSTS/E, DTR is up if (1) Carrier detect is up or (2) Ring is up ; Thus, to connect to a dialout modem, some means must be provided ; for the terminal driver to 'See' CD. This can be done from internal ; modem options, or one can cut CD and loop DTR to CD on the cpu side ; and use the Kermit-11 command SET DTR to get CD up. This routine is ; to return the current DTR status. For RSX, it would be more useful ; to return TRUE if TC.DLU==2 or TRUE if CD is up. ; ; Returns: 1 DTR is present ; 0 DTR is NOT present ; -1 Line is not modem controlled ; ; 18-Dec-85 09:16:08 BDN .iif ndf, UU.CFG, UU.CFG = 42 ; So this builds on version 8 systems inqdtr::tst ver9.x ; /40/ only works on 9.0 or later beq 90$ ; /40/ if so, return(-1) call ttpars ; /40/ get device unit number tstb FIRQB ; /40/ Was parse successful? bne 90$ ; /40/ No, return(-1) clrfqb ; /40/ clear firqb out please movb #UU.CFG ,FIRQB+FQFUN ; /40/ Find out if line has Modem ctl mov #"KB ,FIRQB+FQDEV ; /40/ Always a KB: device please movb r0 ,FIRQB+FQDEVN ; /40/ Unit number please movb #377 ,FIRQB+FQDEVN+1 ; /40/ Unit number is 'real' .UUO ; /40/ do it tstb FIRQB ; /40/ If failure, return(nomodem) bne 90$ ; /40/ Failed bitb #4 ,FIRQB+7 ; /40/ If set, the line is modem ctl beq 90$ ; /40/ No modem control, return(-1) clrfqb ; /40/ We have modem control, what movb #UU.TRM ,FIRQB+FQFUN ; /40/ about DTR being around ? movb r0 ,FIRQB+5 ; /40/ Unit number here this time .UUO ; /40/ get tt characteristics, part 1 tstb FIRQB ; /40/ Can't fail bne 90$ ; /40/ But it did ? bitb #200 ,FIRQB+4 ; /40/ At last, is DTR up ? bne 80$ ; /40/ No, return(0) mov #1 ,r0 ; /40/ Yes, return(1) br 100$ ; /40/ Exit 80$: clr r0 ; /40/ Modem line and no DTR br 100$ ; /40/ exit 90$: mov #-1 ,r0 ; /40/ Not modem or pre 9.x system 100$: return inqbuf::mov #maxpak ,r0 ; /42/ Assume pre RSTS v9 tst ver9.x ; /42/ 9.X with huge buffer quotas? beq 100$ ; /42/ No mov #MAXLNG ,r0 ; /42/ Yes, return the MAX size 100$: return ; /4K11E80MAC[.050032]K11E80.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|bddfsubfunction one movb r0 ,FIRQB+5 ; /40/ unit number or 377 ..BUFQ == . + 2 ; /46/ Patchable movb #40. ,FIRQB+27 ; /40/ raise buffer quotas now .UUO ; /40/ ignore errors 4$: clrfqb ; insure no unpleasant effects movb #UU.TRM ,FIRQB+FQFUN ; uuo code for terminals movb r0 ,FIRQB+5 ; unit number or 377 .UUO ; get the current settings tstb FIRQB ; did the set list work ? bne 90$ ; no, die mov 2(r5) ,r1 ; get the channel number please mul #40 ,r1 ; get address of ttsave area for it add #ttsave ,r1 ; at last mov #FIRQB ,r2 ; get address of current settings mov #40 ,r3 ; number of bytes to copy now 5$: movb (r2)+ ,(r1)+ ; copy a byte sob r3 ,5$ ; next please clr r1 ; get the parity/8bit setting bisb FIRQB+20,r1 ; and check for parity being set bic #^C3 ,r1 ; leave only parity bits here cmpb r1 ,#1 ; parity set ? bhi 7$ ; /36/ yes, can't set 8bit mode then tstb parity ; /36/ If software parity enabled beq 6$ ; /36/ then we must prevent TTDVR cmpb parity ,#PAR$NO ; /36/ from changing characters in bne 7$ ; /36/ range 201-237 into esc seqs. 6$: movb #30 ,r1 ; no parity so please set 8bit mode br 10$ ; /36/ 7$: bisb #20 ,r1 ; /36/ explicitly turn 8bit mode off 10$: clrfqb ; now actually set it movb #UU.TRM ,FIRQB+FQFUN ; uuo code for terminals movb r0 ,FIRQB+5 ; unit number or 377 movb #377 ,FIRQB+12 ; SET XON movb #377 ,FIRQB+35 ; SET GAG movb r1 ,FIRQB+20 ; SET 8BIT movb #200 ,FIRQB+11 ; SET LC OUTPUT movb #377 ,FIRQB+15 ; SET LC INPUT movb #200 ,FIRQB+30 ; insure no delimiters are set now cmpb handch ,#'Q&37 ; This is a pain. We have to use beq 15$ ; multiple delims cause bin mode cmpb handch ,#'S&37 ; perhaps XON also ? bne 20$ ; no 15$: movb #200 ,FIRQB+22 ; timeouts don't work and xon's ; don't get thru unless stall is off 20$: .UUO ; go get RSTS's attention 90$: movb FIRQB ,r0 ; return possible errors unsave return global .sbttl ttpars get unit number from ttname ; T T P A R S ; ; ttpars( %loc ttname ) ; ; output: r0 unit number or 377 for null string .enabl lsb ttpars::save call myterm ; get attached console name movb r0 ,r1 ; get the name clrfqb ; no defaults clrxrb mov #377 ,-(sp) ; assume KB: mov @r5 ,r0 ; address of terminal name 10$: tstb (r0)+ ; get the length of the name bne 10$ ; until we find a NULL sub @r5 ,r0 ; get the length dec r0 ; if zero, then use 377 for unit beq 20$ ; use zero mov r0 ,xrb+xrlen ; length of string for .FSS mov r0 ,xrb+xrbc ; again mov @r5 ,xrb+xrloc ; address of the string to parse .FSS ; and do it tstb FIRQB ; did it work ? bne 90$ ; no bit #20000!40000,xrb+10 ; a device name was parsed ? beq 80$ ; no movb xrb+14, r0 ; get the driver index please scan r0 ,#200$ ; a reasonable device name? tst r0 ; well ? beq 80$ ; no cmpb FIRQB+FQDEVN,r1 ; same device as controlling terminal? beq 20$ ; yes movb FIRQB+FQDEVN,@sp ; yes, save unit number bne 20$ movb #377 ,@sp ; no unit, return 377 for self 20$: clc ; flag success br 100$ ; and exit 80$: movb #6 ,FIRQB ; invlaid device name error 90$: sec ; flag failure 100$: mov (sp)+ ,r0 unsave return .iif ndf, ttyhnd, ttyhnd = 2 .iif ndf, pkbhnd, pkbhnd = 20 .iif ndf, dmchnd, dmchnd = 30 .iif ndf, dmphnd, dmphnd = 46 .save .psect $PDATA ,D 200$: .byte ttyhnd ,pkbhnd ,dmchnd ,dmphnd ,0 .even .restore .dsabl lsb myterm: clrfqb movb #UU.SYS ,FIRQB+FQFUN ; for a systat part one .UUO ; simple movb FIRQB+5 ,r0 ; get the name return .sbttl assign device .enabl lsb ; Assign the device for SET LINE. Device characteristics are ; set in TTYINI and reset in TTYFIN. For edit /41/, check to ; be sure that the JOB privilege mask includes HWCFG, which ; is needed to alter settings on other terminal lines (9.x). .iif ndf , PRVIOL, PRVIOL = 12 assdev::mov r1 ,-(sp) ; /41/ call ttparsK11E80MAC[.050032]K11E80.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|bddfnter++ clr r0 ; no errors br 100$ ; exit 90$: mov #ER$EOF ,r0 ; failure, return(EOF) 95$: clr r1 ; return no data also clr diridx ; init for next time through 100$: unsave return global .sbttl init for the directory dirini: clr diridx ; /38/ mov #dirnam ,r2 ; string address tstb @r2 ; a null string ? bne 10$ ; no 5$: mov #wild ,r2 ; yes, supply *.* 10$: calls l$fss ,<#defdir> ; stuff FIRQB with defaults calls l$fssx , ; parse the string with defaults tst r0 ; did it work ? bne 90$ ; no bit #1 ,xrb+10 ; was some kind of filename passed? bne 20$ ; yes mov #134745 ,FIRQB+FQNAM1+0 ; no, insert * mov #134745 ,FIRQB+FQNAM1+2 ; no, insert * 20$: bit #20 ,xrb+10 ; was a non-null extension passed ? bne 40$ ; yes bit #10 ,xrb+10 ; no extension, was the extension an bne 40$ ; explicit null (ie, abcdef.) ? mov #134745 ,FIRQB+FQNAM1+4 ; no, stuff .* into the filespec 40$: mov #dirfir ,r4 ; save the FIRQB save area pointer mov #FIRQB ,r3 ; and a pointer to the FIRQB itself mov #40 ,r0 ; number of bytes to copy 50$: movb (r3)+ ,(r4)+ ; simple sob r0 ,50$ ; all done saving the FIRQB clc ; success br 100$ ; bye 90$: sec ; failure 100$: return ; bye global .sbttl more routines for dodir dircvt: save mov r3 ,-(sp) ; save the pointer please mov #FIRQB+FQNAM1,r2 ; first three characters of filename calls rdtoa , ; convert it add #3 ,r3 ; and fix the pointer up calls rdtoa , ; convert it add #3 ,r3 ; and fix the pointer up movb #'. ,(r3)+ ; stuff a dot in please calls rdtoa , ; convert it add #3 ,r3 ; bump the pointer along please movb #40 ,(r3)+ ; some spaces movb #40 ,(r3)+ ; some spaces mov FIRQB+16,r0 ; the file size deccvt r0,r3,#6 ; convert it to ascii add #6 ,r3 ; point past the number now movb #40 ,(r3)+ ; some spaces movb #40 ,(r3)+ ; some spaces mov FIRQB+24,r2 ; save the date of creation calls asctim , ; convert the time mov (sp) ,r3 strlen r3 ; get the current length add r0 ,r3 ; and point to the new end of it calls ascdat , ; and get the date strcat r3 ,#dcrlf ; append crlf mov (sp)+ ,r3 ; point back to the string unsave return dirnex: mov #dirfir ,r4 ; mov #FIRQB ,r3 ; and a pointer to the FIRQB itself mov #40 ,r0 ; number of bytes to copy 20$: movb (r4)+ ,(r3)+ ; simple sob r0 ,20$ ; all done loading the FIRQB mov diridx ,FIRQB+4 ; store the index for the file movb #lokfq ,FIRQB+3 ; directory lookup please CALFIP ; get fip to do it please movb FIRQB ,r0 ; did it work ? bne 90$ ; no mov #dirbuf ,r3 ; point to the string buffer call dircvt ; yes, convert it please inc diridx ; setup for the next time clc ; success return ; failure 90$: tst diridx ; error, did we already find a file? beq 100$ ; no, retain error code clr r0 ; yes, return zero and C set 100$: clr diridx ; clear for next time around sec return .save .psect $PDATA ,D wild: .asciz /*.*/ .even .restore .sbttl force a xon to the connect line ; T T X O N ; ; input: @r5 device name, asciz ; 2(r5) lun (for rsxm/m+ compatibility) ; output: r0 error code ttxon:: save ; save a temp register mov @r5 ,r1 ; passed address of 0 or a null string? beq 80$ ; no address, assume _KB: tstb @r1 ; null string passed ? beq 80$ ; yes, assume the console terminal call ttpars ; parse the terminal device name bcs 90$ ; oops 10$: clrxrb ; insure no defaults mov #xrb ,r1 ; point to the xrb now mov #5 ,(r1)+ ; force to kb: function for .SPEC inc (r1)+ ; one byte to force please mov #$xon ,(r1)+ ; address of the buffer for output mov #ttyhnd*400,(r1)+ ; channel zero, device driver index mov r0 ,(r1)+ ; terminal number .spec ; simple br 90$ 80$: mov #6 ,r0 ; ?invalid device name br 100$ ; bye 90$: movb FIK11E80MAC[.050032]K11E80.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|bddfsp ; exit mov #1 ,r0 ; return chkprv::mov 2(sp) ,r1 ; get address of priv to look for clrfqb ; clear the FIRQB out mov #FIRQB+FQFUN,r0 ; setup to get the bit value of WACNT movb #UU.CHK ,(r0)+ ; UUO subfunction inc (r0)+ ; UU.CHK subfunction tst (r0)+ ; not used 10$: movb (r1)+ ,(r0)+ ; copy the desired priv to check bne 10$ ; next please .UUO ; try it out movb FIRQB ,r0 ; if this fails its not verison 9.x bne 90$ ; or later movb FIRQB+4 ,r0 ; success, check if priv is present bne 90$ ; no mov #1 ,r0 ; yes, return(1) br 100$ ; exit 90$: clr r0 ; no, return(0) 100$: mov (sp)+ ,(sp) ; pop stack and exit return ; bye inqv9:: clrfqb ; /39/ clear FIRQB out clr ver9.x ; /40/ assume old RSTS/E movb #UU.PRV ,FIRQB+FQFUN ; /39/ see if version 9 or later .UUO ; /39/ always works (read priv mask) tstb FIRQB ; /39/ success? bne 90$ ; /39/ no mov sp ,ver9.x ; /40/ flag for v9.x and later clc ; /39/ v.9x return ; /39/ exit 90$: sec ; /39/ not 9.x return ; /39/ return .sbttl check for current JOB priv , not PROGRAM priv. ; Added edit 2.41 to check if a user has HWCFG authorized to ; effect a SET LINE command. Note that this will not affect ; the current mask, it just checks to see if the JOB has this ; priv. This is different than UU.CHK in that here we look at ; current 'JOB' mask where the other (CHKPRV) looks at the ; CURRENT program priv mask. To find AUTHORIZED priv, you must ; call AUTHPR. ; Added cause the M+ v3 Kermit will get and drop privs for ; SET LINE. ; ; Passed: 2(sp) Address of priv name to check ; Return: r0 1 for success (or pre 9.x), zero for no priv ; ; Example: ; ; mov #HWCFG ,-(sp) ; call JOBPRV ; tst r0 ; beq error ; ; ; hwcfg:.asciz /HWCFG/ ; .even jobprv::mov r1 ,-(sp) ; /41/ Save a register mov r2 ,-(sp) ; /41/ ... save another one sub #10 ,sp ; /41/ temp save area mov #1 ,r2 ; /41/ Assume success tst ver9.x ; /41/ version nine or later? beq 100$ ; /41/ no, return( success ) clrfqb ; /41/ mov #FIRQB+3,r1 ; /41/ point to FQFUN offset movb #UU.PRV ,(r1)+ ; /41/ read current priv mask. .UUO ; /41/ Do it tstb FIRQB ; /41/ Check status (has to work) bne 90$ ; /41/ Return( failure ) mov sp ,r0 ; /41/ a pointer to mask save area mov (r1)+ ,(r0)+ ; /41/ save current priv mask mov (r1)+ ,(r0)+ ; /41/ .save current priv mask mov (r1)+ ,(r0)+ ; /41/ ..save current priv mask mov (r1)+ ,(r0)+ ; /41/ ...save current priv mask mov #JFSYS ,XRB+0 ; /41/ what to do .CLEAR ; /41/ Drop ALL privs now clrfqb ; /41/ clear firqb out mov #FIRQB+FQFUN,r0 ; /41 movb #UU.CHK ,(r0)+ ; /41/ Convert priv name to bitmask inc (r0)+ ; /41/ Subfunbction code = 1 tst (r0)+ ; /41/ skip this field mov 2+14(sp),r1 ; /41/ copy the priv over 10$: movb (r1)+ ,(r0)+ ; /41/ copy the asciz name over bne 10$ ; /41/ simple .UUO ; /41/ convert NAME to MASK mov sp ,r1 ; /41/ point back to save area mov #FIRQB+FQNAM1,r0 ; /41/ Where the bit pattern is mov #4 ,r2 ; /41/ Four words to check 20$: bit (r0)+ ,(r1)+ ; /41/ Any bit(s) set here ? bne 30$ ; /41/ Yes, we have it sob r2 ,20$ ; /41/ No, keep looking clr r2 ; /41/ Flag not found br 40$ ; /41/ Restore old priv mask 30$: mov #1 ,r2 ; /41/ Flag we have it 40$: clrfqb ; /41/ Now restore JOB privs mov #FIRQB+FQFUN,r0 ; /41/ point to FQFUN offset movb #UU.PRV ,(r0)+ ; /41/ read current priv mask. mov sp ,r1 ; /41/ Saved OLD priv mask mov (r1)+ ,(r0)+ ; /41/ save current priv mask mov (r1)+ ,(r0)+ ; /41/ .save current priv mask mov (r1)+ ,(r0)+ ; /41/ ..save current priv mask mov (r1)+ ,(r0)+ ; /41/ ...save current priv mask .UUO ; /41/ Do it br 100$ ; /41/ exit 90$: clr r2 ; /41/ failure 100$: mov r2 ,r0 ; /41/ Return the status now add #10 ,sp ; /41/ Pop buffer mov (sp)+ ,r2 ; /41/ ...Pop a register mov (sp)+ ,r1 ; /41/ Pop a register mov (sp)+ ,(sp) ; /41/ pop K11E80MAC[.050032]K11E80.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|bddfparameter return ; /41/ At last .sbttl setcc setup a control C trap ; SETCC arm the control C trap ; TTAST field the ast ; ; It would be REALLY nice if we had the equivalent of an IO.KIL ; so we could cancel a pending terminal read as I do in the RSX ; based Kermits. While it is true that control C will terminate ; a read on your console terminal, we need to be able to cancel ; a read that's waiting on another terminal, as is the case if ; Kermit is running LOCAL (set lin ttnn:). Hopefully, some day ; DIGITAL will provide that. setcc:: mov #ttast ,@#24 .ttrst .ttech return ttast: save call cctrap mov #lunsize*2,r1 10$: tst linit(r1) beq 20$ mov r1 ,-(sp) asr (sp) call snoecho 20$: sub #2 ,r1 bge 10$ unsave rti global ; dummy epts and symbols for rsx11m/m+ compatibility tidias:: tidiar::return tmsdia:: setsla::clr r0 return wtmask == 0 ; dummy definitions for event flags ef.co == 0 ; used under RSX ef.ti == 0 bit.co == 0 bit.ti == 0 sf.gmc == 2560 sf.smc == 2440 tc.fdx == 64 tf.ral == 10 tc.tbf == 71 tc.slv == 0 tc.abd == 0 tc.dlu == 0 tc.xsp == 0 tc.rsp == 0 tf.rne == 20 tf.wal == 10 .save .psect $PDATA ,D fu$def::.word 177777 ; do we need a defdir for RMS11v2 .restore xdorsx::call doconn return global rstsrv::clr r0 return senbrk::calls ttspee ,<@r5> ; get the remotes terminal speed mov r0 ,r2 ; save the old speed calls setspd ,<@r5,#50.,2(r5)>;try to set it down to 50 baud tst r0 ; did it work ? bne 100$ ; no, forget it calls binwri ,<#null2,#2,2(r5)>;yes, send a null over calls setspd ,<@r5,r2,2(r5)> ; restore the terminal's speed 100$: clr r0 return .save .psect $PDATA ,D null2: .byte 0,0 .restore .end