home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / cpm80 / cpsrem.asm < prev    next >
Assembly Source File  |  2020-01-01  |  33KB  |  1,150 lines

  1. ; CPSREM.ASM
  2. ;       KERMIT - (Celtic for "FREE")
  3. ;
  4. ;       This is the CP/M-80 implementation of the Columbia University
  5. ;       KERMIT file transfer protocol.
  6. ;
  7. ;       Version 4.0
  8. ;
  9. ;       Copyright June 1981,1982,1983,1984
  10. ;       Columbia University
  11. ;
  12. ; Originally written by Bill Catchings of the Columbia University Center for
  13. ; Computing Activities, 612 W. 115th St., New York, NY 10025.
  14. ;
  15. ; Contributions by Frank da Cruz, Daphne Tzoar, Bernie Eiben,
  16. ; Bruce Tanner, Nick Bush, Greg Small, Kimmo Laaksonen, Jeff Damens, and many
  17. ; others. 
  18. ;
  19. ;       This file contains the (system-independent) routines that implement
  20. ;       the REMOTE commands of the KERMIT protocol.
  21. ;
  22. ; revision history:
  23. ;
  24. ;edit 13, 21-Mar-1991 by MF. Renamed REMOTE SET FILE COLLISION REPLACE to
  25. ;    REMOTE SET FILE COLLISION OVERWRITE and modified the corresponding
  26. ;    help text slightly.
  27. ;edit 12, 13-Feb-1991 by MF. Simplified code at "remcl0" to get REMOTE
  28. ;    command arguments by calling "cmgtch" in order to get command-line
  29. ;    characters directly. This means that command-line characters are
  30. ;    passed literally (except for prefixingand space-compression) to the
  31. ;    remote Kermit and that one need not send "?" or <esc> as "\"-prefixed
  32. ;    octal numbers in order to avoid immediate action by CP/M Kermit.
  33. ;edit 11, 30-Jan-1991 by MF. Corrected code to always require entry of at least
  34. ;    one argument in the REMOTE COPY, REMOTE DELETE (REMOTE ERASE),
  35. ;    REMOTE MESSAGE, REMOTE RENAME and REMOTE TYPE commands. This is
  36. ;    done by branching to KERMT3 (the "not confirmed" code) if the
  37. ;    first argument isn't given. This should correct a bug which occurred
  38. ;    in numerous places in which the character immediately following
  39. ;    that specifying the flavor of a Generic command was not defined if
  40. ;    the first of multiple (at least two) arguments was left blank but
  41. ;    subsequent arguments were not. This should correct a problem
  42. ;    encountered by Russell Lang of Monash University In Australia when
  43. ;    he did a REMOTE MESSAGE command with a blank first argument (the
  44. ;    user id) and a nonblank second argument (the message text) from
  45. ;    CP/M Kermit to Ms-Kermit in Server mode.
  46. ;edit 10, 14-Dec-1990 by MF.  Put "<<>>" around "x" or "F" packet replies
  47. ;    to REMOTE commands as in VMS Bliss Kermit and eliminate unnecessary
  48. ;    instruction before label remc2d.
  49. ;edit 9, 1-Nov-1990 by MF.  Changed REMOTE CWD to REMOTE CD in the quest for
  50. ;    uniformity of nomenclature (per request of FDC).
  51. ;edit 8, 29-Oct-1990 by MF.  Corrected Remote command code to properly
  52. ;    prefix control characters (repeat prefix (~) isn't done in CP/M
  53. ;    yet).
  54. ;edit 7, 17-Oct-1990 by MF.  Changed verb "REMOTE SEND-MESSAGE" to
  55. ;    "REMOTE MESSAGE" to conform with the nomenclature suggested in
  56. ;    Chapter 10 of the 6th edition of the Kermit Protocol Manual.
  57. ;edit 6, 10-Oct-1990 by MF.  Corrected Remote command code to
  58. ;    properly prefix the control-character prefix character and the
  59. ;    eighth-bit quotation prefix character.  Remote Set commands
  60. ;    now function correctly.
  61. ;    Also change the REMOTE SET FILE COLLISION ASK value to 5 per
  62. ;    Kermit Digest V12 #6 (though I still have no idea how the local
  63. ;    Kermit is supposed to answer).
  64. ;edit 5, 5-Oct-1990 by MF.  Coded many Remote Set commands.
  65. ;    The commands I have omitted deal with Attribute packets which
  66. ;    don't make much sense on a CP/M system.
  67. ;    Note also that for those Remote Set commands which take a
  68. ;    numeric argument, no range-checking is done here.
  69. ;    Also note that, for now, REMOTE SET FILE-COLLISION ASK is
  70. ;    equivalent to REMOTE SET FILE-COLLISION DISCARD because
  71. ;    (a) that's what the Kermit Digest indicated and (b) no mechanism
  72. ;    has been proposed for the Remote Kermit to query the Local Kermit.
  73. ;edit 4, 29-Sep-1990 by MF.  Corrected code to ignore error packets in
  74. ;    response to sending an "I" packet, per KPROTO.DOC
  75. ;edit 3, 9-Sep-1990 by MF.  Extensively revised this file to implement
  76. ;    Remote commands except for the following:
  77. ;    REMOTE JOURNAL, REMOTE MAIL, REMOTE PRINT, REMOTE PROGRAM,
  78. ;    REMOTE SET, REMOTE VARIABLE.
  79. ;edit 2 ... MF Dunno where edit 2 went (shown in Version string).
  80. ; edit 1: September 8th, 1987.  Created this file from bits of the two packet files.
  81. ;    The commands supported by this system are all the REMOTE commands,
  82. ;    to allow users to acces remote host systems via Kermit.  Added REMOTE
  83. ;    command table and REMOTE DIR command.
  84. ;
  85. ;
  86. remver:    db    'CPSREM.ASM (13)  21-Mar-1991$'    ; name, edit number, date
  87.  
  88. ;
  89. ;  REMOTE command - quite similar to the SET command
  90. remote:    call selmdm        ;Select modem
  91.     call    flsmdm        ;Flush buffers
  92.     call    selcon        ;Back to keyboard
  93.     lxi    d,remtab    ; remote commands table
  94.     lxi    h,remhlp    ; remote help table
  95.     call    keycmd        ; get result
  96.     xchg
  97.     pchl        ; and do it
  98.  
  99.  
  100.  
  101.  
  102. ; REMOTE command table.  Works the same way as every other table etc.
  103. ;
  104. remtab:    db    19        ; nineteen commands so far
  105.     db    2,'CD$'
  106.     dw    remcd        ; remote cd command
  107.     db    4,'COPY$'
  108.     dw    remcpy        ; remote copy command
  109.     db    6,'DELETE$'
  110.     dw    remdel        ; remote delete command
  111.     db    9,'DIRECTORY$'
  112.         dw    remdir    ; remote directory command
  113.     db    10,'DISK-USAGE$'
  114.     dw    remdsk        ; remote disk-usage command
  115.     db    5,'ERASE$'
  116.     dw    remdel        ; remote erase command (same as delete)
  117.     db    6,'FINISH$'
  118.         dw    finish    ; same as finish
  119.     db    4,'HELP$'
  120.     dw    remhep        ; remote help command
  121.     db    4,'HOST$'
  122.     dw    remhos        ; remote host command
  123.     db    6,'KERMIT$'
  124.     dw    remker        ; remote Kermit command
  125.     db    5,'LOGIN$'
  126.     dw    remlgi        ; remote login
  127.     db    6,'LOGOUT$'
  128.         dw    logout    ; same as logout
  129.     db    7,'MESSAGE$'
  130.     dw    remmsg        ; remote message command
  131.     db    6,'RENAME$'
  132.     dw    remren        ; remote rename
  133.     db    3,'SET$'
  134.     dw    remset        ; remote set command
  135.     db    5,'SPACE$'
  136.     dw    remdsk        ; remote space command (same as disk-usage)
  137.     db    6,'STATUS$'
  138.     dw    remsta        ; remote status (of server) command
  139.     db    4,'TYPE$'
  140.     dw    remtyp        ; remote type command
  141.     db    3,'WHO$'
  142.     dw    remwho        ; remote who command
  143.  
  144. remhlp:    db    cr,lf,'CD - change default directory for remote server'
  145.     db    ' operations'
  146.     db    cr,lf,'COPY - copy files on a remote system'
  147.     db    cr,lf,'DELETE - delete files on a remote system'
  148.     db    cr,lf,'DIRECTORY - list a directory on a remote system'
  149.     db    cr,lf,'DISK-USAGE - show disk usage on a remote system'
  150.     db    cr,lf,'FINISH - stop a remote server'
  151.     db    cr,lf,'HELP - get help from a remote server'
  152.     db    cr,lf,'HOST - execute a command on a remote system'
  153.     db    cr,lf,'KERMIT - tell a remote server to execute a Kermit '
  154.         db    'command'
  155.     db    cr,lf,'LOGIN - send user-identification to a remote server'
  156.     db    cr,lf,'LOGOUT -  stop and logout a remote server'
  157.     db    cr,lf,'MESSAGE - send a message to a remote system user'
  158.     db    cr,lf,'RENAME - rename files on a remote system'
  159.     db    cr,lf,'SET - set remote server parameters'
  160.     db    cr,lf,'SPACE - show disk-usage on a remote system'
  161.     db    cr,lf,'STATUS - Get status of a remote server'
  162.     db    cr,lf,'TYPE - type files on a remote system'
  163.     db    cr,lf,'WHO - show current users on a remote system'
  164.     db    '$'
  165.  
  166.  
  167. ;Description of remote commands
  168.  
  169. ;
  170. ;  Packets start with an I packet in place of S/R packet.  An X
  171. ;    packet is the same as an F (filename) packet except the 'file'
  172. ;    is not applicable.  Copy X packet data field to display.  Set
  173. ;    options so that no data is written to disk during D packets. 
  174. ;    (REMTXT <> 0)
  175. ;
  176. ;Packets:
  177. ;    we    we    comments
  178. ;    send    receive
  179. ;    I
  180. ;        ACK
  181. ;    Command packet
  182. ;        Ack or
  183. ;        Init
  184. ;    ACK
  185. ;        X    Dummy header.
  186. ;    ACK
  187. ;        D    listing from remote end
  188. ;    ACK        We got it
  189. ;    ....
  190. ;    ACK        last packet received ok
  191. ;        Z
  192. ;    ACK
  193. ;        B
  194. ;    ACK        end of transaction.
  195. ;
  196. ;**Note** If the Remote system gives a simple ack to the command packet,
  197. ;that is, a "short reply" is given, the data, if any, in the packet
  198. ;is displayed and the transaction ends.  The outline shown above is for a
  199. ;"long reply".
  200. ;
  201. ; Remote commands
  202. ;
  203. ; Remote Copy - Copy file(s) on remote system
  204. ;
  205. remcpy:    lxi    h,newfms    ;Second argument prompt
  206.     shld    rprmpt        ;...
  207.     mvi    a,'K'        ;Generic type
  208. remcp0:    sta    remdat        ;into packet
  209.     mvi    a,2        ;Packet has at least two characters
  210.     sta    rdl        ;...
  211.     mvi    a,'G'        ;Generic command
  212.     sta    rcom        ;...
  213.     lxi    d,remdat+2    ;Point to data buffer
  214.     call    remcli        ;Get filespec (if any) from command line
  215.     ora    a        ;Anything typed?
  216.       jz    kermt3        ;No, we must have an argument
  217.     mov    b,a        ;Save length
  218.     adi    space        ;Yes, make encoded field length
  219.     sta    remdat+1        ;and store in packet data area
  220.     lda    rdl        ;Get packet length so far
  221.     add    b        ;Count answer length
  222.     sta    rdl        ;and remember new packet size
  223.     lhld    rprmpt        ;Point to "new file" prompt
  224.     xchg        ;...
  225.     shld    rptr        ;Save data pointer
  226.     call    prompt        ;Prompt the user
  227.     lhld    rptr        ;Get data pointer again
  228.     inx    h        ;Skip encoded field-length
  229.     xchg        ;...
  230.     call    remcli        ;get user's answer
  231.     lhld    rptr        ;Restore pointer
  232.     mov    c,a        ;Save answer length
  233.     adi    space        ;Convert to encoded field length
  234.     mov    m,a        ;Put length in packet
  235.     lda    rdl        ;Get accumulated data length
  236.     add    c        ;plus data length
  237.     adi    1        ;plus field length character
  238.     sta    rdl        ;and remember it
  239.     jmp    remcom        ;and branch to common code
  240. ;
  241. ; Remote Cd - Change Directory
  242. ;
  243. remcd:    lxi    h,pswdms    ;Second argument prompt
  244.     shld    rprmpt        ;...
  245.     mvi    a,'C'        ;Generic cd
  246. remcd0:    sta    remdat        ;into packet
  247.     mvi    a,1        ;Packet is at least one character long
  248.     sta    rdl        ;...
  249.     mvi    a,'G'        ;Generic command
  250.     sta    rcom        ;...
  251.     lxi    d,remdat+2    ;Point to data buffer
  252.     call    remcli        ;Get filespec (if any) from command line
  253.     mov    b,a        ;Save answer length (may be zero)
  254.     adi    space        ;Make encoded field length
  255.     sta    remdat+1        ;and store in packet data area
  256.     lda    rdl        ;Get length so far
  257.     add    b        ;Count answer length
  258.     adi    1        ;and field length character
  259.     sta    rdl        ;and remember current packet-size
  260.     lda    remdat        ;Get generic packet flavor
  261.     cpi    'C'        ;Remote CD?
  262.     jnz    remcd1        ;No
  263.     mov    a,b        ;Get length of possible directory spec
  264.     ora    a        ;Did the user give a directory spec?
  265.     jz    remcom        ;No, we can process the command immediately
  266.     mvi    a,0ffH        ;Yes, password follows, make it not echo
  267.     sta    cmqflg        ;...
  268. remcd1:    lhld    rprmpt        ;Point to "password" prompt
  269.     xchg        ;...
  270.     shld    rptr        ;Save data pointer
  271.     mvi    a,0ffH        ;Allow blank password
  272.     sta    cmbflg        ;...
  273.     call    prompt        ;Prompt the user
  274.     lhld    rptr        ;Restore data pointer
  275.     xchg        ;...
  276.     inx    d        ;and increment it
  277.     call    remcli        ;Get user's answer
  278.     ora    a        ;Password given?
  279.       jz    remcom        ;No, proceed with command
  280.     mov    c,a        ;Yes, save answer length
  281.     adi    space        ;Convert to encoded field length
  282.     lhld    rptr        ;Get data pointer
  283.     mov    m,a        ;Put length in packet
  284.     lda    rdl        ;Get accumulated data length
  285.     adi    1        ;Count encoded field length
  286.     add    c        ;plus data length
  287.     sta    rdl        ;and remember packet-size
  288.     jmp    remcom        ;Branch to common code
  289. ;
  290. ; Remote Delete (Erase) command
  291. ;
  292. remdel:    mvi    a,'E'        ;Delete (Erase) command
  293. remdl0:    sta    remdat        ;...
  294.     mvi    a,1        ;At least one character in packet
  295.     sta    rdl        ;...
  296.     mvi    a,'G'        ;Generic command
  297.     sta    rcom        ;...
  298.     lxi    d,remdat+2    ;Point to data field
  299.     call    remcli        ;Get filespec
  300.     mov    b,a        ;Save length
  301.     lda    remdat        ;Get packet type
  302.     cpi    'E'        ;If Generic Delete
  303.     jz    remdl1        ;We must have an argument
  304.     cpi    'T'        ;Ditto for Generic Type
  305.     jz    remdl1        ;...
  306.     mov    a,b        ;Else get back character count
  307.     ora    a        ;Answer typed?
  308.       jz    remcom        ;No, process packet as is
  309. remdl1:    mov    a,b        ;Get character count again
  310.     ora    a        ;Anything typed?
  311.     jz    kermt3        ;No, we must have an argument (Delete/Type)
  312.     adi    space        ;Yes, encode field length
  313.     sta    remdat+1        ;and put in packet
  314.     lda    rdl        ;Get packet length so far
  315.     add    b        ;Count length of filespec
  316.     adi    1        ;Count field length character
  317.     sta    rdl        ;and store packet length
  318.     jmp    remcom        ;and do our stuff
  319. ;
  320. ; Remote Directory command
  321. ;
  322. remdir:    mvi    a,'D'        ;generic directory command
  323.     jmp    remdl0        ;Do common code
  324. ;
  325. ; Remote Disk-usage (Space) command
  326. ;
  327. remdsk:    mvi    a,'U'        ;Disk-usage generic command
  328.     jmp    remdl0        ;Do common code
  329. ;
  330. ; Remote Help command
  331. ;
  332. remhep:    mvi    a,'H'        ;generic help command
  333.     jmp    remdl0        ;Do common code
  334. ;
  335. ; Remote Host command
  336. ;
  337. remhos:    mvi    a,'C'        ;Remote Host command
  338. remho0:    sta    rcom        ;...
  339.     xra    a        ;Zero packet length
  340.     sta    rdl        ;...
  341.     lxi    d,remdat        ;Point to packet data buffer
  342.     call    remcli        ;Get host command
  343.     ora    a        ;Anything typed?
  344.     jz    kermt3        ;No, don't let the user get away with this
  345.     sta    rdl        ;Yes, store packet length
  346.     jmp    remcom        ;and do the command
  347. ;
  348. ; Remote Kermit command
  349. ;
  350. remker:    mvi    a,'K'        ;Remote Kermit command
  351.     jmp    remho0        ;Do common code
  352. ;
  353. ; Remote Login command
  354. ;
  355. remlgi:    mvi    a,'G'        ;Generic command
  356.     sta    rcom        ;...
  357.     mvi    a,'I'        ;Generic type
  358.     sta    remdat        ;into packet
  359.     mvi    a,1        ;At least one character in packet
  360.     sta    rdl        ;...
  361.     lxi    d,remdat+2    ;Point to data buffer
  362.     call    remcli        ;Get userid (if any) from command line
  363.     ora    a        ;Userid typed?
  364.       jz    remcom        ;No, nothing more to do
  365.     mov    b,a        ;Yes, save length
  366.     adi    space        ;Make encoded field length
  367.     sta    remdat+1        ;and store in packet data area
  368.     lda    rdl        ;Get packet length
  369.     add    b        ;Count id length
  370.     adi    1        ;and field length character
  371.     sta    rdl        ;and remember accumulated length
  372.     xchg        ;Save data pointer
  373.     shld    rptr        ;...
  374.     mvi    a,0ffH        ;Allow blank answers
  375.     sta    cmbflg        ;...
  376.     sta    cmqflg        ;Passwords don't echo
  377.     lxi    d,pswdms    ;Point to "password" prompt
  378.     call    prompt        ;Prompt the user
  379.     lhld    rptr        ;Get data pointer
  380.     xchg        ;Put in DE
  381.     inx    d        ;Skip encoded field-length
  382.     call    remcli        ;Get password, if any
  383.     ora    a        ;Anything typed?
  384.       jz    remcom        ;No, do command immediately
  385.     mov    c,a        ;Yes, save answer length
  386.     adi    space        ;Convert to encoded field length
  387.     lhld    rptr        ;Get pointer
  388.     mov    m,a        ;Put length in packet
  389.     lda    rdl        ;Get accumulated data length
  390.     adi    1        ;Count encoded field length
  391.     add    c        ;Count "password" field length
  392.     sta    rdl        ;and remember new packet length
  393.     xchg        ;Save data pointer
  394.     shld    rptr        ;...
  395.     xra    a        ;Allow echoing again for "account" field
  396.     sta    cmqflg        ;...
  397.     lxi    d,acctms    ;Point to "account" prompt
  398.     call    prompt        ;Prompt the user
  399.     lhld    rptr        ;Get data pointer
  400.     xchg        ;into DE
  401.     inx    d        ;Skip encoded field length
  402.     call    remcli        ;Get "account" field, if any
  403.     ora    a        ;Anything typed?
  404.       jz    remcom        ;No, do the command now
  405.     mov    c,a        ;Yes, save length of answer
  406.     adi    space        ;Convert to encoded field length
  407.     lhld    rptr        ;Get data pointer
  408.     mov    m,a        ;Put length in packet
  409.     lda    rdl        ;Get accumulated data length
  410.     adi    1        ;Count encoded field length
  411.     add    c        ;plus "account" length
  412.     sta    rdl        ;and remember it
  413.     jmp    remcom        ;Branch to common code
  414. ;
  415. ; Remote Rename command
  416. ;
  417. remren:    lxi    h,newfms    ;Second argument prompt
  418.     shld    rprmpt        ;...
  419.     mvi    a,'R'        ;generic rename
  420.     jmp    remcp0        ;Do common code
  421. ;
  422. ; Remote Message command
  423. ;
  424. remmsg:    lxi    h,msgms        ;Second argument prompt
  425.     shld    rprmpt        ;...
  426.     mvi    a,'M'        ;generic message
  427.     jmp    remcp0        ;Do common code
  428. ;
  429. ;Remote Set command
  430. ;
  431. remset:    mvi    a,6        ;Packet data area has at least six chars
  432.     sta    rdl        ;...
  433.     mvi    a,'S'        ;Remote Set command
  434.     sta    remdat        ;...
  435.     mvi    a,'G'        ;It's a generic command
  436.     sta    rcom        ;...
  437.     mvi    a,'#'        ;Encoded field-length for SET type
  438.     sta    remdat+1    ;which is three chars long
  439.     lxi    d,rmstab    ;Point to Set command table
  440.     lxi    h,rmshlp    ;and the help table
  441.     call    keycmd        ;Find out which command is to be executed
  442.     xchg        ;Put dispatch address in HL
  443.     pchl        ;Go do the command
  444. ;
  445. ; Common code for Remote Set commands that take an argument
  446. ;
  447. remscm:    lxi    d,remdat+6    ;We get an argument from the user
  448.     mvi    a,cmtxt        ;...
  449.     call    comnd        ;...
  450.     jmp    kermt3        ;Couldn't get one.
  451.     ora    a        ;Did the user give one?
  452.     jz    kermt3        ;a blank answer isn't acceptable
  453.     mov    c,a        ;Save length of answer
  454.     adi    space        ;Convert to encoded field-length
  455.     sta    remdat+5    ;and put in packet data area
  456.     lda    rdl        ;Get current data length
  457.     add    c        ;Count length of answer
  458.     sta    rdl        ;and store new data length
  459.     call    cfmcmd        ;Get a "confirm"
  460.     jmp    remcom        ;Do common Remote command code
  461. ;
  462. ; Common code for Remote Set commands requiring another table lookup
  463. ;
  464. remsc1:    call    chkkey        ;Get user's selection
  465.     sta    remdat+6    ;and put into the packet data area
  466.     mvi    a,'!'        ;Encoded field length for 1 char
  467.     sta    remdat+5    ;Put in packet
  468.     lda    rdl        ;Get accumulated packet data length
  469.     adi    1        ;Count length of answer (1 char)
  470.     sta    rdl        ;and store as new packet data length
  471.     jmp    remcom        ;Go do common Remote command processing
  472. ;
  473. ; Remote Status (of server) command
  474. ;
  475. remsta:    call    cfmcmd        ;Get return
  476.     mvi    a,'Q'        ;Command type (Server Status)
  477.     sta    remdat        ;...
  478.     mvi    a,'G'        ;Generic Kermit command
  479.     sta    rcom        ;...
  480.     mvi    a,1        ;1 character in packet
  481.     sta    rdl        ;...
  482.     jmp    remcom        ;Do common code
  483. ;
  484. ; Remote Type command
  485. ;
  486. remtyp:    mvi    a,'T'        ;generic type command
  487.     jmp    remdl0        ;Do common code
  488. ;
  489. ; Remote Who command
  490. ;
  491. remwho:    lxi    h,optms        ;Second argument prompt
  492.     shld    rprmpt        ;...
  493.     mvi    a,'W'        ;generic who
  494.     jmp    remcd0        ;Do common code
  495.  
  496. ; Common code for Remote commands
  497. ;
  498. remcom:
  499.     mvi    a,0ffH        ; Make sure returned info is sent
  500.     sta    remtxt        ;to the user's screen rather than to a file
  501.     lda    rcom        ;Get packet-type
  502.     cpi    'G'        ;Is it a generic command?
  503.     jnz    remc0e        ;No, go clear the screen
  504.     lda    remdat        ;Yes, get generic command type
  505.     cpi    'S'        ;Is it a Remote Set command?
  506.     jz    remc0f        ;Yes, don't clear the screen
  507. remc0e:    call    clrtop        ; clear the screen
  508. remc0f:    xra    a
  509.     sta    numtry        ; reset retries
  510.     sta    czseen
  511.     sta    pktnum
  512.     lxi    h,0
  513.     shld    numpkt
  514.     shld    numrtr        ; clear some variables
  515.  
  516.     mvi    a,'1'        ; reset block check type
  517.     sta    curchk
  518. remcm0:    mvi    a,'I'        ; init state
  519.     sta    state
  520.     call    sinit        ; do sendinit with I packet (??)
  521.     lda    state        ; now see if we are in the 'X' state
  522.     cpi    'X'
  523.     jz    remco0        ;Yup, all is in order
  524.     cpi    'A'        ;No, in abort state?
  525.     jnz    remcm0        ;No, try I-packet again
  526.     jmp    kermit        ;Yes, like Danny Boy, we must die.
  527.                 ;If we get this far, either the "I" packet
  528.                 ;was understood or the Server couldn't
  529.                 ;handle it and we ignored the error.
  530.                 ;In either case, we can proceed.
  531.  
  532.  
  533.  
  534. remco0:    xra    a
  535.     sta    numtry        ; reset retries
  536.     sta    czseen
  537.     sta    pktnum
  538.     lxi    h,0
  539.     shld    numpkt
  540.     shld    numrtr        ; clear some variables
  541.     mvi    a,'1'        ;Make sure we use
  542.     sta    curchk        ;1-character checksum
  543.     lda    rdl        ;Get packet-length (number of bytes to copy)
  544.     ora    a        ;Anything to copy?
  545.       jz    remcm1        ;No
  546.     sta    temp1        ;Yes, save loop counter
  547.     lda    spsiz        ;Get max packet size
  548.     sui    5        ;less overhead
  549.     sta    temp2        ;gives max chars we can send
  550.     lxi    d,remdat        ;Copy from private buffer
  551.     lxi    h,data        ;to packet data area
  552.     lda    qbchr        ;Get eightgh-bit quoting prefix char
  553.     mov    b,a        ;Save it
  554.     lda    squote        ;Get control-char quoting char
  555.     mov    c,a        ;and save it
  556. remc0a:    lda    temp2        ;Get characters to go in packet
  557.     dcr    a        ;and decrement it
  558.     sta    temp2        ;...
  559.     jm    remc0x        ;We can't copy any more
  560.     ldax    d        ;Get a packet data character
  561.     cpi    space        ;Is it a control char?
  562.     jm    remc0b        ;Yes, quote it
  563.     cmp    c        ;Is it the control-char prefix?
  564.     jz    remc0b        ;Yes, quote it
  565.     lda    quot8        ;No, is eighth-bit quoting in effect?
  566.     ora    a        ;...
  567.     jz    remc0c        ;No, just copy the character
  568.     ldax    d        ;Get character again
  569.     cmp    b        ;Is it the eighth-bit quote char?
  570.     jnz    remc0d        ;No, just copy it
  571. remc0b:    mov    m,c        ;Yes, quote the character
  572.     inx    h        ;Increment the dest. pointer
  573.     lda    temp2        ;Get chars to go
  574.     dcr    a        ;Decrement
  575.     sta    temp2        ;...
  576.     jm    remc0x        ;Can't copy any more
  577.     lda    rdl        ;Count quote prefix
  578.     inr    a        ;...
  579.     sta    rdl        ;...
  580. remc0c:    ldax    d        ;Get character again
  581.     cpi    space        ;If not a control char,
  582.     jp    remc0d        ;just copy the character, else
  583.     adi    40H        ;Convert to printing character
  584.     ani    7fH        ;modulo 128
  585. remc0d:    mov    m,a        ;Copy the character
  586.     inx    h        ;Increment the pointers
  587.     inx    d        ;...
  588. remc0x:    lda    temp1        ;Get loop counter
  589.     dcr    a        ;and decrement it
  590.     sta    temp1        ;...
  591.     jnz    remc0a        ;Copy entire packet data area
  592. ;
  593. remcm1:    xra    a
  594.     sta    argblk        ; set packet no zero
  595.     lda    rdl        ;Number of bytes in packet
  596.     sta    argblk+1    ;into argument block
  597.     lda    rcom        ;Remote command
  598.     call    spack        ;Send the packet
  599.     jmp    kermt3        ;Nogo, die!
  600.     jmp    remco2        ;Try to get an answer
  601.  
  602. remco1:    call    nak0        ;Nak packet
  603. ;
  604.  
  605. remco2:    lda    numtry        ;Get number of retries
  606.     inr    a        ; update retries
  607.     cpi    maxtry        ;To many retries?
  608.     jm    remc2a        ;No
  609.     lxi    d,erms28    ;Yes, complain
  610.     call    prtstr        ;...
  611.     jmp    kermit        ;and abort
  612.  
  613. remc2a:    sta    numtry
  614.     call    rpack        ;Get a packet
  615.     jmp    remco1        ;Couldn't get one.
  616.     cpi    'E'        ;Error packet?
  617.     jnz    remc2b        ;No
  618.     lda    rcom        ;What kind of packet did we send?
  619.     cpi    'G'        ;If it wasn't generic,
  620.     jnz    remc2f        ;there is no need to start a new message line
  621.     lda    remdat        ;Packet was generic
  622.     cpi    'S'        ;Was it a Remote Set?
  623.     cz    prcrlf        ;Yes, start a new line since the screen
  624.                 ;isn't blank and we would clobber the command-
  625.                 ;line otherwise
  626. remc2f:    call    error0        ;Yes, inform the user
  627.     jmp    kermit        ;and abort to main command loop
  628. remc2b:    cpi    'S'        ;Send-init?
  629.     jnz    remc2c        ;No
  630.     call    rini2a        ;Initialize parameters
  631.     lda    state        ;Get state
  632.     cpi    'A'        ;If abort,
  633.     jz    kermit        ;Go back to main command loop
  634.     mvi    a,'X'        ;Set state to text-display
  635.     sta    state        ;...
  636.     jmp    read2        ;Get more packets
  637. remc2c:    cpi    'N'        ;Nacked packet?
  638.     jz    remco2        ;Yes, try again
  639.     sta    state        ;Save packet type
  640.     call    selcon        ;Select Console
  641.     lxi    h,data        ;Point to data
  642.     lda    argblk+1    ;Anything in packet data?
  643.     ora    a        ;...
  644.     jz    remco6        ;No
  645.     push    h        ;Yes, save pointer
  646.     push    psw        ;and character count
  647.     mvi    e,'<'        ;Type "<<" as in VMSKermit
  648.     push    d        ;...
  649.     call    outcon        ;...
  650.     pop    d        ;...
  651.     call    outcon        ;...
  652.     pop    psw        ;Restore character counter
  653.     pop    h        ;and data pointer
  654. remc2d:    ora    a        ;...
  655.     jz    remc2e        ;No more characters
  656.     dcr    a        ;Decrement loop counter
  657. mov    e,m        ;Get character
  658.     inx    h        ;Increment pointer
  659.     push    psw        ;Save loop counter
  660.     push    h        ;Save data pointer
  661.     call    outcon        ;Type on Console
  662.     pop    h        ;Restore pointer
  663.     pop    psw        ;Restore loop counter
  664.     jmp    remc2d        ;Type all packet data
  665. remc2e:    mvi    e,'>'        ;Type ">>" as in VMSKermit
  666.     push    d        ;...
  667.     call    outcon        ;...
  668.     pop    d        ;...
  669.     call    outcon        ;...
  670.     call    prcrlf        ;End the line
  671. remco6:    lda    state        ;Get packet type again
  672.     cpi    'Y'        ;If simple ack,
  673.     jz    kermit        ;Done, else
  674.     call    ackp        ;Acknoledge the packet
  675.     call    countp        ;Count the packet
  676.     mvi    a,'D'        ;Set to data-receive
  677.     sta    state        ;...
  678.     jmp    read2        ; do the same as read a file, but echo
  679.                 ; to the screen.. Dont close non-open files.
  680. ;
  681. ;
  682. ;REMCLI - Get command-line for Remote commands
  683. ;
  684. remcli:    xra    a        ;Zero accumulated length
  685.     sta    rcl        ;...
  686.     mov    b,a        ;[12]...
  687. ;
  688. ;[MF][12]Eliminate following code which calls "comnd" in favor of code which
  689. ;[MF][12]calls "cmgtch" directly so that characters are sent without
  690. ;[MF][12]alteration or inadvertent action ("?" or <esc>). The only thing
  691. ;[MF][12]lost is the ability to produce any ASCII character via
  692. ;[MF][12]octal numbers prefixed with "\" but this isn't used much in remote
  693. ;[MF][12]commands anyway.
  694. ;
  695. ;remcl0:    mvi    a,cmtxt        ;We get arbitrary text
  696. ;    call    comnd        ;from the command-line
  697. ;    jmp    kermt3        ;We couldn't get any.
  698. ;    ora    a        ;Anything given?
  699. ;    jz    remcl1        ;No, done
  700. ;    push    b        ;Save BC
  701. ;    mov    c,a        ;Save length
  702. ;    lda    rcl        ;Get accumulated length
  703. ;    add    c        ;plus current word length
  704. ;    adi    1        ;plus a space
  705. ;    sta    rcl        ;and save accumulated length
  706. ;    mvi    a,space        ;Put in a space separator
  707. ;    stax    d        ;...
  708. ;    inx    d        ;Increment pointer
  709. ;    pop    b        ;Restore BC
  710. ;    jmp    remcl0        ;Get text to end-of-line
  711. ;remcl1:    lda    rcl        ;Get accumulated length
  712. ;    ora    a        ;Anything typed?
  713. ;    rz        ;No
  714. ;    dcr    a        ;Yes, don't count final space
  715. ;    push    psw        ;Save count
  716. ;    dcx    d        ;Point to final space
  717. ;    xra    a        ;Zap it
  718. ;    stax    d        ;...
  719. ;    pop    psw        ;Restore count
  720. ;
  721. ;[MF][12]Simplified code follows
  722. ;
  723. remcl0:    call    cmgtch        ;[12]Get a character from the user
  724.     ani    7fh        ;[12]Turn off minus bit
  725.     cpi    cr        ;[12]If end-of-line,
  726.     jz    remclx        ;[12]We're done
  727.     cpi    lf        ;[12]...
  728.     jz    remclx        ;[12]...
  729.     stax    d        ;[12]else store the character
  730.     inr    b        ;[12]and count it
  731.     inx    d        ;[12]Increment character buffer pointer
  732.     cpi    esc        ;[12]is character an <esc>?
  733.     jz    remcl2        ;[12]Yes
  734.     cpi    ff        ;[12]an <ff>?
  735.     jz    remcl1        ;[12]Yes, diddle command buffer pointer
  736.     cpi    '?'        ;[12]a "?"?
  737.     jnz    remcl0        ;[12]No, just get more characters
  738. remcl1:    push    h        ;[12]Protect HL
  739.     lhld    cmdptr        ;[12]get "cmgtch"'s character pointer
  740.     inx    h        ;[12]and reverse the action at "cmgtc4"
  741.                 ;[12]since we don't need a "confirm" and
  742.                 ;[12]infinite loops are beaucoup bad news
  743.     shld    cmdptr        ;[12]...
  744.     pop    h        ;[12]Restore HL
  745. remcl2:    push    psw        ;[12]Save the character
  746.     xra    a        ;[12]Zero the action flag so we get input
  747.     sta    cmaflg        ;[12]to end-of-line without special action
  748.     pop    psw        ;[12]Restore the character
  749.     jmp    remcl0        ;[12]Get more characters
  750. remclx:    mov    a,b        ;[12]Get accumulated text length
  751.     sta    rcl        ;[12]and remember it
  752. ;
  753.     ret        ;Return
  754. ;
  755. ;Remote set values
  756. ;
  757. ;  REMOTE SET FILE TYPE                    300   0 = TEXT, 1 = BINARY
  758. ;  REMOTE SET FILE NAMES                   301   0 = CONVERTED, 1 = LITERAL
  759. ;  REMOTE SET FILE COLLISION               302   0 = RENAME,  1 = OVERWRITE,
  760. ;                                                2 = BACKUP,  3 = APPEND,
  761. ;                                                4 = DISCARD, 5 = ASK
  762. ;  REMOTE SET FILE REPLACE                 303   0 = PRESERVE, 1 = DEFAULT
  763. ;  REMOTE SET FILE INCOMPLETE              310   0 = DISCARD, 1 = KEEP
  764. ;  REMOTE SET INCOMPLETE (same as above)
  765. ;  REMOTE SET BLOCK-CHECK                  400   number (1, 2, or 3)
  766. ;  REMOTE SET RECEIVE PACKET-LENGTH        401   number (10-9024)
  767. ;  REMOTE SET RECEIVE TIMEOUT              402   number (any, 0 = no timeout)
  768. ;  REMOTE SET RETRY                        403   number (any, 0 = no limit)
  769. ;  REMOTE SET SERVER TIMEOUT               404   number (any, 0 = no timeout)
  770. ;REMOTE SET FILE BLOCKSIZE       311  number
  771. ;REMOTE SET FILE RECORD-LENGTH   312  number
  772. ;REMOTE SET FILE RECORD-FORMAT   313  F (fixed), V (variable), etc...
  773. ;This is just for the record, to assign these numbers to these commands
  774. ;for somebody who needed them.  Details to be filled in later.
  775. ;
  776. ;Remote Set command table
  777. ;
  778. rmstab:    db    7        ;seven entries
  779.     db    16,'BLOCK-CHECK-TYPE$'
  780.     dw    remsbc        ;Remote Set Block Check
  781.     db    4,'FILE$'
  782.     dw    remsfl        ;Remote Set File
  783.     db    10,'INCOMPLETE$'
  784.     dw    remsfi        ;Remote Set (file) Incomplete
  785.     db    7,'RECEIVE$'
  786.     dw    remsrc        ;Remote Set Receive
  787.     db    7,'REPLACE$'
  788.     dw    remsfr        ;Remote Set (file) Replace
  789.     db    5,'RETRY$'
  790.     dw    remsry        ;Remote Set Retry
  791.     db    14,'SERVER-TIMEOUT$'
  792.     dw    remsst        ;Remote Set Server Timeout
  793. ;
  794. rmshlp:    db    cr,lf,'BLOCK-CHECK-TYPE for a remote server'
  795.     db    cr,lf,'FILE parameters for a remote server'
  796.     db    cr,lf,'INCOMPLETE file disposition for a remote server'
  797.     db    cr,lf,'RECEIVE parameters for a remote server'
  798.     db    cr,lf,'REPLACE file attribute handling for a remote server'
  799.     db    cr,lf,'RETRY maximum for a remote server'
  800.     db    cr,lf,'SERVER-TIMEOUT interval for a remote server'
  801.     db    '$'
  802. ;
  803. ;Remote Set File tables
  804. ;
  805. rsftab:    db    8        ;eight entries
  806.     db    10,'BLOCK-SIZE$'
  807.     dw    remsbs        ;Remote Set File Block-size command
  808.     db    9,'COLLISION$'
  809.     dw    remsfc        ;Remote Set File Collision command
  810.     db    10,'INCOMPLETE$'
  811.     dw    remsfi        ;Remote Set File Incomplete command
  812.     db    5,'NAMES$'
  813.     dw    remsfn        ;Remote Set File Names command
  814.     db    13,'RECORD-FORMAT$'
  815.     dw    remsrf        ;Remote Set File Record-format
  816.     db    13,'RECORD-LENGTH$'
  817.     dw    remsrl        ;Remote Set File Record-length
  818.     db    7,'REPLACE$'
  819.     dw    remsfr        ;Remote Set File Replace command
  820.     db    4,'TYPE$'
  821.     dw    remsft        ;Remote Set File Type command
  822. ;
  823. rsfhlp:    db    cr,lf,'BLOCK-SIZE of files for a remote server'
  824.     db    cr,lf,'COLLISION action on filename conflicts for a remote'
  825.     db    ' server'
  826.     db    cr,lf,'INCOMPLETE file disposition for a remote server'
  827.     db    cr,lf,'NAMES translation of files for a remote server'
  828.     db    cr,lf,'RECORD-FORMAT of files for a remote server'
  829.     db    cr,lf,'RECORD-LENGTH for a remote server'
  830.     db    cr,lf,'REPLACE file attribute handling for a remote server'
  831.     db    cr,lf,'TYPE of files for a remote server'
  832.     db    '$'
  833. ;
  834. ;Remote Set File Record-format tables
  835. ;
  836. rcftab:    db    2        ;two entries
  837.     db    5,'FIXED$'
  838.     db    'F','F'        ;Remote Set File Record-format Fixed command
  839.     db    8,'VARIABLE$'
  840.     db    'V','V'        ;Remote Set File Record-format Variable cmd
  841. ;
  842. rcfhlp:    db    cr,lf,'FIXED    VARIABLE'
  843.     db    '$'
  844. ;
  845. ;Remote Set Receive tables
  846. ;
  847. rrctab:    db    2        ;two entries
  848.     db    13,'PACKET-LENGTH$'
  849.     dw    remrpl        ;Remote Set Receive Packet-length command
  850.     db    7,'TIMEOUT$'
  851.     dw    remsrt        ;Remote Set Receive Timeout command
  852. ;
  853. rrchlp:    db    cr,lf,'PACKET-length    TIMEOUT'
  854.     db    '$'
  855. ;
  856. ;Remote Set File-collision table
  857. ;
  858. rfctab:    db    6        ;six entries
  859.     db    6,'APPEND$'
  860.     db    '3','3'        ;Set collision append
  861.     db    3,'ASK$'
  862.     db    '5','5'        ;Set collision ask
  863.     db    6,'BACKUP$'
  864.     db    '2','2'        ;Set collision backup
  865.     db    7,'DISCARD$'
  866.     db    '4','4'        ;Set collision discard
  867.     db    9,'OVERWRITE$'
  868.     db    '1','1'        ;Set collision overwrite
  869.     db    6,'RENAME$'
  870.     db    '0','0'        ;Set collision rename
  871. ;
  872. rfchlp:    db    cr,lf,'ASK about existing files on a remote system'
  873.     db    cr,lf,'APPEND to existing files on a remote system'
  874.     db    cr,lf,'BACKUP (rename) existing files on a remote system'
  875.     db    cr,lf,'DISCARD new versions of existing files on a'
  876.     db    ' remote system'
  877.     db    cr,lf,'OVERWRITE existing files on a remote system'
  878.     db    cr,lf,'RENAME new versions of existing files on a'
  879.     db    ' remote system'
  880.     db    '$'
  881. ;
  882. ;Remote Set File-Incomplete tables
  883. ;
  884. rfitab:    db    2        ;2 entries
  885.     db    7,'DISCARD$'
  886.     db    '0','0'        ;Remote Set File Incomplete Discard
  887.     db    4,'KEEP$'
  888.     db    '1','1'        ;Remote Set File Incomplete Keep
  889. ;
  890. rfihlp:    db    cr,lf,'DISCARD    KEEP'
  891.     db    '$'
  892. ;
  893. ;Remote Set File-Names tables
  894. ;
  895. rfntab:    db    2        ;two entries
  896.     db    9,'CONVERTED$'
  897.     db    '0','0'        ;Remote Set File Names Converted
  898.     db    7,'LITERAL$'
  899.     db    '1','1'        ;Remote Set File Names Literal
  900. ;
  901. rfnhlp:    db    cr,lf,'CONVERTED    LITERAL'
  902.     db    '$'
  903. ;
  904. ;Remote Set File Replace tables
  905. ;
  906. rfrtab:    db    2        ;two entries
  907.     db    8,'PRESERVE$'
  908.     db    '0','0'        ;Remote Set File Replace Preserve
  909.     db    7,'DEFAULT$'
  910.     db    '1','1'        ;Remote Set File Replace Default
  911. ;
  912. rfrhlp:    db    cr,lf,'PRESERVE    DEFAULT'
  913.     db    '$'
  914. ;
  915. ;Remote Set File Type tables
  916. ;
  917. rfttab:    db    2        ;two entries
  918.     db    6,'BINARY$'
  919.     db    '1','1'        ;Remote Set File Type Binary
  920.     db    4,'TEXT$'
  921.     db    '0','0'        ;Remote Set File Type Text
  922. ;
  923. rfthlp:    db    cr,lf,'BINARY    TEXT'
  924.     db    '$'
  925. ;
  926. ; Remote Set Block-check
  927. ;
  928. remsbc:
  929. IF lasm
  930.     lxi    h,'40'        ;1st 2 chars of "400"
  931. ENDIF ;lasm
  932. IF NOT lasm
  933.     lxi    h,'04'
  934. ENDIF ;NOT lasm
  935.     shld    remdat+2    ;Store in correct order
  936.     mvi    a,'0'        ;Put last char of type in buffer
  937.     sta    remdat+4    ;...
  938.     lxi    d,blktab    ;Point to block-check table
  939.     lxi    h,blkhlp    ;and help table
  940.     jmp    remsc1        ;Do common code
  941. ;
  942. ;Remote Set File command
  943. ;
  944. remsfl:    lxi    d,rsftab    ;Point to Remote Set File tables
  945.     lxi    h,rsfhlp    ;...
  946. remsf0:    call    keycmd        ;Get user's selection
  947.     xchg        ;Put dispatch address in HL
  948.     pchl        ;and obey the user's most fervent desires
  949. ;
  950. ;Remote Set Receive command
  951. ;
  952. remsrc:    lxi    d,rrctab    ;Point to the appropriate tables
  953.     lxi    h,rrchlp    ;...
  954.     jmp    remsf0        ;and do command
  955. ;
  956. ;Remote Set Block-size command
  957. ;
  958. remsbs:
  959. IF lasm
  960.     lxi    h,'31'        ;1st 2 chars of Set code
  961. ENDIF ;lasm
  962. IF NOT lasm
  963.     lxi    h,'13'
  964. ENDIF ;NOT lasm
  965.     shld    remdat+2    ;Store chars in correct order
  966.     mvi    a,'1'        ;Put last char in buffer
  967.     sta    remdat+4    ;...
  968.     jmp    remscm        ;and do common Remote Set code
  969. ;
  970. ;Remote Set File-collision command
  971. ;
  972. remsfc:
  973. IF lasm
  974.     lxi    h,'30'        ;Put set type code in buffer
  975. ENDIF ;lasm
  976. IF NOT lasm
  977.     lxi    h,'03'
  978. ENDIF ;NOT lasm
  979.     shld    remdat+2    ;...
  980.     mvi    a,'2'        ;...
  981.     sta    remdat+4        ;...
  982.     lxi    d,rfctab    ;Point to tables
  983.     lxi    h,rfchlp    ;...
  984.     jmp    remsc1        ;and do common code
  985. ;
  986. ;Remote Set File Incomplete command
  987. ;
  988. remsfi:
  989. IF lasm
  990.     lxi    h,'31'        ;Establish command keyword code
  991. ENDIF ;lasm
  992. IF NOT lasm
  993.     lxi    h,'13'
  994. ENDIF ;NOT lasm
  995.     shld    remdat+2    ;...
  996.     mvi    a,'0'        ;...
  997.     sta    remdat+4    ;...
  998.     lxi    d,rfitab    ;Point to tables
  999.     lxi    h,rfihlp    ;...
  1000.     jmp    remsc1        ;and do common code
  1001. ;
  1002. ;Remote Set File-Names command
  1003. ;
  1004. remsfn:
  1005. IF lasm
  1006.     lxi    h,'30'        ;Set command code
  1007. ENDIF ;lasm
  1008. IF NOT lasm
  1009.     lxi    h,'03'
  1010. ENDIF ;NOT lasm
  1011.     shld    remdat+2    ;...
  1012.     mvi    a,'1'        ;...
  1013.     sta    remdat+4    ;...
  1014.     lxi    d,rfntab    ;Point to the appropriate tables
  1015.     lxi    h,rfnhlp    ;...
  1016.     jmp    remsc1        ;and do common code
  1017. ;
  1018. ;Remote Set File Record Format command
  1019. ;
  1020. remsrf:
  1021. IF lasm
  1022.     lxi    h,'31'        ;Set command code
  1023. ENDIF ;lasm
  1024. IF NOT lasm
  1025.     lxi    h,'13'
  1026. ENDIF ;NOT lasm
  1027.     shld    remdat+2    ;...
  1028.     mvi    a,'3'        ;...
  1029.     sta    remdat+4    ;...
  1030.     lxi    d,rcftab    ;Point to proper tables
  1031.     lxi    h,rcfhlp    ;...
  1032.     jmp    remsc1        ;and do common code
  1033. ;
  1034. ;Remote Set File Record Length command
  1035. ;
  1036. remsrl:
  1037. IF lasm
  1038.     lxi    h,'31'        ;Set command code
  1039. ENDIF ;lasm
  1040. IF NOT lasm
  1041.     lxi    h,'13'
  1042. ENDIF ;NOT lasm
  1043.     shld    remdat+2    ;...
  1044.     mvi    a,'2'        ;...
  1045.     sta    remdat+4    ;...
  1046.     jmp    remscm        ;and do common code
  1047. ;
  1048. ;Remote Set File Replace command
  1049. ;
  1050. remsfr:
  1051. IF lasm
  1052.     lxi    h,'30'        ;Set command code
  1053. ENDIF ;lasm
  1054. IF NOT lasm
  1055.     lxi    h,'03'
  1056. ENDIF ;NOT lasm
  1057.     shld    remdat+2    ;...
  1058.     mvi    a,'3'        ;...
  1059.     sta    remdat+4    ;...
  1060.     lxi    d,rfrtab    ;Point to tables
  1061.     lxi    h,rfrhlp    ;...
  1062.     jmp    remsc1        ;and do common code
  1063. ;
  1064. ;Remote Set File Type command
  1065. ;
  1066. remsft:
  1067. IF lasm
  1068.     lxi    h,'30'        ;Set command code
  1069. ENDIF ;lasm
  1070. IF NOT lasm
  1071.     lxi    h,'03'
  1072. ENDIF ;NOT lasm
  1073.     shld    remdat+2    ;...
  1074.     mvi    a,'0'        ;...
  1075.     sta    remdat+4    ;...
  1076.     lxi    d,rfttab    ;Point to tables
  1077.     lxi    h,rfthlp    ;...
  1078.     jmp    remsc1        ;and go to common code
  1079. ;
  1080. ;Remote Set Receive Packet-length command
  1081. ;
  1082. remrpl:
  1083. IF lasm
  1084.     lxi    h,'40'        ;Set command code
  1085. ENDIF ;lasm
  1086. IF NOT lasm
  1087.     lxi    h,'04'
  1088. ENDIF ;NOT lasm
  1089.     shld    remdat+2    ;...
  1090.     mvi    a,'1'        ;...
  1091.     sta    remdat+4    ;...
  1092.     jmp    remscm        ;and do common code
  1093. ;
  1094. ;Remote Set Receive Timeout command
  1095. ;
  1096. remsrt:
  1097. IF lasm
  1098.     lxi    h,'40'        ;Set code
  1099. ENDIF ;lasm
  1100. IF NOT lasm
  1101.     lxi    h,'04'
  1102. ENDIF ;NOT lasm
  1103.     shld    remdat+2    ;...
  1104.     mvi    a,'2'        ;...
  1105.     sta    remdat+4    ;...
  1106.     jmp    remscm        ;and do common code
  1107. ;
  1108. ;Remote Set Retry command
  1109. ;
  1110. remsry:
  1111. IF lasm
  1112.     lxi    h,'40'        ;Set code
  1113. ENDIF ;lasm
  1114. IF NOT lasm
  1115.     lxi    h,'04'
  1116. ENDIF ;NOT lasm
  1117.     shld    remdat+2    ;...
  1118.     mvi    a,'3'        ;...
  1119.     sta    remdat+4    ;...
  1120.     jmp    remscm        ;Go to common code
  1121. ;
  1122. ;Remote Set Server Timeout command
  1123. ;
  1124. remsst:
  1125. IF lasm
  1126.     lxi    h,'40'        ;Set code
  1127. ENDIF ;lasm
  1128. IF NOT lasm
  1129.     lxi    h,'04'
  1130. ENDIF ;NOT lasm
  1131.     shld    remdat+2    ;...
  1132.     mvi    a,'4'        ;...
  1133.     sta    remdat+4    ;...
  1134.     jmp    remscm        ;Do common code
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140. ; Little code to allow some expansion of code without changing
  1141. ;  every futher address, only up to the end of this file.
  1142. ;   TO BE REMOVED FOR RELEASE
  1143.  
  1144. ;    ORG    ($+100H) AND 0FF00H
  1145.  
  1146.  
  1147. IF lasm
  1148.     LINK    CPSSER        
  1149. ENDIF    ;lasm
  1150.