]> cloudbase.mooo.com Git - kermit-80.git/blame - cpsdat.asm
Import of "Kermit 80 for CP/M-80 and CP/M-85" from http://www.columbia.edu/kermit...
[kermit-80.git] / cpsdat.asm
CommitLineData
c25f6a44
L
1; CPSDAT.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,1985
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; Pure and impure data areas. Previously of CPSUTL.ASM
20;
21; revision history:
22;
23;edit 19, 29-Mar-1991 by MF. Add flag "initak" (nonzero) which is cleared
24; after the initial automatic TAKE attempt of KERMIT.INI to allow
25; "unable to find file" complaints if not doing that initial TAKE.
26;edit 18, 21-Mar-1991 by MF. Renamed parameter vermin to revno (revision
27; level) since verno is already known as the "minor version number".
28;edit 17, 27-Feb-1991 by MF. Corrected typeo in "inms19" and commented out
29; "typptr" pointer as the TYPE command now uses the big buffer.
30; Also provided for a "minor version number" (1-26=A-Z) and message to
31; facilitate display of Kermit version in VERSION command (modmsg)
32;edit 16, 12-Feb-1991 by MF. Eliminated storage (message and variable)
33; for case sensitivity by commenting it out.
34;edit 15, 9-Dec-1990 by MF. Modified message for "directory file size"
35; status report to make it clearer when spoken by a speech synthesizer.
36;edit 14, 4-Dec-1990 by MF. Added message for Autoreceive status report.
37;edit 13, 30-Nov-1990 by MF. Added messages to display regular/quiet status
38; of terminal in SHOW and STATUS commands.
39;edit 12, 8-Nov-1990 by MF. Added a new message for Set Autoreceive.
40;edit 11, 2-Nov-1990 by MF. Moved overlay address to 7000H -- I didn't
41; realize I was **that** close to the limit until I made a couple of
42; cosmetic changes and REM CD bombed. This is still ver. 4.10 as it
43; hasn''t been released yet.
44;edit 10, 1-Nov-1990 by MF. Changed message at "spdst" to conform with
45; the change of "SET BAUD-RATE" to "SET SPEED".
46; Also added message "sdpst2" for speed status (staspd) routine
47;edit 9, 17-Oct-1990 by MF. Changed "packet-size" messages to use the
48; word "length" to conform with the nomenclature suggested in the
49; 6th edition of the Kermit Protocol Manual.
50;edit 8, 19-Sep-1990 by MF. Added error message for FRENAME command.
51;edit 7, 14-Sep-1990 by MF. Added storage/strings for SET COLLISION command.
52; Also added strings/storage for SET INCOMPLETE-FILE command.
53;edit 6, 9-Sep-1990 by MF. Added messages and storage for Remote commands.
54; and display of packet sizes
55; Moved overlay address to 06C00H for Version 4.10.
56; edit 5, 8 April, 1987 by OBSchou. Added new entry in jump table to call
57; code for an external terminal type. Added some new error messages
58; and added more to the packet space.
59;
60; edit 4, 30 March by OBSchou. Added in space for autoreceive.
61;
62; edit 3, 19 March, 1987 by OBSchou. Added some more strings etc, and
63; increased the stack space fro 32 entries to 64.
64;
65; edit 2, 11 March, 1987 by OBSchou.
66; Added in some more data and strings and things. Nothing special
67;
68; edit 1, 28 January, 1987 by OBSchou
69; Following file the data section of CPSUTL.ASM. This part of the
70; CPSUTL.ASM file now seperate as it ws getting too larg. Link to here
71; from CPSUTL.ASM (which now has only the utlity routines).
72; Also added in bits submitted by Dave Roberts of Leicester:
73; DJR 18th January 1987 - David J. Roberts.
74; Support for cosmetic changes in CPSMIT:
75; New strings DBGST and CURDST
76; CRLF in front of TIMMSG
77; LOGST changed, and new LOGST2
78;
79;
80datver: db 'CPSDAT.ASM (19) 29-Mar-1991$'
81
82
83
84;\f
85
86version:db 'Kermit-80 v4.'
87 db (verno/10) + '0' ; tenth's digit of version number
88 db (verno MOD 10) + '0' ; hundredth's digit
89IF revno ;[MF]If a revision level,
90 db revno+'@' ;[MF]put it in (range 1-26=A-Z)
91ENDIF ;revno [MF]
92 db ' $'
93modmsg: db ' has been built from the following modules:$';[MF]
94kerm: db 'Kermit-80 '
95kerm1: db 'nnx:>$' ;'x' filled in at startup with DRIVE name
96 ;'nn filled at startup and user with user number
97crlf: db cr,lf,'$'
98ermes1: db cr,lf,'?Unrecognized command$'
99ermes3: db cr,lf,'?Not confirmed$'
100ermes4: db '?Unable to receive initiate',cr,lf,'$'
101ermes5: db '?Unable to receive file name',cr,lf,'$'
102ermes6: db '?Unable to receive end of file',cr,lf,'$'
103erms10: db '?Unable to receive data',cr,lf,'$'
104erms11: db '?Disk full',cr,lf,'$'
105erms12: db '?Directory full',cr,lf,'$'
106erms14: db '?Unable to receive an acknowledgement from the host',cr,lf,'$'
107erms15: db cr,lf,'?Unable to find file',cr,lf,'$'
108erms16: db '?Unable to rename file$'
109erms17: db cr,lf,'?Disk full$'
110erms18: db cr,lf,'?Unable to tell host that the session is finished$'
111erms19: db cr,lf,'?Unable to tell host to logout$'
112erms20: db cr,lf,'?Kermit has not been configured for a target system$'
113erms21: db cr,lf,'?Consistency check on configuration failed$'
114erms22: db cr,lf,'?Error writing to log file',cr,lf,'$' ;[pcc005]
115erms23: db cr,lf,'?Invalid user number$'
116erms24: db cr,lf,'?Invalid Pause parameter$'
117erms25: db cr,lf,'?Invalid BUFFER-SIZE parameter$'
118erms26: db cr,lf,'?Invalid packet length (too long)$'
119erms27: db cr,lf,'?Invalid Checktype$'
120erms28: db cr,lf,'?Too many retries$'
121erms29: db cr,lf,'?Failed to exchange parameters$'
122erms30: db cr,lf,'?Failed to receive input string in alloted time$'
123erms31: db cr,lf,'?File already exists$' ;[MF]
124
125infms3: db bell,'Completed$'
126infms4: db bell,'Failed$'
127infms5: db '%Renaming file to $'
128infms6: db cr,lf,'[Closing the log file]$'
129infms7: db cr,lf,'[Connected to remote host. Type $'
130infms8: db 'C to return;',cr,lf,' type $'
131inms8a: db '? for command list]',cr,lf,'$'
132infms9: db cr,lf,'[Connection closed, back at micro]$'
133inms10: db 'Control-$'
134inms11: db ' Not implemented.$'
135inms12: db ' (Not implemented)',cr,lf,'$'
136inms13: db bell,'Interrupted$'
137inms14: db TAB,TAB,' Directory for drive '
138dnam14: db 'nnx:',cr,lf,'$' ;filled in by dir routine.
139inms15: DB CR,LF,TAB,TAB,'Drive $'
140inms16: DB ' has $';filled in by summary code with drive letter
141inms17: DB 'K bytes free',CR,LF,'$'
142inms18: DB CR,LF,'File(s) erased$',CR,LF
143inms19: db cr,lf,'[Transmitting file to host:'
144 db cr,lf,' 1. Lines automatically sent, and wait for possible reply'
145 db cr,lf,' 2. CONTROL-C aborts transfer'
146 db cr,lf,' 3. If transfer hangs, try a return to continue'
147 db cr,lf,' 4. on exit, you will be placed in CONNECT state.'
148 db cr,lf,'$'
149inms20: db 'R to send the same line again,'
150 db cr,lf,' or type $'
151inms21: db 'C to abort transmission.]',cr,lf,'$'
152inms22: db cr,lf,'[Transmission done. Connected normally '
153 db 'to remote host,'
154 db cr,lf,' type $'
155inms23: db 'Sending...$'
156inms24: db 'Receiving...$'
157inms25: db bell,'Warning: eighth bit cannot be sent$'
158inms26: db cr,lf,'For help, type ? at any point in a command$'
159inms27: db cr,lf,'[Logging suspended]',cr,lf,'$' ;[pcc003]
160inms28: db cr,lf,'[Logging resumed]',cr,lf,'$' ;[pcc003]
161inms29: db cr,lf,'[Transmission Aborted. Connected normally '
162 db 'to remote host,'
163 db cr,lf,' type $'
164autmes: db cr,lf,cr,lf,'[Automatically receiving; type ^C to abort]'
165 db cr,lf,cr,lf,'$' ;[MF]
166anymes: db cr,lf,cr,lf,' * * * Press any key to continue * * * '
167 db cr,lf,cr,lf,'$'
168escmes: db cr,lf,'Type the new escape character: $'
169tacmes: db cr,lf,'Type the new TAC intercept character: $'
170sopmes: db cr,lf,'Give the start-of-packet character: $' ;[gnn]
171padcms: db cr,lf,'Type the new padding character: $' ;[obs]
172xmthlp: db cr,lf,'R Send the same line again$'
173loghlp: db cr,lf,'Q Suspend logging' ;[pcc003]
174 db cr,lf,'R Resume logging$' ;[pcc003]
175inthlp: db cr,lf,'? This message'
176 db cr,lf,'C Close the connection'
177 db cr,lf,'0 (zero) Transmit a NULL'
178 db cr,lf,'P Toggle printer on/off' ;[pcc002]
179 db cr,lf,'S Status of the connection$'
180inhlp1: db cr,lf,'Typing another $'
181inhlp2: db ' will send it to the host'
182 db cr,lf,cr,lf,'Command>$'
183
184xmtst: db cr,lf,'Transmitting a file$'
185autrst: db cr,lf,'Autoreceive is$'
186locst: db cr,lf,'Local echo$'
187onstr: db ' on$'
188offstr: db ' off$'
189flost: db cr,lf,'Flow control$'
190;senst: db cr,lf,'Case sensetivity$'
191vtdpst: db cr,lf,'Terminal display is $'
192vtdpsr: db 'REGULAR$'
193vtdpsq: db 'QUIET$'
194vtemst: db cr,lf,'Terminal emulation is $'
195cpmst: db cr,lf,'File Mode$'
196defstr: db ' default$'
197ascstr: db ' ASCII$'
198binstr: db ' binary$'
199hfsod: db cr,lf,'Display file size on DIRECTORY command$'
200ibmst: db cr,lf,'IBM flag$'
201incst: db cr,lf,'Disposition for incomplete files is$'
202dscstr: db ' discard$'
203kepstr: db ' keep$'
204filst: db cr,lf,'File warning$'
205prst: db cr,lf,'Printer copy$'
206logst: db cr,lf,'Logging to $' ;[pcc003][DJR]
207logst2: db ' is$' ;[DJR]
208susstr: db ' suspended$' ;[pcc003]
209sspmsg: db cr,lf,'SEND start-of-pkt char ^$' ;[gnn]
210rspmsg: db cr,lf,'RECEIVE start-of-pkt char ^$' ;[gnn]
211spsmsg: db cr,lf,'SEND packet length $' ;[MF]
212rpsmsg: db cr,lf,'RECEIVE packet length $' ;[MF]
213escst: db cr,lf,'Escape char: $'
214bufsz1: db cr,lf,'Multi-sector buffering at $'
215bufsz2: db ' of a maximum of $'
216xmitst: db cr,lf,'Transmit protocol char: $'
217bckst: db cr,lf,'Block check type: $'
218bckst1: db '-character$'
219collst: db cr,lf,'File COLLISION: $';[MF]
220parst: db cr,lf,'Parity: $'
221pnonst: db 'none$'
222pmrkst: db 'mark$'
223pspcst: db 'space$'
224poddst: db 'odd$'
225pevnst: db 'even$'
226porst: db cr,lf,'Port in use is: $'
227spdst: db cr,lf,'Current speed is: $'
228spdst2: db ' bps$' ;[MF]
229spdust: db 'indeterminate (not SET)$'
230timmsg: db cr,lf,'Timer$' ;[DJR] Added CRLF like the others
231tacst: db cr,lf,'Current TACTrap Status/Intercept Character: $'
232usrst: db cr,lf,'Current user number: $'
233dbgst: db cr,lf,'Debugging$' ;[DJR]
234curdst: db cr,lf,'Current default disk: $' ;[DJR]
235spac15: db ' $' ; *** 15 spaces ***
236samems: db cr,lf,'?Source and destination files the same$'
237nofile: db cr,lf,'?File not found$'
238cmer00: db cr,lf,'?Program error: Invalid COMND call$'
239cmer01: db cr,lf,'?Ambiguous$'
240cmer02: db cr,lf,'?Illegal CP/M file specification$'
241cmer03: db cr,lf,'?Wild-cards not allowed in file specification$' ;[pcc006]
242cmer04: db cr,lf,'?Invalid user number$'
243cmer05: db cr,lf,'?Invalid \ parameter$'
244cmin00: db ' Confirm with carriage return$'
245cmin01: db ' Enter a number$'
246cmin02: db ' Confirm with carriage return or enter more$'
247
248; Diagnostic messages
249sstatm: db '<SState:> ',0
250rstatm: db '<RState:> ',0
251spackm: db '<Data transmitted> ',0
252rpackm: db '<Data received > ',0
253princr: db cr,lf,0
254;
255; Remote command messages [MF]
256;
257newfms: db cr,lf,'New file: $'
258pswdms: db cr,lf,'Password: $'
259acctms: db cr,lf,'Account: $'
260newnms: db cr,lf,'New name: $'
261msgms: db cr,lf,'Message: $'
262optms: db cr,lf,'Options: $'
263
264;\f
265 ;Impure data
266
267;COMND storage
268
269comchr: ds 1 ;[8] save space
270floctl: db 0 ;[8] flow control on/off flag
271;casens: db 0 ;[8] Upper/lower case sensitive
272cmstat: ds 1 ;What is presently being parsed.
273cmaflg: ds 1 ;Non-zero when an action char has been found.
274cmbflg: ds 1 ;[MF]Nonzero to allow a blank initial keyword
275cmqflg: ds 1 ;[MF]Nonzero to prevent character echoing
276 ;[MF]when entering commands
277cmccnt: ds 1 ;Non-zero if a significant char is found.
278cmsflg: ds 1 ;Non-zero when the last char was a space.
279cmostp: ds 2 ;Old stack pointer for reparse.
280cmrprs: ds 2 ;Address to go to on reparse.
281cmprmp: ds 2 ;Address of prompt.
282cmptab: ds 2 ;Address of present keyword table.
283cmhlp: ds 2 ;Address of present help.
284cmdbuf: ds 80H ;Buffer for command parsing.
285cmbufl equ $-cmdbuf-3 ; set a limit on the command buffer
286cmfcb: ds 2 ;Pointer to FCB.
287cmfcb2: ds 2 ;Pointer to position in FCB.
288cmfwld: ds 1 ;Wildcard flag
289cmcptr: ds 2 ;Pointer for next char input.
290cmdptr: ds 2 ;Pointer into the command buffer.
291cmkptr: ds 2 ;Pointer to keyword.
292cmsptr: ds 2 ;Place to save a pointer.
293slshsn: db 0 ; slash seen in command line
294slashc: db 0 ; count for number of characters in slash sequence
295slashn: db 0 ; number to be built for \xxx
296;\f
297oldsp: ds 2 ;Room for old system stack.
298 ds 80H ;Room for 64 levels of calls.[obs]
299stack: ds 2
300eoflag: ds 1 ;EOF flag;non-zero on EOF.
301curdsk: db 0 ;holds "logged" disk
302curusr: db 0 ;[8] holds "user" number
303rcvsop: db SOH ;[gnn] receive start-of-packet
304sndsop: db SOH ;[gnn] send start-of-packet
305prtcnt: db 0 ;[pcc008] prtchr fairness count
306timflg: db 0 ;[jd] timer flag: 0 -> no timer
307timval: dw 0 ;[jd] timer value
308wrn8: db 0 ;[jd] non-zero if 8-bit-lost warning sent
309qbchr: db '&' ;[jd] binary quote character.
310quot8: db 0 ;[jd] non-zero if doing 8-bit quoting
311logflg: db 0 ;Flag for a log file.
312 ;[pcc005] 0 = no log
313 ;[pcc005] x1 = logging on
314 ;[pcc005] x2 = suspended
315 ;[pcc005] 8xH (bit 7) = file open
316lognam: db 0 ;[pcc013] File to use for session logging
317 db 'KERMIT ' ;[pcc013]
318 db 'LOG' ;[pcc013]
319nexitf: db 0 ; set to 1 for exit to CPM after command tail
320takflg: db 0 ;[8] TAKE flag.
321 ; Bit zero = 1 for take file in progress
322 ; bit 4 = 1 if command line present/in progress
323 ; Note: Take has priority over command line.
324initak: db 0ffh ;[MF]Cleared after initial TAKE (KERMIT.INI)
325taknam: db 0 ;[8] use default drive
326 db 'KERMIT '
327 db 'INI' ;[8] Inital file to TAKE KERMIT.INI
328takptr: ds 2 ;[8] Pointer to position in TAKE file input
329takfcb: ds 12 ;[8] fcb space for take file
330 dw 0 ;[8] fill up extents etc with 00
331 dw 0
332 ds 16 ;[8] used by dos
333 dw 0
334 dw 0
335takdma: ds 128 ;[8]space to read TAKE file...
336prnbuf: ds 1 ; printer buffer. Output pointer
337 ds 1 ; input offset pointer
338 ds 256 ; give a large buffer
339 ds 10 ; and a little spare
340;
341;
342;
343; Transmit space
344;
345repcnt: db 0 ; repeat counter
346starc: db 0 ; star count
347rexbfl: db 0 ; retransmit flag (1=> retransmit)
348rexcnt: db 0 ; retransmit character count
349rexbuf: ds 128 ; max retransmit line length 128 characters
350xmtbuff:
351 ds 128 ; 128 byte sector buffer
352xmtptr: db 0 ; offset pointer to xmtbuff above
353xmtfcb: ds 36 ; fcb for transmit file.
354;
355;INPUT and STRING space
356strlen: db 0 ; length of the string from INPUT and STRING
357
358; Assorted other space
359errorc: db 0 ; error level set to xxx
360errorl: db 0 ; error level to test against
361
362remtxt: db 0 ; set <> 0 if D packets to screen
363
364hosths: ds 1 ; have we told the host to xoff? (is this duplicated)
365stbuff: ds 80h ; some space or the string buffer
366waitp: ds 2 ; wait command timer
367waitp1: ds 2 ; wait/input timer (copy of waitp)
368prntmp: ds 1 ; temporary space to put the caracter to print
369prnfl: db 0 ; printer flag. Used by TYPE/PRINT
370;[MF][17]Following line no longer needed as TYPE uses the big buffer
371;typptr: ds 2 ; pointer used by TYPE/PRINT
372equflg: db 0 ; set to non zero if copy files same
373nquiet: db 0 ; If non zero print from NOUT to display
374
375escflg: db 0 ;Escape flag (start off).
376fileio: db 0 ;Line-by-line from file (default off).
377xofflg: db 0 ;X-OFF (=^S) received from COMM-line
378 ;X-ON (=^Q) received resets this
379clkbit: dw 0 ; 32 bit pseudo clock
380 dw 0 ; MS bits of clock
381number: ds 2 ; Number in binary form from user input
382initflg:db 0 ; set to non zero when system initialised
383maxbsc: ds 1 ; save space to know how big system allows
384 ; for multi-sector buffering. (Usually 8k?)
385;
386; Multiple FCB storage space. Used for the DIR command
387; Later on, I want to shift this into space after the system
388; dependent stuff, but then it becomes messy with pointers
389; to pointers etc... [OBS]
390;
391xfcbptr:
392 ds 2 ; pointer to current fcb space
393fcbcnt: ds 1 ; Number of valid fcbs in space
394;
395fcb0: ds 12 ; 36 bytes requred for a single fcb
396fcblen EQU $-fcb0 ; length of a single fcb
397 ds maxfcb*fcblen ; space for maximum fcbs + 1
398;
399hidefs: db 0ffh ; flag <> 0 if we show file size in DIR
400
401; FCB sapce for COPY command
402cfcbs: ds 33 ; source fcb for copy file ops.
403 ;[MF]and FRENAME ops.
404cfcbd: ds 33 ; destination fcb for copy ops.
405 ;[MF]and FRENAME ops.
406
407colfcb: ds 33 ;[MF]Rename fcb for SET COLLISION
408
409; Command tail data space etc
410cbptr: db 2 ; command tail pointer (0= length of tail)
411cbuff: ds 128 ; temp. space for potential command tail
412
413strcnt: db 0 ; string count for string operations...
414
415vtyval: ds 1 ; holds row number for VT52 cursor positioning
416chrcnt: ds 1 ;Number of chars in the file buffer.
417
418; Various packet variables etc
419bytes: dw 0 ; 4 byte 'byte count' space
420 dw 0
421filcnt: ds 1 ;Number of chars left to fill.
422outpnt: ds 2 ;Position in packet.
423bufpnt: ds 2 ;Position in file buffer.
424fcbptr: ds 2 ;Position in FCB.
425datptr: ds 2 ;Position in packet data buffer.
426cbfptr: ds 2 ;Position in character buffer.
427pktptr: ds 2 ;Position in receive packet.
428size: ds 1 ;Size of data from gtchr.
429curchk: ds 1 ;Current checksum type
430inichk: ds 1 ;Agreed upon checksum type
431czseen: ds 1 ;Flag that control-Z was typed
432dscflg: ds 1 ;[MF]Discard file if nonzero
433pktnum: ds 1 ;Packet number.
434numpkt: ds 2 ;Total number of packets sent.
435numrtr: ds 2 ;Total number of retries.
436numtry: ds 1 ;Number of tries on this packet.
437oldtry: ds 1 ;Number of tries on previous packet.
438state: ds 1 ;Present state of the automaton.
439;*** start of new flags. Do not assume that just because these flags are
440; present that the feature is available. I simply put them in 'for future use'
441rcapas:
442rcap1: db 0 ; receive capabilties byte 0
443rcap2: db 0 ; receive cpabilities byte 1
444scapas:
445scap1: db 0 ; send capabilities byte 0
446scap2: db 0 ; send capabilities byte 1
447rtimeo: db 0 ; receive timeout
448stimeo: db 0 ; send timeout
449rpadc: db 0 ; receive pad character
450spadc: db 0 ; send pad character
451rrept: db 0 ; receive repeat prefix
452srept: db 0 ; send repeat prefix
453rwindo: db 0 ; receive window size
454swindo: db 0 ; send window size
455rdpkt:
456rlpkt: dw 0 ; receive long packet length
457sdpkt:
458slpkt: dw 0 ; send long packet length
459sdckt: db 0 ; send default checktype
460rdckt: db 0 ; receive checktype (should be same as sdckt)
461;*** end of new flags
462sohchr: db 1 ;Default Start-of-header chr is cntl-a
463; Kermit packet starts here
464; Byte 0 = start of packe character
465; 1 = length of packet
466; 2 = packet number
467; 3 = packet type (S R I Z E B etc)
468packet: ds 4 ;Packet (data is part of it).
469; Data part of packet (variable length - include checksum)
470data: ds 5AH ;Data and checksum field of packet.
471recpkt: ds 65H ;Receive packet storage (use the following).
472recpkx: db cr,'$' ;= = = buffer limit
473filbuf: ds 65H ;Character buffer.
474fnbuf: ds 20h ;[jd] file name buffer
475autorc: db 0 ;[obs] set to ON for autoreceive
476
477; Temporary data space. Sometimes accesses as 16 bits (eg temp1/2)
478;** Temp 1 & 2 must be in order
479lstchr: ;Last console input character.
480temp1: ds 1 ;Temporary storage.
481temp2: ds 1
482lincnt: ; used for counting lines in p20ln
483temp3: ds 1
484temp4: ds 1
485temp5: ds 1
486temp6: ds 1
487temp7: ds 1
488temp8: ds 1
489temp9: ds 1
490temp10: ds 1
491temp11: ds 1
492
493
494getrxflg:
495 ds 1 ;[obs 22]
496quietd: db 0 ;loud display during file transfers
497argblk: ds 20H ;Used for subroutine arguments
498
499maxfil EQU 2 ; currently, only two names used.
500fcbblk: ds maxfil*10H ;Used for a list of FCB's
501
502; [gnn] secondary filename storage (remote on send, local on get)
503remnam: ds 60 ;[gnn]
504remlen: ds 1 ;[gnn] length of name
505
506; Bookkeeping storage for multiple-sector buffering. The actual buffer
507; is somewhere in the system-dependent overlay. (at the end, I hope).
508nxtbuf: ds 2 ; Pointer to next sector
509seccnt: ds 1 ; Number of sectors buffered
510endsts: ds 1 ; Status for last read into buffer
511;
512;
513; [MF] Storage for Remote Command processing
514;
515;
516rdl: ds 1 ;[MF]Holds accumulated length of remote data
517;
518rcl: ds 1 ;[MF]Holds length of Remote command line arg
519;
520remdat: ds 95 ;[MF]Packet data buffer (plenty big)
521;
522rcom: ds 1 ;[MF] Remote Command type
523;
524rprmpt: dw 0 ;[MF]Address of prompt strings
525;
526rptr: dw 0 ;[MF]Remote command packet data pointer
527;
528rscode: ds 3 ;[MF]Holds Remote Set command ASCII code
529;
530;
531 org 7000h ; address for Kermit 4.11
532; ORG ($ + 0ffH) AND 0ff00H ; move to start of next page
533
534;
535; hooks for system-dependent routines:
536; This area is overwritten by the system-dependent overlay.
537;
538lnkflg: dw 0 ; linkage information for consistency check.
539lnkent: dw 0 ; more of the same.
540ovlver: dw 0 ; pointer to overlay's version string
541family: dw 0 ;*NEW* [10] address of the family overlay (not CPSSYS)
542;
543; Input/output routines. Note that outmdm and outcon may actually be the
544; same routine if selmdm and selcon do anything. (the same is true
545; of inpmdm and inpcon).
546;
547selmdm: jmp $-$ ; select modem for I/O
548outmdm: jmp $-$ ; output character in E to modem
549inpmdm: jmp $-$ ; read character from modem. return character or 0 in A.
550flsmdm: jmp $-$ ; flush pending input from modem
551selcon: jmp $-$ ; select console for I/O
552outcon: jmp $-$ ; output character in E to console
553inpcon: jmp $-$ ; read char from console. return character or 0 in A
554outlpt: jmp $-$ ; output character in E to printer
555lptstat:jmp $-$ ;*NEW*[10] see if printer ready to print a character
556 ; If 0ffh then ok, if 0h then not ok.
557extern: jmp $-$ ;*NEW for 4.09* If $-$ is not zero, then its a jump to
558 ; a routine to emulate any terminal type the user
559 ; wants to implement.
560xbdos: jmp 0 ;*NEW* address of the bdos trap in this section
561 ; of code. It is filled in initialisation.
562;
563; screen formatting routines
564clrlin: jmp $-$ ; erase current line
565clrspc: jmp $-$ ; erase current position (after backspace)
566delchr: jmp $-$ ; make delete look like backspace
567clrtop: jmp $-$ ; erase screen and go home
568;
569; these routines are called to display a field on the screen.
570scrend: jmp $-$ ; move to prompt field
571screrr: jmp $-$ ; move to error message field
572scrfln: jmp $-$ ; move to filename field
573scrnp: jmp $-$ ; move to packet count field
574scrnrt: jmp $-$ ; move to retry count field
575scrst: jmp $-$ ; move to status field
576rppos: jmp $-$ ; move to receive packet field (debug)
577sppos: jmp $-$ ; move to send packet field (debug)
578;
579sysinit: jmp $-$ ; program initialization
580sysexit: jmp $-$ ; program termination
581syscon: jmp $-$ ; remote session initialization
582syscls: jmp $-$ ; return to local command level
583sysinh: jmp $-$ ; help text for interrupt (escape) extensions
584sysint: jmp $-$ ; interrupt (escape) extensions, including break
585sysflt: jmp $-$ ; filter for incoming characters.
586 ; called with character in E.
587sysbye: jmp $-$ ; terminate remote session
588sysspd: jmp $-$ ; baud rate change routine.
589 ; called with value from table in DE
590sysprt: jmp $-$ ; port change routine.
591 ; called with value from table in HL
592sysscr: jmp $-$ ; screen setup for file transfer
593 ; called with Kermit's version string in DE
594csrpos: jmp $-$ ; move cursor to row B, column C
595sysspc: jmp $-$ ; calculate free space for current disk
596mover: jmp $-$ ; block move
597prtstr: jmp $-$ ; *** NEW *** prtstr moved to overlay
598;
599; Data initialized by system-dependent overlay:
600;
601pttab: ds 2 ; points to local equivalents to VT52 escape sequences
602spdtab: ds 2 ; address of baud rate command table, or zero
603spdhlp: ds 2 ; address of baud rate help table, or zero
604prttab: ds 2 ; address of port command table, or zero
605prthlp: ds 2 ; address of port help table, or zero
606timout: ds 2 ; Initial value for fuzzy timeout
607vtflg: ds 1 ; VT52 emulation flag
608escchr: ds 1 ; Storage for the escape character.
609speed: ds 2 ; storage for the baud rate
610port: ds 2 ; storage for port value
611prnflg: ds 1 ;[hh] printer copy flag (overlay may need it)
612dbgflg: ds 1 ; debugging flag
613ecoflg: ds 1 ; Local echo flag (default off).
614flwflg: ds 1 ; File warning flag (default on).
615ibmflg: ds 1 ; IBM flag (default off).
616cpmflg: ds 1 ; File mode flag (ascii/binary/default)
617incflg: ds 1 ;[MF]Incomplete flag (keep/discard)
618 ;[MF](default discard)
619parity: ds 1 ; Current parity.
620spsiz: ds 1 ; Send packet size.
621rpsiz: ds 1 ; Receive packet size.
622stime: ds 1 ; Send time out.
623rtime: ds 1 ; Receive time out.
624spad: ds 1 ; Send padding.
625rpad: ds 1 ; Receive padding.
626spadch: ds 1 ; Send padding char.
627rpadch: ds 1 ; Receive padding char.
628seol: ds 1 ; Send EOL char.
629reol: ds 1 ; Receive EOL char.
630squote: ds 1 ; Send quote char.
631rquote: ds 1 ; Receive quote char.
632chktyp: ds 1 ; Checksum type desired
633tacflg: ds 1 ; TACTrap flag (zero=off, nonzero=on; when non-zero,
634 ; contains current TAC intercept character)
635tacchr: ds 1 ; TAC intercept character
636bufadr: ds 2 ; Pointer to big buffer for multiple-sector I/O
637bufsec: ds 1 ; Number of sectors big buffer can hold (0 means 256)
638ffussy: ds 1 ; if nonzero, don't permit <>.,;?*[] in CP/M filespec.
639; space used by directory command; here because space calculation is
640; (operating) system-dependent
641bmax: ds 2 ; highest block number on drive
642bmask: ds 1 ; (records/block)-1
643bshiftf: ds 1 ; number of shifts to multiply by rec/block
644nnams: ds 1 ; counter for filenames per line
645
646lnksiz equ $-lnkflg ; length of linkage section, for consistency check.
647
648 END START