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