home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / test / pdp11 / krtcm1.mac < prev    next >
Text File  |  1996-10-17  |  33KB  |  1,021 lines

  1.     .title    KRTCM1    Misc commands overlay
  2.     .ident    "V04.64"
  3.  
  4. ; /E64/    31-Mar-96  John Santos
  5. ;
  6. ;    Changes to support RSTS/E.  Restore "SYS" and "WHO" commands from K11.
  7. ;    Change the "take" file name setup scheme to save a bit of memory and
  8. ;    code.
  9. ;    rename er$aop to er$amo, since it conflicts with an RMS error symbol
  10.  
  11. ; /63/    21-Jan-96  Billy Youdelman
  12. ;
  13. ;    moved sph$xmode after set$modem so it will prevail..
  14.  
  15. ; /62/    27-Jul-93  Billy Youdelman  V03.62
  16. ;
  17. ;    make type append a LF to CR if CR not followed by one
  18. ;    hose hi bit and type anyway for VT100 and below in c$type
  19.  
  20. ; /BBS/     1-Dec-91  Billy Youdelman  V03.61
  21. ;
  22. ;    c$type defaults to .LST, error handling improved, does wildcards
  23. ;    also sped up, types any size record, binary file filtering added
  24. ;
  25. ;    c$set - error handling fixed
  26. ;    c$pwd, c$cls, c$clx, c$xmodem added..
  27. ;    c$take parses file name, checks for/disallows wildcards, etc.
  28. ;    c$conn - disallow connect to TT (since one is there already..)
  29. ;    mount/dismount logical disks command interface, calls TSX emts
  30. ;    added RT-11 style assign default device, for DK only
  31. ;    remote disk_usage passes optional device argument
  32. ;    reinit modem when exiting if DTR dropped during CONNECT
  33. ;    added SET CLn LINE x support for TSX-Plus
  34. ;    added search path for take files
  35. ;    move sho$line here, added modem type, TSX line # and DCD status
  36. ;    added call to c$idle in c$exit to reset modem on exit to monitor
  37. ;    c$set now does multiple args, separated by commas
  38.  
  39. ;    Copyright 1983,1984 Change Software, Inc.
  40. ;
  41. ;    Creation: 16-Oct-84  15:38:44  Brian Nelson
  42. ;
  43. ;    This software is furnished under a license and may
  44. ;    be  used  and  copied  only in accordance with the
  45. ;    terms of such license and with  the  inclusion  of
  46. ;    the  above copyright notice.  This software or any
  47. ;    other copies thereof may not be provided or other-
  48. ;    wise made available to any other person.  No title
  49. ;    to and ownership of the software is hereby  trans-
  50. ;    ferred.
  51. ;
  52. ;    The information in this  software  is  subject  to
  53. ;    change  without notice and should not be construed
  54. ;    as a commitment by the author.
  55. ;
  56. ;    12-Sep-86  10:39:27 BDN Convert for I/D space
  57.  
  58.  
  59.     .include "IN:KRTMAC.MAC"
  60.     .iif ndf  KRTINC  .error    <; .include for IN:KRTMAC.MAC failed>
  61.  
  62. .if df    RT11                ; /E64/
  63.     .mcall    .PURGE    ,.SPFUN        ; /62/
  64. .endc    ;RT11                ; /E64/
  65.  
  66.  
  67.     .sbttl    Local data        ; /63/ consolidated here..
  68.  
  69.     .psect    $rwdata    ,rw,d,lcl,rel,con
  70. crflag:    .word    0            ; /62/ TYPE uses to add LF to lone CR
  71. .if df    RT11                ; /E64/
  72. itsmine:.word    0            ; device is already allocated flag
  73. tk.0:    .word    T10$ ,T30$ ,T50$ ,T70$ ,0    ; addresses of names to try
  74. tk.1:    .word    T20$ ,T40$ ,T60$ ,T80$ ,0    ; put actual file name here
  75.  T10$:    .ascii    "TAK:"                ; this is the take file
  76.  T20$:    .asciz    "            "            ; search path..
  77.  T30$:    .ascii    "KRT:"
  78.  T40$:    .asciz    "            "
  79.  T50$:    .ascii    "DK:"
  80.  T60$:    .asciz    "            "
  81.  T70$:    .ascii    "SY:"
  82.  T80$:    .asciz    "            "
  83. cl.nam:    .asciz    "CLn:"            ; ascii copy of CL name with unit #
  84. .endc    ;RT11                ; /E64/
  85. .if df    RSTS                ; /E64/
  86. tk.0:    .word    T10$ ,T30$ ,T50$ ,T70$ ,0    ; addresses of names to try
  87.  T10$:    .ascii    "TAK:"                ; this is the take file path
  88.  T30$:    .ascii    "KRT:"
  89.  T50$:    .ascii    "DK:"
  90.  T70$:    .ascii    "SY:"
  91. sy.0:    .word    4,0,S20$,S30$,S40$    ; parameter list
  92.  S20$:    .word    100305            ; internal mode for running on the PK
  93.  S30$:    .word    10.            ; first free logical unit number
  94.  S40$:    .word    10.            ; ten minutes and i kill the PK's job
  95. .endc    ;RSTS                ; /E64/
  96.     .even
  97.  
  98.     .psect    $pdata
  99. .if df    RT11                ; /E64/
  100. parlst:    .word    P00$ ,P10$ ,P20$ ,P30$ ,P40$    ; parity display in SHOW LINE
  101.  P00$:    .asciz    "NONE"
  102.  P10$:    .asciz    "ODD"
  103.  P20$:    .asciz    "EVEN"
  104.  P30$:    .asciz    "MARK"
  105.  P40$:    .asciz    "SPACE"
  106. .endc    ;RT11                ; /E64/
  107. cm1.01:    .asciz    " closed"<cr><lf>    ; shared string: TAKE, defterm
  108. cm1.02:    .asciz    " opened"<cr><lf>
  109. cm1.03:    .asciz    " Files copied:"<cr><lf>
  110. cm1.04:    .asciz    "?TYPE-W-Binary file filter enabled"<cr><lf>
  111. cm1.05:    .asciz    " to TT:"<cr><lf>
  112. .if df    RT11                ; /E64/
  113. cm1.06:    .asciz    "Link device is "
  114. cm1.07:    .asciz    "TT:   "
  115. cm1.08:    .asciz    " via Line #"
  116. cm1.09:    .asciz    "   Priority: "
  117. cm1.10:    .asciz    "   Speed: "
  118. cm1.11:    .asciz    "N/A"
  119. cm1.12:    .asciz    "/"
  120. cm1.13:    .asciz    " modem is on-line   "
  121. cm1.14:    .asciz    "DTR: "
  122. cm1.15:    .asciz    "   DCD: "
  123. cm1.16:    .asciz    "   RTS: "
  124. cm1.17:    .asciz    "   CTS: "
  125. cm1.18:    .asciz    "Flow-Control: "
  126. cm1.19:    .asciz    "XOFF/XON   "
  127. cm1.20:    .asciz    "RTS/CTS    "
  128. cm1.21:    .asciz    "S/W Parity: "
  129. .endc    ;RT11                ; /E64/
  130. .if df    RSTS                ; /E64/
  131. cm1.22:    .asciz    "The SYSTEM command requires a command to execute"<cr><lf>
  132. cm1.23:    .asciz    "Error from spawning command "
  133. cm1.24:    .asciz    "No remote line has been set"<cr><lf>
  134. cm1.25:    .asciz    "Current remote link device name is "
  135. cm1.26:    .asciz    "The current speed for the link is"
  136. cm1.27:    .asciz    " baud"<cr><lf>
  137. .endc    ;RSTS                ; /E64/
  138. li.lo:    .asciz    "low"
  139. li.hi:    .asciz    "HIGH"
  140. takdef::.asciz    ".COM"            ; default take file extent, patchable
  141. typdef:    .asciz    ".LST"            ; default extent for type
  142. .if df    RSTS                ; /E64/
  143. sys.cm:    .asciz    #SY/A#            ;/*60*/ RSTS-only hack
  144. .endc    ;RSTS                ; /E64/
  145.     .even
  146.  
  147.  
  148.     .psect    $code
  149.     .sbttl    The SET command        ; /BBS/ just about all new..
  150.  
  151. c$set::    upone    argbuf            ; upper case just next arg
  152.     call    loaset            ; load the set commands overlay
  153.     calls    getcm0    ,<argbuf,r0>    ; lookup address of desired command
  154.     mov    r0    ,r2        ; save a copy of it
  155.     bmi    60$            ; some sort of error occurred
  156.     tst    wasnul            ; were commands listed via "?"
  157.     bne    110$            ; ya
  158.     call    loaset            ; reload set commands overlay
  159.     calls    getcm1    ,<argbuf,r0,r2>    ; check possible argument to command
  160.     tst    r0            ; well?
  161.     bmi    60$            ; bad arg..
  162.  
  163. 10$:    scan    #comma    ,argbuf        ; look for a comma indicating
  164.     mov    r0    ,restof        ; stash pointer to remaining arg(s)
  165.     beq    20$            ; no comma found
  166.     add    argbuf    ,restof        ; convert offset to address
  167.     mov    restof    ,r0        ; get pointer to put a null..
  168.     clrb    -(r0)            ; ..where the comma was
  169.     mov    r1    ,lastcmd    ; save to dispatch when looping back
  170.  
  171. 20$:    jsr    pc    ,@r1        ; dispatch to command starting address
  172.     tst    r0            ; did that succeed?
  173.     bne    40$            ; nope..
  174.     mov    restof    ,r0        ; ya, any more arguments to process?
  175.     beq    110$            ; nope..  note r0 is clear here too
  176. 30$:    cmpb    (r0)+    ,#space        ; is first byte a blank?
  177.     beq    30$            ; ya, skip past it
  178.     dec    r0            ; back up to first non-blank char
  179.     copyz    r0  ,argbuf  ,#ln$max    ; restore remaining as yet unused args
  180.     mov    lastcmd    ,r1        ; recover dispatch address pointer
  181.     br    10$            ; loop back for more
  182.  
  183. 40$:    cmp    r0    ,#cmd$un    ; /62/ which kind of error occurred?
  184.     blt    80$            ; it's not a cmd$.. error
  185.     bgt    50$            ; not ambiguous either
  186. .if df    RT11                ; /E64/
  187.     mov    #er$aop    ,r0        ; it was an ambiguous option or value
  188. .endc    ;RT11                ; /E64/
  189. .if df    RSTS                ; /E64/
  190.     mov    #er$amo    ,r0        ; it was an ambiguous option or value
  191. .endc    ;RSTS                ; /E64/
  192.     br    80$
  193. 50$:    cmp    r0    ,#cmd$bad    ; bad option or value?
  194.     bne    60$            ; no, it's some other cmd$.. error
  195.     mov    #er$bad    ,r0        ; ya, say so
  196.     br    80$
  197.  
  198. 60$:    cmp    r0    ,#cmd$ab    ; ^C typed?
  199.     beq    100$            ; /62/ ya
  200.     cmp    r0    ,#cmd$nx    ; /62/ ^Z but keep program running?
  201.     beq    100$            ; /62/ ya
  202.     cmp    r0    ,#cmd$ex    ; a real ^Z?
  203.     beq    100$            ; /62/ ya
  204.     cmp    r0    ,#cmd$un    ; ambiguous?
  205.     bne    70$            ; nope
  206.     mov    #er$sam    ,r0        ; ya, make it an ambiguous SET command
  207.     br    90$
  208. 70$:    cmp    r0    ,#cmd$bad    ; bad command?
  209.     bne    80$            ; no
  210.     mov    #er$sun    ,r0        ; it's an unrecognizable SET command
  211.  
  212. 80$:
  213. .if df    RT11                ; /E64/
  214.     call    isitcl            ; check for possible SET CLn
  215.     tst    r0            ; was that it?
  216.     beq    110$            ; ya
  217. .endc    ;RT11                ; /E64/
  218. 90$:    direrr    r0            ; no.. _ALL_ KRTST0/1 errors come here
  219. 100$:    call    incsts            ; set the global error flag
  220. 110$:    return
  221.  
  222. skipit::tst    restof            ; was a comma in the arg string?
  223.     beq    120$            ; no
  224.     strlen    argbuf            ; ya, get length of part-one
  225.     add    argbuf    ,r0        ; point to its end
  226.     movb    #comma    ,(r0)+        ; stuff the comma back in !!
  227.     copyz    restof    ,r0  ,#ln$max    ; add in rest of original line and
  228.     clr    restof            ; indicate it has been used here
  229. 120$:    return
  230.  
  231.  
  232.     .sbttl    SET CLn LINE x        ; /BBS/ this is all new..
  233.  
  234. ;    input:    entire command argbuf, .asciz
  235.  
  236. .if df    RT11                ; /E64/
  237. isitcl:    mov    r0    ,r4        ; save incoming error
  238.     cmp    r0    ,#er$pri    ; error from SET CL PRIORITY?
  239.     beq    60$            ; /BBS/ ya, bail out
  240.     upcase    argbuf            ; make sure the whole buffer is ok
  241.  
  242. 10$:    scan    #'=    ,argbuf        ; /62/ look for an equals sign
  243.     tst    r0            ; /62/ well?
  244.     beq    20$            ; /62/ not there
  245.     add    argbuf    ,r0        ; /62/ found one, get pointer
  246.     movb    #space    ,-(r0)        ; /62/ and swap in a space for it
  247.     br    10$            ; /62/ check for another "="
  248.  
  249. 20$:    mov    argbuf    ,r2        ; pointer to CLn:
  250.     beq    60$            ; not there..
  251.     cmpb    #'C    ,(r2)+        ; is first byte a "C" ?
  252.     bne    60$            ; nope..
  253.     cmpb    #'L    ,(r2)+        ; is second byte an "L" ?
  254.     bne    60$            ; nope..
  255.  
  256.     cmpb    (r2)    ,#':        ; is there a colon after CL?
  257.     beq    30$            ; ya
  258.     cmpb    (r2)    ,#space        ; is there a space delimiter?
  259.     beq    30$            ; ya
  260.  
  261.     movb    (r2)+    ,r0        ; get unit #, sign bit should be zero
  262.     sub    #'7+1    ,r0        ; check unit is 0 - 7 only, and..
  263.     add    #7+1    ,r0        ; ..turn ascii into integer
  264.     bcs    40$            ; good number crosses 0
  265.     br    60$            ; bad number, bail out
  266.  
  267. 30$:    clr    r0            ; set CL unit number to 0
  268. 40$:    mov    r0    ,cl.unit    ; save CL unit number
  269.  
  270.     mov    #^rCL0    ,cl.r50        ; rad50 name of "base" CL device
  271.     add    r0    ,cl.r50        ; make it the device at hand..
  272.  
  273.     add    #'0    ,r0        ; now bump it up into an ascii digit
  274.     movb    r0    ,cl.nam+2    ; and stick that into "CLn:"
  275.  
  276.     cmpb    (r2)    ,#':        ; is there a colon after CLn ?
  277.     bne    50$            ; no
  278.     inc    r2            ; ya, bump past it..
  279. 50$:    cmpb    (r2)+    ,#space        ; is there a space delimiter?
  280.     beq    70$            ; ya
  281.  
  282. 60$:    mov    r4    ,r0        ; no, revert to incoming err
  283.     br    100$
  284.  
  285. 70$:    cmpb    (r2)+    ,#'L        ; must be an "L"
  286.     bne    90$            ; nope..
  287.     cmpb    (r2)    ,#'I        ; /62/ is this an "I" ?
  288.     bne    80$            ; /62/ no
  289.     inc    r2            ; /62/ ya, bump to next char
  290.     cmpb    (r2)    ,#'N        ; /62/ an "N" ?
  291.     bne    80$            ; /62/ no
  292.     inc    r2            ; /62/ ya, bump to next char
  293.     cmpb    (r2)    ,#'E        ; /62/ an "E" ?
  294.     bne    80$            ; /62/ no
  295.     inc    r2            ; /62/ ya, bump to next char
  296. 80$:    cmpb    (r2)+    ,#space        ; /62/ a space?
  297.     bne    90$            ; /62/ no, command is no good
  298.     tstb    @r2            ; anything left?
  299.     beq    90$            ; no, command is no good
  300.     tst    tsxsave            ; running under TSX?
  301.     bne    110$            ; ya
  302.     mov    #er$tsx    ,r0        ; no, load appropriate error
  303.     br    100$            ; exit
  304.  
  305. 90$:    mov    #er$bad    ,r0        ; "bad option or value"
  306. 100$:    jmp    260$            ; goto the end, currently just return
  307.  
  308. 110$:    cmpb    (r2)    ,#'*        ; auto-assign?
  309.     bne    120$            ; no
  310.     jmp    cl.wild            ; ya
  311.  
  312. 120$:    clr    r3            ; init a reg to hold line number
  313. 130$:    movb    (r2)+    ,r0        ; next char
  314.     sub    #'9+1    ,r0        ; convert decimal ascii to integer
  315.     add    #9.+1    ,r0        ; whilst ensuring it's a valid digit
  316.     bcc    140$            ; not a number, thus at end of digits
  317.     mul    #10.    ,r3        ; bump accumulator by 10s
  318.     add    r0    ,r3        ; add current digit to the answer
  319.     br    130$            ; try for another numeric byte
  320.  
  321. 140$:    clr    itsmine            ; init already allocated device flag
  322.     tst    r3            ; assign or deassign?
  323.     bne    160$            ; it's an assign
  324.     cmp    cl.r50    ,r50dev        ; dump it, if program owns it, that is
  325.     beq    150$            ; only allow this on current dev
  326.     mov    cl.r50    ,r0        ; if .ne.
  327.     sub    #36    ,r0        ; try making possible "0" unit a space
  328.     cmp    r0    ,r50dev        ; and check it again
  329.     bne    220$            ; /63/ not the same
  330. 150$:    mov    argbuf    ,r0        ; copy pointer
  331.     movb    #'T&137    ,(r0)+        ; load argument to
  332.     movb    #'T&137    ,(r0)+        ; drop the CL
  333.     clrb    (r0)            ; assign via
  334.     call    set$line        ; "SET LINE TT"
  335.     br    200$            ; no error possible here
  336.  
  337. 160$:    tst    r50dev            ; is a link now in use?
  338.     bne    210$            ; ya
  339.     mov    #alloerr,r1        ; no, preser error allocate mapping
  340.     movb    #2    ,d.allo        ; prep to
  341.     mov    #d.allo    ,r0        ; check device
  342.     emt    375            ; for activity
  343.     bcs    240$            ; someone else has it
  344.     tst    r0            ; or, perhaps you do on another line
  345.     beq    180$            ; nope..
  346.     cmp    r0    ,tsxsav        ; check against current job # too
  347.     beq    170$            ; ok  (same line #)
  348.     mov    #er$137    ,r0        ; not ok, in use by you on another job
  349.     br    260$            ; bail out
  350.  
  351. 170$:    mov    sp    ,itsmine    ; allocate, except if already owned..
  352. 180$:    mov    #atterr    ,r1        ; "attach" error mapping
  353.     mov    r3    ,cl.line    ; save the desired line number
  354.     mov    #attcl    ,r0        ; try to
  355.     emt    375            ; attach it
  356.     bcs    240$            ; didn't work
  357.     mov    sp    ,z.atch        ; ok, flag it was done from this pgm
  358.     tst    itsmine            ; need to allocate the device?
  359.     bne    190$            ; no, you already have it
  360.     mov    #alloerr,r1        ; error mapping for allocate
  361.     clrb    d.allo            ; make it ALLOCATE
  362.     mov    #d.allo    ,r0        ; try to
  363.     emt    375            ; allocate the device
  364.     bcs    230$            ; didn't work
  365.  
  366. 190$:    strcpy    argbuf    ,#cl.nam    ; /62/ give SET LINE CL unit's name
  367.     call    set$line        ; same as "Kermit-11>SET LINE CLn"
  368.     bcc    200$            ; it worked
  369.     call    cl.dump            ; didn't work, clean up..
  370.     br    260$            ; exit with error in r0
  371.  
  372. 200$:    clr    r0            ; success
  373.     br    260$
  374. 210$:    mov    #er$140    ,r0        ; must drop current assign first
  375.     br    260$
  376. 220$:    mov    #er$own    ,r0        ; CL line not owned by this job
  377.     br    260$
  378. 230$:    movb    @#errbyt,r2        ; ya, save error
  379.     clr    cl.line            ; prep to
  380.     mov    #attcl    ,r0        ; dump lingering
  381.     emt    375            ; CL to term assign
  382.     movb    r2    ,@#errbyt    ; recover error
  383. 240$:    movb    @#errbyt,r0        ; get the error code
  384.     bpl    250$            ; normal error
  385.     com    r0            ; hard error code
  386.     mov    #faterr    ,r1        ; map into the hard errors
  387. 250$:    asl    r0            ; word addressing
  388.     add    r0    ,r1        ; map the error
  389.     mov    (r1)    ,r0        ; and return its address to caller
  390. 260$:    return
  391. .endc    ;RT11                ; /E64/
  392.  
  393.  
  394.     .sbttl    SET CL LINE * processor
  395.  
  396. .if df    RT11                ; /E64/
  397. cl.wild:tst    r50dev            ; is there now a link device?
  398.     bne    80$            ; ya, it has to go first..
  399.     tstb    ports            ; any ports data supplied?
  400.     beq    90$            ; no, can't do this
  401.     tstb    units            ; any CL units specified?
  402.     beq    90$            ; no, can't do this
  403.     mov    #units    ,r2        ; pointer to string of CL units
  404.     br    20$
  405.  
  406. 10$:    cmpb    (r2)+    ,#space        ; must be a space delimiter
  407.     bne    100$            ; wasn't, no specified CL unit is free
  408.  
  409. 20$:    movb    (r2)+    ,r0        ; get unit #
  410.     sub    #'7+1    ,r0        ; check unit is 0 - 7 only, and..
  411.     add    #7+1    ,r0        ; ..turn ascii into integer
  412.     bcc    100$            ; not a number
  413.     mov    r0    ,cl.unit    ; save CL unit number
  414.     mov    #^rCL0    ,cl.r50        ; rad50 name of "base" CL device
  415.     add    r0    ,cl.r50        ; make it the device at hand..
  416.     add    #'0    ,r0        ; now bump it up into an ascii digit
  417.     movb    r0    ,cl.nam+2    ; and stick that into "CLn:"
  418.  
  419.     clr    itsmine            ; init already allocated device flag
  420.     movb    #2    ,d.allo        ; prep to
  421.     mov    #d.allo    ,r0        ; check device
  422.     emt    375            ; for activity
  423.     bcs    10$            ; someone else has it
  424.     tst    r0            ; or, perhaps you do on another line?
  425.     beq    30$            ; nope..
  426.     cmp    r0    ,tsxsav        ; check against current job # too
  427.     bne    10$            ; it's not this job..
  428.     mov    sp    ,itsmine    ; allocate, except if already owned..
  429.  
  430. 30$:    mov    #ports    ,r4        ; pointer to ports data
  431.     br    50$            ; skip test for end on first pass thru
  432.  
  433. 40$:    tstb    (r4)            ; anything left?
  434.     beq    110$            ; nope..
  435.     cmpb    (r4)+    ,#space        ; is this a space delimiter?
  436.     bne    40$            ; no, keep looking for one
  437.  
  438. 50$:    call    220$            ; extract a number to try
  439.     tst    r3            ; /62/ check for valid number
  440.     beq    90$            ; /62/ line 0 doesn't exist
  441.     cmp    r3    ,#40.        ; max possible TSX line number
  442.     bhi    90$            ; /62/ bad number
  443.     mov    r3    ,cl.line    ; good number, save it for attcl
  444.     mov    #attcl    ,r0        ; try to
  445.     emt    375            ; attach it
  446.     bcc    60$            ; it worked
  447.     movb    @#errbyt,r0        ; it didn't work, find out why
  448.     cmpb    r0    ,#3        ; what to do?
  449.     bgt    40$            ; something's busy, try next one
  450.     beq    90$            ; errbyt=3, bad line
  451.     cmpb    r0    ,#2        ; is it 1 or 2?
  452.     beq    90$            ; errbyt=2, bad unit
  453.     mov    #er$124    ,r0        ; terminal privilege is required
  454.     jmp    180$            ; this is a fatal error..
  455.  
  456. 60$:    mov    sp    ,z.atch        ; flag TSX line was attached by Kermit
  457.     tst    itsmine            ; need to allocate the device?
  458.     bne    120$            ; no, you already have it
  459.     clrb    d.allo            ; make it ALLOCATE
  460.     mov    #d.allo    ,r0        ; try to
  461.     emt    375            ; allocate the device
  462.     bcc    120$            ; ok
  463.     movb    @#errbyt,r0        ; it didn't work, find out why
  464.     cmpb    r0    ,#2        ; what to do?
  465.     blt    40$            ; device in use, try next one
  466.     beq    90$            ; errbyt=2, bad device
  467.     cmpb    r0    ,#4        ; is it 3, 4 or 5?
  468.     beq    40$            ; errbyt=4, in use by another job
  469.     bgt    70$            ; needs allocate privilege
  470.     mov    #er$122    ,r0        ; TSX allocation table is full
  471.     br    180$            ; which is a fatal error..
  472.  
  473. 70$:    mov    #er$123    ,r0        ; allocate privilege is required
  474.     br    180$            ; fatal error..
  475. 80$:    mov    #er$140    ,r0        ; must drop current assign first
  476.     br    180$
  477. 90$:    mov    #er$141    ,r0        ; bad ports and/or units
  478.     br    180$
  479. 100$:    mov    #er$142    ,r0        ; no specified CL unit is free
  480.     br    180$
  481. 110$:    mov    #er$143    ,r0        ; no specified TSX line is free
  482.     br    180$
  483.  
  484. 120$:    strcpy    argbuf    ,#cl.nam    ; /62/ give SET LINE CL unit's name
  485.     mov    infomsg    ,-(sp)        ; save current state of SET TT [NO]QU
  486.     clr    infomsg            ; suppress implicit sho$line in set$li
  487.     call    set$line        ; same as "Kermit-11>SET LINE CLn"
  488.     mov    (sp)+    ,infomsg    ; restore SET TT [NO]QUIET state
  489.     bcc    130$            ; the set$line worked
  490.     call    cl.dump            ; it didn't work, clean up..
  491.     br    180$
  492.  
  493. 130$:    tstb    (r4)            ; anything left in "PORTS" buffer?
  494.     beq    190$            ; no, done
  495.     cmpb    (r4)    ,#space        ; is next byte a space?
  496.     beq    190$            ; ya, thus no parameters given..
  497.     cmpb    (r4)+    ,#'/        ; is next byte a slash?
  498.     bne    160$            ; no, it's an error
  499.     call    220$            ; extract a speed value
  500.     calls    setspd    ,<r3>        ; give it a try
  501.     tst    r0            ; well?
  502.     bne    170$            ; it failed
  503.     clr    b4speed            ; reset this if above succeeds..
  504.     cmpb    (r4)    ,#space        ; anything left in "PORTS" buffer?
  505.     ble    190$            ; no
  506.     cmpb    (r4)+    ,#'/        ; is next byte a slash?
  507.     bne    160$            ; no, it's an error
  508.     clrb    errtxt            ; /63/ init xmode buffer just in case
  509.     mov    argbuf    ,r0        ; /63/ save modem name here
  510.     call    250$            ; copy modem name into spare buff
  511.     cmpb    (r4)    ,#space        ; anything left in "PORTS" buffer?
  512.     ble    140$            ; no, try what was there
  513.     cmpb    (r4)+    ,#'/        ; is next byte a slash?
  514.     bne    160$            ; no, it's an error
  515.     mov    #errtxt    ,r0        ; /63/ pointer for 250$
  516.     call    250$            ; copy xmode into a handy spare buffer
  517.  
  518. 140$:    mov    infomsg    ,-(sp)        ; save status of SET TT [NO]QUIET
  519.     clr    infomsg            ; suppress display
  520.     call    set$modem        ; try to SET to supplied string
  521.     mov    (sp)+    ,infomsg    ; restore SET TT [NO]QUIET
  522.     tst    r0            ; did set$modem work?
  523.     bne    150$            ; /63/ no
  524.     tstb    errtxt            ; /63/ was an xmode value saved?
  525.     beq    190$            ; /63/ no, done
  526.     strcpy    argbuf    ,#errtxt    ; /63/ put xmode where sph$xm needs it
  527.     call    sph$xm            ; /63/ try to SET PHONE XMODE..
  528.     tst    r0            ; did it work?
  529.     beq    190$            ; /63/ ys
  530.     mov    #er$147    ,r0        ; SET PHONE XMODE failed
  531.     br    180$
  532.  
  533. 150$:    mov    #er$146    ,r0        ; no, bad ports string
  534.     br    180$
  535. 160$:    mov    #er$144    ,r0        ; bad delimiter before speed or modem
  536.     br    180$
  537. 170$:    mov    #er$145    ,r0        ; SET SPEED failed, bad ports string
  538. 180$:    call    incsts            ; set the global error flag
  539.     br    210$
  540. 190$:    tst    infomsg            ; time to say what's up?
  541.     beq    200$            ; no
  542.     call    sho$line        ; ya, display what was just done
  543. 200$:    clr    r0            ; flag success
  544. 210$:    return
  545.  
  546. 220$:    clr    r3            ; init an accumulator for the integer
  547. 230$:    movb    (r4)+    ,r0        ; next char
  548.     sub    #'9+1    ,r0        ; convert ascii byte to integer value
  549.     add    #9.+1    ,r0        ; but use it only if a 0..9 digit
  550.     bcc    240$            ; not a number
  551.     mul    #10.    ,r3        ; bump previous integer by 10s
  552.     add    r0    ,r3        ; then add in the current value
  553.     br    230$            ; is next byte part of number?
  554. 240$:    tstb    -(r4)            ; park on first non-numeric byte
  555.     return
  556.  
  557. 250$:    cmpb    (r4)    ,#space        ; is next byte a space or less?
  558.     blos    260$            ; /63/ ya, time to see if it will SET
  559.     cmpb    (r4)    ,#'/        ; no, but is it a slash?
  560.     beq    260$            ; ya, try to SET..
  561.     movb    (r4)+    ,(r0)+        ; no, it's part of the modem name
  562.     br    250$            ; check the next byte
  563. 260$:    clrb    (r0)            ; terminate
  564.     return
  565. .endc    ;RT11                ; /E64/
  566.  
  567.  
  568.     .sbttl    The CONNECT command    ; /BBS/ heavily modified
  569.  
  570. c$conn::tstb    ttname            ; anything to connect ??
  571.     bne    10$            ; ya
  572.     mov    #er$tt    ,r0        ; /62/ can't connect TT to TT
  573.     br    20$
  574.  
  575. 10$:    mov    mready    ,-(sp)        ; save modem's init status
  576. .if df    RT11                ; /E64/
  577.     call    doconn            ; run the terminal emulator
  578. .endc    ;RT11                ; /E64/
  579. .if df    RSTS                ; /E64/
  580.     mov    recdlm    ,-(sp)        ; /56/ Save RMS record delimiter
  581.     mov    #12    ,recdlm        ; /56/ Change to write on line feeds
  582.     call    doconn            ; run the terminal emulator
  583.     mov    (sp)+    ,recdlm        ; /56/ Restore put$ trigger char
  584. .endc    ;RSTS                ; /E64/
  585.     tst    (sp)+            ; was modem ever initialized?
  586.     beq    40$            ; no
  587.     tst    mready            ; ya, still initialized?
  588.     bne    40$            ; ya
  589.     call    reinit            ; no, go re-init it
  590.     tst    r0            ; /62/ did it work?
  591.     beq    30$            ; /62/ ya
  592. 20$:    direrr    r0            ; /62/ dump error message
  593.     call    incsts            ; /62/ flag error so r0 can be cleared
  594.     br    40$
  595. 30$:    .newline            ; ensure prompt comes up in the clear
  596. 40$:    clr    r0            ; /62/ only do error message once
  597.     return
  598.  
  599.     .sbttl    The WHO command        ; /E64/  from old Kermit-11
  600.  
  601. .if df    RSTS                ; /E64/
  602. c$who::    calls    sercmd    ,<#sys.cm,#0>    ;/*60*/ make it nice
  603.     return                ;/*60*/ anyway, time to exit...
  604. .endc    ;RSTS                ; /E64/
  605.  
  606.     .sbttl    The TAKE command    ; /BBS/ heavily hacked ..
  607.  
  608. c$take::tst    cmdlun            ; indirect file already open?
  609.     beq    30$            ; no
  610.     tst    sy.ini            ; here during init from KRT.INI?
  611.     beq    10$            ; no
  612.     call    defterm            ; ya, do end of init file stuff
  613.     br    20$            ; continue
  614.  
  615. 10$:    tst    infomsg            ; /41/ how verbose are we today?
  616.     beq    20$            ; Not very
  617.     wrtall    #indnam            ; dump file name
  618.     wrtall    #cm1.01            ; /63/ " closed",cr
  619. 20$:    calls    close    ,<#lun.ta>    ; close the file
  620.     clr    cmdlun            ; clear the it's open flag for it
  621.  
  622. 30$:    clr    r4            ; init try the path flag
  623.     upcase    argbuf            ; upper case all args
  624.     scan    #'.    ,argbuf        ; look for a dot in the name
  625.     tst    r0            ; find one?
  626.     bne    40$            ; ya..
  627.     strcat    argbuf    ,#takdef    ; no, add .COM to it
  628.  
  629. 40$:    scan    #':    ,argbuf        ; look for device delimiter
  630.     tst    r0            ; find one?
  631.     beq    50$            ; no
  632. .if df    RT11                ; /E64/
  633.     copyz    argbuf    ,#indnam,#16+1    ; /62/ ya, try this file name
  634.     br    100$
  635.  
  636. 50$:    mov    #tk.1    ,r3        ; prep to build a list
  637.     mov    sp    ,r4        ; flag to try the path
  638. 60$:    tst    @r3            ; any more to open up?
  639.     beq    70$            ; no
  640.     copyz    argbuf    ,(r3)+    ,#11.    ; insert name in path stuff
  641.     br    60$            ; try for a possible next one..
  642.  
  643. 70$:    mov    #tk.0    ,r3        ; the top of the list of stuff to try
  644. .endc    ;RT11                ; /E64/
  645. .if df    RSTS                ; /E64/
  646. ; /E64/    Here I have reorganized how the filenames of the TAKE files
  647. ; /E64/    get built, to eliminate the little work buffers at tk.1  This scheme
  648. ; /E64/    would probably also work for RT11...
  649.     copyz    argbuf    ,#indnam,#39.+1    ; /62/ ya, try this file name
  650.     br    100$
  651. 50$:    mov    #tk.0    ,r3        ; the top of the list of stuff to try
  652.     mov    sp    ,r4        ; flag to try the path
  653. .endc    ;RSTS                ; /E64/
  654. 80$:    tst    @r3            ; anything left?
  655.     bne    90$            ; ya
  656.     mov    #er$fnf    ,r0        ; no, can't find it
  657.     br    140$            ; bail out
  658.  
  659. .if df    RT11                ; /E64/
  660. 90$:    copyz    (r3)+    ,#indnam,#16+1    ; /62/ current name in list to opener
  661. 100$:    calls    fparse    ,<#indnam,#srcnam> ; parse the file name please
  662.     tst    r0            ; did the $parse work?
  663.     bne    140$            ; /62/ no
  664. .endc    ;RT11                ; /E64/
  665. .if df    RSTS                ; /E64/
  666. 90$:    copyz    (r3)+    ,#indnam,#39.+1    ; copy device to buffer
  667.     strcat    #indnam    ,argbuf        ; add in filename
  668. 100$:    calls    fparse    ,<#indnam,#srcnam> ; parse the file name please
  669.     tst    r0            ; did the $parse work?
  670.     bne    130$            ; /E64/ no (parse returns error
  671.                     ;   if logical name isn't defined)
  672. .endc    ;RSTS                ; /E64/
  673.     calls    iswild    ,<#srcnam>    ; wildcarded file spec?
  674.     tst    r0            ; no support for it yet here..
  675.     bne    140$            ; /62/ disallow wildcarded file name
  676.  
  677. ;    calls    chkext    ,<#srcnam>    ; check for binary file type
  678. ;    tst    r0            ; iz it binary?
  679. ;    beq    110$            ; nope
  680. ;    mov    #er$fnm    ,r0        ; ya, bad file name
  681. ;    br    130$            ; bail out
  682.  
  683. 110$:    calls    open,<#srcnam,#lun.ta,#text> ; open file for input
  684.     tst    r0            ; did the open for command file work?
  685.     bne    130$            ; no, print error and exit
  686.     mov    #lun.ta    ,cmdlun        ; yes, stuff the unit number in
  687. .if df    RT11                ; /E64/
  688.     copyz    #srcnam    ,#indnam ,#16+1    ; /62/ stash a copy of the file name
  689. .endc    ;RT11                ; /E64/
  690. .if df    RSTS                ; /E64/
  691.     copyz    #srcnam    ,#indnam ,#35+1    ; /62/ stash a copy of the file name
  692. .endc    ;RSTS                ; /E64/
  693.     tst    infomsg            ; status of SET TT [NO]QUIET
  694.     beq    120$            ; it's QUIET
  695.     wrtall    #indnam            ; it's NOQUIET, display file name
  696.     wrtall    #cm1.02            ; /63/ " opened",cr  r0 remains 0 here
  697. 120$:    clr    exstal            ; init take file line number pointer
  698.     br    150$            ; take file will be read by readcmd..
  699.  
  700. 130$:    tst    r4            ; if using the path list of names
  701.     bne    80$            ; be sure they all get tried..
  702. 140$:    direrr    r0            ; print a error message and
  703.     call    incsts            ; /62/ ensure global error flag is set
  704.     clrb    indnam            ; zero out take file name buffer
  705. 150$:    return
  706.  
  707.  
  708.     .sbttl    the SYSTEM command    ; /E64/ restored from old Kermit-11
  709.  
  710. .if df    RSTS                ; /E64/
  711. c$sys::    tstb    @argbuf            ; need something in ARGBUF
  712.     bne    10$            ; oops
  713.     wrtall    #cm1.22
  714.     return
  715. 10$:    strlen    argbuf            ; get the current length so we
  716.     add    argbuf    ,r0        ; can stuff a carriage return
  717.     movb    #cr    ,(r0)+        ; and a null in
  718.     clrb    @r0            ; all set now
  719.     mov    argbuf    ,sy.0+2
  720.     mov    #sy.0    ,r5        ; call the PK driver
  721.     call    runjob            ; simple
  722.     tst    r0            ; did it work ?
  723.     beq    100$            ; yes
  724.     wrtall    #cm1.23
  725.     decout    r0
  726.     .newline
  727. 100$:    .newline
  728.     return
  729. ;    ierr = runjob(buffer,mode,10,timout)
  730. ;
  731. ;     All parameters for  RSTS are  used so we can use the
  732. ;    generalized PK code used also in MINITAB (C) and TED.
  733. ;    For RSX11M/M+, only the first argument is needed.
  734.     .globl    runjob
  735. .endc    ;RSTS                ; /E64/
  736.  
  737.     .sbttl    Local DIRECTORY and SPACE commands  ; /BBS/ modified a bit
  738.  
  739. c$spac::mov    sp    ,summary    ; flag for summary only
  740. c$dir::    upcase    argbuf            ; upper case all command args
  741.     calls    fixwild    ,<argbuf>    ; convert "?" to "%"
  742.     calls    dodir    ,<argbuf>    ; /62/ do the directory
  743.     tst    r0            ; did it work?
  744.     beq    10$            ; yes
  745.     direrr    r0            ; no, print the error
  746. 10$:    return
  747.  
  748.  
  749.     .sbttl    MOUNT, DISMOUNT a logical disk  (TSX+ only)  ; /BBS/ all new
  750.  
  751. .if df    RT11                ; /E64/
  752. c$dismou::mov    sp    ,r1        ; set dismount flag
  753.     br    c.mnt            ; and use common code
  754.  
  755. c$mount::clr    r1            ; flag to mount
  756. c.mnt:    tst    tsxsav            ; /63/ running under TSX?
  757.     bne    10$            ; ya
  758.     mov    #er$tsx    ,r0        ; no, load error
  759.     br    30$            ; that's all
  760.  
  761. 10$:    cmp    tsxver    ,#620.        ; is this V6.20 or above?
  762.     bhis    20$            ; ya
  763.     mov    #er$v62    ,r0        ; no
  764.     br    30$
  765.  
  766. 20$:    call    mount            ; do the mount now
  767.     tst    r0            ; did it work?
  768.     beq    40$            ; yes
  769. 30$:    direrr    r0            ; no, print error message
  770. 40$:    return
  771. .endc    ;RT11                ; /E64/
  772.  
  773.  
  774.     .sbttl    The local TYPE command    ; /BBS/ heavily hacked..
  775.  
  776.     .save
  777.     .psect    $pdata
  778. less:    .asciz    <cr><lf>        ; only type these for a binary file
  779. more:    .asciz    <bell><bs><tab><cr><ff><lf><ctrl$n><ctrl$o><esc> ; ok in text
  780.     .even
  781.     .restore
  782.  
  783. c$type::upcase    argbuf            ; upper case all args
  784.     calls    fparse    ,<argbuf,#srcnam> ; parse the file name please
  785.     tst    r0            ; did the $parse work?
  786.     beq    10$            ; ya
  787.     jmp    170$            ; no
  788.  
  789. 10$:    clr    index            ; init getnxt directory index
  790.     scan    #'.    ,#srcnam    ; look for a dot in the name
  791.     tst    r0            ; find one?
  792.     bne    20$            ; ya..
  793.     strcat    #srcnam    ,#typdef    ; no, add ".LST" to it
  794.  
  795. 20$:    calls    iswild    ,<#srcnam>    ; wildcarded?
  796.     mov    r0    ,r4        ; save copy of answer
  797. 30$:    calls    lookup    ,<#srcnam,#filnam> ; /62/
  798.     tst    r0            ; did it work?
  799.     beq    70$            ; yes
  800.     clr    r1            ; clear try for another flag..
  801.     cmp    r0    ,#er$nmf    ; no more files matching name?
  802.     beq    40$            ; yes, we are all done then
  803.     cmp    r0    ,#er$fnf    ; how about file not found?
  804.     bne    60$            ; /62/ no, print error message
  805. 40$:    tst    index            ; sent any files yet?
  806.     beq    50$            ; no
  807.     jmp    190$            ; yes, that's ok then
  808. 50$:    mov    #er$fnf    ,r0        ; no, change "no more" to "not found"
  809. 60$:    jmp    180$            ; /62/ go do error message
  810.  
  811. 70$:    mov    #more    ,r3        ; init for text file filtering
  812.     clr    r1            ; init binary/text flag
  813.     calls    chkext    ,<#filnam>    ; check for binary file type
  814.     tst    r0            ; iz it binary?
  815.     beq    80$            ; no..
  816.     mov    #less    ,r3        ; ya, get binary file filter
  817.     inc    r1            ; flag as binary
  818. 80$:    clr    r2            ; assume file not open
  819.     calls    open,<#filnam,#lun.in,r1> ; open file for input
  820.     tst    r0            ; but did the open work?
  821.     bne    170$            ; no
  822.     com    r2            ; flag it as being open please
  823.     tst    r4            ; wildcarded?
  824.     beq    90$            ; nope
  825.     cmp    index    ,#1        ; is this the first file?
  826.     bne    90$            ; nope
  827.     wrtall    #cm1.03            ; /63/ " Files copied:",cr
  828. 90$:    tst    r1            ; iz binary filter active?
  829.     beq    100$            ; nope
  830.     wrtall    #cm1.04            ; /63/ "Binary file filter enabled",cr
  831. 100$:    tst    r4            ; more than one file possibly?
  832.     beq    110$            ; no, skip naming of each one
  833.     wrtall    #filnam            ; print the expanded name out
  834.     wrtall    #cm1.05            ; /63/ " to TT:",cr
  835. 110$:    calls    open,<#0,#lun.kb,r1>    ; open (init) TT for putc output
  836.  
  837. 120$:    mov    #lun.in    ,r0        ; I/O chan to use
  838.     call    getcr0            ; get a byte
  839.     tst    r0            ; end of it all?
  840.     bne    170$            ; ya
  841.     cmp    vttype    ,#vt200        ; can term do 8-bit stuff?
  842.     bge    130$            ; ya..
  843.     bicb    #200    ,r1        ; /62/ hose hi bit for VT-100 or below
  844. 130$:    cmpb    r1    ,#space        ; a "printable" char??
  845.     bge    140$            ; ya, no problem..
  846.     scan    r1    ,r3        ; look for char in allowed list
  847.     tst    r0            ; a hit?
  848.     beq    120$            ; nope, so on to the next
  849. 140$:    asr    crflag            ; /62/ ya, was last byte a CR?
  850.     bcc    150$            ; /62/ no
  851.     cmpb    r1    ,#lf        ; /62/ is this byte a LF?
  852.     beq    150$            ; /62/ ya
  853.     calls    putc    ,<#lf,#lun.kb>    ; /62/ no, append LF to CR just typed
  854. 150$:    cmpb    r1    ,#cr        ; /62/ is this byte a CR?
  855.     bne    160$            ; /62/ no
  856.     inc    crflag            ; /62/ ya, flag it is
  857. 160$:    calls    putc    ,<r1,#lun.kb>    ; put char to TT
  858.     br    120$            ; next char please
  859.  
  860. 170$:    mov    r0    ,r1        ; save copy for wildcard loop
  861.     cmp    r0    ,#er$eof    ; end of file?
  862.     beq    190$            ; ya
  863. 180$:    direrr    r0            ; no, print the error out
  864.     clr    r1            ; clear look for another flag
  865. 190$:    calls    close    ,<#lun.kb>    ; flush TT out buffer
  866.     tst    r2            ; is the type file open?
  867.     beq    200$            ; no
  868.     calls    close    ,<#lun.in>    ; ya, close it
  869. 200$:    cmp    r1    ,#er$eof    ; try for another match?
  870.     bne    210$            ; nope, done
  871.     .newline            ; ya, put possible next file in clear
  872.     jmp    30$            ; then go try to type it out
  873. 210$:
  874. .if df    RT11                ; /E64/
  875.     .purge    #lun.sr            ; /62/ hose dir search channel
  876. .endc    ;RT11                ; /E64/
  877.     clr    r0            ; /62/ any error was already handled
  878.     return
  879.  
  880.  
  881.     .sbttl    SHOW LINE        ; /BBS/ moved here, added defterm
  882.  
  883. defterm::tst    infomsg            ; SET TT NOQ during init?
  884.     beq    10$            ; no
  885.     wrtall    #indnam            ; ya, say
  886.     wrtall    #cm1.01            ; /63/ " closed",cr
  887. 10$:    tst    signon            ; need to do this?
  888.     bne    20$            ; no
  889.     call    sho$line        ; ya, SHOW LINE as part of pgm sign-on
  890. 20$:    mov    qu.ini    ,infomsg    ; make the SET permanent
  891.     clr    sy.ini            ; done with this now
  892.     return
  893.  
  894. .if df    RT11                ; /E64/
  895. sho$li::wrtall    #cm1.06            ; /63/ "Link device is "
  896.     tstb    ttname            ; something besides TT?
  897.     bne    10$            ; ya
  898.     wrtall    #cm1.07            ; /63/ "TT:   "
  899.     jmp    170$            ; skip speed, DTR, etc for TT
  900.  
  901. 10$:    wrtall    #ttname            ; display link device name
  902.     mov    cl$line    ,r0        ; using a TSX port with it?
  903.     beq    20$            ; not this time
  904.     wrtall    #cm1.08            ; /63/ " via Line #"
  905.     call    L10266            ; dump line # to TT
  906. 20$:    tst    tsxsav            ; running under TSX?
  907.     beq    30$            ; no
  908.     wrtall    #cm1.09            ; /63/ "   Priority: "
  909.     mov    cl.pri    ,r0        ; pass priority value to L10266
  910.     call    L10266            ; dump priority to TT
  911. 30$:    wrtall    #cm1.10            ; /63/ "   Speed: "
  912.     call    ttspeed            ; is current
  913.     tst    r0            ; speed available?
  914.     bne    40$            ; /62/ yes
  915.     wrtall    #cm1.11            ; /63/ "N/A"
  916.     br    50$
  917. 40$:    call    L10266            ; print the speed
  918.     mov    b4speed    ,r0        ; did last call alter speed?
  919.     beq    50$            ; nope
  920.     wrtall    #cm1.12            ; /63/ "/"
  921.     call    L10266            ; display the "SET" speed too
  922.  
  923. 50$:    .newline
  924.     tst    mready            ; a modem on-line?
  925.     beq    60$            ; /62/ no
  926.     wrtall    #modem            ; ya
  927.     wrtall    #cm1.13            ; /63/ " modem is on-line   "
  928. 60$:    tst    sy.ini            ; here for program initialization?
  929.     bne    170$            ; ya, skip past DTR/DCD stuff
  930.     wrtall    #cm1.14            ; /63/ "DTR: "
  931.     call    inqdtr            ; see if DTR is up
  932.     tst    r0            ; if < it's not supported
  933.     bmi    70$            ; no good
  934.     bgt    80$            ; DTR's up
  935.     wrtall    #li.lo            ; /62/ "low"
  936.     br    90$
  937. 70$:    wrtall    #cm1.11            ; /63/ "N/A"
  938.     br    90$
  939. 80$:    wrtall    #li.hi            ; /62/ "HIGH"
  940. 90$:    wrtall    #cm1.15            ; /63/ "   DCD: "
  941.     call    inqcd            ; see if DCD is up
  942.     tst    r0            ; if > DCD is asserted
  943.     bgt    100$            ; it's up
  944.     wrtall    #li.lo            ; /62/ "low"
  945.     br    110$
  946. 100$:    wrtall    #li.hi            ; /62/ "HIGH"
  947. 110$:    clr    r1            ; /62/ preset to XOFF flow control
  948.     tst    km.lock            ; /62/ only do these next two
  949.     beq    150$            ; /62/ for the KM handler
  950.     clr    -(sp)            ; /62/ a one word buffer
  951.     mov    sp    ,r1        ; /62/ pointer to it
  952.     .spfun    #rtwork,#xc.control,#clstat,r1,#0,#1 ; get the status
  953.     mov    (sp)+    ,r1        ; /62/ pop buffer, save a copy
  954.     wrtall    #cm1.16            ; /63/ "   RTS: "
  955.     bit    #10    ,r1        ; /62/ is RTS asserted?
  956.     bne    120$            ; /62/ ya
  957.     wrtall    #li.lo            ; /62/ "low"
  958.     br    130$
  959. 120$:    wrtall    #li.hi            ; /62/ "HIGH"
  960. 130$:    wrtall    #cm1.17            ; /63/ "   CTS: "
  961.     bit    #20    ,r1        ; /62/ is CTS asserted?
  962.     bne    140$            ; /62/ ya
  963.     wrtall    #li.lo            ; /62/ "low"
  964.     br    150$
  965. 140$:    wrtall    #li.hi            ; /62/ "HIGH"
  966.  
  967. 150$:    .newline
  968.     wrtall    #cm1.18            ; /63/ "Flow-Control: "
  969.     bit    #40    ,r1        ; /62/ if <> it's done in hardware
  970.     bne    160$
  971.     wrtall    #cm1.19            ; /63/ "XOFF/XON   "
  972.     br    170$
  973. 160$:    wrtall    #cm1.20            ; /63/ RTS/CTS   "
  974. 170$:    mov    parity    ,r0        ; display what's set in Kermit itself
  975.     wrtall    #cm1.21            ; /63/ "S/W Parity: "
  976.     asl    r0            ; word indexing into list
  977.     wrtall    parlst(r0)        ; write appropriate word to TT
  978.     .newline            ; format display
  979.     mov    sp    ,signon        ; sign-on has been done
  980.     clr    r0            ; no error possible
  981.     return
  982. .endc    ;RT11                ; /E64/
  983. .if df    RSTS                ; /E64/
  984. sho$li::tstb    ttname            ; show the terminal show
  985.     bne    300$            ; something is there
  986.     wrtall    #cm1.24
  987.     return
  988. 300$:    wrtall    #cm1.25
  989.     wrtall    #ttname            ; print it
  990.     .newline
  991.     wrtall    #cm1.26
  992.     call    ttspee
  993.     decout    r0
  994.     wrtall    #cm1.27            ; /E64/ and finish off the message
  995.  
  996.     return
  997. .endc    ;RSTS                ; /E64/
  998.  
  999.  
  1000.     .sbttl    Cleanup before exiting to monitor    ; /BBS/ enhanced
  1001.  
  1002. c$exit::call    sd$off            ; close possibly open debug file
  1003.     tst    outopn            ; is an output file open?
  1004.     beq    10$            ; no
  1005.     calls    close    ,<#lun.ou>    ; ya, close it
  1006. 10$:    mov    mready    ,-(sp)        ; save modem status
  1007.     call    c$idle            ; reset modem, if need be..
  1008.     tst    (sp)+            ; was there a modem?
  1009.     beq    20$            ; nope
  1010.     calls    suspend    ,<#0,settle>    ; ya, let it settle
  1011. 20$:
  1012. .if df    RT11                ; /E64/
  1013.     call    xl.dump            ; drop DTR, handler interrupts
  1014.     tst    tsxcl            ; using a CL line?
  1015.     beq    30$            ; no
  1016.     call    cl.dump            ; dump it
  1017. .endc    ;RT11                ; /E64/
  1018. 30$:    jmp    exit            ; goto hardware reset in KRTRMS
  1019.  
  1020.     .end
  1021.