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