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

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