home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / pdp11 / k11st1.mac < prev    next >
Text File  |  2020-01-01  |  22KB  |  989 lines

  1.     .title    k11st1    the SET command,overlay one
  2.     .ident    /2.0.43/
  3.  
  4.  
  5.  
  6.     .if ndf, K11INC
  7.     .ift
  8.     .include    /IN:K11MAC.MAC/
  9.     .include    /IN:K11CDF.MAC/
  10.     .endc
  11.  
  12.  
  13.     .macro    decout    val
  14.     mov    val    ,-(sp)
  15.     call    numout
  16.     .endm    decout
  17.  
  18.     .enabl    gbl
  19.     .enabl    lc
  20.     .psect    $code
  21.  
  22.     $cmglob    =    0
  23.  
  24. ;    Copyright (C) 1984  Change Software, Inc.
  25. ;
  26. ;    31-Jan-84  15:13:45  Brian Nelson
  27. ;
  28. ;    Removed SET command code from K11CMD.MAC for space saving via
  29. ;    placement into an overlay.
  30.  
  31.  
  32.  
  33.     global    <argbuf,argpnt>
  34.  
  35.  
  36.     .psect    $code
  37.  
  38.  
  39.     .sbttl    things from k11st0 needed in k11st1
  40.     .enabl    lsb
  41.  
  42.  
  43.  
  44. sd$off:    bic    #log$al    ,trace        ; clear all debug bits now
  45.     bit    #log$op    ,trace        ; is there a log file open ?
  46.     beq    20$            ; no
  47.     calls    close    ,<#lun.lo>    ; close it
  48.     bic    #log$op    ,trace        ; say it's closed please
  49.     message    <Debug file closed>,cr
  50. 20$:    clr    r0
  51.     return
  52.  
  53. ttchk:    tstb    ttname            ; insure a line is set
  54.     beq    10$            ; ok
  55.     clc
  56.     return
  57. 10$:    message    <Please use the SET LINE command>,cr
  58.     sec
  59.     return
  60.  
  61.     .dsabl    lsb
  62.  
  63.  
  64.     .sbttl    set block-check-type
  65.  
  66.  
  67.  
  68. set$bl::calls    getcm0    ,<argpnt,#blklst>; find out which option was given
  69.     tst    r0            ; did we find one
  70.     bmi    110$            ; no
  71.     jsr    pc    ,@r1        ; dispatch now
  72.     clr    r0            ; no errors
  73. 110$:    return
  74.  
  75.  
  76.  
  77.     $cmglob    =    0
  78.  
  79.     command    blklst    ,1_CHARACTER_CHECKSUM    ,1    ,sbl$1
  80.     command    blklst    ,2_CHARACTER_CHECKSUM    ,1    ,sbl$2
  81.     command    blklst    ,3_CHARACTER_CRC_CCITT    ,1    ,sbl$3
  82.     command    blklst    ,1-CHARACTER-CHECKSUM    ,1    ,sbl$1
  83.     command    blklst    ,2-CHARACTER-CHECKSUM    ,1    ,sbl$2
  84.     command    blklst    ,3-CHARACTER-CRC-CCITT    ,1    ,sbl$3
  85.     command    blklst    ,ONE_CHARACTER_CHECKSUM    ,3    ,sbl$1
  86.     command    blklst    ,TWO_CHARACTER_CHECKSUM    ,3    ,sbl$2
  87.     command    blklst    ,THREE_CHARACTER_CRC_CCITT,3    ,sbl$3
  88.     command    blklst    ,ONE-CHARACTER-CHECKSUM    ,3    ,sbl$1
  89.     command    blklst    ,TWO-CHARACTER-CHECKSUM    ,3    ,sbl$2
  90.     command    blklst    ,THREE-CHARACTER-CRC-CCITT,3    ,sbl$3
  91.     command    blklst
  92.  
  93.  
  94.  
  95. sbl$1:    movb    #'1    ,setrec+p.chkt
  96.     movb    #'1    ,setsen+p.chkt
  97.     return
  98.  
  99.  
  100. sbl$2:    movb    #'2    ,setrec+p.chkt
  101.     movb    #'2    ,setsen+p.chkt
  102.     return
  103.  
  104.  
  105. sbl$3:    movb    #'3    ,setrec+p.chkt
  106.     movb    #'3    ,setsen+p.chkt
  107.     return
  108.  
  109.     global    <argbuf    ,conpar    ,setrec    ,setsen    ,senpar>
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.     .sbttl    set dtr and hangup line
  117.  
  118.  
  119. set$dt::call    ttchk            ; must have already done a SET LINE
  120.     bcs    100$            ; oops
  121.     calls    ttydtr    ,<#ttname>    ; try to raise DTR on the line
  122.     tst    r0            ; did it work ?
  123.     beq    100$            ; yes
  124.     direrr    r0            ; no, emit a message as to why
  125. 100$:    clr    r0            ; and exit
  126.     return
  127.  
  128.  
  129.  
  130. c$disc::
  131. c$hang::$name    <HAN>
  132. set$hu::call    ttchk            ; must have already done a SET LINE
  133.     bcs    100$            ; oops
  134.     calls    ttyhang    ,<#ttname>    ; try to hang up the line
  135.     tst    r0            ; did it work ?
  136.     beq    100$            ; yes
  137.     direrr    r0            ; no, emit a message as to why
  138.     clr    r0
  139.     return
  140. 100$:    message    <KERMIT link >
  141.     print    #ttname
  142.     message    < disconnected>,cr
  143.     return
  144.  
  145.     global    <ttname>
  146.  
  147.  
  148.  
  149.  
  150.     .sbttl    set filetype
  151.  
  152.  
  153. set$fi::calls    getcm0    ,<argpnt,#setfil>
  154.     tst    r0            ; did we find a keyword ?
  155.     bmi    100$            ; no
  156.     jsr    pc    ,@r1        ; yes, dispatch on it please
  157. 100$:    return
  158.  
  159.  
  160.  
  161. sf$typ:    mov    argpnt    ,r0        ; this is a KLUDGE, ignore 'TYPE'
  162. 10$:    tstb    @r0            ; find EOS as of yet ?
  163.     beq    90$            ; yes, exit with an error
  164.     cmpb    (r0)+    ,#40        ; found a delimiter yet ?
  165.     bne    10$            ; no, keep looking
  166.     calls    getcm0    ,<r0,#setfil>    ; yes, recheck the table for type
  167.     tst    r0            ; did it work ?
  168.     bmi    90$            ; no
  169.     jsr    pc    ,@r1        ; yes, dispatch on it please
  170.     clr    r0            ; no errors
  171.     br    100$            ; exit
  172. 90$:    mov    #-1    ,r0        ; error
  173. 100$:    return
  174.  
  175.  
  176.  
  177. sf$asc:    mov    #text    ,$image        ; imagemode := false
  178.     message    <Ascii text mode set>,cr; confirm it
  179.     clr    r0            ; no errors
  180.     return                ; bye
  181.  
  182.  
  183.  
  184. sf$bin:    call    xbin
  185.     mov    #binary    ,$image        ; imagemode := true
  186.     message    <Binary mode set>,cr    ; confirm it
  187.     clr    r0            ; no errors
  188.     return                ; bye
  189.  
  190.  
  191.  
  192. sf$dec:    call    xbin            ; SF$DEC added /52/
  193.     MESSAGE    <DEC_Multinational mode set>,CR
  194.     mov    #DECNAT    ,$image
  195.     clr    r0            ; No errors
  196.     return                ; Exit
  197.  
  198. sf$aut:    mov    sp    ,doauto        ; allow checking of file type and
  199.     clr    r0            ; attributes to see if the file should
  200.     return                ; be sent as a binary file
  201.  
  202. sf$noa:    clr    doauto            ; never check the file out
  203.     clr    r0            ; no errors
  204.     return
  205.  
  206.  
  207. sf$sup:    clr    filprot            ; supercede created files
  208.     clr    r0
  209.     return
  210.  
  211. sf$nos:    mov    sp    ,filprot    ; do not supercede files
  212.     clr    r0
  213.     return
  214.  
  215.     .enabl    lsb
  216.  
  217. xbin:    tstb    parity
  218.     beq    100$
  219.     cmpb    parity    ,#par$no    ; has it been set to none ?
  220.     beq    100$            ; yes
  221.     message    <The other Kermit must be able to support 8 bit prefixing>,cr
  222.     message    <Without this feature, the high bit will be lost on every>,cr
  223.     message    <character sent>,cr
  224.     message
  225. 100$:    return
  226.  
  227.     .dsabl    lsb
  228.  
  229.  
  230.     command    setfil    ,SUPERCEDE    ,2    ,sf$sup
  231.     command    setfil    ,NOPROTECT    ,3    ,sf$sup
  232.     command    setfil    ,NOSUPERCEDE    ,3    ,sf$nos
  233.     command    setfil    ,PROTECT    ,2    ,sf$nos
  234.  
  235.     command    setfil    ,7_BIT        ,1    ,sf$asc
  236.     command    setfil    ,7-BIT        ,1    ,sf$asc
  237.     command    setfil    ,8_BIT        ,1    ,sf$dec
  238.     command    setfil    ,8-BIT        ,1    ,sf$dec
  239.     command    setfil    ,ASCII        ,2    ,sf$asc
  240.     command    setfil    ,BINARY        ,2    ,sf$bin
  241.     command    setfil    ,EIGHT        ,2    ,sf$bin
  242.     command    setfil    ,SEVEN        ,2    ,sf$asc
  243.     command    setfil    ,EIGHT_BIT    ,2    ,sf$dec
  244.     command    setfil    ,SEVEN_BIT    ,2    ,sf$asc
  245.     command    setfil    ,EIGHT-BIT    ,2    ,sf$dec
  246.     command    setfil    ,SEVEN-BIT    ,2    ,sf$asc
  247.     command    setfil    ,FIXED        ,2    ,sf$bin
  248.     command    setfil    ,IMAGE        ,2    ,sf$bin
  249.     command    setfil    ,AUTO        ,3    ,sf$aut
  250.     command    setfil    ,NOAUTO        ,3    ,sf$noa
  251.     command    setfil    ,TYPE        ,3    ,sf$typ
  252.     command    setfil    ,TEXT        ,2    ,sf$asc
  253.     command    setfil    ,TXT        ,2    ,sf$asc
  254.     command    setfil    ,DEC_MULTINATIONAL,2    ,sf$dec
  255.  
  256. ;    The following two added /54/ 09-Sep-86  14:48:42 to resolve
  257. ;    problems accessing decnet files. 
  258.  
  259.     command    setfil    ,NAMES        ,2    ,sf$nam
  260.     command    setfil    ,NAMING        ,2    ,sf$nam
  261.     command    setfil
  262.  
  263.  
  264.     .ASSUME    TEXT    EQ    0
  265.     .ASSUME    BINARY    EQ    1
  266.     .ASSUME    DECNAT    EQ    2
  267.  
  268.     global    <argbuf    ,$image>
  269.  
  270.  
  271.  
  272.     .sbttl    SET FILE NAM option    ; Added /54/ 09-Sep-86  14:46:48
  273.  
  274.  
  275. sf$nam:    mov    argpnt    ,r0        ; /54/ Get current pointer
  276. 10$:    tstb    @r0            ; /54/ Find EOS as of yet ?
  277.     beq    90$            ; /54/ Yes, exit with an error
  278.     cmpb    (r0)+    ,#40        ; /54/ Found a delimiter yet ?
  279.     bne    10$            ; /54/ No, keep looking
  280.     calls    getcm0    ,<r0,#sfname>    ; /54/ Yes, recheck the table for type
  281.     tst    r0            ; /54/ Did it work ?
  282.     bmi    90$            ; /54/ No
  283.     jsr    pc    ,@r1        ; /54/ Yes, dispatch on it please
  284.     clr    r0            ; /54/ No errors
  285.     br    100$            ; /54/ Exit
  286. 90$:    mov    #-1    ,r0        ; /54/ Error
  287. 100$:    return
  288.  
  289.  
  290. sfn$tr:    clr    rawfil            ; /54/ The default, always convert
  291.     return                ; /54/ Exit
  292.  
  293. sfn$fu:    mov    sp    ,rawfil        ; /54/ Don't remove extra stuff, like
  294.     return                ; /54/ node names and so on.
  295.  
  296.     command    sfname    ,CONVERTED    ,1    ,sfn$tr
  297.     command    sfname    ,FULL        ,1    ,sfn$fu
  298.     command    sfname    ,LITERAL    ,1    ,sfn$fu
  299.     command    sfname    ,TRANSLATED    ,1    ,sfn$tr
  300.     command    sfname
  301.  
  302.     GLOBAL    <rawfil>        ; End /54/ edits
  303.  
  304.  
  305.  
  306.     .sbttl    set BINARY-TYPE .ext
  307.     .enabl    lsb
  308.  
  309.  
  310. set$bi::save    <r1,r2,r3>        ; save work registers please
  311.     sub    #100    ,sp        ; allocate some work space
  312.     mov    sp    ,r3        ; and a pointer to it please
  313.     clrb    @r3            ; insure .asciz
  314.     mov    argpnt    ,r2        ; get the argbuf pointer now
  315.     cmpb    @r2    ,#'.        ; is there a leading dot ?
  316.     beq    10$            ; yes
  317.     movb    #'.    ,(r3)+        ; no, insert one please
  318.     clrb    @r3            ; asciz please
  319. 10$:    strcat    r3    ,r2        ; concat the filetype now
  320.     mov    sp    ,r3        ; point back to the buffer
  321.     strlen    r3            ; get the length
  322.     cmp    r0    ,#4        ; it must be exactly 4 chars
  323.     beq    20$            ; ok
  324.     message    <The filetype must be of the form .xyz>,cr
  325.     message    <as in: SET BIN .SAV  or  SET BIN .TSK>,cr
  326.     br    90$            ; error exit
  327. 20$:    tst    binset            ; have we been here before
  328.     bne    30$            ; yes
  329.     message    <The default binary filetype list has been deleted>,cr
  330.     mov    bintyp    ,r1
  331.     clrb    @r1            ; insure that it's been done
  332.     mov    sp    ,binset        ; flag we have been here before
  333. 30$:    strcat    bintyp    ,r3        ; concat the new one onto the list
  334.     clr    r0            ; exit with success
  335.     br    100$            ; exit
  336.  
  337. 90$:    mov    #-1    ,r0        ; failure
  338. 100$:    add    #100    ,sp        ; pop local buffer and then ....
  339.     unsave    <r3,r2,r1>        ; pop registers
  340.     return                ; bye
  341.  
  342.  
  343.     .dsabl    lsb
  344.  
  345.  
  346.  
  347.  
  348.     .sbttl    more set routines
  349.  
  350. ;    SET$DF    set a default filename string for all file opens
  351. ;    and creates.
  352.  
  353.  
  354.  
  355.     .enabl    lsb
  356.  
  357. set$df::copyz    argpnt    ,#defdir,#filsiz; setup a default directory
  358.     calls    fparse    ,<#200$,#filnam>; try to parse it to see if
  359.     tst    r0            ; if the string is valid
  360.     beq    10$            ; ok
  361.     message    <Error from $PARSE - >    ;
  362.     direrr    r0            ; no, print the error out
  363.     clrb    defdir
  364.     br    100$
  365.  
  366. 10$:    message    <Directory for files set to >
  367.     print    #defdir
  368.     message
  369. 100$:    clr    r0
  370.     return
  371.  
  372.     .save
  373.     .psect    $PDATA    ,D
  374. 200$:    .asciz    /JUNK.DAT/
  375.     .even
  376.     .restore
  377.  
  378.     global    <filsiz>
  379.  
  380.     .dsabl    lsb
  381.  
  382.  
  383. set$ho::clrb    defdir
  384.     message    <Directory set back to none (SY:)>,cr
  385.     clr    r0
  386.     return
  387.  
  388.  
  389. ;    S E T $ L O
  390. ;
  391. ;    SET LOGFILE filespec
  392. ;
  393. ;    set and create the logfile
  394.     
  395.     .enabl    lsb
  396.  
  397. c$logf::
  398. set$lo::call    sd$off            ; insure previous file is closed
  399.     tst    logapp            ; /41/ Append log files?
  400.     bne    10$            ; /41/ Yes
  401.     calls    create    ,<argpnt,#lun.lo,#text>; handle SET DEBUG FILE filename
  402.     br    20$            ; /41/ Check for errors
  403. 10$:    calls    append    ,<argpnt,#lun.lo,#text>; handle SET DEBUG FILE filename
  404. 20$:    tst    r0            ; did the logfile create work ?
  405.     beq    30$            ; yes
  406.     direrr    r0            ; no,print the error out
  407.     return
  408. 30$:    bis    #log$op    ,trace        ; yes, say it's open please
  409.     copyz    argpnt    ,#logfil,#30    ; save the debug filename for show
  410.     tst    infomsg            ; /41/ Verbose today?
  411.     beq    100$            ; /41/ No
  412.     message    <Opened Log_file >    ; /41/ say we did it
  413.     print    argpnt            ; at last, confirm the logfile name
  414.     message                ; crlf
  415. 100$:    return                ; exit
  416.  
  417.     global    <argbuf    ,defdir,logapp>
  418.  
  419.     .dsabl    lsb
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.     .sbttl    set send and set receive
  427.     .enabl    lsb
  428.  
  429. set$wi::message    <Kermit-11 supports the LONG PACKET extension.>,cr
  430.     message    <It does not support SLIDING WINDOWS>,cr
  431.     clr    r0
  432.     return
  433.  
  434.  
  435. set$rc::mov    #reclst    ,r3
  436.     call    200$
  437.     tst    r0
  438.     beq    10$
  439.     message    <%SET-W Unknown option in SET RECEIVE>,cr
  440. 10$:    return
  441.  
  442. set$sn::mov    #senlst    ,r3
  443.     call    200$
  444.     tst    r0
  445.     beq    20$
  446.     message    <%SET-W Unknown option in SET SEND>,cr
  447. 20$:    return
  448.  
  449.  
  450. 200$:    calls    getcm0    ,<argpnt,r3>    ; find out which option was given
  451.     tst    r0            ; did we find the option ?
  452.     bmi    300$            ; no
  453. 220$:    calls    getcm1    ,<argpnt,r3,r0>    ; yes, look for value clause now
  454.     tst    r0            ; find it (or read it?)
  455.     bmi    300$            ; no
  456.     mov    argbuf    ,argpnt        ; yes. GETCM1 always returns in ARGBUF
  457.     jsr    pc    ,@r1        ; dispatch to correct action
  458.     br    310$            ; and exit
  459. 300$:    mov    #1    ,r0        ; exit on error
  460. 310$:    mov    argbuf    ,argpnt        ; insure argpnt is reset to default
  461.     return                ; exit
  462.  
  463.     .dsabl    lsb
  464.  
  465. command    reclst    ,END-OF-LINE    ,3    ,set$eo,<EOLN char ? >,string
  466. command    reclst    ,PACKET-SIZE    ,3    ,str$pl,<Packet Length ? >,decnum
  467. command    reclst    ,PACKET-LENGTH    ,3    ,str$pl,<Packet Length ? >,decnum
  468. command    reclst    ,PAUSE        ,3    ,set$ps,<Pause time ? >,decnum
  469. command    reclst    ,START-OF-PACKET,3    ,str$so,<Octal valule of SOH ? >,octnum
  470. command    reclst    ,START_OF_PACKET,3    ,str$so,<Octal valule of SOH ? >,octnum
  471. command    reclst    ,TIMEOUT    ,3    ,set$ti,<Packet timeout ? >,decnum
  472. command    reclst    ,PADCHARACTER    ,4    ,str$pd,<Padding char (octal) ? >,octnum
  473. command    reclst    ,PADDING    ,4    ,str$pn,<Number of pad chars ? >,decnum
  474. command    reclst
  475.  
  476. command    senlst    ,END-OF-LINE    ,3    ,set$eo,<EOLN char ? >,string
  477. command    senlst    ,PACKET-LENGTH    ,3    ,sts$pl,<Packet Length ? >,decnum
  478. command    senlst    ,PACKET-SIZE    ,3    ,sts$pl,<Packet Length ? >,decnum
  479. command    senlst    ,PAUSE        ,3    ,set$ps,<Pause time ? >,decnum
  480. command    senlst    ,START-OF-PACKET,3    ,sts$so,<Octal valule of SOH ? >,octnum
  481. command    senlst    ,START_OF_PACKET,3    ,sts$so,<Octal valule of SOH ? >,octnum
  482. command    senlst    ,TIMEOUT    ,3    ,set$ti,<Packet timeout ? >,decnum
  483. command    senlst    ,PADCHARACTER    ,4    ,sts$pd,<Padding char (octal) ? >,octnum
  484. command    senlst    ,PADDING    ,4    ,sts$pn,<Number of pad chars ? >,decnum
  485. command    senlst    ,XON        ,3    ,sts$xo
  486. command    senlst    ,NOXON        ,3    ,sts$nx
  487. command    senlst
  488.  
  489.  
  490.  
  491.  
  492.  
  493.     .sbttl    set end-of-line octalvalue, set packetlength and set pause
  494.  
  495. sts$so:    call    setsop
  496.     tst    r0
  497.     bne    100$
  498.     mov    r1    ,sensop
  499. 100$:    return
  500.  
  501. str$so:    call    setsop
  502.     tst    r0
  503.     bne    100$
  504.     mov    r1    ,recsop
  505. 100$:    return
  506.  
  507. set$so::call    setsop
  508.     tst    r0
  509.     bne    100$
  510.     mov    r1    ,recsop
  511.     mov    r1    ,sensop
  512. 100$:    return
  513.  
  514. setsop:    calls    octval    ,<argpnt>    ; get the octal value
  515.     tst    r0            ; check for errors
  516.     bne    80$            ; exit if so
  517.     tst    r1            ; insure in range 1..36
  518.     beq    90$            ; no, exit
  519.     cmp    r1    ,#36        ; ...
  520.     bgt    90$            ; ...
  521. 80$:    return
  522. 90$:    message    <The SOH character must be between 1 and 36 octal>,cr
  523.     mov    #1    ,r0
  524.     return
  525.  
  526.  
  527.     global    <recsop    ,sensop>
  528.  
  529. sts$xo:    mov    sp    ,prexon        ; /53/ Prefix packets with XON
  530.     clr    r0            ; /53/ Success
  531.     return                ; /53/ Exit
  532.  
  533. sts$nx:    clr    prexon            ; /53/ Don't prefix with XON
  534.     clr    r0            ; /53/ Success
  535.     return                ; /53/ Exit
  536.  
  537.     GLOBAL    <PREXON>        ; /53/ Defined in K11DAT
  538.  
  539.  
  540.  
  541. set$eo::calls    octval    ,<argpnt>    ; get the octal value now
  542.     tst    r0            ; did it work ?
  543.     bne    100$            ; no
  544.     movb    r1    ,senpar+p.eol    ; yes,stuff it in there please
  545.     movb    r1    ,setsen+p.eol    ; yes,stuff it in there please
  546.     clr    r0
  547. 100$:    return                ; bye
  548.  
  549.  
  550.  
  551.  
  552. set$ps::calls    l$val    ,<argpnt>    ; get the value
  553.     tst    r0            ; well ?
  554.     bne    100$            ; no, bad value
  555.     mov    r1    ,pauset        ; ok
  556. 100$:    return
  557.  
  558. set$dl::calls    l$val    ,<argpnt>    ; get the value
  559.     tst    r0            ; well ?
  560.     bne    100$            ; no, bad value
  561.     mov    r1    ,sendly        ; ok
  562. 100$:    return
  563.  
  564.  
  565.  
  566.     global    <argbuf    ,conpar    ,conesc    ,pauset    ,sendly>
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.     .sbttl    set rec pac and set sen pac
  577.  
  578.     .enabl    lsb
  579.  
  580. str$pl:    strcmp    argpnt    ,#ps$max    ; /43/ Was it SET REC PAC MAX?
  581.     tst    r0            ; /43/ Well?
  582.     bne    5$            ; /43/ No
  583.     call    inqbuf            ; /43/ Yes, find out what this
  584.     mov    r0    ,r1        ; /43/ Save it here and then be
  585.     tst    infomsg            ; /43/ Being verbose today?
  586.     beq    10$            ; /43/ Not really.
  587.     message    <Receive buffer size set to > ; /43/ 
  588.     decout    r1            ; /43/ Tell user what we set it to
  589.     message                ; /43/ 
  590.     br    10$            ; /43/ be off to common code.
  591. 5$:    calls    l$val    ,<argpnt>    ; /43/ Get the user's size
  592.     tst    r0            ; /43/ Successful?
  593.     bne    100$            ; /43/ No, just exit then
  594.     cmp    r1    ,#96.        ; /43/ huge packets today?
  595.     bgt    10$            ; /43/ Yes
  596.     movb    r1    ,setrec+p.spsiz    ; /43/ set up it
  597.     movb    r1    ,senpar+p.spsiz    ; /43/ It actually goes HERE
  598.     clr    reclng            ; /43/ Clear this
  599.     br    30$            ; /43/ And reset MAXL1 and MAXL2
  600.  
  601. 10$:    call    inqbuf            ; /43/ Find out MAX buffer size
  602.     cmp    r0    ,#MAXLNG    ; /43/ Will this fit internally?
  603.     blos    15$            ; /43/ Yes
  604.     mov    #MAXLNG    ,r0        ; /43/ No, reset it please
  605. 15$:    cmp    r1    ,#MAXLNG    ; /43/ Will this fit within the
  606.     blos    16$            ; /43/ Kermit-11 internal buffers?
  607.     mov    #MAXLNG    ,r1        ; /43/ No, reset to max we allow.
  608.     message    <This size exceeds Kermit-11's internal buffering of >,cr
  609.     decout    r1            ; /43/ Inform them and reset it
  610.     message    < bytes. It has been reset to that value>,cr ; /43/ Warning
  611. 16$:    cmp    r1    ,r0        ; /43/ Will the user's size fit?
  612.     blos    20$            ; /43/ Yes
  613.     tst    infomsg            ; /43/ Really print this message?
  614.     beq    20$            ; /43/ No
  615.     message    <This packet size exceeds the host's input buffer size of>,cr
  616.     decout    r0            ; /43/
  617.     message    < bytes.  This may cause the line/port driver to loose>,cr
  618.     message    <data at rates greater than 2400 baud.>,cr
  619. 20$:    mov    r1    ,reclng        ; /43/ Setup this parameter
  620. 30$:    clr    r0            ; /43/ Now setup for divide by 95
  621.     div    #95.    ,r0        ; /43/ Simple
  622.     movb    r0    ,setrec+p.mxl1    ; /43/ Insert it into parameters
  623.     movb    r0    ,senpar+p.mxl1    ; /43/ Insert it into parameters
  624.     movb    r1    ,setrec+p.mxl2    ; /43/ Insert it into parameters
  625.     movb    r1    ,senpar+p.mxl2    ; /43/ Insert it into parameters
  626.     clr    r0            ; /43/ No errors
  627. 100$:    return                ; /43/ Exit
  628.  
  629.     .dsabl    lsb
  630.  
  631.  
  632. sts$pl:    call    plc            ; /43/ Get the value
  633.     bcs    100$            ; /43/ Oops
  634.     movb    r1    ,setsen+p.spsiz    ; /43/ set up it
  635.     movb    r1    ,conpar+p.spsiz    ; /43/ It actually goes HERE
  636. 100$:    return                ; /43/ Exit
  637.  
  638.  
  639.     .enabl    lsb
  640.  
  641. plc:    calls    l$val    ,<argpnt>    ; set the arguement now
  642.     tst    r0            ; did it work ?
  643.     bne    120$            ; no
  644.     cmp    r1    ,#20.        ; minimum of twenty
  645.     blo    110$            ; too small
  646.     cmp    r1    ,#96.        ; /43/ Large ?
  647.     blo    90$            ; /43/ No
  648.     br    110$            ; /43/
  649. 90$:    clr    r0
  650. 100$:    return
  651.  
  652. 110$:    message    <The packet size must normally be in the range 20..94>,cr
  653. 120$:    sec
  654.     return
  655.  
  656.  
  657.     .save
  658.     .psect    $PDATA,d
  659. ps$max:    .asciz    /MAX/
  660.     .even
  661.     .restore
  662.     .dsabl    lsb
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.     .sbttl    Set RECEIVE, Set SEND Padding, Padcharacter
  670.  
  671.  
  672. ;    Added /57/ Brian Nelson 17-Jul-87  08:52:30
  673.  
  674. sts$pd::calls    octval    ,<argpnt>    ; get the octal value now
  675.     tst    r0            ; did it work ?
  676.     bne    100$            ; no
  677.     movb    r1    ,senpar+p.padc    ; yes,stuff it in there please
  678.     movb    r1    ,setsen+p.padc    ; yes,stuff it in there please
  679. 100$:    return                ; bye
  680.  
  681.  
  682. sts$pn::calls    l$val    ,<argpnt>    ; get the value
  683.     tst    r0            ; well ?
  684.     bne    100$            ; no, bad value
  685.     mov    r1    ,senpar+p.npad    ; ok
  686.     mov    r1    ,setsen+p.npad    ; ok
  687. 100$:    return
  688.  
  689. str$pd::calls    octval    ,<argpnt>    ; get the octal value now
  690.     tst    r0            ; did it work ?
  691.     bne    100$            ; no
  692.     movb    r1    ,recpar+p.padc    ; yes,stuff it in there please
  693.     movb    r1    ,setrec+p.padc    ; yes,stuff it in there please
  694. 100$:    return                ; bye
  695.  
  696.  
  697. str$pn::calls    l$val    ,<argpnt>    ; get the value
  698.     tst    r0            ; well ?
  699.     bne    100$            ; no, bad value
  700.     mov    r1    ,recpar+p.npad    ; ok
  701.     mov    r1    ,setrec+p.npad    ; ok
  702. 100$:    return
  703.  
  704.  
  705.  
  706.     .sbttl    set escape whatever and set retry
  707.     .enabl    lsb
  708.  
  709.  
  710. set$es::calls    octval    ,<argpnt>    ; get the octal value now
  711.     tst    r0            ; did it work ?
  712.     bne    100$            ; no
  713.     cmpb    r1    ,#40        ; must be a control character
  714.     blo    10$            ; ok
  715.     message    <The escape character must be a control character>,cr
  716.     br    20$            ; exit
  717. 10$:    mov    r1    ,conesc        ; store it
  718. 20$:    return
  719.  
  720.  
  721.  
  722. set$re::calls    l$val    ,<argpnt>    ; SET RETRY decimal number
  723.     tst    r0            ; well ?
  724.     bne    100$            ; no, bad value
  725.     cmp    r1    ,#3        ; a reasonable minimum ?
  726.     bhis    30$            ; ok
  727.     message    <RETRY should be between 3 and 30>,cr
  728.     return
  729. 30$:    mov    r1    ,maxtry        ; ok
  730. 40$:    return
  731.  
  732.  
  733.  
  734. set$ti::calls    l$val    ,<argpnt>    ; SET TIMEOUT decimal number
  735.     tst    r0            ; well ?
  736.     bne    100$            ; no, bad value
  737.     cmp    r1    ,#4        ; a reasonable minimum ?
  738.     blo    50$            ; ok
  739.     cmp    r1    ,#60.        ; a reasonable maximum ?
  740.     blos    60$            ; yes
  741. 50$:    message    <TIMEOUT should be between 4 and 60>,cr
  742.     return
  743. 60$:    movb    r1    ,conpar+p.time    ; alter remotes sinit default
  744.     movb    r1    ,setrec+p.time    ; show thats it's been set
  745. 100$:    return
  746.  
  747.     global    <argbuf    ,conesc    ,conpar    ,maxtry    ,setrec>
  748.  
  749.     .dsabl    lsb
  750.  
  751.     .sbttl    set record-format (highly RMS11 dependant)
  752.  
  753.  
  754. set$rf::calls    getcm0    ,<argpnt,#rfmlst>; find out which option was given
  755.     tst    r0
  756.     bmi    100$
  757.     jsr    pc    ,@r1
  758.     clr    r0
  759. 100$:    return
  760.  
  761.  
  762. srf$st:    clr    df$rat            ; stream ascii please for RSTS?
  763.     movb    #fb$stm    ,df$rfm        ; say so and exit
  764.     return
  765.  
  766. srf$va:    movb    #fb$cr    ,df$rat        ; must have this for RSX?
  767.     movb    #fb$var    ,df$rfm        ; r.var and fd.cr
  768.     return
  769.  
  770.     global    <df$rat    ,df$rfm    ,fb$cr    ,fb$stm    ,fb$var>
  771.  
  772.     command    rfmlst    ,STREAM     ,3    ,srf$st
  773.     command    rfmlst    ,VARIABLE,3    ,srf$va
  774.     command    rfmlst
  775.  
  776.  
  777.  
  778.     .sbttl    enable or disable attribute packet transmission
  779.  
  780.  
  781. set$at::calls    getcm0    ,<argpnt,#onoff>; 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    ,sendat        ; /42/
  786.     clr    r0            ; /42/
  787. 110$:    return
  788.  
  789.  
  790. set$lp::calls    getcm0    ,<argpnt,#onoff>; /42/ find out which option was given
  791.     tst    r0            ; /42/ did we find one
  792.     bmi    110$            ; /42/ no
  793.     jsr    pc    ,@r1        ; /42/ dispatch now
  794.     mov    r0    ,dolong        ; /42/
  795.     clr    r0            ; /42/
  796. 110$:    return
  797.  
  798. st$nat::clr    doattr
  799.     clr    r0
  800.     return
  801.  
  802. st$nlp::clr    dolong
  803.     clr    r0
  804.     return
  805.  
  806.     cm$glob    =    0
  807.  
  808.     command    onoff    ,OFF    ,3    ,s$of    ; /42/ Change names
  809.     command    onoff    ,ON    ,2    ,s$on    ; /42/ Change names
  810.     command    onoff    ,NONE    ,3    ,s$of    ; /42/ Change names
  811.     command    onoff                ; /42/ Change names
  812.  
  813.  
  814. s$of:    clr    r0
  815.     return
  816.  
  817. s$on:    mov    sp    ,r0
  818.     return
  819.  
  820.  
  821.     global    <sendat    ,dolong>
  822.  
  823.  
  824. set$pr::copyz    argpnt    ,#prompt,#20.
  825.     clr    r0
  826.     return
  827.  
  828.     global    <prompt    ,argbuf>
  829.  
  830.  
  831.  
  832.     .sbttl    error debugging
  833.  
  834.  
  835. set$se::calls    l$val    ,<argpnt>    ; SET SEED decimal number
  836.     tst    r0            ; well ?
  837.     bne    100$            ; no, bad value
  838.     mov    r1    ,testc        ; save it
  839. 100$:    return
  840.  
  841.  
  842. set$ra::calls    getcm0    ,<argpnt,#ranlst>; find out which option was given
  843.     tst    r0            ; did we find one
  844.     bmi    110$            ; no
  845.     jsr    pc    ,@r1        ; dispatch now
  846.     mov    r0    ,ranerr        ; save for the show command
  847. 100$:    clr    r0            ; exit with no error set
  848. 110$:    return
  849.  
  850.  
  851.  
  852.  
  853.     cm$glob    =    0
  854.  
  855.  
  856.     command    ranlst    ,OFF    ,3    ,sra$of
  857.     command    ranlst    ,ON    ,2    ,sra$on
  858.     command    ranlst    ,NONE    ,3    ,sra$of
  859.     command    ranlst
  860.  
  861.  
  862. sra$of:    clr    r0
  863.     return
  864.  
  865. sra$on:    mov    sp    ,r0
  866.     return
  867.  
  868.     global    <ranerr    ,testc>
  869.  
  870.  
  871.  
  872.  
  873.     .sbttl    set repeat on/off or to something (?)
  874.  
  875.  
  876.  
  877. set$rp::calls    getcm0    ,<argpnt,#relst>; find out which option was given
  878.     tst    r0            ; did we find one
  879.     bmi    110$            ; no
  880.     jsr    pc    ,@r1        ; dispatch now
  881.     mov    r0    ,setrpt        ; save for the show command
  882. 100$:    clr    r0            ; exit with no error set
  883. 110$:    return
  884.  
  885.  
  886.     cm$glob    =    0
  887.     command    relst    ,OFF    ,3    ,rep$of
  888.     command    relst    ,ON    ,2    ,rep$on
  889.     command    relst
  890.  
  891.  
  892. rep$of:    clr    r0
  893.     return
  894.  
  895. rep$on:    mov    #-1    ,r0
  896.     return
  897.  
  898.     global    <setrpt>
  899.  
  900.  
  901.  
  902.     .sbttl    set local terminal type
  903.  
  904.  
  905. set$tt::calls    getcm0    ,<argpnt,#ttlst>; find out which option was given
  906.     tst    r0            ; did we find one
  907.     bmi    110$            ; no
  908.     jsr    pc    ,@r1        ; dispatch now
  909.     mov    r0    ,vttype        ; save for the show command
  910. 100$:    clr    r0            ; exit with no error set
  911. 110$:    return
  912.  
  913.  
  914.  
  915.     cm$glob    =    0
  916.     command    ttlst    ,TTY    ,3    ,svt$tt
  917.     command    ttlst    ,VT100    ,3    ,svt$vt
  918.     command    ttlst    ,VT101    ,3    ,svt$vt
  919.     command    ttlst    ,VT102    ,3    ,svt$vt
  920.     command    ttlst    ,VT200    ,3    ,svt$22
  921.     command    ttlst    ,VT220    ,3    ,svt$22
  922.     command    ttlst
  923.  
  924.  
  925. svt$tt:    clr    r0
  926.     return
  927.  
  928. svt$vt:    mov    #vt100    ,r0
  929.     return
  930.  
  931. svt$22:    mov    #vt200    ,r0
  932.     return
  933.  
  934.  
  935.     global    <vttype>
  936.  
  937.  
  938.  
  939.     .sbttl    set various things for the console terminal
  940.  
  941.  
  942. set$co::calls    getcm0    ,<argpnt,#colst>; find out which option was given
  943.     tst    r0            ; did we find one
  944.     bmi    110$            ; no
  945.     jsr    pc    ,@r1        ; dispatch now
  946. 100$:    clr    r0            ; exit with no error set
  947. 110$:    return
  948.  
  949.  
  950.  
  951.     cm$glob    =    0
  952.     command    colst    ,8-BIT    ,1    ,sco$8
  953.     command    colst    ,7-BIT    ,1    ,sco$7
  954.     command    colst    ,8BIT    ,1    ,sco$8
  955.     command    colst    ,7BIT    ,1    ,sco$7
  956.     command    colst    ,8_BIT    ,1    ,sco$8
  957.     command    colst    ,7_BIT    ,1    ,sco$7
  958.     command    colst    ,PASSALL,3    ,sco$8
  959.     command    colst
  960.  
  961.  
  962. sco$7:    clr    con8bit
  963.     return
  964.  
  965. sco$8:    mov    sp    ,con8bit
  966.     return
  967.  
  968.     global    <con8bit>
  969.  
  970.  
  971. numout:    save    <r0,r1,r2>        ; /43/ Better formatting
  972.     mov    2+<3*2>(sp),r1        ; /43/ Get value please
  973.     mov    r1    ,-(sp)        ; /43/ Stuff it in
  974.     clr    -(sp)            ; /43/ Double conversion
  975.     mov    sp    ,r1        ; /43/ Address of word to convert
  976.     sub    #20    ,sp        ; /43/ A buffer to use
  977.     mov    sp    ,r0        ; /43/ A pointer to it
  978.     clr    r2            ; /43/ Leading zero/space suppress
  979.     call    $cddmg            ; /43/ Convert
  980.     clrb    @r0            ; /43/ .Asciz
  981.     mov    sp    ,r1        ; /43/ Reset pointer
  982.     print    r1            ; /43/ Dump please
  983.     add    #20+4    ,sp        ; /43/ Pop Junk
  984.     unsave    <r2,r1,r0>        ; /43/ Pop registers
  985.     mov    (sp)+    ,(sp)        ; /43/ Move return address up
  986.     return                ; /43/ Exit
  987.  
  988.     .end
  989.