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