home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / b / krtst1.mac < prev    next >
Text File  |  2020-01-01  |  35KB  |  1,162 lines

  1.     .title    KRTST1    SET command overlay one
  2.     .ident    "V03.63"
  3.  
  4. ; /63/    27-Sep-97  Billy Youdelman  V03.63
  5. ;
  6. ;    allow attributes to be individually set, ala C-Kermit
  7. ;    modify SET FLOW XON to force quoting of XOFF and XON chars
  8. ;    consolidate local data..
  9. ;    add SET FILE WILDCARDS
  10. ;    cd with no arg defaults to home dir, shows default after executing
  11.  
  12. ; /E64/    05-May-96  John Santos
  13. ;
  14. ;    Fix bug in SET TERM which always set NOSCOPE
  15.  
  16. ; /62/    27-Jul-93  Billy Youdelman  V03.62
  17. ;
  18. ;    moved BREAK, CREATE-SIZE and [NO]VOLUME-VERIFY here ..
  19. ;    conform sinit-related SETs to major update of KRTINI.MAC
  20. ;    make SET TIME-OUT to SET RECEIVE TIME-OUT and SET SEND TIME-OUT
  21. ;    add SET CONSOLE PRIORITY for KM/XC/XL under TSX
  22. ;    add SET FLOW-CONTROL to support RTS/CTS and KM handler
  23.  
  24. ; /BBS/     1-Dec-91  Billy Youdelman  V03.61
  25. ;
  26. ;    HOME uses dkname:
  27. ;    set$df - now calls c$cwd
  28. ;    set$sn - clear r0 after printing error message, avoid dupe msg
  29. ;    sts$pl - corrected packet length max test to 94. (maxpak)
  30. ;    set$attributes - fixed so "?" arg doesn't set to last displayed
  31. ;    added set ld empty, using TSX emts
  32. ;    sf$typ - patched to pass proper arg to any routine it calls ..
  33. ;    added warn message to str$pl if CRC block checking not enabled
  34. ;    str$pl re-enables long packets if set >94., warns if CRC not on
  35. ;    set$file - added SET FILE NAMING [NO]LOWER-CASE, for Unix
  36. ;    con8bit set/cleared as appropriate by set$tt
  37. ;    SET LONG ON now does SET BLO 3, SET REC PAC 1024
  38. ;    time-out may now be set as low as 1 second
  39. ;    SET REC PAC >94 now enables long-packets, if set off prior to it
  40. ;    added SET CL PORTS, UNITS for auto line assign under TSX+
  41. ;    added SET CONSOLE [NO]MILNET to force 2 XONs when CONNECTing
  42. ;    cleaned up SET FILE code, see HELP SET FILE for details
  43. ;
  44. ;    set$bi - modified to be augmented by new entries, not trashed,
  45. ;    to allow dependence on it for selection of filtering for the
  46. ;    new improved type routine in KRTCM1, supports types <3 chars
  47. ;
  48. ;    st$nlp - clr senlng, which is now used to ensure a packet of
  49. ;    almost or equal to 94 bytes in a long-packet xfr will get the
  50. ;    correct header.  command dispatch table also patched for this
  51. ;
  52. ;    added set$vl - sets action on vlswch char ^W and print window
  53. ;    char ^B in the CONNECT mode under TSX+  see HELP SET VLSWCH
  54. ;
  55. ;    moved SET [NO]QUIET here, made it SET TT [NO]QUIET, added tests
  56. ;    for it where missing..
  57.  
  58. ;    Copyright 1984 Change Software, Inc.
  59. ;
  60. ;    31-Jan-84  15:13:45  Brian Nelson
  61.  
  62.  
  63.     .include "IN:KRTMAC.MAC"
  64.     .iif ndf  KRTINC  .error    <; .include for IN:KRTMAC.MAC failed>
  65.     .include "IN:KRTCDF.MAC"
  66.     .iif ndf  KRTCDF  .error    <; .include for IN:KRTCDF.MAC failed>
  67.  
  68.     .mcall    .GVAL    ,.SPFUN        ; /62/
  69.  
  70.  
  71.     .sbttl    Local data        ; /63/ consolidate local data here..
  72.  
  73.     .psect $pdata
  74. st1.01:    .asciz    "Blocks: "
  75. st1.02:    .asciz    "Mode: "
  76. st1.03:    .asciz    "Option: "
  77. st1.04:    .asciz    "Value: "
  78. st1.05:    .asciz    "Octal 1-36: "
  79. st1.06:    .asciz    "Seconds: "
  80. st1.07:    .asciz    "Octal value: "
  81. st1.08:    .asciz    "How many? "
  82. st1.09:    .asciz    "On, Off? "
  83. st1.10:    .asciz    "Length? "
  84. st1.11:    .asciz    "Your max authorized priority is "
  85. st1.12:    .asciz    "DK  --> "         ; /63/
  86. st1.13:    .asciz    "Explicit or Implicit? " ; /63/
  87. st1.14:    .asciz    "You may need to SET BLO "
  88. st1.15:    .asciz    " on the other Kermit"<cr><lf>
  89. st1.16:    .asciz    "ASCII text mode set"<cr><lf>
  90. st1.17:    .asciz    "Binary mode set"<cr><lf>
  91. st1.18:    .asciz    "DEC-Multinational mode set"<cr><lf>
  92. st1.19:    .asciz    "Auto ASCII/Binary mode set"<cr><lf>
  93. st1.20:    .asciz    "Caution: Binary files will require 8-bit prefixing"<cr><lf>
  94. st1.21:    .asciz    " appended to BINARY-TYPE list"<cr><lf>
  95. st1.22:    .asciz    "Packet length truncated to buffer maximum of "
  96. st1.23:    .asciz    ". bytes"<cr><lf>
  97. st1.24:    .asciz    "Remember to SET BLO 3 for long-packets"<cr><lf>
  98.     .even
  99.  
  100.  
  101.     .psect    $code
  102.     .sbttl    SET SPEED
  103.  
  104. set$sp::calls    l$val    ,<argbuf>    ; get the speed into decimal
  105.     tst    r0            ; ok?
  106.     bne    20$            ; /BBS/ nope
  107.     calls    setspd    ,<r1>        ; set the speed
  108.     tst    r0            ; did it work?
  109.     bne    30$            ; /BBS/ no
  110.     clr    b4speed            ; /BBS/ ya, also clear fallback speed
  111.     clr    r0            ; /BBS/ success
  112.     tst    mready            ; /BBS/ is a modem on-line?
  113.     beq    30$            ; /BBS/ no
  114.     call    inqcd            ; /BBS/ ya, is the modem active?
  115.     tst    r0            ; /BBS/ well..
  116.     ble    10$            ; /BBS/ probably not, do the init
  117.     clr    r0            ; /BBS/ restore r0 after inqcd eats it
  118.     br    30$            ; /BBS/ definitely active, don't init
  119. 10$:    tst    (sp)+            ; /BBS/ ya, dump return address then
  120.     jmp    set$dtr            ; load adjacent overlay, re-init modem
  121.  
  122. 20$:    mov    #er$spe    ,r0        ; /BBS/ unknown speed
  123. 30$:    return
  124.  
  125.  
  126.     .sbttl    SET CL
  127.     .enabl    lsb            ; /63/
  128.  
  129.     MAXPRI    = -18.            ; /62/ offset to max priority allowed
  130.  
  131. set$cl::tst    tsxsav            ; /62/ running under TSX?
  132.     bne    10$            ; /62/ ya
  133.     mov    #er$tsx    ,r0        ; /62/ no
  134.     br    120$            ; /62/
  135. 10$:    upcase    argbuf            ; /BBS/ added this, all new..
  136. 20$:    scan    #'=    ,argbuf        ; /62/ look for an equals sign
  137.     tst    r0            ; /62/ well?
  138.     beq    30$            ; /62/ none there, or left
  139.     add    argbuf    ,r0        ; /62/ found one, get pointer
  140.     movb    #space    ,-(r0)        ; /62/ and swap in a space for it
  141.     br    20$            ; /62/ check for another "="
  142. 30$:    calls    getcm0    ,<argbuf,#cllst> ; find out which option was given
  143.     tst    r0            ; did we find one
  144.     bmi    120$            ; no
  145.     tst    wasnul            ; were commands listed via "?"
  146.     bne    120$            ; ya
  147.     mov    argbuf    ,r0        ; this is a KLUDGE, skip to needed arg
  148. 40$:    tstb    @r0            ; find EOS as of yet?
  149.     bne    50$            ; no
  150.     mov    #cmd$bad,r0        ; ya, thus it's no good
  151.     br    120$            ; exit with an error
  152. 50$:    cmpb    (r0)+    ,#space        ; found a delimiter yet?
  153.     bne    40$            ; no, keep looking
  154.     mov    r0    ,argpnt        ; pass proper arg to called cmd
  155.     jmp    @r1            ; /63/ dispatch now
  156.  
  157.     command    cllst    ,LINE    ,1    ,scl$$
  158.     command    cllst    ,PORTS    ,2    ,scl$1
  159.     command    cllst    ,PRIORITY,2    ,scl$3
  160.     command    cllst    ,UNITS    ,1    ,scl$2
  161.     command    cllst
  162.  
  163. scl$$:    mov    cmdbuf    ,r0        ; recover original command string
  164. 60$:    cmpb    (r0)+    ,#space        ; step in to..  (skip past "SET")
  165.     bne    60$            ; ..first argument
  166.     mov    r0    ,r1        ; copy pointer to first arg  ("CLn")
  167. 70$:    cmpb    (r1)+    ,#space        ; step in past next space delimiter
  168.     bne    70$            ; to arg(s) > "CLn" and copy back so
  169.     copyz    argbuf    ,r1 ,#ln$max-4    ; multi cmds delimited by commas work
  170.     strcpy    argbuf    ,r0        ; /62/ reset current "CLn LINE x" cmd
  171.     mov    #cmd$bad,r0        ; and force it to fall thru to the
  172.     return                ; SET CLn LINE x stuff in KRTCM1
  173.  
  174. scl$3:    calls    l$val    ,<argpnt>    ; convert ascii to integer
  175.     tst    r0            ; well?
  176.     bne    80$            ; bad value
  177.     cmp    r1    ,#1.        ; a reasonable minimum?
  178.     blo    80$            ; ok
  179.     cmp    r1    ,#127.        ; a reasonable maximum?
  180.     blos    90$            ; yes
  181. 80$:    mov    #er$pri    ,r0        ; no, return error
  182.     br    120$
  183. 90$:    .gval    #rtwork    ,#maxpri    ; /62/ get max allowed priority
  184.     cmp    r0    ,r1        ; /62/ requested more than can be had?
  185.     bhis    100$            ; /62/ no
  186.     mov    r0    ,r1        ; /62/ bump down to max possible
  187.     wrtall    #st1.11            ; /63/ Your max authorized priority is
  188.     call    L10266            ; /62/ display it
  189.     .newline            ; /62/
  190. 100$:    movb    r1    ,cl.pri        ; save desired priority
  191. 110$:    clr    r0            ; no error (must do here for sco$pr)
  192. 120$:    return
  193.  
  194. scl$1:    copyz    argpnt    ,#ports    ,#ln$max ; /63/ max string len is LN$MAX bytes
  195.     br    110$            ; /63/ no error
  196.  
  197. scl$2:    copyz    argpnt    ,#units    ,#16.    ; up to 8 single digit CL unit numbers
  198.     br    110$            ; /63/ no error    delimited by blanks
  199.  
  200.     .dsabl    lsb            ; /63/
  201.  
  202.  
  203.     .sbttl    SET FLOW-CONTROL    ; /62/ new, KM handler only
  204.     .enabl    lsb
  205.  
  206.     KMFLOW    = 277            ; SET FLOW-CONTROL spfun
  207.  
  208. set$km::
  209.     tst    km.lock            ; is KM the link device?
  210.     bne    10$            ; ya
  211.     mov    #er$km    ,r0        ; no, can't do this
  212.     br    30$            ; /63/
  213. 10$:    upcase    argbuf            ; upper case the argument
  214.     calls    getcm0    ,<argbuf,#kmlst> ; which option was given?
  215.     tst    r0            ; find one?
  216.     bmi    30$            ; /63/ no
  217.     tst    wasnul            ; were commands listed via "?"
  218.     bne    30$            ; /63/ ya
  219.     jmp    @r1            ; /63/ dispatch
  220.  
  221.     command    kmlst    ,RTS/CTS,1    ,km$rts
  222.     command    kmlst    ,XOFF    ,1    ,km$xof
  223.     command    kmlst
  224.  
  225. km$rts:    mov    sp    ,r1        ; make word count <>
  226.     br    20$
  227.  
  228. km$xof:    mov    #ctlflgs,r1        ; /63/ pointer to control flags data
  229.     mov    #1    ,r0        ; /63/ modify some flags with this..
  230.     movb    r0    ,22(r1)        ; /63/ force quoting of ^Q
  231.     movb    r0    ,24(r1)        ; /63/ ^S
  232.     movb    r0    ,63(r1)        ; /63/ 200!^Q
  233.     movb    r0    ,65(r1)        ; /63/ 200!^S
  234.     clr    r1            ; zero word count
  235. 20$:    .spfun    #rtwork,#xc.control,#kmflow,#0,r1,#1 ; do the SET
  236.     clr    r0            ; no error possible
  237. 30$:    return
  238.  
  239.     .dsabl    lsb
  240.  
  241.     .sbttl    SET BLOCK-CHECK-TYPE
  242.     .enabl    lsb
  243.  
  244. set$bl::upcase    argbuf            ; /BBS/ upper case all args
  245.     calls    getcm0    ,<argbuf,#blklst> ; find out which option was given
  246.     tst    r0            ; did we find one
  247.     bmi    30$            ; no
  248.     tst    wasnul            ; /BBS/ were commands listed via "?"
  249.     bne    30$            ; /BBS/ ya
  250.     jmp    @r1            ; /63/ dispatch now
  251.  
  252.     command    blklst    ,1-CHARACTER-CHECKSUM    ,1    ,sbl$1
  253.     command    blklst    ,2-CHARACTER-CHECKSUM    ,1    ,sbl$2
  254.     command    blklst    ,3-CHARACTER-CRC-CCITT    ,1    ,sbl$3
  255.     command    blklst    ,CRC-CCITT        ,1    ,sbl$3
  256.     command    blklst
  257.  
  258. sbl$1:    movb    #'1    ,r1
  259.     br    10$            ; /63/
  260.  
  261. sbl$2:    movb    #'2    ,r1
  262.     br    10$            ; /63/
  263.  
  264. sbl$3:    movb    #'3    ,r1
  265. 10$:    mov    r1    ,setchkt    ; /62/ save the
  266.     movb    r1    ,senpar+p.chkt    ; /62/ result
  267.     tst    infomsg            ; /BBS/ verbose today?
  268.     beq    20$            ; /BBS/ No
  269.     wrtall    #st1.14            ; /63/ "You may need to SET BLO "
  270.     movb    r1    ,r0        ; /BBS/ get the number
  271.     call    writ1char        ; /BBS/ dump it
  272.     wrtall    #st1.15            ; /63/ " on the other Kermit"
  273. 20$:    clr    r0            ; no error
  274. 30$:    return
  275.  
  276.     .dsabl    lsb
  277.  
  278.  
  279.     .sbttl    SET FILE
  280.     .enabl    lsb
  281.  
  282. set$fi::upcase    argbuf            ; /BBS/ upper case the arguments
  283.     calls    getcm0    ,<argbuf,#setfil> ; parse the command
  284.     tst    r0            ; did it work?
  285.     bmi    20$            ; /63/ nope
  286.     tst    wasnul            ; /BBS/ were commands listed via "?"
  287.     bne    20$            ; /63/ ya
  288.     calls    getcm1    ,<argbuf,#setfil,r0> ; /63/ check for possible arg
  289.     tst    r0            ; /63/ well?
  290.     bmi    20$            ; /63/ bad arg..
  291.     jmp    @r1            ; /63/ dispatch
  292.  
  293.     command    setfil    ,ASCII        ,2    ,sf$asc
  294.     command    setfil    ,AUTOMATIC    ,2    ,sf$aut
  295.     command    setfil    ,BINARY        ,1    ,sf$bin
  296.     command    setfil    ,CREATE-SIZE    ,2    ,srt$cr    ,st1.01
  297.     command    setfil    ,CSI-PARSING    ,2    ,srt$cs    ,st1.02
  298.     command    setfil    ,DEC-MULTINATIONAL,1    ,sf$dec
  299.     command    setfil    ,FIXED        ,1    ,sf$bin
  300.     command    setfil    ,IMAGE        ,1    ,sf$bin
  301.     command    setfil    ,NAMING        ,2    ,sf$nam    ,st1.03
  302.     command    setfil    ,NOPROTECT    ,3    ,sf$sup
  303.     command    setfil    ,NOREPLACE    ,2    ,sf$nos    ; /62/
  304.     command    setfil    ,NOVOLUME-VERIFY,3    ,srt$nv    ; /62/
  305.     command    setfil    ,PROTECT    ,1    ,sf$nos
  306.     command    setfil    ,REPLACE    ,1    ,sf$sup    ; /62/
  307.     command    setfil    ,TEXT        ,2    ,sf$asc
  308.     command    setfil    ,TYPE        ,2    ,sf$typ
  309.     command    setfil    ,VOLUME-VERIFY    ,1    ,srt$vo    ; /62/
  310.     command    setfil    ,WILDCARDS    ,1    ,sf$wil    ,st1.13    ; /63/
  311.     command    setfil
  312.  
  313. sf$typ:    calls    getcm0    ,<argbuf,#setfil> ; /63/ recheck the table for type
  314.     tst    r0            ; did it work?
  315.     bmi    20$            ; /63/ no
  316.     tst    wasnul            ; /BBS/ were commands listed via "?"
  317.     bne    20$            ; /63/ ya
  318.     calls    getcm1    ,<argbuf,#setfil,r0> ; /63/ check for possible arg
  319.     tst    r0            ; /63/ well?
  320.     bmi    20$            ; /63/ bad arg..
  321.     jmp    @r1            ; /63/ dispatch
  322.  
  323. sf$asc:    mov    #text    ,$image        ; image_mode := false
  324.     clr    doauto            ; /BBS/ force it on
  325.     tst    infomsg            ; SET TT QUIET?
  326.     beq    10$            ; ya
  327.     wrtall    #st1.16            ; /63/ "ASCII text mode set"
  328.     br    10$
  329.  
  330. sf$bin:    mov    #binary    ,$image        ; image_mode := true
  331.     clr    doauto            ; /BBS/ force it on
  332.     tst    infomsg            ; SET TT QUIET?
  333.     beq    10$            ; ya
  334.     wrtall    #st1.17            ; /63/ "Binary mode set"
  335.     call    xbin            ; check parity and warn if needed
  336.     br    10$
  337.  
  338. sf$dec:    mov    #decnat    ,$image        ; /52/ added
  339.     clr    doauto            ; /BBS/ force it on
  340.     tst    infomsg            ; SET TT QUIET?
  341.     beq    10$            ; ya
  342.     wrtall    #st1.18            ; /63/ "DEC-Multinational mode set"
  343.     call    xbin            ; check parity and warn if needed
  344.     br    10$
  345.  
  346. sf$aut:    mov    sp    ,doauto        ; allow auto checking of attributes
  347.     mov    #text    ,$image        ; begin check with image_mode := false
  348.     tst    infomsg            ; SET TT QUIET?
  349.     beq    10$            ; ya
  350.     wrtall    #st1.19            ; /63/ "Auto ASCII/Binary mode set"
  351.     call    xbin            ; check parity and warn if needed
  352.     br    10$
  353.  
  354. sf$sup:    clr    filprot            ; overwrite an existing file
  355.     br    10$
  356.  
  357. sf$nos:    mov    sp    ,filprot    ; do not overwrite an existing file
  358. 10$:    clr    r0            ; /63/ no error
  359. 20$:    return                ; /63/
  360.  
  361. xbin:    tst    parity            ; /BBS/ set to none?
  362.     beq    10$            ; yes
  363.     wrtall    #st1.20            ; /63/ "Binary files will be prefixed"
  364.     br    10$            ; /63/
  365.  
  366. srt$cr:    calls    l$val    ,<argbuf>    ; /63/ yes, see if a good number
  367.     tst    r0            ; well?
  368.     bne    20$            ; /63/ ok
  369.     mov    r1    ,en$siz        ; yes, save it please  note r0=0 here
  370.     return                ; /63/
  371.  
  372. srt$vo:    mov    sp    ,rtvol        ; check for valid volume id
  373.     br    10$            ; /63/
  374.  
  375. srt$nv:    clr    rtvol            ; ignore volume id
  376.     br    10$            ; /63/
  377.  
  378. sf$nam:    calls    getcm0    ,<argbuf,#sfname> ; /63/ check the table for naming
  379.     tst    r0            ; /54/ did it work?
  380.     bmi    20$            ; /63/ no
  381.     tst    wasnul            ; /BBS/ were commands listed via "?"
  382.     bne    20$            ; /63/ ya
  383.     jmp    @r1            ; /63/ no, dispatch on it please
  384.  
  385.     command    sfname    ,CONVERTED    ,1    ,sfn$tr
  386.     command    sfname    ,FULL        ,1    ,sfn$fu
  387.     command    sfname    ,LOWER-CASE    ,1    ,sfn$lc
  388.     command    sfname    ,NOLOWER-CASE    ,1    ,sfn$uc
  389.     command    sfname
  390.  
  391. sfn$tr:    clr    rawfil            ; /54/ the default, always convert
  392.     br    10$            ; /63/ no error
  393.  
  394. sfn$fu:    mov    sp    ,rawfil        ; /54/ don't remove extra stuff, like
  395.     br    10$            ; /63/ node names and so on
  396.  
  397. sfn$uc:    clr    locase            ; /BBS/ the default, upper case only
  398.     br    10$            ; /63/ no error
  399.  
  400. sfn$lc:    mov    sp    ,locase        ; /BBS/ leave names to remote as typed
  401.     br    10$            ; /63/ no error
  402.  
  403. srt$cs:    calls    getcm0    ,<argbuf,#cstype> ; /63/ check the table for modes
  404.     tst    r0            ; did it work?
  405.     bmi    20$            ; /63/ no
  406.     tst    wasnul            ; were commands listed via "?"
  407.     bne    20$            ; /63/ ya
  408.     jmp    @r1            ; /63/ no, dispatch on it please
  409.  
  410.     command    cstype    ,EMULATED    ,1    ,scs$em
  411.     command    cstype    ,REAL        ,1    ,scs$re
  412.     command    cstype
  413.  
  414. scs$re:    clr    csi.fake        ; the default, use the real .csipsc
  415.     br    10$            ; /63/ no error
  416.  
  417. scs$em:    mov    sp    ,csi.fake    ; fake csispc comma delimit processing
  418.     br    10$            ; /63/ no error
  419.  
  420. sf$wil:    upcase    argbuf            ; /63/ all new.. upper case the arg
  421.     calls    getcm0    ,<argbuf,#wldlst> ; which option was given?
  422.     tst    r0            ; find one?
  423.     bmi    20$            ; no
  424.     tst    wasnul            ; were commands listed via "?"
  425.     bne    20$            ; ya
  426.     jmp    @r1            ; dispatch
  427.  
  428.     command    wldlst    ,EXPLICIT,1    ,wld$ex
  429.     command    wldlst    ,IMPLICIT,1    ,wld$im
  430.     command    wldlst
  431.  
  432. wld$ex:    clr    dowild            ; SET WILD EXPLICIT
  433.     br    10$
  434.  
  435. wld$im:    mov    sp    ,dowild        ; SET WILD IMPLICIT
  436.     br    10$
  437.  
  438.     .dsabl    lsb
  439.  
  440.  
  441.     .sbttl    SET BINARY-TYPE
  442.  
  443. set$bi::save    <r1,r2,r3>
  444.     strlen    bintyp            ; /BBS/ any room left in list?
  445.     cmp    r0    ,#120.        ; /BBS/ max of 31. entries possible
  446.     ble    10$            ; /BBS/ if <= 30. then it's modifiable
  447.     mov    #er$bnl    ,r0        ; /BBS/ say the list is full
  448.     br    70$            ; /BBS/ no room
  449. 10$:    mov    #spare1    ,r3        ; /63/ pointer to some work space
  450.     clrb    @r3            ; ensure .asciz
  451.     upcase    argbuf            ; /BBS/ upper case remaining args
  452.     mov    argbuf    ,r2        ; get the argbuf pointer now
  453.     cmpb    @r2    ,#'.        ; is there a leading dot?
  454.     beq    20$            ; yes
  455.     movb    #'.    ,(r3)+        ; no, insert one please
  456.     clrb    @r3            ; .asciz please
  457. 20$:    mov    #spare1    ,r3        ; /63/ refresh pointer
  458.     strcat    r3    ,r2        ; concatenate the file type now
  459.     strlen    r3            ; get the length
  460.     mov    #4    ,r1        ; /BBS/ must be 4
  461.     sub    r0    ,r1        ; /BBS/ chars or less
  462.     beq    50$            ; /BBS/ it's exactly 4
  463.     bgt    30$            ; /BBS/ it's less than 4
  464.     mov    #er$one    ,r0        ; /BBS/ illegal file type length
  465.     br    70$            ; error exit
  466.  
  467. 30$:    mov    r3    ,r2        ; /BBS/ save copy of pointer
  468.     add    r0    ,r2        ; /BBS/ point to last char
  469. 40$:    movb    #space    ,(r2)+        ; /BBS/ space pad file extent
  470.     sob    r1    ,40$        ; /BBS/ until total length is 4
  471.     clrb    @r2            ; /BBS/ null terminate padded string
  472. 50$:    strcat    bintyp    ,#spare1    ; /63/ concat new one onto the list
  473.     tst    infomsg            ; SET TT QUIET?
  474.     beq    60$            ; ya
  475.     wrtall    #spare1            ; /63/ say what was
  476.     wrtall    #st1.21            ; /63/ " appended to BINARY-TYPE list"
  477. 60$:    clr    r0            ; success
  478. 70$:    unsave    <r3,r2,r1>
  479.     return
  480.  
  481.  
  482.     .sbttl    ASSIGN, CWD, HOME    ; /62/ moved this here..
  483.     .enabl    lsb            ; /BBS/ all new
  484.  
  485. c$assign::scan    #space    ,argbuf        ; look for a space delimiter
  486.     tst    r0            ; find one?
  487.     beq    10$            ; no delimiter = no good..
  488.     add    argbuf    ,r0        ; point one byte past the delimiter
  489.     clrb    -(r0)            ; bump back and hose it
  490.     tstb    (r0)+            ; point at first char after delimiter
  491.     bicb    #40    ,@r0        ; make sure it's upper case
  492.     cmpb    (r0)+    ,#'D        ; iz it a "D" ?
  493.     bne    10$            ; nope..
  494.     bicb    #40    ,@r0        ; make sure it's upper case
  495.     cmpb    (r0)+    ,#'K        ; got a "K" here?
  496.     bne    10$            ; nope
  497.     tstb    @r0            ; end of the line?
  498.     beq    c$cwd            ; ya, it's "DK"    (no colon)
  499.     cmpb    (r0)+    ,#':        ; no, is it "DK:" ?  (with colon)
  500.     bne    10$            ; no, so wutever it is, it's no good
  501.     tstb    @r0            ; anything else there?
  502.     beq    c$cwd            ; no, it's ok
  503. 10$:    mov    #er$ass    ,r0        ; ya, thus it's a bad assign
  504.     br    60$            ; goto error handler
  505.  
  506. c$cwd::    strlen    argbuf            ; get length of argument
  507.     cmp    r0    ,#4        ; /62/ a possibly legal name?
  508.     ble    30$            ; /62/ ya
  509. 20$:    mov    #er$dna    ,r0        ; /63/ no, name is no good
  510.     br    60$            ; goto error handler
  511.  
  512. 30$:    tstb    @argbuf            ; /63/ did user include where to go?
  513.     bne    40$            ; /63/ yes
  514.     strcpy    argbuf    ,#dkname    ; /63/ if no dev specified, then HOME
  515.     strlen    argbuf            ; /63/ get length of home dir's name
  516. 40$:    mov    r0    ,r1        ; /63/ save copy of length
  517.     add    argbuf    ,r0        ; /62/ point to end of string in buff
  518.     cmpb    -(r0)    ,#':        ; /62/ last byte a colon?
  519.     beq    50$            ; ya
  520.     cmp    r1    ,#3        ; /63/ if no end colon max len is 3 ch
  521.     bhi    20$            ; /63/ it's too long
  522.     inc    r0            ; /62/ no, goto where colon has to be
  523.     movb    #':    ,(r0)+        ; /62/ insert colon after device name
  524.     clrb    (r0)            ; /62/ re-terminate..
  525.  
  526. 50$:    upcase    argbuf            ; ensure device name is upper case
  527.     calls    fparse,<argbuf,#spare1>    ; check dev using handy buff
  528.     tst    r0            ; ok?
  529.     beq    70$            ; ya
  530. 60$:    direrr    r0            ; say what went wrong
  531.     br    80$
  532.  
  533. 70$:    copyz    #spare1    ,#defdir,#5    ; /62/ modify default dir
  534.     wrtall    #st1.12            ; /63/ stick "DK --> " in it..
  535.     wrtall    #defdir            ; /63/ add the directory name in
  536.     .newline            ; /63/
  537. 80$:    clr    r0            ; any error in above already handled
  538.     return
  539.  
  540.     .dsabl    lsb
  541.  
  542.  
  543.     .sbttl    SET HOME        ; /BBS/ enhanced..
  544.  
  545. set$ho::upcase    argbuf            ; upper case the arg
  546.     strlen    argbuf            ; and get its length
  547.     add    argbuf    ,r0        ; get pointer to end of string in buff
  548.     cmpb    -1(r0)    ,#':        ; last byte a colon?
  549.     beq    10$            ; ya
  550.     movb    #':    ,(r0)+        ; and insert colon after device name
  551.     clrb    @r0            ; and re-terminate..
  552. 10$:    sub    argbuf    ,r0        ; get actual length of it all now
  553.     cmp    r0    ,#4        ; is it too much?
  554.     ble    20$            ; no
  555.     mov    #er$iln    ,r0        ; bad device name
  556.     return
  557.  
  558. 20$:    copyz    argbuf    ,#dkname,#5    ; /62/ modify the home dir
  559.     clr    r0            ; no error
  560.     return
  561.  
  562.  
  563.     .sbttl    SET SEND, RECEIVE
  564.     .enabl    lsb
  565.  
  566. set$rc::mov    #reclst    ,r3        ; point to the RECEIVE command table
  567.     br    10$
  568. set$sn::mov    #senlst    ,r3        ; point to the SEND command table
  569. 10$:    upcase    argbuf            ; /BBS/ upper case the arguments
  570.     calls    getcm0    ,<argbuf,r3>    ; find out which option was given
  571.     tst    r0            ; did we find the option?
  572.     bmi    30$            ; no
  573.     tst    wasnul            ; /BBS/ were commands listed via "?"
  574.     bne    30$            ; /BBS/ ya
  575.     calls    getcm1    ,<argbuf,r3,r0>    ; yes, look for value clause now
  576.     tst    r0            ; find it (or read it)?
  577.     bmi    30$            ; no
  578.     jmp    @r1            ; /63/ ya, dispatch
  579.  
  580.     command reclst    ,PACKET-LENGTH    ,1    ,str$pl    ,st1.04
  581.     command reclst    ,START-OF-PACKET,1    ,str$so    ,st1.05
  582.     command    reclst    ,TIME-OUT    ,1    ,str$ti    ,st1.06
  583.     command reclst
  584.  
  585.     command    senlst    ,NOXON        ,1    ,sts$nx
  586.     command    senlst    ,PACKET-LENGTH    ,3    ,sts$pl    ,st1.04
  587.     command    senlst    ,PADCHARACTER    ,4    ,sts$pd    ,st1.07
  588.     command    senlst    ,PADDING    ,4    ,sts$pn    ,st1.08
  589.     command senlst    ,START-OF-PACKET,1    ,sts$so    ,st1.05
  590.     command    senlst    ,TIME-OUT    ,1    ,sts$ti    ,st1.06
  591.     command    senlst    ,XON        ,1    ,sts$xo
  592.     command    senlst
  593.  
  594. sts$so:    call    setsop            ; check for valid value
  595.     tst    r0            ; well?
  596.     bne    30$            ; no good..
  597.     mov    r1    ,sensop        ; ok, save new SEND start of packet
  598.     return
  599.  
  600. str$so:    call    setsop            ; check for valid value
  601.     tst    r0            ; well?
  602.     bne    30$            ; no good..
  603.     mov    r1    ,recsop        ; ok, save new REC start of packet
  604.     return
  605.  
  606. set$so::call    setsop            ; check for valid value
  607.     tst    r0            ; well?
  608.     bne    30$            ; no good..
  609.     mov    r1    ,sensop        ; ok, save new SEND start of packet
  610.     mov    r1    ,recsop        ; ditto for REC
  611.     return
  612.  
  613. setsop:    calls    octval    ,<argbuf>    ; get the octal value
  614.     tst    r0            ; check for errors
  615.     bne    20$            ; exit if so
  616.     tst    r1            ; greater than zero?
  617.     ble    20$            ; no, exit
  618.     cmp    r1    ,#36        ; <= 36 ?
  619.     ble    30$            ; /BBS/ ya
  620. 20$:    mov    #er$oct    ,r0        ; /BBS/ no, must be 1 to 36 octal
  621. 30$:    return
  622.  
  623. str$ti:    call    settim            ; /62/ get and check value
  624.     tst    r0            ; /62/ ok?
  625.     bne    30$            ; /62/ no
  626.     mov    r1    ,rectim        ; /62/ ya, save it
  627.     return                ; /62/
  628.  
  629. sts$ti:    call    settim            ; /62/ get and check value
  630.     tst    r0            ; /62/ ok?
  631.     bne    30$            ; /62/ no
  632.     mov    r1    ,sentim        ; /62/ ya, save it
  633.     return                ; /62/
  634.  
  635. settim:    calls    l$val    ,<argbuf>    ; convert ascii digits to an integer
  636.     tst    r0            ; well?
  637.     bne    40$            ; no, bad value
  638.     cmp    r1    ,#maxpak    ; /62/ largest possible value..
  639.     blos    30$            ; /63/ it's ok, return
  640. 40$:    mov    #er$tim    ,r0        ; /BBS/ must be between 0 and 94.
  641.     return
  642.  
  643. sts$xo:    mov    sp    ,prexon        ; /53/ prefix packets with XON
  644.     br    50$            ; /63/ no error possible
  645.  
  646. sts$nx:    clr    prexon            ; /53/ don't prefix with XON
  647. 50$:    clr    r0            ; /63/ no error possible
  648.     return
  649.  
  650. sts$pl:    calls    l$val    ,<argbuf>    ; get the argument now
  651.     tst    r0            ; did it work?
  652.     bne    90$            ; /62/ no
  653.     cmp    r1    ,#20.        ; minimum of twenty
  654.     blt    70$            ; /62/ too small, go say so
  655.     cmp    r1    ,#maxpak    ; /62/ how long is it to be?
  656.     ble    60$            ; /62/ within "normal" range
  657.     call    st$.pl            ; /62/ do long-packet tests..
  658. 60$:    mov    r1    ,senlen        ; /62/ do the SET
  659.     br    50$            ; /62/ that's it..
  660.  
  661. str$pl:    calls    l$val    ,<argbuf>    ; /43/ get the user's size
  662.     tst    r0            ; /43/ successful?
  663.     bne    90$            ; /63/ no
  664.     cmp    r1    ,#maxpak    ; /43/ huge packets? /BBS/ wuz 96.
  665.     bgt    str.pl            ; /43/ yes
  666.     cmp    r1    ,#20.        ; /BBS/ too small?
  667.     blt    70$            ; /62/ ya..
  668.     movb    r1    ,senpar+p.spsiz    ; /43/ set up it
  669.     clrb    senpar+p.mxl1        ; /62/ and hose any possible
  670.     clrb    senpar+p.mxl2        ; /62/ previous long packet length
  671.     clr    reclng            ; /43/ clear this
  672.     clr    dolong            ; /BBS/ and this
  673.     br    50$            ; /62/ that's it..
  674. 70$:    mov    #er$txp    ,r0        ; /62/ minimum length is 20. bytes
  675.     return                ; /62/
  676.  
  677. str.pl:    call    st$.pl            ; /62/ shared with sts$pl
  678.     mov    r1    ,reclng        ; /62/ setup this parameter
  679.     mov    sp    ,dolong        ; /62/ ensure long packets are on
  680.     clr    r0            ; /43/ now setup for divide by 95
  681.     div    #95.    ,r0        ; /43/ break length into two bytes
  682.     movb    r0    ,senpar+p.mxl1    ; /62/ and insert it
  683.     movb    r1    ,senpar+p.mxl2    ; /62/ into parameter vector
  684.     br    50$            ; /63/ success
  685.  
  686. st$.pl:    cmp    r1    ,#maxlng    ; /43/ will this fit within the
  687.     blos    80$            ; /63/ Kermit-11 internal buffers?
  688.     mov    #maxlng    ,r1        ; /43/ no, reset to max we allow
  689.     wrtall    #st1.22            ; /63/ "Packet length truncated .."
  690.     mov    r1    ,r0        ; put length where L10266 needs it
  691.     call    L10266            ; /BBS/ write r0 to TT
  692.     wrtall    #st1.23            ; /63/ ". bytes"
  693. 80$:    cmpb    setchkt    ,#'3        ; /62/ CRC block checking in use?
  694.     beq    90$            ; /BBS/ ya
  695.     tst    infomsg            ; SET TT QUIET?
  696.     beq    90$            ; ya..
  697.     wrtall    #st1.24            ; /63/ "Remember to SET BLO 3 .."
  698. 90$:    return
  699.  
  700.     .dsabl    lsb
  701.  
  702.  
  703.     .sbttl    SET END-OF-LINE
  704.  
  705. set$eo::call    setsop            ; /BBS/ octal value must be 1..36
  706.     tst    r0            ; did it work?
  707.     bne    10$            ; no
  708.     movb    r1    ,senpar+p.eol    ; /62/ yes, stuff it in there please
  709. 10$:    return
  710.  
  711.  
  712.     .sbttl    SET PAUSE
  713.  
  714. set$ps::calls    l$val    ,<argbuf>    ; get the value
  715.     tst    r0            ; well?
  716.     bne    10$            ; /63/ it's no good
  717.     mov    r1    ,pauset        ; ok value, save it
  718. 10$:    return
  719.  
  720.  
  721.     .sbttl    SET DELAY
  722.  
  723. set$dl::calls    l$val    ,<argbuf>    ; get the value
  724.     tst    r0            ; well?
  725.     bne    10$            ; /63/ it's no good
  726.     mov    r1    ,sendly        ; ok value, save it
  727. 10$:    return
  728.  
  729.  
  730.     .sbttl    SET SEND PADDING, PADCHARACTER    ; /57/ Brian Nelson 17-Jul-87
  731.  
  732. sts$pd:    calls    octval    ,<argbuf>    ; get the octal value now
  733.     tst    r0            ; did it work?
  734.     bne    10$            ; /63/ no
  735.     movb    r1    ,senpar+p.padc    ; /62/ yes, SET it
  736. 10$:    return
  737.  
  738. sts$pn:    calls    l$val    ,<argbuf>    ; get the value
  739.     tst    r0            ; well?
  740.     bne    10$            ; /63/ it's no good
  741.     mov    r1    ,senpar+p.npad    ; /62/ ok, stuff number of chars here
  742. 10$:    return
  743.  
  744.  
  745.     .sbttl    SET ESCAPE
  746.  
  747. set$es::call    setsop            ; /BBS/ get the octal value now
  748.     tst    r0            ; did it work?
  749.     bne    10$            ; /BBS/ no
  750.     mov    r1    ,conesc        ; ya, store it
  751. 10$:    return
  752.  
  753.  
  754.     .sbttl    SET ATTRIBUTES        ; /63/ add individual attributes..
  755.     .enabl    lsb            ; /63/
  756.  
  757. set$at::upcase    argbuf            ; ensure arg(s) are upper case
  758.     calls    getcm0    ,<argbuf,#attr>    ; find out which option was given
  759.     tst    r0            ; did it work?
  760.     bmi    s.enx            ; /63/ nope
  761.     tst    wasnul            ; were commands listed via "?"
  762.     bne    s.enx            ; /63/ ya, so don't set to last shown
  763.     calls    getcm1    ,<argbuf,#attr,r0> ; check for possible arg to command
  764.     tst    r0            ; well?
  765.     bmi    s.enx            ; /63/ bad arg..
  766.     jmp    @r1            ; dispatch
  767.  
  768.     command    attr    ,ALL        ,1  ,sat$all    ,st1.09
  769.     command    attr    ,DATE        ,1  ,sat$date    ,st1.09
  770.     command    attr    ,EXACT-LENGTH    ,1  ,sat$exact    ,st1.09
  771.     command    attr    ,LENGTH        ,1  ,sat$len    ,st1.09
  772.     command    attr    ,OFF        ,2  ,sat$off
  773.     command    attr    ,ON        ,2  ,sat$on
  774.     command    attr    ,PROTECTION    ,1  ,sat$prot    ,st1.09
  775.     command    attr    ,SYSTEM-ID    ,9. ,sat$id    ,st1.09
  776.     command    attr    ,SYSTEM-INFO    ,9. ,sat$info    ,st1.09
  777.     command    attr    ,TYPE        ,1  ,sat$type    ,st1.09
  778.     command    attr
  779.  
  780. sat$al:    mov    #at.all    ,r2        ; all attributes
  781.     br    s.ofon
  782.  
  783. sat$da:    mov    #at.cdt    ,r2        ; create date
  784.     br    s.ofon
  785.  
  786. sat$ex:    mov    #at.xle    ,r2        ; exact length in bytes
  787.     br    s.ofon
  788.  
  789. sat$le:    mov    #at.len    ,r2        ; length
  790.     br    s.ofon
  791.  
  792. sat$of:    bic    #at.on    ,doattr        ; set them off
  793.     br    s.end            ; success
  794.  
  795. sat$on:    bis    #at.on    ,doattr        ; set them on
  796.     br    s.end            ; success
  797.  
  798. sat$pr:    mov    #at.pro    ,r2        ; file protection
  799.     br    s.ofon
  800.  
  801. sat$id:    mov    #at.sys    ,r2        ; system ID
  802.     br    s.ofon
  803.  
  804. sat$in:    mov    #at.inf    ,r2        ; DEC-specific file type
  805.     br    s.ofon
  806.  
  807. sat$ty:    mov    #at.typ    ,r2        ; file type
  808.     .br    s.ofon            ; /63/ fall through to s.ofon
  809.  
  810. s.ofon:    calls    getcm0    ,<argbuf,#offon> ; yes, check what to do now..
  811.     tst    r0            ; did it work?
  812.     bmi    s.enx            ; no, return with error in r0
  813.     tst    wasnul            ; were commands listed via "?"
  814.     bne    s.enx            ; ya
  815.     jmp    @r1            ; /63/ dispatch on it please
  816.  
  817.     command    offon    ,OFF    ,2    ,s.of
  818.     command    offon    ,ON    ,2    ,s.on
  819.     command    offon
  820.  
  821. s.of:    bic    r2    ,doattr
  822.     br    s.end            ; /83/
  823.  
  824. s.on:    bis    r2    ,doattr
  825.     br    s.end            ; /63/
  826.  
  827. st$nat::bic    #at.on    ,doattr        ; don't do attributes
  828. s.end:    clr    r0            ; no error
  829. s.enx:    return
  830.  
  831.  
  832.     .sbttl    SET LONG-PACKETS
  833.  
  834. set$lp::upcase    argbuf            ; /BBS/ ensure args are upper case
  835.     calls    getcm0    ,<argbuf,#onoff> ; /42/ find out which option given
  836.     tst    r0            ; /42/ did we find one
  837.     bmi    st$ox            ; /63/ no
  838.     tst    wasnul            ; /BBS/ were commands listed via "?"
  839.     bne    st$ox            ; /63/ ya
  840.     jsr    pc    ,@r1        ; /42/ dispatch now
  841.     mov    r0    ,dolong        ; /42/ save result
  842.     beq    st$nlp            ; /63/ turning it off
  843.     mov    argbuf    ,r0        ; /BBS/ turning it on, copy address
  844.     movb    #'3    ,(r0)+        ; /BBS/ SET BLO 3
  845.     clrb    @r0            ; /BBS/ null terminate
  846.     call    set$bl            ; /BBS/ do the set
  847.     mov    #maxlng    ,r1        ; /BBS/ load max possible packet size
  848.     mov    r1    ,senlen        ; /62/ SET SEN PAC too..
  849.     jmp    str.pl            ; /63/ special entry point for str$pl
  850.  
  851.     command    onoff    ,OFF    ,2    ,st$of ; /63/ clearing r0 turns it off
  852.     command    onoff    ,ON    ,2    ,st$on
  853.     command    onoff
  854.  
  855. st$on:    mov    sp    ,r0        ; /63/ set it on
  856.     return
  857.  
  858. st$nlp::clr    dolong            ; don't do long packets
  859.     clr    senlng            ; /BBS/ for short long packet fix
  860.     cmp    senlen    ,#maxpak    ; /62/ is send length >94. ?
  861.     ble    st$of            ; /63/ no, don't modify SET SEN PAC
  862.     mov    #maxpak    ,senlen        ; /62/ ya, SET SEN PAC 94. here too..
  863. st$of:    clr    r0            ; /62/ no error
  864. st$ox:    return
  865.  
  866.  
  867.     .sbttl    SET PROMPT
  868.  
  869. set$pr::call    skipit            ; /BBS/ ignore comma in argument
  870.     mov    argbuf    ,r1        ; /63/ pointer to start of string
  871.     cmpb    (r1)    ,#42        ; /63/ is first byte a " ?
  872.     beq    10$            ; /63/ yes
  873.     cmpb    (r1)    ,#47        ; /63/ or a ' ?
  874.     bne    20$            ; /63/ nope..
  875. 10$:    strlen    argbuf            ; /63/ length of string
  876.     add    argbuf    ,r0        ; /63/ pointer to end of it
  877.     cmpb    -(r0)    ,(r1)        ; /63/ does last byte match the first?
  878.     bne    20$            ; /63/ nope..
  879.     inc    r1            ; /63/ ya, skip past leading quote
  880.     clrb    (r0)            ; /63/ and hose trailing quote
  881. 20$:    copyz    r1    ,#prompt ,#31.    ; write new prompt string
  882.     clr    r0            ; no error possible
  883.     return
  884.  
  885.  
  886.     .sbttl    SET SEED, RANDOM
  887.     .enabl    lsb            ; /63/
  888.  
  889. set$se::calls    l$val    ,<argbuf>    ; convert ascii arg to integer
  890.     tst    r0            ; well?
  891.     bne    10$            ; /63/ no, bad value
  892.     mov    r1    ,seed        ; save it as the random number seed
  893. 10$:    return
  894.  
  895. set$ra::upcase    argbuf            ; /BBS/ upper case the argument
  896.     calls    getcm0    ,<argbuf,#ranlst> ; find out which option was given
  897.     tst    r0            ; did we find one?
  898.     bmi    30$            ; /63/ no
  899.     tst    wasnul            ; /BBS/ were commands listed via "?"
  900.     bne    30$            ; /63/ ya
  901.     jmp    @r1            ; /63/ dispatch
  902.  
  903.     command    ranlst    ,OFF    ,2    ,sra$of
  904.     command    ranlst    ,ON    ,2    ,sra$on
  905.     command    ranlst
  906.  
  907. sra$of:    clr    ranerr            ; /62/ turn it off
  908.     br    20$            ; /63/
  909.  
  910. sra$on:    mov    sp    ,ranerr        ; /62/ turn it on
  911. 20$:    clr    r0            ; /63/ no error
  912. 30$:    return                ; /63/
  913.  
  914.     .dsabl    lsb            ; /63/
  915.  
  916.  
  917.     .sbttl    SET REPEAT
  918.     .enabl    lsb            ; /63/
  919.  
  920. set$rp::upcase    argbuf            ; /BBS/ upper case the argument
  921.     calls    getcm0    ,<argbuf,#relst> ; which option was given?
  922.     tst    r0            ; find one?
  923.     bmi    20$            ; no
  924.     tst    wasnul            ; /BBS/ were commands listed via "?"
  925.     bne    20$            ; /BBS/ ya
  926.     jmp    @r1            ; /63/ dispatch
  927.  
  928.     command    relst    ,OFF    ,2    ,rep$of
  929.     command    relst    ,ON    ,2    ,rep$on
  930.     command    relst
  931.  
  932. rep$of::clr    setrpt            ; /63/ SET NOREPEAT-QUOTING
  933.     br    10$            ; /63/
  934.  
  935. rep$on:    mov    sp    ,setrpt        ; /62/ turn it on
  936. 10$:    clr    r0            ; no error
  937. 20$:    return
  938.  
  939.     .dsabl    lsb            ; /63/
  940.  
  941.  
  942.     .sbttl    SET TERMINAL
  943.     .enabl    lsb            ; /63/
  944.  
  945. set$tt::upcase    argbuf            ; /BBS/ upper case the args
  946.     calls    getcm0    ,<argbuf,#ttlst> ; which option was given?
  947.     tst    r0            ; find one?
  948.     bmi    30$            ; no
  949.     tst    wasnul            ; /BBS/ were commands listed via "?"
  950.     bne    30$            ; /BBS/ ya
  951.     jmp    @r1            ; /E64/  dispatch
  952.  
  953.     command    ttlst    ,NOQUIET,3    ,svt$nq
  954.     command    ttlst    ,NOSCOPE,3    ,svt$ns
  955.     command    ttlst    ,QUIET    ,1    ,svt$qu
  956.     command    ttlst    ,SCOPE    ,1    ,svt$vt
  957.     command    ttlst    ,TTY    ,1    ,svt$tt
  958.     command    ttlst    ,VT100    ,3    ,svt$vt
  959.     command    ttlst    ,VT101    ,3    ,svt$vt
  960.     command    ttlst    ,VT102    ,3    ,svt$vt
  961.     command    ttlst    ,VT200    ,3    ,svt$22
  962.     command    ttlst    ,VT220    ,3    ,svt$22
  963.     command    ttlst
  964.  
  965. svt$ns:    mov    #noscope,r0        ; make it NOSCOPE (printing terminal)
  966.     br    10$
  967. svt$tt:    mov    #tty    ,r0        ; make it TTY (dumb tube terminal)
  968. 10$:    mov    r0    ,vttype        ; save the term type
  969.     clr    con8bit            ; neither of these are 8-bit devices
  970.     br    20$            ; /63/
  971.  
  972. svt$vt:    mov    #vt100    ,vttype        ; make it a VT-100
  973.     clr    con8bit            ; which isn't 8-bit either..
  974.     br    20$            ; /63/
  975.  
  976. svt$22:    mov    #vt200    ,vttype        ; make it a VT-220
  977.     mov    sp    ,con8bit    ; /BBS/ for the CONNECT mode..
  978.     br    20$            ; /63/
  979.  
  980. svt$qu:    clr    qu.ini            ; /BBS/ copy for after init/^c abort
  981.     clr    infomsg            ; /41/ disallow full info messages
  982.     br    20$            ; /63/
  983.  
  984. svt$nq:    mov    sp    ,qu.ini        ; /BBS/ copy for after init/^c abort
  985.     mov    sp    ,infomsg    ; /41/ allow full info messages
  986.     tst    sy.ini            ; /BBS/ is init file running?
  987.     beq    20$            ; /BBS/ no
  988.     .newline            ; /BBS/ ya, get a fresh line
  989. 20$:    clr    r0            ; success
  990. 30$:    return
  991.  
  992.     .dsabl    lsb            ; /63/
  993.  
  994.  
  995.     .sbttl    Clear a VT-100's screen    ; /62/ moved this here..
  996.     .enabl    lsb
  997.  
  998. c$cls::    movb    #'l!40    ,nrm.rev    ; set for normal video
  999.     br    10$
  1000. c$clx::    movb    #'h!40    ,nrm.rev    ; set for reverse video
  1001. 10$:    wrtall    #clstxt            ; clean up the screen
  1002.     clr    r0            ; /62/
  1003.     return
  1004.  
  1005.     .save
  1006.     .psect    $rwdata    ,rw,d,lcl,rel,con
  1007. clstxt:    .ascii    <esc>"<"    ; ANSI mode from VT-52
  1008.     .ascii    <esc>"[?1l"    ; reset cursor key application mode
  1009.     .ascii    <esc>"[?3l"    ; reset to 80 cols
  1010.     .ascii    <esc>"[?4l"    ; reset to jump scroll
  1011.     .ascii    <esc>"[?5"    ; prefix for normal/reverse video
  1012. nrm.rev:.byte    0        ; set to normal/reverse screen as desired
  1013.     .ascii    <esc>"[?6l"    ; reset to cursor origin mode
  1014.     .ascii    <esc>"[?7h"    ; set auto wraparound mode
  1015.     .ascii    <esc>"[?8h"    ; set auto repeat mode
  1016.     .ascii    <esc>"(B"    ; designate ASCII character set as G0
  1017.     .ascii    <ctrl$o>    ; reset to normal text from graphics..
  1018.     .ascii    <esc>"[1;24r"    ; reset scrolling region to entire screen
  1019.     .ascii    <esc>"[J"    ; erase from cursor to end (here, everything)
  1020.     .ascii    <esc>"[m"    ; reset all attributes to normal
  1021.     .ascii    <esc>"[q"    ; turn off all leds
  1022.     .ascii    <esc>"[v"    ; make cursor visible
  1023.     .ascii    <esc>">"    ; restore keypad numeric mode
  1024.     .byte    0        ; terminator
  1025.     .even
  1026.     .restore
  1027.  
  1028.     .dsabl    lsb
  1029.  
  1030.  
  1031.     .sbttl    SET CONSOLE
  1032.     .enabl    lsb            ; /62/
  1033.  
  1034. set$co::upcase    argbuf            ; /BBS/ upper case the args
  1035.     calls    getcm0    ,<argbuf,#colst>  ; which option was given?
  1036.     tst    r0            ; find one?
  1037.     bmi    20$            ; /63/ no
  1038.     tst    wasnul            ; /BBS/ were commands listed via "?"
  1039.     bne    20$            ; /63/ ya
  1040.     calls    getcm1    ,<argbuf,#colst,r0> ; /63/ check for possible arg
  1041.     tst    r0            ; /63/ well?
  1042.     bmi    20$            ; /63/ bad arg..
  1043.     jmp    @r1            ; /63/ dispatch
  1044.  
  1045.     command    colst    ,7-BIT    ,1    ,sco$7
  1046.     command    colst    ,8-BIT    ,1    ,sco$8
  1047.     command    colst    ,BREAK    ,1    ,sco$br    ,st1.10
  1048.     command    colst    ,MILNET    ,1    ,sco$mi
  1049.     command    colst    ,NOMILNET,1    ,sco$no
  1050.     command    colst    ,PRIORITY,1    ,sco$pr    ,st1.04
  1051.     command    colst
  1052.  
  1053. sco$7:    clr    con8bit            ; goto the 7-bit mode
  1054.     br    10$            ; /62/
  1055.  
  1056. sco$8:    mov    sp    ,con8bit    ; use all 8 bits..
  1057.     br    10$            ; /62/
  1058.  
  1059. sco$no:    clr    milnet            ; /BBS/ don't send a couple ^Qs
  1060.     br    10$            ; /62/
  1061.  
  1062. sco$mi:    mov    sp    ,milnet        ; /BBS/ send a couple ^Qs on CONNECT
  1063. 10$:    clr    r0            ; no error
  1064. 20$:    return
  1065.  
  1066. sco$br:    calls    getcm0    ,<argbuf,#brklst> ; /63/ check the table for length
  1067.     tst    r0            ; /62/ did it work?
  1068.     bmi    20$            ; /63/ no
  1069.     tst    wasnul            ; /62/ were commands listed via "?"
  1070.     bne    20$            ; /63/ ya
  1071.     jmp    @r1            ; /63/ no, dispatch it please
  1072.  
  1073.     command    brklst    ,LONG    ,1  ,sbk$lo    ; /62/
  1074.     command    brklst    ,SHORT    ,1  ,sbk$sh    ; /62/
  1075.     command    brklst                ; /62/
  1076.  
  1077. sbk$sh:    mov    #17.    ,r3        ; /62/ assume 60Hz
  1078.     cmp    clkflg    ,#50.        ; /62/ is it 50Hz?
  1079.     bne    30$            ; /62/ no
  1080.     mov    #14.    ,r3        ; /62/ ya, this is .280 sec at 50Hz
  1081.     br    30$            ; /62/ go save the appropriate value
  1082.  
  1083. sbk$lo:    mov    #3    ,r3        ; /62/ 3 seconds
  1084.     mul    clkflg    ,r3        ; /62/ accommodate clock rate
  1085. 30$:    mov    r3    ,break+2    ; /62/ store the value
  1086.     br    10$            ; /62/ success
  1087.  
  1088. sco$pr:    tst    tsxsav            ; /62/ running under TSX?
  1089.     bne    40$            ; /62/ ya
  1090.     mov    #er$tsx    ,r0        ; /62/ no
  1091.     return                ; /63/
  1092. 40$:    mov    argbuf    ,argpnt        ; /63/ point to mow current arg
  1093.     jmp    scl$3            ; /62/ go set the priority
  1094.  
  1095.     .dsabl    lsb            ; /62/
  1096.  
  1097.  
  1098.     .sbttl    SET LD            ; /BBS/ added entire routine
  1099.  
  1100. set$ld::tst    tsxsav            ; running under TSX?
  1101.     bne    10$            ; ya
  1102.     mov    #er$tsx    ,r0        ; no
  1103.     br    20$
  1104. 10$:    cmp    tsxver    ,#630.        ; needs TSX V6.30 or above
  1105.     bhis    30$            ; got it
  1106.     mov    #er$v63    ,r0        ; don't have it, say so
  1107. 20$:    return                ; /63/
  1108.  
  1109. 30$:    upcase    argbuf            ; /BBS/ upper case command args
  1110.     calls    getcm0    ,<argbuf,#ldlst> ; which option was given?
  1111.     tst    r0            ; find one?
  1112.     bmi    20$            ; no
  1113.     tst    wasnul            ; were commands listed via "?"
  1114.     bne    20$            ; ya
  1115.     jmp    @r1            ; /63/ dispatch
  1116.  
  1117.     command    ldlst    ,EMPTY    ,1    ,sld$1
  1118.     command    ldlst
  1119.  
  1120. sld$1:    clr    -(sp)            ; /62/ .word 0
  1121.     mov    #56405    ,-(sp)        ; /62/ .byte 5,135
  1122.     mov    sp    ,r0        ; pointer to it
  1123.     emt    375            ; dismount all logical disks
  1124.     bcc    40$            ; ok
  1125.     mov    #ld$bsy    ,r0        ; chan(s) open to a logical disk
  1126.     br    50$            ; if error, don't reassign DK
  1127. 40$:    strcpy    #defdir    ,#dkname    ; /62/ go home if successful
  1128.     clr    r0            ; success
  1129. 50$:    cmp    (sp)+    ,(sp)+        ; pop work area
  1130.     return
  1131.  
  1132.  
  1133.     .sbttl    SET VLSWCH        ; /BBS/ all new..
  1134.     .enabl    lsb            ; /63/
  1135.  
  1136. set$vl::tst    tsxsav            ; running under TSX?
  1137.     bne    10$            ; ya
  1138.     mov    #er$tsx    ,r0        ; no, works under TSX only
  1139.     br    30$
  1140. 10$:    upcase    argbuf            ; upper case command arguments
  1141.     calls    getcm0    ,<argbuf,#vlopts> ; which option was given?
  1142.     tst    r0            ; find one?
  1143.     bmi    30$            ; no
  1144.     tst    wasnul            ; were commands listed via "?"
  1145.     bne    30$            ; ya
  1146.     jmp    @r1            ; /63/ dispatch
  1147.  
  1148.     command    vlopts    ,LOCAL    ,1 ,vl$clr
  1149.     command    vlopts    ,REMOTE    ,1 ,vl$set
  1150.     command    vlopts
  1151.  
  1152. vl$set:    movb    limits    ,vlflag        ; non-zero = pass ^W to remote,
  1153.     br    20$            ; /63/ also store TSLICH in vlflag
  1154.  
  1155. vl$clr:    clrb    vlflag            ; zero = local ^W operation
  1156. 20$:    clr    r0            ; /63/ success
  1157. 30$:    return                ; /63/
  1158.  
  1159.     .dsabl    lsb            ; /63/
  1160.  
  1161.     .end
  1162.