]> cloudbase.mooo.com Git - kermit-80.git/blame - cpxsy2.asm
Add AVR-CP/M system (cpxac.asm) and a Makefile
[kermit-80.git] / cpxsy2.asm
CommitLineData
e58a7a25
L
1IF NOT lasm\r
2.printx * CPXSY2.ASM *\r
3ENDIF ;NOT lasm\r
4; KERMIT - (Celtic for "FREE")\r
5;\r
6; This is the CP/M-80 implementation of the Columbia University\r
7; KERMIT file transfer protocol.\r
8;\r
9; Version 4.0\r
10;\r
11; Copyright June 1981,1982,1983,1984,1985\r
12; Columbia University\r
13;\r
14; Originally written by Bill Catchings of the Columbia University Center for\r
15; Computing Activities, 612 W. 115th St., New York, NY 10025.\r
16;\r
17; Contributions by Frank da Cruz, Daphne Tzoar, Bernie Eiben,\r
18; Bruce Tanner, Nick Bush, Greg Small, Kimmo Laaksonen, Jeff Damens, and many\r
19; others.\r
20;\r
21; This file contains the system-dependent code and data for KERMIT.\r
22; It will be probably be broken into independent files to generate\r
23; overlays for the various systems, one or more overlay possible\r
24; from each file. For now, we will leave it in one piece.\r
25;\r
26; revision history:\r
27;\r
28;\r
29;\f This is the system-dependent command to change the baud rate.\r
30; DE contains the two-byte value from the baud rate table; this\r
31; value is also stored in 'speed'.\r
32sysspd:\r
33\r
34\r
35IF px8 ; [29]\r
36 push d\r
37 call rsclose ; baud rate can only be set on opening rs232\r
38 pop d\r
39 mov a, e\r
40 sta px8blk+4 ; set param block\r
41 call rsopen ; to set rate\r
42 ret\r
43ENDIF ; px8 [29]\r
44\r
45; Set the speed for the Osborne I\r
46IF osbrn1\r
47 mvi a,osbin1 ;Reset the ACIA\r
48 call osstst ;Write the control port\r
49osbs1: inr c ;Waiting loop\r
50 jnz osbs1\r
51 mov a,e ; get the specified speed\r
52 jmp osstst ;Write the control reg.\r
53ENDIF;osbrn1\r
54\r
55;[hh] set the speed for a lobo MAX-80\r
56IF lobo\r
57 mov a,e ;[hh] get the parsed value\r
58setbd: sta baudrt ;[hh] and send it to the baud rate port\r
59 ret ;[hh]\r
60ENDIF;lobo\r
61\r
62; Set the speed for bigboard I or the delphi or the CPT-85xx\r
63; or Cromemco (TU-ART)\r
64IF delphi OR cpt85xx OR cmemco OR mmate ;[22] [29]\r
65 mov a,e ; get the parsed value\r
66 out baudrt ; Tell the baud rate generator.\r
67 ret\r
68ENDIF;delphi OR cpt85xx OR cmemco OR mmate [22] [29]\r
69\r
70;[22] Set the speed for Acorn BBC\r
71IF bbc\r
72 mov l,e\r
73 mvi a,7 ;Set receive baud rate\r
74 call osbyte ;*FX7,?e\r
75 mov l,e\r
76 mvi a,8 ;Set transmit baud rate\r
77 call osbyte ;*FX8,?e\r
78 ret\r
79ENDIF;[22] bbc\r
80\r
81;[22] Set speed for RM 380Z\r
82IF rm380z\r
83 mvi a,4 ;device type (SI/O4) in A\r
84 rst 6 ; EMT\r
85 db 29h ; SETLST\r
86 ret\r
87ENDIF;[22] rm380z\r
88\r
89; Set the speed for MicroMikko. DE is baud rate multiplier\r
90IF mikko\r
91 di\r
92 lxi h,txclk\r
93 mov m,d ;LSB first (swapped in memory)\r
94 mov m,e ;MSB last\r
95 lxi h,rxclk\r
96 mov m,d\r
97 mov m,e\r
98 mvi b,0 ;"modifier" for 1 stop bit\r
99 mvi a,2 ;Test MSB of speed >2 (110 bps or less)\r
100 cmp e\r
101 jp miksp1\r
102 mvi b,00001000B ;"modifier" for 2 stop bits\r
103miksp1: mvi a,4 ;Select SIO Reg 4\r
104 lxi h,sioac\r
105 mov m,a\r
106 mvi a,sion4 ;Get values\r
107 ora b ;Add modifier\r
108 mov m,a ;Set value (stop bits)\r
109 ei\r
110 ret\r
111ENDIF;mikko\r
112\r
113\r
114; Set the speed for the Decision I\r
115IF mdI\r
116 call selmdm ;Let's be absolutely sure, huh?\r
117 mvi a,dlab+wls1+wls0+stb ;Set data latch access bit\r
118 out lcr ;Out to Line Control Register\r
119 lhld speed ;Load baudrate multiplier\r
120 xchg\r
121 mov a,d ;Get low order byte for baud rate\r
122 out dlm ;Out to the MSB divisor port\r
123 mov a,e ;...and the high order byte\r
124 out dll ;Out to the LSB divisor port\r
125 mvi a,wls1+wls0+stb ;Enable Divisor Access Latch\r
126 out lcr ;Out to ACE Line Control Register\r
127 xra a ;Clear A\r
128 out ier ;Set no interrupts\r
129 out lsr ;Clear status\r
130 in msr ;Clear Modem Status Register\r
131 in lsr ;Clear Line Status Register\r
132 in rbr ;Clear Receiver Buffers\r
133 in rbr\r
134 ret\r
135ENDIF ;mdI [Toad Hall]\r
136\r
137IF teletek\r
138 di\r
139 mov a,e ; first speed byte\r
140 out baudrt\r
141 mov a,d ; second speed byte\r
142 out baudrt\r
143 ei\r
144 ret\r
145ENDIF ;teletek\r
146\r
147IF access ;[29]\r
148 mov a,e ;Get the parsed time constant\r
149;The following code is derived from the Access initialization code\r
150 sta savspd ;Save the time constant\r
151 mvi a,14h ;Code for 'monitor' to set channel A baudrate\r
152 call monitor\r
153 lda savspd ;Get the time constant\r
154 call monitor ; and send it to the CRT\r
155 ret\r
156savspd: ds 1\r
157monitor: ;Routine to do CRT functions\r
158 out 90h ;Output the data to the CRT\r
159 mvi a,1 ;Set DRDY true\r
160 out 23h\r
161mon1: in 0a0h ;Wait for CACK* true\r
162 rlc\r
163 jc mon1\r
164 in 80h ;Read the input data latch\r
165 push psw ;Save the input data\r
166 xra a ;Set DRDY false\r
167 out 23h\r
168mon2: in 0a0h ;Wait for CACK* false\r
169 rlc\r
170 jc mon2\r
171 pop psw\r
172 sta 0ee02h ;Save the input data\r
173 ret\r
174ENDIF;access [29]\r
175\r
176\r
177IF disc ;[29]\r
178; Assuming that parsing of value from speed table puts low order\r
179; byte of time constant in the e register and high byte in d.\r
180 mvi a,12 ;Register 12\r
181 out mnprts\r
182 mov a,e ;Low order byte of time constant\r
183 out mnprts\r
184 mvi a,13 ;Register 13\r
185 out mnprts\r
186 mov a,d ;High order byte of time constant\r
187 out mnprts\r
188 mvi a,14 ;Register 14\r
189 out mnprts\r
190 mvi a,3 ;Enable baud rate generator\r
191 out mnprts\r
192 mvi a,11 ;Register 11\r
193 out mnprts\r
194 mvi a,52h ;no Xtal, tclk=rclk=/trxc out=br gen\r
195 out mnprts\r
196 ret\r
197ENDIF;disc [29]\r
198;\f Speed tables\r
199; (Note that speed tables MUST be in alphabetical order for later\r
200; lookup procedures, and must begin with a value showing the total\r
201; number of entries. The speed help tables are just for us poor\r
202; humans.\r
203\r
204; db string length,string,divisor (2 identical bytes or 1 word)\r
205; [Toad Hall]\r
206\r
207IF delphi OR lobo ;[hh]\r
208spdtbl: db 10h ;16 entries\r
209 db 03h,'110$', 02h,02h\r
210 db 04h,'1200$', 07h,07h\r
211 db 05h,'134.5$', 03h,03h\r
212 db 03h,'150$', 04h,04h\r
213 db 04h,'1800$', 08h,08h\r
214 db 05h,'19200$', 0fh,0fh\r
215 db 04h,'2000$', 09h,09h\r
216 db 04h,'2400$', 0ah,0ah\r
217 db 03h,'300$', 05h,05h\r
218 db 04h,'3600$', 0bh,0bh\r
219 db 04h,'4800$', 0ch,0ch\r
220 db 02h,'50$', 00h,00h\r
221 db 03h,'600$', 06h,06h\r
222 db 04h,'7200$', 0dh,0dh\r
223 db 02h,'75$', 01h,01h\r
224 db 04h,'9600$', 0eh,0eh\r
225\r
226sphtbl: db cr,lf,' 50 75 110 134.5 150 300 600 1200'\r
227 db cr,lf,' 1800 2000 2400 3600 4800 7200 9600 19200$'\r
228ENDIF;delphi OR lobo ;[hh]\r
229\r
230IF cpt85xx\r
231spdtbl: db 15 ; 15 entries\r
232 db 03,'110$', 03h,03h\r
233 db 04,'1200$', 09h,09h\r
234 db 05,'134.5$', 04h,04h\r
235 db 03,'150$', 05h,05h\r
236 db 04,'1800$', 0Ah,0Ah\r
237 db 04,'2400$', 0Bh,0Bh\r
238 db 03,'300$', 06h,06h\r
239 db 04,'3600$', 0Ch,0Ch\r
240 db 04,'4800$', 0Dh,0Dh\r
241 db 02,'50$', 01h,01h\r
242 db 03,'600$', 07h,07h\r
243 db 04,'7200$', 0Eh,0Eh\r
244 db 02,'75$', 02h,02h\r
245 db 03,'900$', 08h,08h\r
246 db 04,'9600$', 0Fh,0Fh\r
247\r
248sphtbl: db cr,lf,' 50 75 110 134.5 150 300 600 900'\r
249 db cr,lf,' 1200 1800 2400 3600 4800 7200 9600$'\r
250ENDIF;cpt85xx\r
251\r
252IF bbc ;[22]\r
253spdtbl: db 8 ; 8 entries\r
254 db 04,'1200$', 04h,04h\r
255 db 03,'150$', 02h,02h\r
256 db 05,'19200$', 08h,08h\r
257 db 04,'2400$', 05h,05h\r
258 db 03,'300$', 03h,03h\r
259 db 04,'4800$', 06h,06h\r
260 db 02,'75$', 01h,01h\r
261 db 04,'9600$', 07h,07h\r
262\r
263sphtbl: db cr,lf,' 75 150 300 1200 2400 4800 9600 19200$'\r
264ENDIF;[22] bbc\r
265\r
266IF rm380z ;[22]\r
267spdtbl: db 7 ; 7 entries\r
268 db 03,'110$', 00h,00h\r
269 db 04,'1200$', 03h,03h\r
270 db 04,'2400$', 04h,04h\r
271 db 03,'300$', 01h,01h\r
272 db 04,'4800$', 05h,05h\r
273 db 03,'600$', 02h,02h\r
274 db 04,'9600$', 06h,06h\r
275\r
276sphtbl: db cr,lf,' 110 300 600 1200 2400 4800 9600$'\r
277ENDIF;[22] rm380z\r
278\r
279IF px8 ; [29]\r
280spdtbl: db 9 ; 9 entries\r
281 db 03,'110$', 02h,02h\r
282 db 04,'1200$', 0ah,0ah\r
283 db 03,'150$', 04h,04h\r
284 db 05,'19200$', 0fh,0fh\r
285 db 04,'2400$', 0ch,0ch\r
286 db 03,'300$', 06h,06h\r
287 db 04,'4800$', 0dh,0dh\r
288 db 03,'600$', 08h,08h\r
289 db 04,'9600$', 0eh,0eh\r
290sphtbl: db cr, lf\r
291 db ' 100 150 300 600 1200 2400 4800 9600 19200$'\r
292ENDIF ; px8 [29]\r
293\r
294IF mikko\r
295spdtbl: db 9h ;9 entries\r
296 db 03h,'110$'\r
297 dw 0369h\r
298 db 04h,'1200$'\r
299 dw 0050h\r
300 db 03h,'150$'\r
301 dw 0280h\r
302 db 04h,'2400$'\r
303 dw 0028h\r
304 db 03h,'300$'\r
305 dw 0140h\r
306 db 04h,'4800$'\r
307 dw 0014h\r
308 db 03h,'600$'\r
309 dw 00A0H\r
310 db 02h,'75$'\r
311 dw 0500h\r
312 db 04h,'9600$'\r
313 dw 000ah\r
314\r
315sphtbl: db cr,lf,' 75 110 150 300 600 1200 2400 4800 9600$'\r
316ENDIF;mikko\r
317\r
318IF osbrn1\r
319spdtbl: db 02h ;2 entries\r
320 db 04h,'1200$', OSBI12,OSBI12\r
321 db 03h,'300$', OSBI03,OSBI03\r
322\r
323sphtbl: db cr,lf,' 300',cr,lf,' 1200$'\r
324ENDIF;osbrn1\r
325\r
326\r
327IF mdI\r
328spdtbl: db 0dh ; 13 entries\r
329 db 03h, '110$'\r
330 dw 1047\r
331 db 04h, '1200$'\r
332 dw 96\r
333 db 03h, '150$'\r
334 dw 768\r
335 db 05h,'19200$'\r
336 dw 6\r
337 db 04h, '2400$'\r
338 dw 48\r
339 db 03h, '300$'\r
340 dw 384\r
341 db 05h,'38400$'\r
342 dw 3\r
343 db 03h, '450$'\r
344 dw 288\r
345 db 04h, '4800$'\r
346 dw 24\r
347 db 05h,'56000$'\r
348 dw 2\r
349 db 03h, '600$'\r
350 dw 192\r
351 db 02h, '75$'\r
352 dw 1536\r
353 db 04h, '9600$'\r
354 dw 12\r
355\r
356sphtbl: db cr,lf,' 75 110 150 300 450 600 1200'\r
357 db cr,lf,' 2400 4800 9600 19200 38400 56000$'\r
358\r
359;(Lord knows what you'll be communicating with at 56000 baud, but the\r
360;Multi-I/O board literature says it'll do it, so what the heck....\r
361;might as well throw it in here just to show off...sure hope the\r
362;port don't melt...)\r
363\r
364ENDIF ;mdI [Toad Hall]\r
365\r
366IF cmemco ;[25]\r
367spdtbl: db 7 ; 7 entries\r
368 db 3,'110$', 01H,01H\r
369 db 4,'1200$', 88H,88H\r
370 db 3,'150$', 82H,82H\r
371 db 4,'2400$', 90H,90H\r
372 db 3,'300$', 84H,84H\r
373 db 4,'4800$', 0A0H,0A0H\r
374 db 4,'9600$', 0C0H,0C0H\r
375\r
376sphtbl: db cr,lf\r
377 db ' 110 150 300 1200 2400 4800 9600$'\r
378ENDIF;cmemco\r
379\r
380IF access ;Similar to bbI with different values [29]\r
381spdtbl: db 6h ;6 entries\r
382 db 04h,'1200$', 28h,28h\r
383 db 04h,'2400$', 14h,14h\r
384 db 03h,'300$', 0a0h,0a0h\r
385 db 04h,'4800$', 0ah,0ah\r
386 db 03h,'600$', 50h,50h\r
387 db 04h,'9600$', 5,5\r
388\r
389sphtbl: db cr,lf,' 300 600 1200 2400 4800 9600$'\r
390ENDIF;access [29]\r
391\r
392IF mmate ;[29]\r
393spdtbl: db 10h ;16 entries\r
394 db 03h,'110$', 0e2h,0e2h\r
395 db 04h,'1200$', 0e7h,0e7h\r
396 db 05h,'134.5$', 0e3h,0e3h\r
397 db 03h,'150$', 0e4h,0e4h\r
398 db 04h,'1800$', 0e8h,0e8h\r
399 db 05h,'19200$', 0efh,0efh\r
400 db 04h,'2000$', 0e9h,0e9h\r
401 db 04h,'2400$', 0eah,0eah\r
402 db 03h,'300$', 0e5h,0e5h\r
403 db 04h,'3600$', 0ebh,0ebh\r
404 db 04h,'4800$', 0ech,0ech\r
405 db 02h,'50$', 0e0h,0e0h\r
406 db 03h,'600$', 0e6h,0e6h\r
407 db 04h,'7200$', 0edh,0edh\r
408 db 02h,'75$', 0e1h,0e1h\r
409 db 04h,'9600$', 0eeh,0eeh\r
410\r
411sphtbl: db cr,lf,' 50 75 110 134.5 150 300 600 1200'\r
412 db cr,lf,' 1800 2000 2400 3600 4800 7200 9600 19200$'\r
413ENDIF;mmate [29]\r
414\r
415IF disc ;[29]\r
416; Similar to mikko table but with different time constant values\r
417spdtbl: db 9h ;9 entries\r
418 db 03h,'110$'\r
419 dw 1134\r
420 db 04h,'1200$'\r
421 dw 102h\r
422 db 03h,'150$'\r
423 dw 831\r
424 db 04h,'2400$'\r
425 dw 50\r
426 db 03h,'300$'\r
427 dw 415\r
428 db 04h,'4800$'\r
429 dw 24\r
430 db 03h,'600$'\r
431 dw 206\r
432 db 02h,'75$'\r
433 dw 1665\r
434 db 04h,'9600$'\r
435 dw 11\r
436\r
437sphtbl: db cr,lf,' 75 110 150 300 600 1200 2400 4800 9600$'\r
438ENDIF;disc [29]\r
439\r
440IF teletek\r
441spdtbl: db 7 ; 7 entries\r
442 db 4, '1200$', 47h,40h\r
443 db 5,'19200$', 47h,04h\r
444 db 4, '2400$', 47h,20h\r
445 db 3, '300$', 47h,00h\r
446 db 4, '4800$', 47h,10h\r
447 db 3, '600$', 47h,80h\r
448 db 4, '9600$', 47h,08h\r
449\r
450sphtbl: db cr,lf\r
451 db ' 300 600 1200 2400 4800 9600 19200$'\r
452ENDIF ;teletk\r
453\r
454\r
455; The following conditionals were once a huge if not statement. There\r
456; wasn't enough room to add the lobo to the list, so it had to be broken\r
457; into 2, which you can't do with an if not. I redid it as two ifs and\r
458; applied them to those that wouldn't set baud. [Hal Hostetler]\r
459IF robin OR gener OR dmII OR vector OR trs80;[32]\r
460spdtbl equ 0 ; SET BAUD not supported.\r
461sphtbl equ 0\r
462ENDIF;robin OR gener OR dmII OR vector OR trs80 \r
463;\r
464IF mmdI OR osi OR cpm3 OR S1008 ; [29]\r
465spdtbl EQU 0 ;[hh] SET BAUD not supported.\r
466sphtbl EQU 0 ;[hh] ran out of room above...\r
467ENDIF;mmdI OR osi OR cpm3 OR S1008 [29]\r
468;\r
469IF hp125 ;[MF]\r
470spdtbl equ 0 ; SET BAUD not supported.\r
471sphtbl equ 0\r
472ENDIF;hp125 [MF]\r
473;\r
474;\f This is the system-dependent SET PORT command.\r
475; HL contains the argument from the command table.\r
476sysprt:\r
477IF lobo ;[hh]\r
478 mov a,l ;[hh] get the data port value and store at\r
479 sta outmd3+1 ;[hh] the two places we use...\r
480 sta inpmd2+1 ;[hh] MNPORT in the overlay\r
481 sta port ;[hh] inform program of the change in ports\r
482 inr a ;[hh] status port = data port + 1 in the Lobo\r
483 sta outmd1+1 ;[hh] store it at the three places...\r
484 sta inpmd1+1 ;[hh] we use MNPRTS...\r
485 sta outctl+1 ;[hh] in the overlay\r
486 mov a,h ;[hh] now get the baud rate port value\r
487 sta getbd+1 ;[hh] store it in the two places we use...\r
488 sta setbd+1 ;[hh] BAUDRT in the overlay\r
489 sta port+1 ;[hh] don't need to, but keeps it consistant\r
490getbd: lda baudrt ;[hh] get baud rate value from port\r
491 sta speed ;[hh] tell STAT. baud rate for each port\r
492 ;[hh] is independant of the other\r
493ENDIF ;lobo\r
494\r
495IF iobyt\r
496 mov a,m ;Get the I/O byte\r
497 sta prtiob ;Save the desired IO byte for this port\r
498 inx h ;Point at next entry\r
499 mov a,m ;Get the output function\r
500 sta prtfun ;Save it\r
501ENDIF;iobyt\r
502\r
503IF iobyt AND robin\r
504 inx h ;Point at next entry\r
505 mov a,m ;Get the hardware address for the port\r
506 sta prtadr ;Store it\r
507ENDIF;iobyt AND robin\r
508;\r
509IF hp125 ;[MF]\r
510 push psw\r
511 push b\r
512 push d\r
513 push h\r
514 xchg ;Put port connect sequence address in DE\r
515 call prtstr ;Connect proper port\r
516 pop h\r
517 pop d\r
518 pop b\r
519 pop psw\r
520ENDIF;hp125 [MF]\r
521;\r
522 ret\r
523;\f\r
524; Port tables for Lobo MAX-80\r
525IF lobo ;[hh]\r
526; help text\r
527prhtbl: db cr,lf,'RS-232 port A or B$'\r
528;\r
529; command table\r
530prttbl: db 02H ;[hh] two entries\r
531 db 01H,'A$',0E4H,0D0H\r
532 db 01H,'B$',0E6H,0D4H\r
533ENDIF ;lobo\r
534;\f\r
535; Port tables for GENERIC CPM 2.2\r
536IF gener\r
537; help text\r
538prhtbl: db cr,lf,'CRT device'\r
539 db cr,lf,'PTR device'\r
540 db cr,lf,'TTY device'\r
541 db cr,lf,'UC1 device'\r
542 db cr,lf,'UR1 device'\r
543 db cr,lf,'UR2 device$'\r
544\r
545; command table\r
546prttbl: db 06H ;Six devices to choose from\r
547 db 03H,'CRT$'\r
548 dw crtptb\r
549 db 03H,'PTR$'\r
550 dw ptrptb\r
551 db 03H,'TTY$'\r
552 dw ttyptb\r
553 db 03H,'UC1$'\r
554 dw uc1ptb\r
555 db 03H,'UR1$'\r
556 dw ur1ptb\r
557 db 03H,'UR2$'\r
558 dw ur2ptb\r
559\r
560; port entry table\r
561; table entries are:\r
562; db iobyte-value, BDOS output function, reserved\r
563crtptb: db crtio,conout,0\r
564ptrptb: db ptrio,punout,0\r
565ttyptb: db ttyio,conout,0\r
566uc1ptb: db uc1io,conout,0\r
567ur1ptb: db ur1io,punout,0\r
568ur2ptb: db ur2io,punout,0\r
569ENDIF;gener\r
570\r
571;\f\r
572; Port tables for DECmate II or MicroMikko or Acorn BBC\r
573;\r
574IF dmII OR mikko OR bbc ;[22]\r
575; help text\r
576prhtbl: db cr,lf,'COMMUNICATIONS port$'\r
577\r
578; command table\r
579prttbl: db 01H ;Only one port known at this point\r
580 db 0EH,'COMMUNICATIONS$'\r
581 dw comptb ;address of info\r
582\r
583; port entry table\r
584; table entries are:\r
585; db iobyte-value, BDOS output function, reserved\r
586comptb: db batio,punout,0\r
587\r
588ENDIF;[22] dmII OR mikko OR bbc\r
589;\f\r
590; Port tables for Robin\r
591;\r
592IF robin\r
593; help text\r
594prhtbl: db cr,lf,'COMMUNICATIONS port'\r
595 db cr,lf,'GENERAL purpose port'\r
596 db cr,lf,'PRINTER port$'\r
597\r
598; command table\r
599prttbl: db 03H ;Three entries\r
600 db 0EH,'COMMUNICATIONS$'\r
601 dw comptb\r
602 db 07H,'GENERAL$'\r
603 dw gppptb\r
604 db 07H,'PRINTER$'\r
605 dw prnptb\r
606\r
607; port entry table\r
608; table entries are:\r
609; db iobyte-value, BDOS output function, hardware port address\r
610; (control/status)\r
611;\r
612;At present, the hardware port address is only used for sending a break.\r
613comptb: db batio,punout,comtst\r
614gppptb: db gppio,conout,gentst\r
615prnptb: db lptio,conout,prntst\r
616\r
617prtadr: db comtst ;space for current hardware port address\r
618ENDIF;robin\r
619\r
620IF iobyt\r
621prtfun: db punout ;Function to use for output to comm port\r
622prtiob: db batio ;I/O byte to use for communicating\r
623coniob: db defio ;I/O byte to use for console\r
624ENDIF;iobyt\r
625;\r
626IF hp125 ;[MF]\r
627; Help table\r
628prhtbl: db cr,lf,'Communications port'\r
629 db cr,lf,'Printer port$'\r
630; command table\r
631prttbl: db 02H ;2 entries\r
632 db 0eH,'COMMUNICATIONS$'\r
633 dw mapon1\r
634 db 07H,'PRINTER$'\r
635 dw mapon2\r
636;Port table entries are the addresses of the escape sequences to connect\r
637;the ports.\r
638;\r
639ENDIF;hp125 [MF]\r
640\r
641IF NOT (iobyt OR lobo OR hp125) ;[hh] [MF]\r
642prttbl equ 0 ; SET PORT is not supported\r
643prhtbl equ 0\r
644ENDIF;NOT iobyt OR lobo OR hp125 [MF]\r
645;\f\r
646; selmdm - select modem port\r
647; selcon - select console port\r
648; selmdm is called before using inpmdm or outmdm;\r
649; selcon is called before using inpcon or outcon.\r
650; For iobyt systems, diddle the I/O byte to select console or comm port;\r
651; For Decision I, switches Multi I/O board to console or modem serial\r
652; port. [Toad Hall]\r
653; For the rest, does nothing.\r
654; preserves bc, de, hl.\r
655selmdm:\r
656IF iobyt\r
657 lda prtiob ;Set up for output to go to the comm port\r
658 sta iobyte ;Switch byte directly\r
659ENDIF;iobyt\r
660\r
661IF mdI\r
662 lda group\r
663 ori mdmgrp ;Mask modem serial port\r
664 out grpsel\r
665ENDIF;mdI [Toad Hall]\r
666\r
667 ret\r
668\r
669selcon:\r
670IF iobyt\r
671 lda coniob ;Set up for output to go to the console port\r
672 sta iobyte ;Switch directly\r
673ENDIF;iobyt\r
674\r
675IF mdI\r
676 lda group\r
677 ori congrp ;Mask console serial port (1)\r
678 out grpsel\r
679ENDIF;mdI [Toad Hall]\r
680\r
681 ret\r
682;\f Get character from console, or return zero.\r
683; result is returned in A. destroys bc, de, hl.\r
684;\r
685inpcon:\r
686IF NOT iobyt\r
687 mvi c,dconio ;Direct console I/O BDOS call.\r
688 mvi e,0FFH ;Input.\r
689 call BDOS\r
690ENDIF;NOT iobyt\r
691\r
692IF iobyt\r
693 call bconst ;Get the status\r
694 ora a ;Anything there?\r
695 rz ;No, forget it\r
696 call bconin ;Yes, get the character\r
697ENDIF;iobyt\r
698 ret\r
699;\f\r
700; Output character in E to the console.\r
701; destroys bc, de, hl\r
702;\r
703outcon:\r
704\r
705IF rm380z ;[22]\r
706 mov a,e\r
707 cpi cr ;cr produces cr + lf\r
708 jnz outcn1\r
709 mvi e,'N'-100O ;Control-N produces cr only\r
710outcn1: ;continue\r
711ENDIF;[22] rm380z\r
712\r
713IF NOT iobyt\r
714 mvi c,dconio ;Console output bdos call.\r
715 call bdos ;Output the char to the console.\r
716ENDIF;NOT iobyt\r
717\r
718IF iobyt\r
719 mov c,e ;Character\r
720 call bcnout ;to Console\r
721ENDIF;iobyt\r
722 ret\r
723;\f\r
724; outmdm - output a char from E to the modem.\r
725; the parity bit has been set as necessary.\r
726; returns nonskip; bc, de, hl preserved.\r
727outmdm:\r
728IF osi OR lobo ;[hh]\r
729 push h\r
730outmd1: lxi h,mnprts ;address of the port status register\r
731outmd2: mov a,m ; get port status in A\r
732 ani output ;Loop till ready.\r
733 jz outmd2\r
734outmd3: lxi h,mnport ;address of port data register\r
735 mov m,e ; write the character\r
736 pop h\r
737 ret\r
738ENDIF;osi OR lobo\r
739\r
740IF osbrn1\r
741 call osldst ;Read the status port\r
742 ani output ;Loop till ready.\r
743 jz outmdm\r
744 mov a,e\r
745 jmp osstda ;Write to the data port\r
746ENDIF;osbrn1\r
747\r
748IF px8 ; [29]\r
749 push h\r
750 push b\r
751 push d\r
752outmd1: call rsoutst ; get the output status\r
753 ora a\r
754 jz outmd1 ; check if output enabled\r
755 pop d\r
756 mov c, e ; char in C\r
757 push d\r
758 call rsput\r
759 pop d\r
760 pop b\r
761 pop h\r
762 ret\r
763ENDIF; px8 [29]\r
764\r
765IF inout\r
766 in mnprts ;Get the output done flag.\r
767 ani output ;Is it set?\r
768 jz outmdm ;If not, loop until it is.\r
769 mov a,e\r
770 out mnport ;Output it.\r
771 ret\r
772ENDIF;inout\r
773\r
774IF iobyt\r
775;**** Note that we enter from outpkt with the I/O byte already set up for\r
776; output to go to the comm port\r
777 push h\r
778 push b\r
779 lda prtfun ;Get the output function\r
780 mov c,a ;Into C\r
781 call bdos ;And output the character\r
782 pop b\r
783 pop h\r
784 ret\r
785ENDIF;iobyt\r
786\r
787IF cpm3 OR hp125 ;[MF]\r
788 push h\r
789 push b\r
790 mvi c,auxout ;Output to the aux output device\r
791 call bdos\r
792 pop b\r
793 pop h\r
794 ret\r
795ENDIF;cpm3 OR hp125 [MF]\r
796\r
797;\forg $+100h AND 0FF00h ; get rid of phase error\r
798\r
799;\r
800; get character from modem; return zero if none available.\r
801; for IOBYT systems, the modem port has already been selected.\r
802; destroys bc, de, hl.\r
803inpmdm:\r
804IF iobyt\r
805 call bconst ;Is Char at COMM-Port?\r
806 ora a ;something there?\r
807 rz ; return if nothing there\r
808 call bconin ; data present. read data.\r
809ENDIF;iobyt\r
810\r
811IF cpm3\r
812 mvi c,auxist\r
813 call bdos ;is char at auxin?\r
814 ora a ;something there?\r
815 rz ;no\r
816 mvi c,auxin\r
817 call bdos ;read char from auxin\r
818ENDIF;cpm3\r
819;\r
820IF hp125 ;[MF]\r
821 lxi b,70ffh ;SEt subfunction to get RDR (auxin) status\r
822 call bdos ;is char at RDR?\r
823 ora a ;something there?\r
824 rz ;no\r
825 mvi c,auxin\r
826 call bdos ;read char from RDR\r
827ENDIF;hp125 [MF]\r
828\r
829IF osi OR lobo ;[hh]\r
830inpmd1: lda mnprts ;Get the port status into A.\r
831 ani input ;See if the input ready bit is on.\r
832 rz ;If not then return.\r
833inpmd2: lda mnport ;If so, get the char.\r
834ENDIF;osi OR lobo \r
835\r
836IF osbrn1\r
837 call osldst ;Read the status port\r
838 ani input ;Something there?\r
839 rz ;Nope\r
840 call osldda ;Read the data port\r
841ENDIF;osbrn1\r
842\r
843IF inout\r
844;Note: modem port should already be selected for mdI. [Toad Hall]\r
845 in mnprts ;Get the port status into A.\r
846 ani input ;See if the input ready bit is on.\r
847 rz ;If not then return.\r
848 in mnport ;If so, get the char.\r
849ENDIF;inout\r
850\r
851IF px8 ; [29]\r
852 call rserst ; check error status\r
853 ani 64h ; this assumes 'not open' cannot occur\r
854 jnz inpmd1 ; error has occurred!\r
855 call rsinst ; any chars outstanding?\r
856 ora a\r
857 rz ; exit if none\r
858 call rsget ; get char in A\r
859 ret\r
860; return the 'no char outstanding' indication on error\r
861inpmd1: mvi a, 0\r
862ENDIF; px8 [29]\r
863\r
864 ret ; return with character in A\r
865\r
866\r
867;\r
868; flsmdm - flush comm line.\r
869; Modem is selected.\r
870; Currently, just gets characters until none are available.\r
871\r
872flsmdm: call inpmdm ; Try to get a character\r
873 ora a ; Got one?\r
874 jnz flsmdm ; If so, try for another\r
875 ret ; Receiver is drained. Return.\r
876;\f\r
877; lptstat - get the printer status. Return a=0ffh if ok, or 0 if not.\r
878lptstat:\r
879IF iobyt ;[33]\r
880 call bprtst ;\r
881call bprtst ; get status\r
882ENDIF ;iobyt[33]\r
883IF NOT iobyt ;[33]\r
884 xra a ; assume it is ok.. this may not be necessary\r
885ENDIF ;iobyt [33]\r
886 ret\r
887\r
888;\r
889; outlpt - output character in E to printer\r
890; console is selected.\r
891; preserves de.\r
892outlpt:\r
893 push d ; save DE in either case\r
894 call prtflt ; go through printer filter [30]\r
895 ana a ; if A = 0 do nothing,\r
896 jz outlp1 ; [30] if a=0 do nothing\r
897\r
898IF NOT iobyt\r
899 mvi c,lstout\r
900 call bdos ;Char to printer\r
901ENDIF;NOT iobyt\r
902IF iobyt\r
903 mov c,e\r
904 call blsout\r
905ENDIF;iobyt\r
906\r
907outlp1: pop d ; restore saved register pair\r
908 ret\r
909;\f\r
910; Screen manipulation routines\r
911; csrpos - move to row B, column C\r
912;\r
913; csrpos for terminals that use a leadin sequence followed\r
914; by (row + 31.) and (column + 31.)\r
915;\r
916IF NOT (robin OR dmII OR osi OR vector OR termin OR hp125)\r
917 ;[MF] Terminals code in CPXVDU\r
918csrpos: push b ; save coordinates\r
919 lxi d,curldn ; get cursor leadin sequence\r
920 call prtstr ; print it\r
921 pop h ; restore coordinates\r
922 mov a,h ; get row\r
923 adi (' '-1) ; space is row one\r
924 mov e,a\r
925 push h\r
926 call outcon ; output row\r
927 pop h\r
928 mov a,l ; get column\r
929 adi (' '-1) ; space is column one\r
930 mov e,a\r
931 jmp outcon ; output it and return\r
932ENDIF;NOT (robin OR dmII OR osi OR vector OR termin OR hp125)[MF]\r
933;\r
934;\r
935;\r
936; csrpos for ANSI terminals\r
937;\r
938IF robin OR dmII \r
939csrpos: push b ; save coordinates\r
940 lxi d,curldn ; get cursor leadin sequence\r
941 call prtstr ; print it\r
942 pop h ; peek at coordinates\r
943 push h ; then save away again\r
944 mov l,h ; l = row\r
945 mvi h,0 ; hl = row\r
946 call nout ; output in decimal\r
947 mvi e,';' ; follow with semicolon\r
948 call outcon ; print it\r
949 pop h ; restore column\r
950 mvi h,0 ; hl = column\r
951 call nout\r
952 mvi e,'H' ; terminate with 'move cursor' command\r
953 jmp outcon ; output it and return\r
954ENDIF;robin OR dmII \r
955;\r
956; csrpos for the HP-125 [MF]\r
957;\r
958IF hp125 ;[MF]\r
959csrpos: dcr b ;HP-125 uses zero-based addressing\r
960 dcr c ;...\r
961 push b ; save coordinates\r
962 lxi d,curldn ; get cursor leadin sequence\r
963 call prtstr ; print it\r
964 pop h ; peek at coordinates\r
965 push h ; then save away again\r
966 mov l,h ; l = row\r
967 mvi h,0 ; hl = row\r
968 call nout ; output in decimal\r
969 mvi e,'R'+20h ;Say it was a row\r
970 call outcon ; print it\r
971 pop h ; restore column\r
972 mvi h,0 ; hl = column\r
973 call nout\r
974 mvi e,'C' ; terminate with 'move cursor' command\r
975 jmp outcon ; output it and return\r
976ENDIF;hp125 [MF]\r
977;\r
978; csrpos for the Vector General. It's weird.\r
979;\r
980IF vector\r
981csrpos: dcr b ; vector uses zero-based addressing?\r
982 dcr c\r
983 push b ; save coordinates\r
984 mvi e,esc ; print an escape\r
985 call outcon\r
986 pop d ; peek at coordinates\r
987 push d\r
988 call outcon ; output column\r
989 pop d\r
990 mov e,d ; get row\r
991 jmp outcon ; output and return\r
992ENDIF;vector\r
993\r
994IF osi ; systems without cursor positioning\r
995csrpos: ret ; dummy routine referenced by linkage section\r
996ENDIF;osi\r
997\r
998\r
999;\r
1000; delchr - make delete look like a backspace. Unless delete is a printing\r
1001; character, we just need to print a backspace. (we'll output clrspc\r
1002; afterwards)\r
1003; For Kaypro and Vector General, delete puts a blotch on the screen.\r
1004; For Apple and Osborne 1, delete moves but doesn't print.\r
1005delchr:\r
1006\r
1007IF vector OR osbrn1 OR lobo\r
1008 lxi d,delstr\r
1009 jmp prtstr\r
1010ENDIF ;vector OR osbrn1 OR lobo\r
1011\r
1012IF bbc OR rm380z ;[22]\r
1013 ret\r
1014ENDIF;bbc OR rm380z\r
1015\r
1016IF NOT (vector OR osbrn1 OR bbc OR rm380z);[22]\r
1017 mvi e,bs ;get a backspace\r
1018 jmp outcon\r
1019ENDIF;NOT (vector OR osbrn1 OR bbc OR rm380z [22]\r
1020\r
1021; erase the character at the current cursor position\r
1022clrspc: mvi e,' '\r
1023 call outcon\r
1024 mvi e,bs ;get a backspace\r
1025 jmp outcon\r
1026\r
1027; erase the current line\r
1028clrlin: lxi d,eralin\r
1029 jmp prtstr\r
1030\r
1031; erase the whole screen, and go home. preserves b (but not c)\r
1032clrtop: lxi d,erascr\r
1033 jmp prtstr\r
1034\r
1035\r
1036IF robin\r
1037sysver: db 'VT180 Robin$'\r
1038ENDIF;robin\r
1039\r
1040IF dmII\r
1041sysver: db 'DECmate II CP/M-80$'\r
1042ENDIF;dmII\r
1043\r
1044IF delphi ; [7] new system\r
1045sysver: db 'Digicomp Delphi 100$'\r
1046endif;delphi\r
1047\r
1048IF access\r
1049sysver: db 'Actrix CP/M$'\r
1050endif;\r
1051\r
1052IF teletek\r
1053sysver: db 'Teletek SYSTEMASTER CP/M-80$'\r
1054ENDIF ;teletek\r
1055\r
1056IF cpt85xx\r
1057sysver: db 'CPT-85xx under CompuPak CP/M$'\r
1058ENDIF;cpt85xx\r
1059\r
1060IF mdI\r
1061sysver: db 'Morrow Decision I$'\r
1062ENDIF;mdI [Toad Hall]\r
1063\r
1064IF mmdI\r
1065sysver: db 'MicroDecision I$'\r
1066ENDIF;mmdI\r
1067\r
1068IF osi\r
1069sysver: db 'Ohio Scientific$'\r
1070ENDIF;osi\r
1071\r
1072IF mmate ;[29]\r
1073sysver: db 'PMC Micromate using port I/O$'\r
1074ENDIF;mmate [29]\r
1075\r
1076IF disc ;[29]\r
1077sysver: db 'Discovery using 83U board port B$'\r
1078ENDIF ;disc [29]\r
1079\r
1080IF s1008 ;[29]\r
1081sysver: db 'U. S. MicroSales using printer port$'\r
1082ENDIF ;s1008 [29]\r
1083\r
1084IF cmemco ;[25]\r
1085sysver: db 'Cromemco (TU-ART)$'\r
1086ENDIF;cmemco\r
1087;\r
1088IF robin OR dmII\r
1089; Note that we cannot support Graphics Mode or the H19 erase-screen command\r
1090; (<esc>E), because the sequences are more than three bytes.\r
1091defesc EQU '\'-100O ;Still Control-\ (just ran out of room...)\r
1092vtval EQU 0 ; we probably don't want VT52 emulation\r
1093outlin: db esc,3CH,esc,'[H',esc,'[J',cr,lf,tab,tab,'$'\r
1094erascr: db esc,'[H',esc,'[J$' ;Clear screen and go home.\r
1095eralin: db cr,esc,'[K$' ;Clear line.\r
1096curldn: db esc,'[$' ; Cursor leadin\r
1097ttab:\r
1098ta: db esc,'[A$' ; Cursor up.\r
1099tb: db esc,'[B$' ; Cursor down.\r
1100tc: db esc,'[C$' ; Cursor right.\r
1101td: db esc,'[D$' ; Cursor left\r
1102te: db '$',0,0,0 ; (can't) Clear display\r
1103tf: db '$',0,0,0 ; (don't) Enter Graphics Mode\r
1104tg: db '$',0,0,0 ; (don't) Exit Graphics mode\r
1105th: db esc,'[H$' ; Cursor home.\r
1106ti: db esc,'M$',0 ; Reverse linefeed.\r
1107tj: db esc,'[J$' ; Clear to end of screen.\r
1108tk: db esc,'[K$' ; Clear to end of line.\r
1109ENDIF;robin OR dmII\r
1110\r
1111IF mikko\r
1112sysver: db 'MikroMikko$'\r
1113outlin: db subt,cr,lf,tab,'$'\r
1114erascr: db subt,'$' ;Clear screen and go home.\r
1115eralin: db cr,1CH,'$' ;Clear line.\r
1116curldn: db esc,'=$' ;cursor leadin\r
1117ttab: ;Table start location.\r
1118ta: db 0BH,'$',0,0 ;Cursor up.\r
1119tb: db 0AH,'$',0,0 ;Cursor down.\r
1120tc: db 0CH,'$',0,0 ;Cursor right.\r
1121td: db bs,'$',0,0 ;Cursor left\r
1122te: db subt,'$',0,0 ;Clear display\r
1123tf: db '$',0,0,0 ;(can't) Enter Graphics Mode\r
1124tg: db '$',0,0,0 ;(can't) Exit Graphics mode\r
1125th: db 1EH,'$',0,0 ;Cursor home.\r
1126ti: db '$',0,0,0 ;(can't) Reverse linefeed.\r
1127tj: db 1cH,'$',0,0 ;Clear to end of screen.\r
1128tk: db 1cH,'$',0,0 ;Clear to end of line.\r
1129ENDIF;mikko\r
1130;\f\r
1131IF bbc ;[22]\r
1132sysver: db 'BBC (Z80)$'\r
1133outlin: db 0CH,esc,'=',21H,30H,'$'\r
1134erascr: db 0CH,'$' ;Clear screen and go home.\r
1135eralin: db cr,esc,'@$' ;Clear line.\r
1136curldn: db esc,'=$' ;cursor leadin\r
1137ttab: ;Table start location.\r
1138ta: db 0BH,'$',0,0 ;Cursor up.\r
1139tb: db 0AH,'$',0,0 ;Cursor down.\r
1140tc: db tab,'$',0,0 ;Cursor right.\r
1141td: db bs,'$',0,0 ;Cursor left\r
1142te: db 0CH,'$',0,0 ;Clear display\r
1143tf: db '$',0,0,0 ;(can't) Enter Graphics Mode\r
1144tg: db '$',0,0,0 ;(can't) Exit Graphics mode\r
1145th: db 1EH,'$',0,0 ;Cursor home.\r
1146ti: db '$',0,0,0 ;(can't) Reverse linefeed.\r
1147tj: db esc,'?$',0,0 ;Clear to end of screen.\r
1148tk: db esc,'@$',0,0 ;Clear to end of line.\r
1149ENDIF;[22] bbc\r
1150;\f\r
1151IF rm380z ;[22]\r
1152sysver: db 'Research Machines 380Z$'\r
1153outlin: db 1FH,cr,tab,'$'\r
1154erascr: db 1FH,'$' ;Clear screen and go home.\r
1155eralin: db 0EH,19H,'$' ;Clear line.\r
1156curldn: db 16H,'$' ;cursor leadin\r
1157ttab: ;Table start location.\r
1158ta: db 0BH,'$',0,0 ;Cursor up.\r
1159tb: db 0AH,'$',0,0 ;Cursor down.\r
1160tc: db 18H,'$',0,0 ;Cursor right.\r
1161td: db bs,'$',0,0 ;Cursor left\r
1162te: db 1FH,'$',0,0 ;Clear display\r
1163tf: db '$',0,0,0 ;(can't) Enter Graphics Mode\r
1164tg: db '$',0,0,0 ;(can't) Exit Graphics mode\r
1165th: db 1DH,'$',0,0 ;Cursor home.\r
1166ti: db '$',0,0,0 ;(can't) Reverse linefeed.\r
1167tj: db 1EH,'$',0,0 ;Clear to end of screen.\r
1168tk: db 19H,'$',0,0 ;Clear to end of line.\r
1169ENDIF;[22] rm380z\r
1170\r
1171IF lobo ;[hh]\r
1172sysver: db 'Lobo MAX-80$'\r
1173outlin: db esc,'*',cr,lf,tab,tab,'$'\r
1174erascr: db esc,'*$' ;[hh] clear screen and home cursor\r
1175eralin: db cr,esc,'R$' ;[hh] clear line\r
1176curldn: db esc,'=$' ;[hh] cursor lead-in string\r
1177delstr: db bs,' ',bs,bs,'$' ;[hh] ??adjust for echoing delete\r
1178ttab: ;[hh] table start location\r
1179ta: db 0BH,'$',0,0 ;[hh] cursor up\r
1180tb: db 0AH,'$',0,0 ;[hh] cursor down\r
1181tc: db 0CH,'$',0,0 ;[hh] cursor right\r
1182td: db 08H,'$',0,0 ;[hh] cursor left\r
1183te: db esc,'*$',0 ;[hh] clear display (homes cursor)\r
1184tf: db '$',0,0,0 ;[hh] (can't) enter graphics mode\r
1185tg: db '$',0,0,0 ;[hh] (can't) exit graphics mode\r
1186th: db 01EH,'$',0,0 ;[hh] home cursor\r
1187ti: db esc,'E$',0 ;[hh] reverse linefeed (insert line)\r
1188tj: db esc,'Y$',0 ;[hh] clear to end of screen\r
1189tk: db esc,'T$',0 ;[hh] clear to end of line\r
1190ENDIF ;lobo\r
1191\r
1192IF px8 ; [29]\r
1193sysver: db 'Epson PX-8$'\r
1194outlin: db esc,'*$'\r
1195erascr: db esc,'*$' ; clear screen and home\r
1196eralin: db cr,esc,'T$' ; clear line\r
1197curldn: db esc,'=$' ; cursor lead in\r
1198ttab: ; table start location\r
1199ta: db 30,'$',0,0 ; cursor up\r
1200tb: db 31,'$',0,0 ; cursor down\r
1201tc: db 28,'$',0,0 ; cursor right\r
1202td: db 29,'$',0,0 ; cursor left\r
1203te: db esc,'*$',0 ; clear display\r
1204tf: db '$',0,0,0 ; can't enter graphics graphics mode\r
1205tg: db '$',0,0,0 ; can't exit graphics mode\r
1206th: db 11,'$',0,0 ; home cursor\r
1207ti: db 30,'$',0,0 ; reverse linefeed\r
1208tj: db esc,'Y$',0 ; erase to end of screen\r
1209tk: db esc,'T$',0 ; erase to end of line\r
1210ENDIF ; px8 [29]\r
1211\r
1212;\f\r
1213IF osbrn1\r
1214sysver: db 'Osborne 1$'\r
1215outlin: db 1AH,cr,lf,tab,'$' ;(Clear screen, home cursor)\r
1216erascr: db 1AH,'$' ;Clear screen and go home.\r
1217eralin: db cr,esc,'T$' ;Clear line.\r
1218delstr: db bs,bs,'$' ; Adjust for delete\r
1219curldn: db esc,'=$' ;Cursor lead-in\r
1220ttab: ;Table start location.\r
1221ta: db ('K'-100O),'$',0,0 ;Cursor up.\r
1222tb: db 12O,'$',0,0 ;Cursor down.\r
1223tc: db ('L'-100O),'$',0,0 ;Cursor right.\r
1224td: db bs,'$',0,0 ;Cursor left.\r
1225te: db subt,'$',0,0 ;Clear screen.\r
1226tf: db '$',0,0,0 ;(can't) Enter graphics mode\r
1227tg: db '$',0,0,0 ;(can't) Exit graphics mode\r
1228th: db ('^'-100O),'$',0,0 ;Cursor home.\r
1229ti: db ('K'-100O),'$',0,0 ;Reverse linefeed.\r
1230tj: db esc,'T$',0 ;(can't) Clear to end of screen.\r
1231tk: db esc,'T$',0 ;Clear to end of line.\r
1232ENDIF;osbrn1\r
1233;\f\r
1234IF vector\r
1235sysver: db 'Vector Graphics$'\r
1236outlin: db ('D'-100O),cr,lf,tab,tab,'$'\r
1237erascr: db ('D'-100O),'$' ;Clear screen and go home.\r
1238eralin: db cr,('Q'-100O),'$' ;Clear line.\r
1239delstr: db bs,' ',bs,bs,'$' ; adjust for echoing delete character\r
1240ttab: ;Table start location.\r
1241ta: db ('U'-100O),'$',0,0 ;Cursor up.\r
1242tb: db 12O,'$',0,0 ;Cursor down.\r
1243tc: db ('Z'-100O),'$',0,0 ;Cursor right.\r
1244td: db '$',0,0,0 ;(can't) Cursor left\r
1245te: db '$',0,0,0 ;(can't) Clear display\r
1246tf: db '$',0,0,0 ;(can't) Enter graphics mode\r
1247tg: db '$',0,0,0 ;(can't) Exit graphics mode\r
1248th: db ('B'-100O),'$',0,0 ;Cursor home.\r
1249ti: db ('U'-100O),'$',0,0 ;Reverse linefeed.\r
1250tj: db ('P'-100O),'$',0,0 ;Clear to end of screen.\r
1251tk: db ('Q'-100O),'$',0,0 ;Clear to end of line.\r
1252ENDIF;vector\r
1253\r
1254IF trs80lb\r
1255sysver: db 'TRS-80 II Lifeboat CP/M$'\r
1256outlin: db esc,':',cr,lf,tab,tab,'$'\r
1257erascr: db esc,':$' ;Clear screen and go home.\r
1258eralin: db cr,esc,'T$' ;Clear line.\r
1259curldn: db esc,'=$' ;Cursor lead-in\r
1260ttab: ;Table start location.\r
1261ta: db 0BH,'$',0,0 ;Cursor up.\r
1262tb: db 0AH,'$',0,0 ;Cursor down.\r
1263tc: db 0CH,'$',0,0 ;Cursor right.\r
1264td: db bs,'$',0,0 ;Cursor left\r
1265te: db esc,':$',0 ;Clear display\r
1266tf: db '$',0,0,0 ;(can't) Enter Graphics Mode\r
1267tg: db '$',0,0,0 ;(can't) Exit Graphics mode\r
1268th: db 1EH,'$',0,0 ;Cursor home.\r
1269ti: db 0BH,'$',0,0 ;Reverse linefeed.\r
1270tj: db esc,'Y$',0 ;Clear to end of screen.\r
1271tk: db esc,'T$',0 ;Clear to end of line.\r
1272ENDIF;trs80lb\r
1273;\f\r
1274IF trs80pt\r
1275sysver: db 'TRS-80 II P+T CP/M$'\r
1276outlin: db 0CH,cr,lf,tab,tab,'$'\r
1277erascr: db 0CH,'$' ;Clear screen and go home.\r
1278eralin: db cr,01H,'$' ;Clear line.\r
1279curldn: db esc,'Y$' ;Cursor lead-in\r
1280ttab: ;Table start location ;Must be 4 bytes each\r
1281ta: db 1EH,'$',0,0 ;Cursor up.\r
1282tb: db 1FH,'$',0,0 ;Cursor down.\r
1283tc: db 1DH,'$',0,0 ;Cursor right.\r
1284td: db 1CH,'$',0,0 ;Cursor left\r
1285te: db 0CH,'$',0,0 ;Clear display\r
1286tf: db 11H,'$',0,0 ;Enter Graphics Mode\r
1287tg: db 14H,'$',0,0 ;Exit Graphics mode\r
1288th: db 06H,'$',0,0 ;Cursor home.\r
1289ti: db 1EH,'$',0,0 ;Reverse linefeed.\r
1290tj: db 02H,'$',0,0 ;Clear to end of screen.\r
1291tk: db 01H,'$',0,0 ;Clear to end of line.\r
1292ENDIF;trs80pt\r
1293\r
1294IF osi\r
1295outlin: db cr,lf,'Starting ...$'\r
1296erascr equ crlf ;"Home & clear" (best we can do).\r
1297eralin: db '^U',cr,lf,'$' ;Clear line.\r
1298prpack: db cr,lf,'RPack: $'\r
1299pspack: db cr,lf,'SPack: $'\r
1300ttab equ 0 ; no VT52 table\r
1301ENDIF;osi\r
1302;\r
1303IF hp125 ;[MF]\r
1304defesc EQU '\'-100O ;Still Control-\ (just ran out of room...)\r
1305vtval EQU 0 ; we probably don't want VT52 emulation\r
1306;\r
1307sysver: db 'HP-125 Series 100$'\r
1308;\r
1309outlin: db esc,'H',esc,'J',cr,lf,tab,tab,'$'\r
1310erascr: db esc,'H',esc,'J$' ;Clear screen and go home.\r
1311eralin: db cr,esc,'K$' ;Clear line.\r
1312curldn: db esc,'&a$' ;Cursor leadin\r
1313ttab: ;Table start location.\r
1314ta: db esc,'A$',0 ;Cursor up.\r
1315tb: db esc,'B$',0 ;Cursor down.\r
1316tc: db esc,'C$',0 ;Cursor right.\r
1317td: db esc,'D$',0 ;Cursor left\r
1318te: db esc,'J$',0 ;Clear display\r
1319tf: db '$',0,0,0 ;[hh] (can't) enter graphics mode\r
1320tg: db '$',0,0,0 ;[hh] (can't) exit graphics mode\r
1321th: db esc,'H$',0 ;Cursor home.\r
1322ti: db esc,'M$',0 ;Reverse linefeed.\r
1323tj: db esc,'J$',0 ;Clear to end of screen.\r
1324tk: db esc,'K$',0 ;Clear to end of line.\r
1325;\r
1326;\r
1327; Escape sequences to map CP/M Reader/Punch to Data Comm input/output,\r
1328; respectively and to turn off these mappings\r
1329;\r
1330mapon1: db esc,'&i10s18d9M'\r
1331 db esc,'&i2s25d9M'\r
1332 db esc,'&i10s16d2M'\r
1333 db esc,'&i0s25d2M$';Esc. sequences to turn off DAtacomm2/turn\r
1334 ;on Data Comm 1\r
1335mapon2: db esc,'&i10s16d9M'\r
1336 db esc,'&i0s25d9M'\r
1337 db esc,'&i10s18d2M'\r
1338 db esc,'&i2s25d2M$';Esc. sequences to turn off Datacomm1/turn\r
1339 ;on Datacomm 2\r
1340mapoff: db esc,'&i0s25d9M'\r
1341 db esc,'&i10s16d9M'\r
1342 db esc,'&i2s25d9M'\r
1343 db esc,'&i10s18d9M$'\r
1344;\r
1345readin: call $-$ ;Read character into b\r
1346 mov a,b ;Get 8-bit character\r
1347 ret ;and return\r
1348;\r
1349jbuf: db 7 ;bios dispatch table vector argument block\r
1350 db 0 ;to read RDR routine address\r
1351 db 0c3h ;...\r
1352 dw 0 ;...\r
1353;\r
1354ENDIF;hp125 ;[MF]\r
1355\r
1356IF lasm and termin ; if no terminal, no need to link\r
1357LINK CPXVDU.ASM\r
1358ENDIF ; lasm and termin\r
1359\r
1360ovlend EQU $\r
1361\r
1362IF lasm\r
1363 END ; If m80 then this ignored\r
1364ENDIF ; lasm\r