home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / b / krtcm1.min < prev    next >
Text File  |  2020-01-01  |  5KB  |  362 lines

  1.     .title    KRTCM1.MIN  Misc commands overlay
  2.     .ident    "V03.62"
  3.  
  4. ; /62/    31-May-93  Billy Youdelman
  5.  
  6. ;    Copyright 1983,1984 Change Software, Inc.
  7. ;
  8. ;    This software is furnished under a license and may
  9. ;    be  used  and  copied  only in accordance with the
  10. ;    terms of such license and with  the  inclusion  of
  11. ;    the  above copyright notice.  This software or any
  12. ;    other copies thereof may not be provided or other-
  13. ;    wise made available to any other person.  No title
  14. ;    to and ownership of the software is hereby  trans-
  15. ;    ferred.
  16. ;
  17. ;    The information in this  software  is  subject  to
  18. ;    change  without notice and should not be construed
  19. ;    as a commitment by the author.
  20.  
  21.     .include "IN:KRTMAC.MIN"
  22.     .iif ndf  KRTINC  .error    <; .include for IN:KRTMAC.MIN failed>
  23.  
  24.     .mcall    .PURGE
  25.  
  26.  
  27.     .psect    $code
  28.     .sbttl    The SET command
  29.  
  30. c$set::    upone    argbuf
  31.     call    loaset
  32.     calls    getcm0    ,<argbuf,r0>
  33.     mov    r0    ,r2
  34.     bmi    79$
  35.     tst    wasnul
  36.     bne    100$
  37.     call    loaset
  38.     calls    getcm1    ,<argbuf,r0,r2>
  39.     tst    r0
  40.     bmi    79$
  41.  
  42. 7$:    scan    #comma    ,argbuf
  43.     mov    r0    ,restof
  44.     beq    17$
  45.     add    argbuf    ,restof
  46.     mov    restof    ,r0
  47.     clrb    -(r0)
  48.     mov    r1    ,lastcmd
  49.  
  50. 17$:    jsr    pc    ,@r1
  51.     tst    r0
  52.     bne    29$
  53.     mov    restof    ,r0
  54.     beq    100$
  55. 173$:    cmpb    (r0)+    ,#space
  56.     beq    173$
  57.     dec    r0
  58. 177$:    copyz    r0  ,argbuf  ,#ln$max
  59.     mov    lastcmd    ,r1
  60.     br    7$
  61.  
  62. 29$:    cmp    r0    ,#cmd$un
  63.     blt    89$
  64.     bgt    37$
  65.     mov    #er$aop    ,r0
  66.     br    89$
  67. 37$:    cmp    r0    ,#cmd$bad
  68.     bne    79$
  69.     mov    #er$bad    ,r0
  70.     br    89$
  71.  
  72. 79$:    cmp    r0    ,#cmd$ab
  73.     beq    99$
  74.     cmp    r0    ,#cmd$nx
  75.     beq    99$
  76.     cmp    r0    ,#cmd$ex
  77.     beq    99$
  78.     cmp    r0    ,#cmd$un
  79.     bne    81$
  80.     mov    #er$sam    ,r0
  81.     br    89$
  82. 81$:    cmp    r0    ,#cmd$bad
  83.     bne    89$
  84.     mov    #er$sun    ,r0
  85. 89$:    direrr    r0
  86. 99$:    call    incsts
  87. 100$:    return
  88.  
  89. skipit::tst    restof
  90.     beq    23$
  91.     strlen    argbuf
  92.     add    argbuf    ,r0
  93.     movb    #comma    ,(r0)+
  94.     copyz    restof    ,r0  ,#ln$max
  95.     clr    restof
  96. 23$:    return
  97.  
  98.  
  99.     .sbttl    The TAKE command
  100.     .enabl    lsb
  101.  
  102. c$take::tst    cmdlun
  103.     beq    9$
  104.     tst    sy.ini
  105.     beq    5$
  106.     call    defterm
  107.     br    7$
  108.  
  109. 5$:    tst    infomsg
  110.     beq    7$
  111. 6$:    wrtall    #indnam
  112.     message    < closed>,cr
  113. 7$:    calls    close    ,<#lun.ta>
  114.     clr    cmdlun
  115.  
  116. 9$:    clr    r4
  117.     upcase    argbuf
  118.  
  119.     scan    #'.    ,argbuf
  120.     tst    r0
  121.     bne    10$
  122.     strcat    argbuf    ,#takdef
  123.  
  124. 10$:    scan    #':    ,argbuf
  125.     tst    r0
  126.     beq    11$
  127.     copyz    argbuf    ,#indnam,#16+1
  128.     br    12$
  129.  
  130. 11$:    mov    #202$    ,r3
  131.     mov    sp    ,r4
  132. 210$:    tst    @r3
  133.     beq    220$
  134.     copyz    argbuf    ,(r3)+    ,#11.
  135.     br    210$
  136.  
  137. 220$:    mov    #201$    ,r3
  138. 225$:    tst    @r3
  139.     bne    227$
  140.     mov    #er$fnf    ,r0
  141.     br    95$
  142.  
  143. 227$:    copyz    (r3)+    ,#indnam,#16+1
  144.  
  145. 12$:    calls    fparse    ,<#indnam,#srcnam>
  146.     tst    r0
  147.     bne    95$
  148.  
  149. 13$:    calls    iswild    ,<#srcnam>
  150.     tst    r0
  151.     bne    95$
  152.  
  153. 17$:    calls    open,<#srcnam,#lun.ta,#text>
  154.     tst    r0
  155.     bne    90$
  156. 20$:    mov    #lun.ta    ,cmdlun
  157.     copyz    #srcnam    ,#indnam ,#16+1
  158.     tst    infomsg
  159.     beq    29$
  160.     wrtall    #indnam
  161.     message    < opened>,cr
  162. 29$:    clr    exstal
  163.     br    100$
  164.  
  165. 90$:    tst    r4
  166.     bne    225$
  167. 95$:    direrr    r0
  168.     call    incsts
  169.     clrb    indnam
  170. 100$:    return
  171.  
  172.     .save
  173.     .psect    $rwdata    ,rw,d,lcl,rel,con
  174. 201$:    .word    500$ ,600$ ,0
  175. 202$:    .word    501$ ,601$ ,0
  176. 500$:    .ascii    "DK:"
  177. 501$:    .asciz    "            "
  178. 600$:    .ascii    "SY:"
  179. 601$:    .asciz    "            "
  180.     .even
  181.  
  182.     .psect    $pdata
  183. takdef::.asciz    ".COM"
  184.     .even
  185.     .restore
  186.  
  187.     .dsabl    lsb
  188.  
  189.  
  190.     .sbttl    Local DIRECTORY and SPACE commands
  191.  
  192. c$spac::mov    sp    ,summary
  193. c$dir::    upcase    argbuf
  194.     calls    fixwild    ,<argbuf>
  195.     calls    dodir    ,<argbuf>
  196.     tst    r0
  197.     beq    100$
  198.     direrr    r0
  199. 100$:    return
  200.  
  201.  
  202.     .sbttl    The local TYPE command
  203.     .enabl    lsb
  204.  
  205. c$type::upcase    argbuf
  206.     calls    fparse    ,<argbuf,#srcnam>
  207.     tst    r0
  208.     beq    1$
  209.     jmp    90$
  210.  
  211. 1$:    clr    index
  212.     scan    #'.    ,#srcnam
  213.     tst    r0
  214.     bne    2$
  215.     strcat    #srcnam    ,#typdef
  216.  
  217. 2$:    calls    iswild    ,<#srcnam>
  218.     mov    r0    ,r4
  219.  
  220. 3$:    calls    lookup    ,<#srcnam,#filnam>
  221.     tst    r0
  222.     beq    4$
  223.     clr    r1
  224.     cmp    r0    ,#er$nmf
  225.     beq    20$
  226.     cmp    r0    ,#er$fnf
  227.     bne    993$
  228. 20$:    tst    index
  229.     beq    21$
  230.     jmp    95$
  231. 21$:    mov    #er$fnf    ,r0
  232. 993$:    jmp    93$
  233.  
  234. 4$:    mov    #more    ,r3
  235.     clr    r1
  236.     calls    chkext    ,<#filnam>
  237.     tst    r0
  238.     beq    5$
  239.     mov    #less    ,r3
  240.     inc    r1
  241.  
  242. 5$:    clr    r2
  243.     calls    open,<#filnam,#lun.in,r1>
  244.     tst    r0
  245.     bne    90$
  246.     com    r2
  247.     tst    r4
  248.     beq    7$
  249.     cmp    index    ,#1
  250.     bne    7$
  251.     message    < Files copied:>,cr
  252. 7$:    tst    r1
  253.     beq    8$
  254.     message    <?TYPE-W-Binary file filter enabled>,cr
  255. 8$:    tst    r4
  256.     beq    9$
  257.     wrtall    #filnam
  258.     message    < to TT:>,cr
  259. 9$:    calls    open,<#0,#lun.kb,r1>
  260.  
  261. 10$:    mov    #lun.in    ,r0
  262.     call    getcr0
  263.     tst    r0
  264.     bne    90$
  265.     cmp    vttype    ,#vt200
  266.     bge    22$
  267.     bicb    #200    ,r1
  268. 22$:    cmpb    r1    ,#space
  269.     bge    33$
  270. 23$:    scan    r1    ,r3
  271.     tst    r0
  272.     beq    10$
  273.  
  274. 33$:    asr    crflag
  275.     bcc    37$
  276.     cmpb    r1    ,#lf
  277.     beq    37$
  278.     calls    putc    ,<#lf,#lun.kb>
  279. 37$:    cmpb    r1    ,#cr
  280.     bne    39$
  281.     inc    crflag
  282. 39$:    calls    putc    ,<r1,#lun.kb>
  283.     br    10$
  284.  
  285. 90$:    mov    r0    ,r1
  286.     cmp    r0    ,#er$eof
  287.     beq    95$
  288. 93$:    direrr    r0
  289.     clr    r1
  290. 95$:    calls    close    ,<#lun.kb>
  291. 97$:    tst    r2
  292.     beq    100$
  293.     calls    close    ,<#lun.in>
  294. 100$:    cmp    r1    ,#er$eof
  295.     bne    101$
  296.     .newline
  297.     jmp    3$
  298. 101$:    .purge    #lun.sr
  299.     clr    r0
  300.     return
  301.  
  302.     .save
  303.     .psect    $pdata
  304. less:    .asciz    <cr><lf>
  305. more:    .asciz    <bell><bs><tab><cr><ff><lf><ctrl$n><ctrl$o><esc>
  306. typdef:    .asciz    ".LST"
  307.     .even
  308.  
  309.     .psect    $rwdata    ,rw,d,lcl,rel,con
  310. crflag:    .word    0
  311.     .restore
  312.  
  313.     .dsabl    lsb
  314.  
  315.  
  316.     .sbttl    SHOW LINE
  317.     .enabl    lsb
  318.  
  319. defterm::tst    infomsg
  320.     beq    1$
  321.     wrtall    #indnam
  322.     message    < closed>,cr
  323. 1$:    tst    signon
  324.     bne    3$
  325.     call    sho$line
  326. 3$:    mov    qu.ini    ,infomsg
  327.     clr    sy.ini
  328.     return
  329.  
  330. sho$li::message    <Link device is TT:   S/W Parity: >
  331.     mov    parity    ,r0
  332.     asl    r0
  333.     wrtall    parlst(r0)
  334.     .newline
  335.     mov    sp    ,signon
  336.     clr    r0
  337.     return
  338.  
  339.     .save
  340.     .psect    $pdata
  341. parlst:    .word    5$ ,10$ ,20$ ,30$ ,40$
  342. 5$:    .asciz    "NONE"
  343. 10$:    .asciz    "ODD"
  344. 20$:    .asciz    "EVEN"
  345. 30$:    .asciz    "MARK"
  346. 40$:    .asciz    "SPACE"
  347.     .even
  348.     .restore
  349.  
  350.     .dsabl    lsb
  351.  
  352.  
  353.     .sbttl    Cleanup before exiting to monitor
  354.  
  355. c$exit::call    sd$off
  356.     tst    outopn
  357.     beq    30$
  358.     calls    close    ,<#lun.ou>
  359. 30$:    jmp    exit
  360.  
  361.     .end
  362.