2 ; KERMIT - (Celtic for "FREE")
4 ; This is the CP/M-80 implementation of the Columbia University
5 ; KERMIT file transfer protocol.
9 ; Copyright June 1981,1982,1983,1984
12 ; Originally written by Bill Catchings of the Columbia University Center for
13 ; Computing Activities, 612 W. 115th St., New York, NY 10025.
15 ; Contributions by Frank da Cruz, Daphne Tzoar, Bernie Eiben,
16 ; Bruce Tanner, Nick Bush, Greg Small, Kimmo Laaksonen, Jeff Damens, and many
19 ; This file contains the (system-independent) routines that implement
20 ; the REMOTE commands of the KERMIT protocol.
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
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
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.
86 remver: db 'CPSREM.ASM (13) 21-Mar-1991$' ; name, edit number, date
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
102 ; REMOTE command table. Works the same way as every other table etc.
104 remtab: db 19 ; nineteen commands so far
106 dw remcd ; remote cd command
108 dw remcpy ; remote copy command
110 dw remdel ; remote delete command
112 dw remdir ; remote directory command
114 dw remdsk ; remote disk-usage command
116 dw remdel ; remote erase command (same as delete)
118 dw finish ; same as finish
120 dw remhep ; remote help command
122 dw remhos ; remote host command
124 dw remker ; remote Kermit command
126 dw remlgi ; remote login
128 dw logout ; same as logout
130 dw remmsg ; remote message command
132 dw remren ; remote rename
134 dw remset ; remote set command
136 dw remdsk ; remote space command (same as disk-usage)
138 dw remsta ; remote status (of server) command
140 dw remtyp ; remote type command
142 dw remwho ; remote who command
144 remhlp: db cr,lf,'CD - change default directory for remote server'
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 '
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'
167 ;Description of remote commands
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.
187 ; D listing from remote end
190 ; ACK last packet received ok
194 ; ACK end of transaction.
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
203 ; Remote Copy - Copy file(s) on remote system
205 remcpy: lxi h,newfms ;Second argument prompt
207 mvi a,'K' ;Generic type
208 remcp0: sta remdat ;into packet
209 mvi a,2 ;Packet has at least two characters
211 mvi a,'G' ;Generic command
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
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
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
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
241 ; Remote Cd - Change Directory
243 remcd: lxi h,pswdms ;Second argument prompt
245 mvi a,'C' ;Generic cd
246 remcd0: sta remdat ;into packet
247 mvi a,1 ;Packet is at least one character long
249 mvi a,'G' ;Generic command
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
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
268 remcd1: lhld rprmpt ;Point to "password" prompt
270 shld rptr ;Save data pointer
271 mvi a,0ffH ;Allow blank password
273 call prompt ;Prompt the user
274 lhld rptr ;Restore data pointer
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
290 ; Remote Delete (Erase) command
292 remdel: mvi a,'E' ;Delete (Erase) command
293 remdl0: sta remdat ;...
294 mvi a,1 ;At least one character in packet
296 mvi a,'G' ;Generic command
298 lxi d,remdat+2 ;Point to data field
299 call remcli ;Get filespec
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
306 mov a,b ;Else get back character count
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
320 ; Remote Directory command
322 remdir: mvi a,'D' ;generic directory command
323 jmp remdl0 ;Do common code
325 ; Remote Disk-usage (Space) command
327 remdsk: mvi a,'U' ;Disk-usage generic command
328 jmp remdl0 ;Do common code
330 ; Remote Help command
332 remhep: mvi a,'H' ;generic help command
333 jmp remdl0 ;Do common code
335 ; Remote Host command
337 remhos: mvi a,'C' ;Remote Host command
338 remho0: sta rcom ;...
339 xra a ;Zero packet length
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
348 ; Remote Kermit command
350 remker: mvi a,'K' ;Remote Kermit command
351 jmp remho0 ;Do common code
353 ; Remote Login command
355 remlgi: mvi a,'G' ;Generic command
357 mvi a,'I' ;Generic type
358 sta remdat ;into packet
359 mvi a,1 ;At least one character in packet
361 lxi d,remdat+2 ;Point to data buffer
362 call remcli ;Get userid (if any) from command line
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
374 mvi a,0ffH ;Allow blank answers
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
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
395 xra a ;Allow echoing again for "account" field
397 lxi d,acctms ;Point to "account" prompt
398 call prompt ;Prompt the user
399 lhld rptr ;Get data pointer
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
415 ; Remote Rename command
417 remren: lxi h,newfms ;Second argument prompt
419 mvi a,'R' ;generic rename
420 jmp remcp0 ;Do common code
422 ; Remote Message command
424 remmsg: lxi h,msgms ;Second argument prompt
426 mvi a,'M' ;generic message
427 jmp remcp0 ;Do common code
431 remset: mvi a,6 ;Packet data area has at least six chars
433 mvi a,'S' ;Remote Set command
435 mvi a,'G' ;It's a generic command
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
445 ; Common code for Remote Set commands that take an argument
447 remscm: lxi d,remdat+6 ;We get an argument from the user
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
462 ; Common code for Remote Set commands requiring another table lookup
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
473 ; Remote Status (of server) command
475 remsta: call cfmcmd ;Get return
476 mvi a,'Q' ;Command type (Server Status)
478 mvi a,'G' ;Generic Kermit command
480 mvi a,1 ;1 character in packet
482 jmp remcom ;Do common code
484 ; Remote Type command
486 remtyp: mvi a,'T' ;generic type command
487 jmp remdl0 ;Do common code
491 remwho: lxi h,optms ;Second argument prompt
493 mvi a,'W' ;generic who
494 jmp remcd0 ;Do common code
496 ; Common code for Remote commands
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
509 sta numtry ; reset retries
514 shld numrtr ; clear some variables
516 mvi a,'1' ; reset block check type
518 remcm0: mvi a,'I' ; init state
520 call sinit ; do sendinit with I packet (??)
521 lda state ; now see if we are in the 'X' state
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.
535 sta numtry ; reset retries
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?
546 sta temp1 ;Yes, save loop counter
547 lda spsiz ;Get max packet size
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
554 lda squote ;Get control-char quoting char
556 remc0a: lda temp2 ;Get characters to go in packet
557 dcr a ;and decrement it
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?
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
576 jm remc0x ;Can't copy any more
577 lda rdl ;Count quote prefix
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
585 remc0d: mov m,a ;Copy the character
586 inx h ;Increment the pointers
588 remc0x: lda temp1 ;Get loop counter
589 dcr a ;and decrement it
591 jnz remc0a ;Copy entire packet data area
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
602 remco1: call nak0 ;Nak packet
605 remco2: lda numtry ;Get number of retries
606 inr a ; update retries
607 cpi maxtry ;To many retries?
609 lxi d,erms28 ;Yes, complain
611 jmp kermit ;and abort
614 call rpack ;Get a packet
615 jmp remco1 ;Couldn't get one.
616 cpi 'E' ;Error packet?
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-
626 remc2f: call error0 ;Yes, inform the user
627 jmp kermit ;and abort to main command loop
628 remc2b: cpi 'S' ;Send-init?
630 call rini2a ;Initialize parameters
633 jz kermit ;Go back to main command loop
634 mvi a,'X' ;Set state to text-display
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?
645 push h ;Yes, save pointer
646 push psw ;and character count
647 mvi e,'<' ;Type "<<" as in VMSKermit
652 pop psw ;Restore character counter
653 pop h ;and data pointer
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
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
678 jmp read2 ; do the same as read a file, but echo
679 ; to the screen.. Dont close non-open files.
682 ;REMCLI - Get command-line for Remote commands
684 remcli: xra a ;Zero accumulated length
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.
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
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
708 ; inx d ;Increment pointer
710 ; jmp remcl0 ;Get text to end-of-line
711 ;remcl1: lda rcl ;Get accumulated length
712 ; ora a ;Anything typed?
714 ; dcr a ;Yes, don't count final space
715 ; push psw ;Save count
716 ; dcx d ;Point to final space
719 ; pop psw ;Restore count
721 ;[MF][12]Simplified code follows
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
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>?
735 jz remcl1 ;[12]Yes, diddle command buffer pointer
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
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
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.
776 ;Remote Set command table
778 rmstab: db 7 ;seven entries
779 db 16,'BLOCK-CHECK-TYPE$'
780 dw remsbc ;Remote Set Block Check
782 dw remsfl ;Remote Set File
784 dw remsfi ;Remote Set (file) Incomplete
786 dw remsrc ;Remote Set Receive
788 dw remsfr ;Remote Set (file) Replace
790 dw remsry ;Remote Set Retry
791 db 14,'SERVER-TIMEOUT$'
792 dw remsst ;Remote Set Server Timeout
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'
803 ;Remote Set File tables
805 rsftab: db 8 ;eight entries
807 dw remsbs ;Remote Set File Block-size command
809 dw remsfc ;Remote Set File Collision command
811 dw remsfi ;Remote Set File Incomplete command
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
819 dw remsfr ;Remote Set File Replace command
821 dw remsft ;Remote Set File Type command
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'
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'
834 ;Remote Set File Record-format tables
836 rcftab: db 2 ;two entries
838 db 'F','F' ;Remote Set File Record-format Fixed command
840 db 'V','V' ;Remote Set File Record-format Variable cmd
842 rcfhlp: db cr,lf,'FIXED VARIABLE'
845 ;Remote Set Receive tables
847 rrctab: db 2 ;two entries
848 db 13,'PACKET-LENGTH$'
849 dw remrpl ;Remote Set Receive Packet-length command
851 dw remsrt ;Remote Set Receive Timeout command
853 rrchlp: db cr,lf,'PACKET-length TIMEOUT'
856 ;Remote Set File-collision table
858 rfctab: db 6 ;six entries
860 db '3','3' ;Set collision append
862 db '5','5' ;Set collision ask
864 db '2','2' ;Set collision backup
866 db '4','4' ;Set collision discard
868 db '1','1' ;Set collision overwrite
870 db '0','0' ;Set collision rename
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'
877 db cr,lf,'OVERWRITE existing files on a remote system'
878 db cr,lf,'RENAME new versions of existing files on a'
882 ;Remote Set File-Incomplete tables
884 rfitab: db 2 ;2 entries
886 db '0','0' ;Remote Set File Incomplete Discard
888 db '1','1' ;Remote Set File Incomplete Keep
890 rfihlp: db cr,lf,'DISCARD KEEP'
893 ;Remote Set File-Names tables
895 rfntab: db 2 ;two entries
897 db '0','0' ;Remote Set File Names Converted
899 db '1','1' ;Remote Set File Names Literal
901 rfnhlp: db cr,lf,'CONVERTED LITERAL'
904 ;Remote Set File Replace tables
906 rfrtab: db 2 ;two entries
908 db '0','0' ;Remote Set File Replace Preserve
910 db '1','1' ;Remote Set File Replace Default
912 rfrhlp: db cr,lf,'PRESERVE DEFAULT'
915 ;Remote Set File Type tables
917 rfttab: db 2 ;two entries
919 db '1','1' ;Remote Set File Type Binary
921 db '0','0' ;Remote Set File Type Text
923 rfthlp: db cr,lf,'BINARY TEXT'
926 ; Remote Set Block-check
930 lxi h,'40' ;1st 2 chars of "400"
935 shld remdat+2 ;Store in correct order
936 mvi a,'0' ;Put last char of type in buffer
938 lxi d,blktab ;Point to block-check table
939 lxi h,blkhlp ;and help table
940 jmp remsc1 ;Do common code
942 ;Remote Set File command
944 remsfl: lxi d,rsftab ;Point to Remote Set File tables
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
950 ;Remote Set Receive command
952 remsrc: lxi d,rrctab ;Point to the appropriate tables
954 jmp remsf0 ;and do command
956 ;Remote Set Block-size command
960 lxi h,'31' ;1st 2 chars of Set code
965 shld remdat+2 ;Store chars in correct order
966 mvi a,'1' ;Put last char in buffer
968 jmp remscm ;and do common Remote Set code
970 ;Remote Set File-collision command
974 lxi h,'30' ;Put set type code in buffer
982 lxi d,rfctab ;Point to tables
984 jmp remsc1 ;and do common code
986 ;Remote Set File Incomplete command
990 lxi h,'31' ;Establish command keyword code
998 lxi d,rfitab ;Point to tables
1000 jmp remsc1 ;and do common code
1002 ;Remote Set File-Names command
1006 lxi h,'30' ;Set command code
1014 lxi d,rfntab ;Point to the appropriate tables
1016 jmp remsc1 ;and do common code
1018 ;Remote Set File Record Format command
1022 lxi h,'31' ;Set command code
1030 lxi d,rcftab ;Point to proper tables
1032 jmp remsc1 ;and do common code
1034 ;Remote Set File Record Length command
1038 lxi h,'31' ;Set command code
1046 jmp remscm ;and do common code
1048 ;Remote Set File Replace command
1052 lxi h,'30' ;Set command code
1060 lxi d,rfrtab ;Point to tables
1062 jmp remsc1 ;and do common code
1064 ;Remote Set File Type command
1068 lxi h,'30' ;Set command code
1076 lxi d,rfttab ;Point to tables
1078 jmp remsc1 ;and go to common code
1080 ;Remote Set Receive Packet-length command
1084 lxi h,'40' ;Set command code
1092 jmp remscm ;and do common code
1094 ;Remote Set Receive Timeout command
1098 lxi h,'40' ;Set code
1106 jmp remscm ;and do common code
1108 ;Remote Set Retry command
1112 lxi h,'40' ;Set code
1120 jmp remscm ;Go to common code
1122 ;Remote Set Server Timeout command
1126 lxi h,'40' ;Set code
1134 jmp remscm ;Do common code
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
1144 ; ORG ($+100H) AND 0FF00H