home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / pdp11 / k11st0.mac < prev    next >
Text File  |  2020-01-01  |  27KB  |  1,185 lines

  1.     .title    k11st0    the SET command,overlay zero
  2.     .ident    /2.0.05/
  3.  
  4.  
  5.  
  6.     .if ndf, K11INC
  7.     .ift
  8.     .include    /IN:K11MAC.MAC/
  9.     .include    /IN:K11CDF.MAC/
  10.     .endc
  11.  
  12.  
  13.     .enabl    gbl
  14.     .enabl    lc
  15.     .psect    $code
  16.  
  17.     $cmglob    =    0
  18.  
  19. ;    Copyright (C) 1984  Change Software, Inc.
  20. ;
  21. ;    31-Jan-84  15:13:45  Brian Nelson
  22. ;
  23. ;    Removed SET command code from K11CMD.MAC for space saving via
  24. ;    placement into an overlay.
  25.  
  26.  
  27.  
  28.     .psect    $code
  29.  
  30.  
  31.     .sbttl    set a line for dilaing out and speed
  32.  
  33.  
  34.     .enabl    lsb
  35.  
  36.  
  37. set$li::mov    sp    ,doallo        ; /58/ Assume exclusive owner
  38.     mov    #ttname    ,r1        ; /58/ Destination
  39.     mov    argbuf    ,r0        ; /58/ Source
  40. 10$:    cmpb    (r0)    ,#'/        ; /58/ Included /[NO]ALLOCATE
  41.     beq    20$            ; /58/ Yes, exit
  42.     movb    (r0)+    ,(r1)+        ; /58/ No, just copy
  43.     bne    10$            ; /58/ Next please
  44.     br    40$            ; /58/ Skip qualifier processing
  45. 20$:    clrb    (r1)            ; /58/ Insure .asciz
  46.     inc    r0            ; /58/ Skip past the '/'
  47.     cmpb    (r0)    ,#'N&137    ; /58/ Was it /N
  48.     bne    30$            ; /58/ No
  49.     clr    doallo            ; /58/ Yes, say so then
  50.     br    40$            ; /58/ Continue on
  51. 30$:    cmpb    (r0)    ,#'A&137    ; /58/ Try /A
  52.     bne    110$            ; /58/ Error
  53. 40$:    STRCPY    #ttdial    ,#ttname    ; /58/ Copy device name here also
  54.     tst    doallo            ; /58/ Should we take the device?
  55.     beq    50$            ; /58/ No
  56.     calls    assdev    ,<#ttname>    ; try to get the exec to allocate it
  57.     tst    r0            ; did the allocation work ?
  58.     beq    60$            ; no
  59.     message    <Error from device assignment >
  60.     direrr    r0            ; print out the directive error
  61.     return                ; and exit
  62. 50$:    calls    noecho    ,<#ttname>    ; try to disable echoing
  63. 60$:    clr    remote            ; no longer are we remote
  64.     calls    ttpars    ,<#ttname>    ; see if the terminal is KB: or TI:
  65.     cmpb    r0    ,#377        ; well ?
  66.     bne    100$            ; no
  67.     mov    sp    ,remote        ; yes, we are now the remote system
  68.     calls    gttname    ,<#ttname>    ; get our local terminal number
  69.     copyz    #ttname    ,#ttdial    ; and update it please
  70.     message    <Kermit-11 no longer running in LOCAL mode>,cr
  71. 100$:    call    linsts
  72.     clr    r0
  73. 110$:    return
  74.  
  75.  
  76.     .dsabl    lsb
  77.  
  78.     .enabl    lsb
  79.  
  80. linsts:    tst    infomsg            ; /41/ Print this info today?
  81.     beq    100$            ; /41/ No
  82.     message    <Link device: >        ; /40/ format info about link status
  83.     print    #ttname            ; /40/ name
  84.     calls    ttspeed    ,<#ttname>    ; /40/ current speed
  85.     tst    r0            ; /40/ Is speed settable?
  86.     bne    10$            ; /40/ yes
  87.     message    <   Speed not settable>    ; /40/ no
  88.     br    20$            ; /40/ next please
  89. 10$:    message    <   Speed: >        ; /40/ dump it
  90.     decout    r0            ; /40/
  91. 20$:    calls    inqdtr    ,<#ttname>    ; /40/ see if dtr or cd is up
  92.     tst    r0            ; /40/ if < 0 , then not supported
  93.     bmi    40$            ; /40/ no good
  94.     bgt    30$            ; /40/ Dtr's up
  95.     message    <   DTR/CD not currently present> ; /40/ a message
  96.     br    40$            ; /40/ next
  97. 30$:    message    <   DTR/CD present>    ; /40/ it's there
  98. 40$:    message                ; /40/ all done
  99.     calls    inqpar    ,<#ttname>    ; /53/ Check for parity
  100.     tst    r0            ; /53/ Set?
  101.     beq    100$            ; /53/ NO
  102.     movb    #PAR$SPACE,parity    ; /53/ Force 7bit mode
  103.     message    <Parity is set, forcing 7bit mode>,CR
  104. 100$:    return                ; /40/ exit
  105.  
  106.     global    <infomsg,ttname>
  107.     global    <INQPAR,INQDTR,DOALLO>
  108.  
  109.     .dsabl    lsb
  110.  
  111.  
  112.  
  113.     .sbttl    more terminal setting options
  114.     .enabl    lsb
  115.  
  116. set$sp::calls    l$val    ,<argbuf>    ; get the speed into decimal
  117.     tst    r0            ; ok ?
  118.     bne    30$            ; yes
  119.     call    ttchk            ; is a line assigned now ?
  120.     bcs    100$            ; no
  121.     calls    setspd    ,<#ttname,r1,#lun.co>; set the speed please
  122.     tst    r0            ; did it work ?
  123.     beq    100$            ; yes, exit
  124.     cmp    r0    ,#377        ; bad speed ?
  125.     beq    30$
  126.     direrr    r0
  127.     br    100$
  128. 30$:    message    <Bad value for speed or speed not settable>,cr
  129.  
  130. 100$:    clr    r0
  131.     return
  132.  
  133.     global    <argbuf    ,lun.co>
  134.  
  135.     .dsabl    lsb
  136.  
  137.  
  138.  
  139. ttchk:    tstb    ttname            ; insure a line is set
  140.     beq    10$            ; ok
  141.     clc
  142.     return
  143. 10$:    message    <Please use the SET LINE command>,cr
  144.     sec
  145.     return
  146.  
  147.  
  148.  
  149.     global    <argbuf    ,modem    ,remote    ,ttdial    ,ttname>
  150.  
  151.  
  152.  
  153.     .sbttl    set debug whatever
  154.  
  155.  
  156. set$de::calls    getcm0    ,<argbuf,#dbglst>; find out which option was given
  157.     tst    r0            ; did we find one
  158.     bmi    110$            ; no
  159.     calls    getcm1    ,<argbuf,#dbglst,r0>
  160.     tst    r0            ; now get arguement if needed
  161.     bmi    110$            ; oops
  162.     jsr    pc    ,@r1        ; dispatch now
  163.     return                ; bye
  164. 110$:    call    sd$hel            ; error, print a help and exit
  165.     clr    r0            ; say we have no errors
  166.     return                ; bye
  167.  
  168.  
  169.  
  170.     .enabl    lsb            ; for message macro in SDOPEN
  171.  
  172. sdopen:    bit    #log$op    ,trace        ; a logfile open ?
  173.     bne    200$            ; yes
  174.     message    <Please use the SET LOGFILE command first>,cr
  175.     clr    r0            ; and exit with carry set
  176.     sec                ; error exit
  177.     return                ; bye
  178. 200$:    clc                ; return with file status open
  179.     return                ; bye
  180.  
  181.     .dsabl    lsb
  182.  
  183.  
  184.     $cmglob    =    0        ; don't make these routines global
  185.  
  186.     command    dbglst    ,ALL    ,3    ,sd$all
  187.     command    dbglst    ,CONSOLE,3    ,sd$con
  188.     command    dbglst    ,CONNECT,3    ,sd$con
  189.     command    dbglst    ,FILE    ,3    ,sd$fil
  190.     command    dbglst    ,HELP    ,3    ,sd$hel
  191.     command    dbglst    ,NONE    ,3    ,sd$none
  192.     command    dbglst    ,OFF    ,3    ,sd$off
  193.     command    dbglst    ,ON    ,2    ,sd$on
  194.     command    dbglst    ,PACKET    ,3    ,sd$pak
  195.     command    dbglst    ,RAW    ,3    ,sd$raw
  196.     command    dbglst    ,RPACK    ,3    ,sd$rpa
  197.     command    dbglst    ,STATE    ,3    ,sd$sta
  198.     command    dbglst    ,TERMINAL,3    ,sd$ter
  199.     command    dbglst    ,NOTERMINAL,3    ,sd$not
  200.     command    dbglst
  201.  
  202.  
  203.  
  204.  
  205.  
  206.     .sbttl    routines for SET DEBUG
  207.     .enabl    lsb
  208.  
  209.  
  210. sd$none:
  211. sd$off::bic    #log$al    ,trace        ; clear all debug bits now
  212.     bit    #log$op    ,trace        ; is there a log file open ?
  213.     beq    20$            ; no
  214.     calls    close    ,<#lun.lo>    ; close it
  215.     bic    #log$op    ,trace        ; say it's closed please
  216.     tst    infomsg            ; /41/ Inform the user?
  217.     beq    20$            ; /41/ No
  218.     message    <Log_file closed>,cr    ; /41/ Call it Log file now
  219. 20$:    clr    r0
  220.     return
  221.  
  222.  
  223. sd$all:
  224. sd$on:    bic    #log$al    ,trace        ; insure previous logfile closed
  225.     call    rawchk            ; disallow other logging if raw logging
  226.     bcs    100$            ; oops
  227.     call    sdopen            ; a debug file already open ?
  228.     bcs    100$            ; no
  229.     bis    #log$al    ,trace        ; set debug on turns the world on
  230.     clr    r0
  231. 100$:    return
  232.  
  233.  
  234. sd$ter:    mov    sp    ,debug        ; i/o to local kermit terminal
  235.     clr    r0
  236.     return
  237.  
  238. sd$not:    clr    debug
  239.     clr    r0
  240.     return
  241.  
  242.     global    <argbuf    ,debug    ,lun.lo    ,trace    ,errtxt    ,logfil>
  243.  
  244.     .dsabl    lsb
  245.  
  246.  
  247.  
  248.  
  249.     .sbttl    more set debug routines
  250.  
  251.  
  252. ;    SD$CON    enable logging of virtual connect i/o to disk file
  253. ;
  254. ;    SD$PAK    enable logging of all packets to disk file
  255. ;
  256. ;    SD$STA    enable logging of all states to disk file
  257.  
  258.  
  259. sd$con:    call    sdopen            ; logfile open ?
  260.     bcs    100$            ; no
  261.     bis    #log$co    ,trace        ; yes, set console emulation logging
  262.     clr    r0
  263. 100$:    return
  264.  
  265.  
  266. sd$fil:    call    sdopen            ; logfile open ?
  267.     bcs    100$            ; no
  268.     call    rawchk            ; disallow other logging if raw logging
  269.     bcs    100$            ; oops
  270.     bis    #log$fi    ,trace        ; yes, set file opens and creates
  271.     clr    r0
  272. 100$:    return
  273.  
  274.  
  275.  
  276. sd$pak:    call    sdopen            ; logfile open
  277.     bcs    100$            ; no
  278.     call    rawchk            ; disallow other logging if raw logging
  279.     bcs    100$            ; oops
  280.     bis    #log$pa    ,trace        ; yes, set packet logging on
  281.     clr    r0
  282. 100$:    return
  283.  
  284.  
  285.  
  286. sd$sta:    call    sdopen            ; logfile open
  287.     bcs    100$            ; no
  288.     call    rawchk            ; disallow other logging if raw logging
  289.     bcs    100$            ; oops
  290.     bis    #log$st    ,trace        ; yes, set state logging on
  291.     clr    r0
  292. 100$:    return
  293.  
  294.  
  295.  
  296.     .sbttl    check for oding raw terminal i/o dumps
  297.     .enabl    lsb
  298.  
  299. sd$raw:    call    sdopen            ; logfile open
  300.     bcs    100$            ; no
  301.     mov    trace    ,r0
  302.     bic    #log$op    ,r0
  303.     tst    r0
  304.     beq    10$
  305.     message    <Can't do RAW i/o disk logging with other DEBUG options set>
  306.     message
  307.     br    100$
  308. 10$:    bis    #log$io    ,trace        ; yes, set state logging on
  309.     calls    close    ,<#lun.lo>
  310.     calls    create    ,<#logfil,#lun.lo,#binary> ; redo as image file
  311.     message    <Old logfile closed and new logfile created in BINARY mode>,cr
  312. 100$:    clr    r0
  313.     return
  314.  
  315.  
  316. rawchk:    bit    #log$io    ,trace
  317.     beq    200$
  318.     message    <Can't do disk logging with RAW i/o logging on>,cr
  319.     sec
  320.     return
  321. 200$:    clc
  322.     return
  323.  
  324.  
  325. sd$rpa:    bis    #log$rp    ,trace
  326.     clr    r0
  327.     return
  328.  
  329.  
  330.  
  331. sd$hel:    message
  332.     message    <To enable:>,cr
  333.     message    <    Connection logging   SET DEBUG CONSOLE>,cr
  334.     message <    File opens/creates   SET DEBUG FILE>,cr
  335.     message    <    Packet traffic       SET DEBUG PACKET>,cr
  336.     message    <    Raw terminal i/o      SET DEBUG RAW>,cr
  337.         message <    State transitions    SET DEBUG STATE>,cr
  338.     message
  339.     message    <Connection logging can be controlled by  typing your>,cr
  340.     message    <escape character followed by a R to resume or a Q to>,cr
  341.     message    <stop logging.>,cr
  342.     message
  343.     return
  344.  
  345.  
  346.     .dsabl    lsb
  347.  
  348.  
  349.     .sbttl    set parity here
  350.     .enabl    lsb
  351.  
  352. set$pa::calls    getcm0    ,<argbuf,#parlst>; find out which option was given
  353.     tst    r0            ; did we find one
  354.     bmi    110$            ; no
  355.     jsr    pc    ,@r1        ; dispatch now
  356. 20$:    mov    r0    ,parity        ; save for the show command
  357.     cmpb    r0    ,#par$no    ; no parity?
  358.     beq    100$            ; yes, no problem
  359.     message    <Kermit-11 will have to request 8 Bit quoting for the>,cr
  360.     message    <transmission of  binary files.  If  the other Kermit>,cr
  361.     message    <does  not support this, information for binary files>,cr
  362.     message    <will be lost.>,cr
  363. 100$:    clr    r0            ; exit with no error set
  364.     return
  365.  
  366. 110$:    message    <Unknown parity>,cr
  367.     return
  368.  
  369.     .dsabl    lsb
  370.  
  371.  
  372.     cm$glob    =    0
  373.  
  374.     command    parlst    ,EVEN    ,3    ,spa$ev
  375.     command    parlst    ,ODD    ,3    ,spa$od
  376.     command    parlst    ,MARK    ,3    ,spa$ma
  377.     command    parlst    ,SPACE    ,3    ,spa$sp
  378.     command    parlst    ,NONE    ,3    ,spa$no
  379.     command    parlst
  380.  
  381.  
  382. spa$ev:    mov    #par$ev    ,r0        ; set parity even
  383.     return
  384.  
  385. spa$od:    mov    #par$od    ,r0        ; set parity odd
  386.     return
  387.  
  388. spa$ma:    mov    #par$ma    ,r0        ; set parity mark
  389.     return
  390.  
  391. spa$sp:    mov    #par$sp    ,r0        ; set parity space
  392.     return
  393.  
  394. spa$no:    mov    #par$no    ,r0        ; set parity none
  395.     return
  396.  
  397.     global    <Argbuf    ,parity>
  398.  
  399.  
  400.     .sbttl    set handshake
  401.  
  402.     squote    =    47
  403.     dquote    =    42
  404.  
  405. ;    03-Aug-84  09:36:52  Allow literal characters like SET HAN '?
  406.  
  407. set$ha::call    ttchk            ; insure a line is set
  408.     bcs    100$            ; no, they must set line first
  409.     mov    argbuf    ,r0        ; get the address of argbuf
  410.     cmpb    @r0    ,#squote    ; a literal quoted character?
  411.     beq    10$            ; yes, use the next character as the
  412.     cmpb    @r0    ,#dquote    ; handshake character. Look for " also
  413.     bne    20$            ; no
  414. 10$:    movb    1(r0)    ,r0        ; get the handshake character please
  415.     br    30$            ; and copy it please
  416. 20$:    calls    getcm0    ,<r0,#hanlst>    ; find out which option was given
  417.     tst    r0            ; did we find one
  418.     bmi    110$            ; no
  419.     jsr    pc    ,@r1        ; dispatch now
  420. 30$:    movb    r0    ,handch        ; save for the show command
  421. 100$:    clr    r0            ; exit with no error set
  422. 110$:    return
  423.  
  424.  
  425.  
  426.  
  427.     cm$glob    =    0
  428.  
  429.     command    hanlst    ,NONE        ,3    ,sha$no
  430.     command    hanlst    ,XON        ,3    ,sha$xn
  431.     command    hanlst    ,XOFF        ,3    ,sha$xf
  432.     command    hanlst    ,CARRIAGE-RETURN,3    ,sha$cr
  433.     command    hanlst    ,CARRIAGE_RETURN,3    ,sha$cr
  434.     command    hanlst
  435.  
  436.  
  437. sha$no:    clrb    r0            ; no handshake (the default)
  438.     return
  439.  
  440. sha$xn:    movb    #'Q&37    ,r0        ; wait for an XON
  441.     return
  442.  
  443. sha$xf:    movb    #'S&37    ,r0        ; wait for an XOFF (??)
  444.     return
  445.  
  446. sha$cr:    movb    #cr    ,r0        ; wait for a carriage return
  447.     return
  448.  
  449.  
  450.     .sbttl    set DUPLEEX and SET LOCAL
  451.  
  452. ;     Provide both SET DUPLEX FULL/HALF and SET LOCAL ON/OFF
  453. ;    to provide user's with compatibility with the different
  454. ;    ways other Kermits do this.
  455.  
  456.  
  457. set$lc::mov    #lcelst    ,r5
  458.     br    dulc
  459.  
  460. set$du::mov    #duplst    ,r5
  461. dulc:    call    ttchk            ; insure a line is set
  462.     bcs    100$            ; no, they must set line first
  463. 10$:    calls    getcm0    ,<argbuf,r5>    ; find out which option was given
  464.     tst    r0            ; did we find one
  465.     bmi    110$            ; no
  466.     jsr    pc    ,@r1        ; dispatch now
  467. 100$:    clr    r0            ; exit with no error set
  468. 110$:    return
  469.  
  470.  
  471. sdu$ha:    mov    sp    ,duplex        ; simple
  472.     return
  473.  
  474. sdu$fu:    clr    duplex            ; the default
  475.     return
  476.  
  477.     $cmglob    =    0
  478.  
  479.     command    duplst    ,FULL    ,2    ,sdu$fu
  480.     command    duplst    ,HALF    ,2    ,sdu$ha
  481.     command    duplst
  482.     command    lcelst    ,ON    ,2    ,sdu$ha
  483.     command    lcelst    ,OFF    ,2    ,sdu$fu
  484.     command    lcelst
  485.  
  486.  
  487.  
  488.     global    <argbuf    ,duplex    ,handch>
  489.  
  490.  
  491.     .sbttl    set ibm (may be site dependent)
  492.  
  493.  
  494. set$ib::calls    getcm0    ,<argbuf,#ibmlst>; find out which option was given
  495.     tst    r0            ; did we find one
  496.     bmi    110$            ; no
  497.     jsr    pc    ,@r1        ; dispatch now
  498. 100$:    clr    r0            ; exit with no error set
  499. 110$:    return
  500.  
  501.  
  502.     $cmglob    =    0
  503.  
  504.     command    ibmlst    ,ON    ,2    ,sib$on
  505.     command    ibmlst    ,OFF    ,2    ,sib$of
  506.     command    ibmlst
  507.  
  508.  
  509. sib$on:    mov    sp    ,duplex        ; half duplex
  510.     mov    #par$ma    ,parity        ; mark parity
  511.     movb    #'Q&37    ,handch        ; XON handshaking
  512.     message    <SET DUPLEX HALF, SET PARITY MARK, SET HANDSHAKE XON done>,cr
  513.     return                ; bye
  514.  
  515.  
  516. sib$of:    clr    duplex            ; full duplex
  517.     mov    #par$no    ,parity        ; no parity
  518.     clrb    handch            ; no handshaking
  519.     message    <SET DUPLEX FULL, SET PARITY NONE, SET HANDSHAKE NONE done>,cr
  520.     return
  521.  
  522.  
  523.  
  524.     .sbttl    set [no]quiet
  525.  
  526. set$qu::clr    infomsg            ; /41/ Disallow full info messages
  527.     clr    tkecho            ; /41/ No command file echoing
  528.     clr    r0            ; /41/ Return( success )
  529.     return                ; /41/ Exit
  530.  
  531. set$nq::mov    sp    ,infomsg    ; /41/ Allow full info messages
  532.     mov    sp    ,tkecho        ; /41/ Command file echoing
  533.     clr    r0            ; /41/ Return( success )
  534.     return                ; /41/ Exit
  535.  
  536.     global    <infomsg,tkecho>
  537.  
  538.  
  539.  
  540.     .sbttl    set logout_string
  541.  
  542. ;    Accept a string sequence as in SET LOGO BYE<15><12>
  543. ;
  544. ;    Added edit /41/ 27-Dec-85  12:01:05 BDN re Steve Heflin's mods.
  545.  
  546. set$ls::prsbuf    #logstr
  547.     return
  548.  
  549.  
  550.     global    <argbuf,logstr>
  551.  
  552.  
  553.  
  554.  
  555.  
  556.     .sbttl    set update value
  557.  
  558.  
  559. set$nu::clr    blip
  560.     clr    r0
  561.     return
  562.  
  563. set$up::calls    l$val    ,<argbuf>    ; get the interval into decimal
  564.     tst    r0            ; ok ?
  565.     bne    100$            ; no
  566.     mov    r1    ,blip        ; yes, set it up please
  567.     clr    r0
  568.     return
  569. 100$:    mov    #1    ,r0
  570.     return
  571.  
  572.  
  573. set$po::calls    getcm0    ,<argbuf,#poslst>; find out which option was given
  574.     tst    r0            ; did we find one
  575.     bmi    110$            ; no
  576.     jsr    pc    ,@r1        ; dispatch now
  577.     clr    r0
  578. 110$:    return
  579.  
  580.  
  581.     $cmglob    =    0
  582.  
  583.     command    poslst    ,NODTE    ,2    ,spo$nd
  584.     command    poslst    ,DTE    ,2    ,spo$dt
  585.     command    poslst
  586.  
  587. spo$nd:    clr    procom
  588.     return
  589.  
  590. spo$dt:    mov    sp    ,procom
  591.     return
  592.  
  593.     global    <procom>    
  594.  
  595.  
  596.  
  597.  
  598.     .sbttl    SET RSX
  599.  
  600.  
  601. set$rx::calls    getcm0    ,<argbuf,#rsxlst>; find out which option was given
  602.     tst    r0            ; did we find one
  603.     bmi    110$            ; no
  604.     jsr    pc    ,@r1        ; dispatch now
  605. 110$:    return
  606.  
  607.  
  608.     $cmglob    =    0
  609.  
  610.     command    rsxlst    ,CHARIO    ,2    ,srx$ch
  611.     command    rsxlst    ,LINEIO    ,2    ,srx$li
  612.     command    rsxlst    ,TC.DLU    ,2    ,srx$tc
  613.     command    rsxlst    ,CONNECT,2    ,srx$co
  614.     command    rsxlst
  615.  
  616.  
  617. srx$ch:    mov    sp    ,chario
  618.     clr    r0
  619.     return
  620.     
  621. srx$li:    clr    chario
  622.     clr    r0
  623.     return
  624.  
  625.  
  626.     .enabl    lsb
  627.  
  628.  
  629. srx$tc:    mov    argbuf    ,r0        ; attempt to resolve the tc.dlu
  630. 10$:    tstb    @r0            ; question for connecting to a
  631.     beq    90$            ; modem.
  632.     cmpb    (r0)+    ,#40        ; scan for a trailing space
  633.     bne    10$            ; not found yet
  634. 20$:    movb    @r0    ,r1        ; found space, next character must
  635.     sub    #'0    ,r1        ; be a digit from 0..2
  636.     bmi    90$            ; no good
  637.     cmp    r1    ,#2        ; check for upper limit now
  638.     bhi    90$            ; no good
  639.     mov    r1    ,tcdlu        ; save it
  640.     clr    r0            ; and exit
  641.     br    100$
  642. 90$:    message    <SET RSX TC.DLU value, where value is 0..2>,cr
  643.     mov    #1    ,r0
  644. 100$:    return
  645.  
  646.  
  647.     .dsabl    lsb
  648.     .enabl    lsb
  649.  
  650.  
  651. srx$co:    call    nextarg            ; next one please
  652. 20$:    cmpb    @r1    ,#'D&137    ; SET RSX CONNECT DEFAULT
  653.     bne    30$            ; no
  654.     clr    con$dsp            ; /44/ yes, clear ALTCON then
  655.     br    100$
  656. 30$:    cmpb    @r1    ,#'A&137    ; SET RSX CONNECT ALTERNATE
  657.     bne    90$            ; no
  658.     mov    altcon    ,con$dsp    ; /44/
  659.     br    100$
  660. 90$:    message    <?Error - SET RSX CON [DEF][ALT]>,cr
  661. 100$:    clr    r0
  662.     return
  663.  
  664.     .dsabl    lsb
  665.  
  666.     global    <altcon    ,chario    ,tcdlu>
  667.     global    <con$dsp>    ; /44/
  668.  
  669.  
  670.  
  671.  
  672.     .sbttl    SET RT11 (10-Sep-85  13:11:38)
  673.  
  674.  
  675. ;    SET RT11 FLOW_CONTROL ON
  676. ;    SET RT11 FLOW_CONTROL OFF
  677. ;    SET RT11 [NO]FLOW_CONTROL
  678. ;    SET RT11 [NO]VOLUME_VERIFY
  679. ;    SET RT11 CREATE_SIZE n
  680. ;    SET RT11 BREAK [LONG][SHORT]
  681. ;    SET RT11 [NO]WILDCARD
  682.  
  683. set$rt::calls    getcm0    ,<argbuf,#rtlist>
  684.     tst    r0
  685.     bmi    110$
  686.     jsr    pc    ,@r1
  687. 110$:    return
  688.  
  689.  
  690. srt$wc:    clr    nowild            ; /51/ Clear it
  691.     clr    r0            ; /51/ Success
  692.     return
  693.  
  694. srt$nw:    mov    sp    ,nowild        ; /51/ Set it
  695.     clr    r0            ; /51/ Success
  696.     return                ; /51/ Exit
  697.  
  698. srt$cr:    call    nextarg            ; see if another arg present
  699.     tstb    @r1            ; well?
  700.     beq    90$            ; no
  701.     calls    l$val    ,<r1>        ; yes, see if a good number
  702.     tst    r0            ; well ?
  703.     bne    90$            ; no
  704.     mov    r1    ,en$siz        ; yes, save it please
  705.     return                ; exit
  706. 90$:    message    <%SET-W SET RT11 CREATE_SIZE decimal_value>,cr
  707.     return
  708.  
  709. srt$fl:    call    nextarg            ; get third argument in command
  710.     tstb    @r1            ; did we find one or stop on null
  711.     beq    90$            ; null, assume SET RT11 FLOW_CONTROL
  712.     cmpb    (r1)+    ,#'O&137    ; must be 'O' next
  713.     bne    110$            ; not 'O', error
  714.     clr    r0            ; assume no flow control
  715.     cmpb    (r1)+    ,#'F&137    ; 'F' --> SET RT11 FLOW OFF
  716.     beq    100$            ; ok
  717. 90$:    mov    sp    ,r0        ; not off, assume ON
  718. 100$:    mov    r0    ,rtflow        ; store the value and exit
  719.     clr    r0
  720.     return
  721. 110$:    message    <%SET-W SET RT11 FLOW [ON][OFF]>,cr
  722.     mov    #1    ,r0
  723.     return
  724.  
  725.  
  726. srt$br:    call    nextarg            ; /43/ Get third argument in command
  727.     mov    #17.    ,r0        ; /43/ Assume short break
  728.     tstb    @r1            ; /43/ Did we find one or stop on null
  729.     beq    100$            ; /43/ Assume SET RT11 BREAK SHORT
  730.     cmpb    @r1    ,#'S&137    ; /43/ 'SHORT' ?
  731.     beq    100$            ; /43/ Yes, exit
  732.     cmpb    @r1    ,#'L&137    ; /43/ 'LONG' ?
  733.     bne    110$            ; /43/ No, error
  734.     mov    #60.*3    ,r0        ; /43/ Yes, set three second break
  735. 100$:    mov    r0    ,brklen        ; /43/ Store the value and exit
  736.     clr    r0
  737.     return
  738. 110$:    message    <%SET-W SET RT11 BREAK [SHORT][LONG]>,cr
  739.     mov    #1    ,r0
  740.     return
  741.  
  742.  
  743. srt$vo:    mov    sp    ,rtvol
  744.     clr    r0
  745.     return
  746.  
  747. srt$nv:    clr    rtvol
  748.     clr    r0
  749.     return
  750.  
  751. srt$nf:    clr    rtflow
  752.     clr    r0
  753.     return
  754.  
  755.     cm$glob    =    0
  756.     command    rtlist    ,FLOW_CONTROL    ,2    ,srt$fl
  757.     command    rtlist    ,NOFLOW_CONTROL    ,2    ,srt$nf
  758.     command    rtlist    ,NOVOLUME_VERIFY,3    ,srt$nv
  759.     command    rtlist    ,VOLUME_VERIFY    ,3    ,srt$vo
  760.     command    rtlist    ,CREATE_SIZE    ,2    ,srt$cr
  761.     command    rtlist    ,BREAK        ,2    ,srt$br
  762.     command    rtlist    ,WILDCARDING    ,2    ,srt$wc
  763.     command    rtlist    ,NOWILDCARDING    ,3    ,srt$nw
  764.     command    rtlist
  765.  
  766.     global    <argbuf    ,en$siz    ,rtflow    ,rtvol    ,brklen    ,nowild>
  767.  
  768.  
  769.  
  770.     .sbttl    disable xon/xoff flow control for RT11 (old command)
  771.  
  772. ;    SET RTFLOW ON
  773. ;    SET RTFLOW OFF
  774. ;
  775. ;    We need this because some modems (like the VADIC 212) can't
  776. ;    handle XON's and XOFF's comming from the connect code. Thus
  777. ;    we need a way to disable this. We need flow control for the
  778. ;    connect command for RT11 due to the speed limitations of MT
  779. ;    service.
  780.  
  781. set$cf::calls    getcm0    ,<argbuf,#cflst>; find out which option was given
  782.     tst    r0            ; did we find one
  783.     bmi    110$            ; no
  784.     jsr    pc    ,@r1        ; dispatch now
  785.     mov    r0    ,conflow    ; save for the show command
  786. 100$:    clr    r0            ; exit with no error set
  787. 110$:    return
  788.  
  789.  
  790.     cm$glob    =    0
  791.     command    cflst    ,OFF    ,3    ,scf$of
  792.     command    cflst    ,ON    ,2    ,scf$on
  793.     command    cflst    ,NONE    ,3    ,scf$of
  794.     command    cflst
  795.  
  796.  
  797. scf$of:    clr    r0
  798.     return
  799.  
  800. scf$on:    mov    sp    ,r0
  801.     return
  802.  
  803.  
  804.  
  805.     .sbttl    set server
  806.  
  807.  
  808. set$sv::calls    getcm0    ,<argpnt,#svlst>; find out which option was given
  809.     tst    r0            ; did we find the option ?
  810.     bmi    100$            ; no
  811.     calls    getcm1    ,<argpnt,#svlst,r0> ; yes, look for value clause now
  812.     tst    r0            ; find it (or read it?)
  813.     bmi    100$            ; no
  814.     mov    argbuf    ,argpnt        ; yes. GETCM1 always returns in ARGBUF
  815.     jsr    pc    ,@r1        ; dispatch to correct action
  816.     br    110$            ; and exit
  817. 100$:    mov    #1    ,r0        ; exit on error
  818. 110$:    mov    argbuf    ,argpnt        ; insure argpnt is reset to default
  819.     return                ; exit
  820.  
  821. srv$ti:    calls    l$val    ,<argbuf>
  822.     tst    r0
  823.     bne    100$
  824.     mov    r1    ,serwait
  825.     clr    r0
  826. 100$:    return
  827.  
  828.  
  829. srv$nt:    mov    #60.*120.,serwait    ; wait a couple of hours
  830.     clr    r0            ; success
  831.     return
  832.  
  833. srv$dd:    call    ttchk            ; /45/ MUST do a SET LINE first
  834.     bcc    10$            ; /45/ It's ok
  835.     clr    srvprot            ; /45/ Insure it's off
  836.     mov    #1    ,r0        ; /45/ Not ok, return status
  837.     return                ; /45/ Exit
  838. 10$:    mov    sp    ,srvprot    ; /45/ Insure that REMOTE FIN and
  839.     clr    r0            ; /45/ REMOTE BYE can't function.
  840.     return                ; /45/ Exit, success
  841.  
  842. srv$nd:    clr    srvprot            ; /45/ Undo SET SERVER DEDICATED
  843.     clr    r0            ; /45/ Success
  844.     return                ; /45/ Exit
  845.  
  846. srv$dt:    mov    sp    ,srvdet        ; /45/ Flag for detaching server
  847.     clr    r0            ; /45/ Success
  848.     return                ; /45/ Exit
  849.  
  850. command    svlst    ,TIME_OUT    ,2    ,srv$ti    ,<Server_Idle timeout? >,decnum
  851. command    svlst    ,NOTIME_OUT    ,3    ,srv$nt
  852. command    svlst    ,TIME-OUT    ,2    ,srv$ti    ,<Server_Idle timeout? >,decnum
  853. command    svlst    ,NOTIME-OUT    ,3    ,srv$nt
  854. command    svlst    ,DEDICATED    ,3    ,srv$dd
  855. command    svlst    ,NODEDICATED    ,3    ,srv$nd
  856. command    svlst    ,DETACH        ,3    ,srv$dt
  857. command    svlst
  858.  
  859.     global    <serwait>
  860.  
  861.  
  862.  
  863.  
  864.  
  865.     .sbttl    SET EOF [NO]EXIT
  866.  
  867.  
  868. set$ef::calls    getcm0    ,<argbuf,#eflist>
  869.     tst    r0
  870.     bmi    110$
  871.     jsr    pc    ,@r1
  872. 110$:    return
  873.  
  874.  
  875.     command    eflist    ,NOEXIT    ,2    ,sef$ne
  876.     command    eflist    ,EXIT    ,2    ,sef$ex
  877.     command    eflist
  878.  
  879. sef$ne:    clr    exieof
  880.     clr    r0
  881.     return
  882.  
  883. sef$ex:    mov    sp    ,exieof
  884.     clr    r0
  885.     return
  886.  
  887.  
  888.     global    <exieof>
  889.  
  890.  
  891.  
  892.     .sbttl    SET DIAL commands
  893.     .enabl    lsb
  894.  
  895. ;    Assumed: SET MODEM USER_DEFINED already done
  896. ;
  897. ;    SET DIAL WAKEUP get_modems_attention    (VA212PA: "\05\015")
  898. ;    SET DIAL PROMPT modems_prompt        (VA212PA: "*")
  899. ;    SET DIAL INIT   dial_initiate        (VA212PA: "D\015")
  900. ;    SET DIAL FORMAT dial_formatter        (VA212PA: "%s")
  901. ;    SET DIAL CONFIRM number_confirm        (VA212PA: "\015")
  902. ;    SET DIAL SUCCESS on_line_string        (VA212PA: "ONLINE")
  903. ;    SET DIAL INFO    ringing_message    (VA212PA: "RINGING")
  904. ;    SET DIAL FAILURE failed_call        (VA212PA: "BUSY")
  905. ;
  906. ;    The first 5 are permanent fields in the modem descriptor.
  907. ;    The SUCCESS, INFO and FAILURE fields are built as linked
  908. ;    lists, thus you can have as many as desired.
  909. ;
  910. ;    The CONFIRM and INFO fields are optional.
  911.  
  912.  
  913. set$di::mov    #dialst    ,r3
  914.     sub    #140    ,sp        ; A temp buffer
  915.     mov    sp    ,r4        ; A pointer to this buffer
  916.     calls    getcm0    ,<argbuf,r3>    ; Find out which option was given
  917.     tst    r0            ; Did we find the option ?
  918.     bmi    100$            ; No
  919.     calls    getcm1    ,<argbuf,r3,r0>; Yes, look for value clause now
  920.     tst    r0            ; Find it (or read it?)
  921.     bmi    100$            ; No
  922.     jsr    pc    ,@r1        ; Dispatch to correct action
  923.     tst    r0
  924.     beq    100$
  925.     message    <%SET-W Unknown option in SET DIAL>,cr
  926. 100$:    add    #140    ,sp        ; Pop buffer
  927.     return
  928.  
  929.     .dsabl    lsb
  930.  
  931. command    dialst    ,WAKEUP        ,2    ,ss$wak,<String: >,string
  932. command    dialst    ,WAKE_STRING    ,6    ,ss$wak,<String: >,string
  933. command    dialst    ,PROMPT        ,2    ,ss$pro,<String: >,string
  934. command    dialst    ,INITIATE    ,2    ,ss$ini,<String: >,string
  935. command    dialst    ,FORMAT        ,2    ,ss$for,<String: >,string
  936. command    dialst    ,SUCCESS    ,2    ,ss$suc,<Connect acknowledge: >,string
  937. command    dialst    ,INFORMATION    ,2    ,ss$inf,<Ringing acknowledge: >,string
  938. command    dialst    ,FAILURE    ,2    ,ss$fai,<Failure acknowledge: >,string
  939. command    dialst    ,CONFIRM    ,2    ,ss$con,<String: >,string
  940. command    dialst    ,WAKE_RATE    ,6    ,ss$wra,<Delay in milliseconds: >,decnum
  941. command    dialst    ,DIAL_RATE    ,6    ,ss$dra,<Delay in milliseconds: >,decnum
  942. command    dialst    ,DIAL_PAUSE    ,6    ,ss$pau,<Pause character(s): >,string
  943. command    dialst    ,TIMEOUT    ,2    ,ss$tmo,<Timeout in seconds: >,decnum
  944. command    dialst    ,TIME_OUT    ,2    ,ss$tmo,<Timeout in seconds: >,decnum
  945. command    dialst
  946.  
  947.  
  948.  
  949.     .sbttl    More SET DIAL commands
  950.  
  951.  
  952. ;    MODEM type data structure. Taken directly from K11DIA.MAC
  953.  
  954.  
  955.     mod.next    =:    0    ; next modem in list
  956.     mod.str        =:    2    ; address of name of modem
  957.     mod.val        =:    4    ; numeric value for dispatching
  958.     dial.time    =:    6    ; value of dial time
  959.     wake.string    =:    10    ; address of wakeup string
  960.     wake.rate    =:    12    ; value of delay
  961.     wake.prompt    =:    14    ; address of wakeup prompt
  962.     dmod.string    =:    16    ; address of dial dial string
  963.     dmod.prompt    =:    20    ; address of prompt returned for dial
  964.     dial.string    =:    22    ; address of formatting string for dial
  965.     dial.rate    =:    24    ; value of delay
  966.     wake.ack    =:    26    ; address of wakeup response
  967.     dial.ack    =:    30    ; 1st = waitfor, 2nd to confirm number
  968.     dial.online    =:    32    ; online ack string
  969.     dial.busy    =:    34    ; busy ack
  970.     dial.wait    =:    36    ; Pause string
  971.     dial.confirm    =:    40    ; string to confirm number for dialing
  972.     dial.go        =:    42    ; ie, va212 returns "DIALING\n"
  973.     res.bin        =:    44    ; if <>, returns status with \n
  974.                     ; otherwise a binary response (DF03)
  975.     dial.echo    =:    46    ; if <>, numbers are echoed immediately
  976.     mod.comment    =:    50    ;
  977.     res.head    =:    52    ; 
  978.     ext.dial    =:    54    ; if ne, address of external dialer
  979.     dial.xabort    =:    56    ; /45/ To abort call from modem
  980.     dial.idle    =:    60    ; /45/ Place modem in IDLE state
  981.     dial.pulse    =:    62    ; /45/ Switch to pulse dialing
  982.     dial.nopulse    =:    64    ; /45/ Switch to tone dialing
  983.     def.guard    =:    66    ; /45/ last thing (unused)
  984.  
  985.  
  986.     
  987.  
  988.     .sbttl    set dial, cont'd
  989.  
  990.  
  991. ss$pau:    mov    #dial.wait,r5        ; Pause character(s)
  992.     call    sd.chk            ; Insert
  993.     return                ; and exit
  994.  
  995. ss$wak:    mov    #wake.string,r5        ; Offset to setup
  996.     call    sd.chk            ; Convert to binary and check
  997.     return
  998.  
  999. ss$for:    mov    #dial.string,r5        ; Formatting for dialing
  1000.     call    sd.chk            ; Convert, check and copy
  1001.     return                ; Exit
  1002.  
  1003. ss$pro:    mov    #wake.prompt,r5        ; String modem returns for wakeup,
  1004.     call    sd.chk            ; as in "HELLO: I'M READY"
  1005.     return                ; Exit
  1006.  
  1007. ss$ini:    mov    #dmod.string,r5        ; Could be part of SET DIAL FORMAT
  1008.     call    sd.chk            ; Used as in VA212 (D\015)
  1009.     return
  1010.  
  1011. ss$con:    mov    #dial.confirm,r5    ; As in VA212PA, to confirm the
  1012.     call    sd.chk            ; number is actually correct
  1013.     return
  1014.  
  1015. ss$suc:    mov    #1    ,r3        ; Message class
  1016.     call    sd.res            ; Insert response string
  1017.     return
  1018.  
  1019.  
  1020. ss$inf:    clr    r3            ; Message class
  1021.     call    sd.res            ; Insert response string
  1022.     return
  1023.  
  1024.  
  1025. ss$fai:    mov    #-1    ,r3        ; Message class
  1026.     call    sd.res            ; Insert response string
  1027.     return
  1028.  
  1029. ss$dra:    mov    #dial.rate,r5        ; Stuff the value in now
  1030.     call    sd.val            ; ....
  1031.     return                ; exit
  1032.  
  1033. ss$wra:    mov    #wake.rate,r5        ; Stuff the value in now
  1034.     call    sd.val            ; ....
  1035.     return                ; exit
  1036.     
  1037. ss$tmo:    calls    l$val    ,<argbuf>    ; This goes into a global
  1038.     tst    r0            ; Success
  1039.     bne    100$            ; No
  1040.     mov    r1    ,diatmo        ; Yes, exit
  1041. 100$:    return                ; Bye
  1042.  
  1043.  
  1044.     global    <argbuf,diatmo>
  1045.  
  1046.  
  1047.  
  1048.     .sbttl    SET DIAL, cont'd
  1049.  
  1050.     .enabl    lsb
  1051.  
  1052.  
  1053.  
  1054. sd.chk:    prsbuf    r4            ; Expand and copy string to workbuffer
  1055.     tst    r0            ; Successful?
  1056.     bne    100$            ; No
  1057.     strlen    r4            ; Get the length of the result
  1058.     inc    r0            ; Plus one for the null terminator
  1059.     inc    r0            ; Insure NEXT is even address
  1060.     bic    #1    ,r0        ; Even address boundary
  1061.     malloc    r0            ; Ask for the allocation
  1062.     add    umddef    ,r5        ;
  1063.     mov    r0    ,(r5)        ; Insert the new buffer address
  1064.     strcpy    (r5)    ,r4        ; Copy the string and exit
  1065.     clr    r0            ; Success
  1066.     br    100$            ; Exit
  1067. 80$:    message    <Insufficient space to contain string>,cr
  1068. 100$:    return
  1069.  
  1070.     .dsabl    lsb
  1071.     .enabl    lsb
  1072.  
  1073. sd.res:    prsbuf    r4            ; Expand and copy string to workbuffer
  1074.     tst    r0            ; Successful?
  1075.     bne    100$            ; No
  1076.     strlen    r4            ; Get the length of the result
  1077.     add    #2    ,r0        ; Plus one for the null terminator
  1078.     bic    #1    ,r0        ; Insure on a word boundary
  1079.     add    #4    ,r0        ; Space for link and status
  1080.     mov    umddef    ,r5        ; Get base address of structure
  1081.     add    #res.hea,r5        ; Link to first entry
  1082. 10$:    tst    (r5)            ; End of the chain yet?
  1083.     beq    20$            ; Yes
  1084.     mov    (r5)    ,r5        ; No, get the next one please
  1085.     br    10$            ; And recheck
  1086. 20$:    malloc    r0            ; Ask for an allocation
  1087.     tst    r0            ; Did we get it
  1088.     beq    80$            ; No, exit
  1089.     mov    r0    ,(r5)        ; Yes, insert the address
  1090.     beq    80$            ; /59/ Overflowed
  1091.     mov    (r5)    ,r5        ; Point directly to new area
  1092.     clr    (r5)+            ; No link to next
  1093.     mov    r3    ,(r5)+        ; Message class type
  1094.     strcpy    r5    ,r4        ; Insert the string and exit
  1095.     clr    r0            ; Success
  1096.     br    100$            ; Exit
  1097. 80$:    message    <Insufficient space to contain string>,cr
  1098.     inc    r0            ; Error
  1099. 100$:    return
  1100.  
  1101.     .dsabl    lsb
  1102.  
  1103.  
  1104. sd.val:    add    umddef    ,r5        ; Point directly to the field
  1105.     calls    l$val    ,<argbuf>    ; Anything there thats any good?
  1106.     tst    r0            ; Success?
  1107.     bne    100$            ; No
  1108.     mov    r1    ,(r5)        ; Yes, insert the value and exit
  1109. 100$:    return
  1110.  
  1111.  
  1112.     global    <argbuf>
  1113.  
  1114.  
  1115.     .sbttl    set PHONE
  1116.  
  1117. ;    added /45/ along with SET DIAL
  1118.  
  1119.  
  1120. set$ph::calls    getcm0    ,<argbuf,#pholst>; Find out which option was given
  1121.     tst    r0            ; Did we find the option ?
  1122.     bmi    100$            ; No
  1123.     calls    getcm1    ,<argbuf,#pholst,r0>; Yes, look for value clause now
  1124.     tst    r0            ; Find it (or read it?)
  1125.     bmi    100$            ; No
  1126.     jsr    pc    ,@r1        ; Dispatch to correct action
  1127. 100$:    return                ; Exit
  1128.  
  1129.  
  1130. command    pholst    ,NUMBER    ,2    ,sph$nu,<Name and phonenumber: >,string
  1131. command    pholst    ,PULSE    ,2    ,sph$pu
  1132. command pholst    ,TONE    ,2    ,sph$to
  1133. command    pholst    ,BLIND    ,2    ,sph$bl
  1134. command    pholst
  1135.  
  1136.  
  1137. sph$to:    mov    #1    ,pulse
  1138.     clr    r0
  1139.     return
  1140.  
  1141. sph$pu:    mov    #-1    ,pulse
  1142.     clr    r0
  1143.     return
  1144.  
  1145. sph$bl:    mov    #1    ,blind
  1146.     clr    r0
  1147.     return
  1148.  
  1149. sph$nu:    mov    #pnhead    ,r5        ; Get listhead for phone numbers
  1150. 10$:    tst    (r5)            ; Found the last entry yet ?
  1151.     beq    20$            ; Yes, insert new element here
  1152.     mov    (r5)    ,r5        ; No, check the next one
  1153.     br    10$            ; Keep looking
  1154. 20$:    strlen    argbuf            ; Get total length of data
  1155.     add    #4    ,r0        ; Add in space for nulls and insure
  1156.     bic    #1    ,r0        ; even length, also link next field
  1157.     malloc    r0            ; Ask for the space please
  1158.     mov    r0    ,(r5)        ; Insert the address
  1159.     beq    90$            ; No space
  1160.     clr    (r0)+            ; This is now the tail
  1161.     strcpy    r0    ,argbuf    ; Stuff the data in and exit
  1162.     clr    r0            ; Success
  1163.     return                ; Bye
  1164. 90$:    message    <No space left for numbers>,cr
  1165.     inc    r0            ; Exit with error
  1166.     return                ; Bye
  1167.                                     
  1168.     global    <PNHEAD>        ; List header
  1169.     global    <PULSE>            ; /54/
  1170.     global    <BLIND>            ; /54/
  1171.  
  1172.  
  1173.  
  1174.  
  1175. nextarg:mov    argbuf    ,r1
  1176. 10$:    tstb    @r1
  1177.     beq    100$
  1178.     cmpb    (r1)+    ,#40
  1179.     bne    10$
  1180. 100$:    return
  1181.  
  1182.  
  1183.  
  1184.     .end
  1185.