4 ; KERMIT - (Celtic for "FREE")
6 ; This is the CP/M-80 implementation of the Columbia University
7 ; KERMIT file transfer protocol.
11 ; Copyright June 1981,1982,1983,1984,1985
14 ; Originally written by Bill Catchings of the Columbia University Center for
15 ; Computing Activities, 612 W. 115th St., New York, NY 10025.
17 ; Contributions by Frank da Cruz, Daphne Tzoar, Bernie Eiben,
18 ; Bruce Tanner, Nick Bush, Greg Small, Kimmo Laaksonen, Jeff Damens, and many
21 ; This file contains the system-dependent code and data for KERMIT.
22 ; It will be probably be broken into independent files to generate
23 ; overlays for the various systems, one or more overlay possible
24 ; from each file. For now, we will leave it in one piece.
29 ;
\f This is the system-dependent command to change the baud rate.
30 ; DE contains the two-byte value from the baud rate table; this
31 ; value is also stored in 'speed'.
37 call rsclose ; baud rate can only be set on opening rs232
40 sta px8blk+4 ; set param block
41 call rsopen ; to set rate
45 ; Set the speed for the Osborne I
47 mvi a,osbin1 ;Reset the ACIA
48 call osstst ;Write the control port
49 osbs1: inr c ;Waiting loop
51 mov a,e ; get the specified speed
52 jmp osstst ;Write the control reg.
55 ;[hh] set the speed for a lobo MAX-80
57 mov a,e ;[hh] get the parsed value
58 setbd: sta baudrt ;[hh] and send it to the baud rate port
62 ; Set the speed for bigboard I or the delphi or the CPT-85xx
63 ; or Cromemco (TU-ART)
64 IF delphi OR cpt85xx OR cmemco OR mmate ;[22] [29]
65 mov a,e ; get the parsed value
66 out baudrt ; Tell the baud rate generator.
68 ENDIF;delphi OR cpt85xx OR cmemco OR mmate [22] [29]
70 ;[22] Set the speed for Acorn BBC
73 mvi a,7 ;Set receive baud rate
76 mvi a,8 ;Set transmit baud rate
81 ;[22] Set speed for RM 380Z
83 mvi a,4 ;device type (SI/O4) in A
89 ; Set the speed for MicroMikko. DE is baud rate multiplier
93 mov m,d ;LSB first (swapped in memory)
98 mvi b,0 ;"modifier" for 1 stop bit
99 mvi a,2 ;Test MSB of speed >2 (110 bps or less)
102 mvi b,00001000B ;"modifier" for 2 stop bits
103 miksp1: mvi a,4 ;Select SIO Reg 4
106 mvi a,sion4 ;Get values
108 mov m,a ;Set value (stop bits)
114 ; Set the speed for the Decision I
116 call selmdm ;Let's be absolutely sure, huh?
117 mvi a,dlab+wls1+wls0+stb ;Set data latch access bit
118 out lcr ;Out to Line Control Register
119 lhld speed ;Load baudrate multiplier
121 mov a,d ;Get low order byte for baud rate
122 out dlm ;Out to the MSB divisor port
123 mov a,e ;...and the high order byte
124 out dll ;Out to the LSB divisor port
125 mvi a,wls1+wls0+stb ;Enable Divisor Access Latch
126 out lcr ;Out to ACE Line Control Register
128 out ier ;Set no interrupts
129 out lsr ;Clear status
130 in msr ;Clear Modem Status Register
131 in lsr ;Clear Line Status Register
132 in rbr ;Clear Receiver Buffers
135 ENDIF ;mdI [Toad Hall]
139 mov a,e ; first speed byte
141 mov a,d ; second speed byte
148 mov a,e ;Get the parsed time constant
149 ;The following code is derived from the Access initialization code
150 sta savspd ;Save the time constant
151 mvi a,14h ;Code for 'monitor' to set channel A baudrate
153 lda savspd ;Get the time constant
154 call monitor ; and send it to the CRT
157 monitor: ;Routine to do CRT functions
158 out 90h ;Output the data to the CRT
159 mvi a,1 ;Set DRDY true
161 mon1: in 0a0h ;Wait for CACK* true
164 in 80h ;Read the input data latch
165 push psw ;Save the input data
166 xra a ;Set DRDY false
168 mon2: in 0a0h ;Wait for CACK* false
172 sta 0ee02h ;Save the input data
178 ; Assuming that parsing of value from speed table puts low order
179 ; byte of time constant in the e register and high byte in d.
180 mvi a,12 ;Register 12
182 mov a,e ;Low order byte of time constant
184 mvi a,13 ;Register 13
186 mov a,d ;High order byte of time constant
188 mvi a,14 ;Register 14
190 mvi a,3 ;Enable baud rate generator
192 mvi a,11 ;Register 11
194 mvi a,52h ;no Xtal, tclk=rclk=/trxc out=br gen
199 ; (Note that speed tables MUST be in alphabetical order for later
200 ; lookup procedures, and must begin with a value showing the total
201 ; number of entries. The speed help tables are just for us poor
204 ; db string length,string,divisor (2 identical bytes or 1 word)
207 IF delphi OR lobo ;[hh]
208 spdtbl: db 10h ;16 entries
209 db 03h,'110$', 02h,02h
210 db 04h,'1200$', 07h,07h
211 db 05h,'134.5$', 03h,03h
212 db 03h,'150$', 04h,04h
213 db 04h,'1800$', 08h,08h
214 db 05h,'19200$', 0fh,0fh
215 db 04h,'2000$', 09h,09h
216 db 04h,'2400$', 0ah,0ah
217 db 03h,'300$', 05h,05h
218 db 04h,'3600$', 0bh,0bh
219 db 04h,'4800$', 0ch,0ch
220 db 02h,'50$', 00h,00h
221 db 03h,'600$', 06h,06h
222 db 04h,'7200$', 0dh,0dh
223 db 02h,'75$', 01h,01h
224 db 04h,'9600$', 0eh,0eh
226 sphtbl: db cr,lf,' 50 75 110 134.5 150 300 600 1200'
227 db cr,lf,' 1800 2000 2400 3600 4800 7200 9600 19200$'
228 ENDIF;delphi OR lobo ;[hh]
231 spdtbl: db 15 ; 15 entries
232 db 03,'110$', 03h,03h
233 db 04,'1200$', 09h,09h
234 db 05,'134.5$', 04h,04h
235 db 03,'150$', 05h,05h
236 db 04,'1800$', 0Ah,0Ah
237 db 04,'2400$', 0Bh,0Bh
238 db 03,'300$', 06h,06h
239 db 04,'3600$', 0Ch,0Ch
240 db 04,'4800$', 0Dh,0Dh
242 db 03,'600$', 07h,07h
243 db 04,'7200$', 0Eh,0Eh
245 db 03,'900$', 08h,08h
246 db 04,'9600$', 0Fh,0Fh
248 sphtbl: db cr,lf,' 50 75 110 134.5 150 300 600 900'
249 db cr,lf,' 1200 1800 2400 3600 4800 7200 9600$'
253 spdtbl: db 8 ; 8 entries
254 db 04,'1200$', 04h,04h
255 db 03,'150$', 02h,02h
256 db 05,'19200$', 08h,08h
257 db 04,'2400$', 05h,05h
258 db 03,'300$', 03h,03h
259 db 04,'4800$', 06h,06h
261 db 04,'9600$', 07h,07h
263 sphtbl: db cr,lf,' 75 150 300 1200 2400 4800 9600 19200$'
267 spdtbl: db 7 ; 7 entries
268 db 03,'110$', 00h,00h
269 db 04,'1200$', 03h,03h
270 db 04,'2400$', 04h,04h
271 db 03,'300$', 01h,01h
272 db 04,'4800$', 05h,05h
273 db 03,'600$', 02h,02h
274 db 04,'9600$', 06h,06h
276 sphtbl: db cr,lf,' 110 300 600 1200 2400 4800 9600$'
280 spdtbl: db 9 ; 9 entries
281 db 03,'110$', 02h,02h
282 db 04,'1200$', 0ah,0ah
283 db 03,'150$', 04h,04h
284 db 05,'19200$', 0fh,0fh
285 db 04,'2400$', 0ch,0ch
286 db 03,'300$', 06h,06h
287 db 04,'4800$', 0dh,0dh
288 db 03,'600$', 08h,08h
289 db 04,'9600$', 0eh,0eh
291 db ' 100 150 300 600 1200 2400 4800 9600 19200$'
295 spdtbl: db 9h ;9 entries
315 sphtbl: db cr,lf,' 75 110 150 300 600 1200 2400 4800 9600$'
319 spdtbl: db 02h ;2 entries
320 db 04h,'1200$', OSBI12,OSBI12
321 db 03h,'300$', OSBI03,OSBI03
323 sphtbl: db cr,lf,' 300',cr,lf,' 1200$'
328 spdtbl: db 0dh ; 13 entries
356 sphtbl: db cr,lf,' 75 110 150 300 450 600 1200'
357 db cr,lf,' 2400 4800 9600 19200 38400 56000$'
359 ;(Lord knows what you'll be communicating with at 56000 baud, but the
360 ;Multi-I/O board literature says it'll do it, so what the heck....
361 ;might as well throw it in here just to show off...sure hope the
364 ENDIF ;mdI [Toad Hall]
367 spdtbl: db 7 ; 7 entries
369 db 4,'1200$', 88H,88H
371 db 4,'2400$', 90H,90H
373 db 4,'4800$', 0A0H,0A0H
374 db 4,'9600$', 0C0H,0C0H
377 db ' 110 150 300 1200 2400 4800 9600$'
380 IF access ;Similar to bbI with different values [29]
381 spdtbl: db 6h ;6 entries
382 db 04h,'1200$', 28h,28h
383 db 04h,'2400$', 14h,14h
384 db 03h,'300$', 0a0h,0a0h
385 db 04h,'4800$', 0ah,0ah
386 db 03h,'600$', 50h,50h
389 sphtbl: db cr,lf,' 300 600 1200 2400 4800 9600$'
393 spdtbl: db 10h ;16 entries
394 db 03h,'110$', 0e2h,0e2h
395 db 04h,'1200$', 0e7h,0e7h
396 db 05h,'134.5$', 0e3h,0e3h
397 db 03h,'150$', 0e4h,0e4h
398 db 04h,'1800$', 0e8h,0e8h
399 db 05h,'19200$', 0efh,0efh
400 db 04h,'2000$', 0e9h,0e9h
401 db 04h,'2400$', 0eah,0eah
402 db 03h,'300$', 0e5h,0e5h
403 db 04h,'3600$', 0ebh,0ebh
404 db 04h,'4800$', 0ech,0ech
405 db 02h,'50$', 0e0h,0e0h
406 db 03h,'600$', 0e6h,0e6h
407 db 04h,'7200$', 0edh,0edh
408 db 02h,'75$', 0e1h,0e1h
409 db 04h,'9600$', 0eeh,0eeh
411 sphtbl: db cr,lf,' 50 75 110 134.5 150 300 600 1200'
412 db cr,lf,' 1800 2000 2400 3600 4800 7200 9600 19200$'
416 ; Similar to mikko table but with different time constant values
417 spdtbl: db 9h ;9 entries
437 sphtbl: db cr,lf,' 75 110 150 300 600 1200 2400 4800 9600$'
441 spdtbl: db 7 ; 7 entries
442 db 4, '1200$', 47h,40h
443 db 5,'19200$', 47h,04h
444 db 4, '2400$', 47h,20h
445 db 3, '300$', 47h,00h
446 db 4, '4800$', 47h,10h
447 db 3, '600$', 47h,80h
448 db 4, '9600$', 47h,08h
451 db ' 300 600 1200 2400 4800 9600 19200$'
455 ; The following conditionals were once a huge if not statement. There
456 ; wasn't enough room to add the lobo to the list, so it had to be broken
457 ; into 2, which you can't do with an if not. I redid it as two ifs and
458 ; applied them to those that wouldn't set baud. [Hal Hostetler]
459 IF robin OR gener OR dmII OR vector OR trs80;[32]
460 spdtbl equ 0 ; SET BAUD not supported.
462 ENDIF;robin OR gener OR dmII OR vector OR trs80
464 IF mmdI OR osi OR cpm3 OR S1008 ; [29]
465 spdtbl EQU 0 ;[hh] SET BAUD not supported.
466 sphtbl EQU 0 ;[hh] ran out of room above...
467 ENDIF;mmdI OR osi OR cpm3 OR S1008 [29]
470 spdtbl equ 0 ; SET BAUD not supported.
474 ;
\f This is the system-dependent SET PORT command.
475 ; HL contains the argument from the command table.
478 mov a,l ;[hh] get the data port value and store at
479 sta outmd3+1 ;[hh] the two places we use...
480 sta inpmd2+1 ;[hh] MNPORT in the overlay
481 sta port ;[hh] inform program of the change in ports
482 inr a ;[hh] status port = data port + 1 in the Lobo
483 sta outmd1+1 ;[hh] store it at the three places...
484 sta inpmd1+1 ;[hh] we use MNPRTS...
485 sta outctl+1 ;[hh] in the overlay
486 mov a,h ;[hh] now get the baud rate port value
487 sta getbd+1 ;[hh] store it in the two places we use...
488 sta setbd+1 ;[hh] BAUDRT in the overlay
489 sta port+1 ;[hh] don't need to, but keeps it consistant
490 getbd: lda baudrt ;[hh] get baud rate value from port
491 sta speed ;[hh] tell STAT. baud rate for each port
492 ;[hh] is independant of the other
496 mov a,m ;Get the I/O byte
497 sta prtiob ;Save the desired IO byte for this port
498 inx h ;Point at next entry
499 mov a,m ;Get the output function
504 inx h ;Point at next entry
505 mov a,m ;Get the hardware address for the port
507 ENDIF;iobyt AND robin
514 xchg ;Put port connect sequence address in DE
515 call prtstr ;Connect proper port
524 ; Port tables for Lobo MAX-80
527 prhtbl: db cr,lf,'RS-232 port A or B$'
530 prttbl: db 02H ;[hh] two entries
531 db 01H,'A$',0E4H,0D0H
532 db 01H,'B$',0E6H,0D4H
535 ; Port tables for GENERIC CPM 2.2
538 prhtbl: db cr,lf,'CRT device'
539 db cr,lf,'PTR device'
540 db cr,lf,'TTY device'
541 db cr,lf,'UC1 device'
542 db cr,lf,'UR1 device'
543 db cr,lf,'UR2 device$'
546 prttbl: db 06H ;Six devices to choose from
562 ; db iobyte-value, BDOS output function, reserved
563 crtptb: db crtio,conout,0
564 ptrptb: db ptrio,punout,0
565 ttyptb: db ttyio,conout,0
566 uc1ptb: db uc1io,conout,0
567 ur1ptb: db ur1io,punout,0
568 ur2ptb: db ur2io,punout,0
572 ; Port tables for DECmate II or MicroMikko or Acorn BBC
574 IF dmII OR mikko OR bbc ;[22]
576 prhtbl: db cr,lf,'COMMUNICATIONS port$'
579 prttbl: db 01H ;Only one port known at this point
580 db 0EH,'COMMUNICATIONS$'
581 dw comptb ;address of info
585 ; db iobyte-value, BDOS output function, reserved
586 comptb: db batio,punout,0
588 ENDIF;[22] dmII OR mikko OR bbc
590 ; Port tables for Robin
594 prhtbl: db cr,lf,'COMMUNICATIONS port'
595 db cr,lf,'GENERAL purpose port'
596 db cr,lf,'PRINTER port$'
599 prttbl: db 03H ;Three entries
600 db 0EH,'COMMUNICATIONS$'
609 ; db iobyte-value, BDOS output function, hardware port address
612 ;At present, the hardware port address is only used for sending a break.
613 comptb: db batio,punout,comtst
614 gppptb: db gppio,conout,gentst
615 prnptb: db lptio,conout,prntst
617 prtadr: db comtst ;space for current hardware port address
621 prtfun: db punout ;Function to use for output to comm port
622 prtiob: db batio ;I/O byte to use for communicating
623 coniob: db defio ;I/O byte to use for console
628 prhtbl: db cr,lf,'Communications port'
629 db cr,lf,'Printer port$'
631 prttbl: db 02H ;2 entries
632 db 0eH,'COMMUNICATIONS$'
636 ;Port table entries are the addresses of the escape sequences to connect
641 IF NOT (iobyt OR lobo OR hp125) ;[hh] [MF]
642 prttbl equ 0 ; SET PORT is not supported
644 ENDIF;NOT iobyt OR lobo OR hp125 [MF]
646 ; selmdm - select modem port
647 ; selcon - select console port
648 ; selmdm is called before using inpmdm or outmdm;
649 ; selcon is called before using inpcon or outcon.
650 ; For iobyt systems, diddle the I/O byte to select console or comm port;
651 ; For Decision I, switches Multi I/O board to console or modem serial
653 ; For the rest, does nothing.
654 ; preserves bc, de, hl.
657 lda prtiob ;Set up for output to go to the comm port
658 sta iobyte ;Switch byte directly
663 ori mdmgrp ;Mask modem serial port
665 ENDIF;mdI [Toad Hall]
671 lda coniob ;Set up for output to go to the console port
672 sta iobyte ;Switch directly
677 ori congrp ;Mask console serial port (1)
679 ENDIF;mdI [Toad Hall]
682 ;
\f Get character from console, or return zero.
683 ; result is returned in A. destroys bc, de, hl.
687 mvi c,dconio ;Direct console I/O BDOS call.
693 call bconst ;Get the status
694 ora a ;Anything there?
696 call bconin ;Yes, get the character
700 ; Output character in E to the console.
701 ; destroys bc, de, hl
707 cpi cr ;cr produces cr + lf
709 mvi e,'N'-100O ;Control-N produces cr only
714 mvi c,dconio ;Console output bdos call.
715 call bdos ;Output the char to the console.
720 call bcnout ;to Console
724 ; outmdm - output a char from E to the modem.
725 ; the parity bit has been set as necessary.
726 ; returns nonskip; bc, de, hl preserved.
730 outmd1: lxi h,mnprts ;address of the port status register
731 outmd2: mov a,m ; get port status in A
732 ani output ;Loop till ready.
734 outmd3: lxi h,mnport ;address of port data register
735 mov m,e ; write the character
741 call osldst ;Read the status port
742 ani output ;Loop till ready.
745 jmp osstda ;Write to the data port
752 outmd1: call rsoutst ; get the output status
754 jz outmd1 ; check if output enabled
766 in mnprts ;Get the output done flag.
767 ani output ;Is it set?
768 jz outmdm ;If not, loop until it is.
770 out mnport ;Output it.
775 ;**** Note that we enter from outpkt with the I/O byte already set up for
776 ; output to go to the comm port
779 lda prtfun ;Get the output function
781 call bdos ;And output the character
787 IF cpm3 OR hp125 ;[MF]
790 mvi c,auxout ;Output to the aux output device
795 ENDIF;cpm3 OR hp125 [MF]
797 ;
\forg $+100h AND 0FF00h ; get rid of phase error
800 ; get character from modem; return zero if none available.
801 ; for IOBYT systems, the modem port has already been selected.
802 ; destroys bc, de, hl.
805 call bconst ;Is Char at COMM-Port?
806 ora a ;something there?
807 rz ; return if nothing there
808 call bconin ; data present. read data.
813 call bdos ;is char at auxin?
814 ora a ;something there?
817 call bdos ;read char from auxin
821 lxi b,70ffh ;SEt subfunction to get RDR (auxin) status
822 call bdos ;is char at RDR?
823 ora a ;something there?
826 call bdos ;read char from RDR
830 inpmd1: lda mnprts ;Get the port status into A.
831 ani input ;See if the input ready bit is on.
832 rz ;If not then return.
833 inpmd2: lda mnport ;If so, get the char.
837 call osldst ;Read the status port
838 ani input ;Something there?
840 call osldda ;Read the data port
844 ;Note: modem port should already be selected for mdI. [Toad Hall]
845 in mnprts ;Get the port status into A.
846 ani input ;See if the input ready bit is on.
847 rz ;If not then return.
848 in mnport ;If so, get the char.
852 call rserst ; check error status
853 ani 64h ; this assumes 'not open' cannot occur
854 jnz inpmd1 ; error has occurred!
855 call rsinst ; any chars outstanding?
858 call rsget ; get char in A
860 ; return the 'no char outstanding' indication on error
864 ret ; return with character in A
868 ; flsmdm - flush comm line.
870 ; Currently, just gets characters until none are available.
872 flsmdm: call inpmdm ; Try to get a character
874 jnz flsmdm ; If so, try for another
875 ret ; Receiver is drained. Return.
877 ; lptstat - get the printer status. Return a=0ffh if ok, or 0 if not.
881 call bprtst ; get status
884 xra a ; assume it is ok.. this may not be necessary
889 ; outlpt - output character in E to printer
890 ; console is selected.
893 push d ; save DE in either case
894 call prtflt ; go through printer filter [30]
895 ana a ; if A = 0 do nothing,
896 jz outlp1 ; [30] if a=0 do nothing
900 call bdos ;Char to printer
907 outlp1: pop d ; restore saved register pair
910 ; Screen manipulation routines
911 ; csrpos - move to row B, column C
913 ; csrpos for terminals that use a leadin sequence followed
914 ; by (row + 31.) and (column + 31.)
916 IF NOT (robin OR dmII OR osi OR vector OR termin OR hp125)
917 ;[MF] Terminals code in CPXVDU
918 csrpos: push b ; save coordinates
919 lxi d,curldn ; get cursor leadin sequence
920 call prtstr ; print it
921 pop h ; restore coordinates
923 adi (' '-1) ; space is row one
926 call outcon ; output row
929 adi (' '-1) ; space is column one
931 jmp outcon ; output it and return
932 ENDIF;NOT (robin OR dmII OR osi OR vector OR termin OR hp125)[MF]
936 ; csrpos for ANSI terminals
939 csrpos: push b ; save coordinates
940 lxi d,curldn ; get cursor leadin sequence
941 call prtstr ; print it
942 pop h ; peek at coordinates
943 push h ; then save away again
946 call nout ; output in decimal
947 mvi e,';' ; follow with semicolon
948 call outcon ; print it
949 pop h ; restore column
950 mvi h,0 ; hl = column
952 mvi e,'H' ; terminate with 'move cursor' command
953 jmp outcon ; output it and return
956 ; csrpos for the HP-125 [MF]
959 csrpos: dcr b ;HP-125 uses zero-based addressing
961 push b ; save coordinates
962 lxi d,curldn ; get cursor leadin sequence
963 call prtstr ; print it
964 pop h ; peek at coordinates
965 push h ; then save away again
968 call nout ; output in decimal
969 mvi e,'R'+20h ;Say it was a row
970 call outcon ; print it
971 pop h ; restore column
972 mvi h,0 ; hl = column
974 mvi e,'C' ; terminate with 'move cursor' command
975 jmp outcon ; output it and return
978 ; csrpos for the Vector General. It's weird.
981 csrpos: dcr b ; vector uses zero-based addressing?
983 push b ; save coordinates
984 mvi e,esc ; print an escape
986 pop d ; peek at coordinates
988 call outcon ; output column
991 jmp outcon ; output and return
994 IF osi ; systems without cursor positioning
995 csrpos: ret ; dummy routine referenced by linkage section
1000 ; delchr - make delete look like a backspace. Unless delete is a printing
1001 ; character, we just need to print a backspace. (we'll output clrspc
1003 ; For Kaypro and Vector General, delete puts a blotch on the screen.
1004 ; For Apple and Osborne 1, delete moves but doesn't print.
1007 IF vector OR osbrn1 OR lobo
1010 ENDIF ;vector OR osbrn1 OR lobo
1012 IF bbc OR rm380z ;[22]
1016 IF NOT (vector OR osbrn1 OR bbc OR rm380z);[22]
1017 mvi e,bs ;get a backspace
1019 ENDIF;NOT (vector OR osbrn1 OR bbc OR rm380z [22]
1021 ; erase the character at the current cursor position
1024 mvi e,bs ;get a backspace
1027 ; erase the current line
1028 clrlin: lxi d,eralin
1031 ; erase the whole screen, and go home. preserves b (but not c)
1032 clrtop: lxi d,erascr
1037 sysver: db 'VT180 Robin$'
1041 sysver: db 'DECmate II CP/M-80$'
1044 IF delphi ; [7] new system
1045 sysver: db 'Digicomp Delphi 100$'
1049 sysver: db 'Actrix CP/M$'
1053 sysver: db 'Teletek SYSTEMASTER CP/M-80$'
1057 sysver: db 'CPT-85xx under CompuPak CP/M$'
1061 sysver: db 'Morrow Decision I$'
1062 ENDIF;mdI [Toad Hall]
1065 sysver: db 'MicroDecision I$'
1069 sysver: db 'Ohio Scientific$'
1073 sysver: db 'PMC Micromate using port I/O$'
1077 sysver: db 'Discovery using 83U board port B$'
1081 sysver: db 'U. S. MicroSales using printer port$'
1085 sysver: db 'Cromemco (TU-ART)$'
1089 ; Note that we cannot support Graphics Mode or the H19 erase-screen command
1090 ; (<esc>E), because the sequences are more than three bytes.
1091 defesc EQU '\'-100O ;Still Control-\ (just ran out of room...)
1092 vtval EQU 0 ; we probably don't want VT52 emulation
1093 outlin: db esc,3CH,esc,'[H',esc,'[J',cr,lf,tab,tab,'$'
1094 erascr: db esc,'[H',esc,'[J$' ;Clear screen and go home.
1095 eralin: db cr,esc,'[K$' ;Clear line.
1096 curldn: db esc,'[$' ; Cursor leadin
1098 ta: db esc,'[A$' ; Cursor up.
1099 tb: db esc,'[B$' ; Cursor down.
1100 tc: db esc,'[C$' ; Cursor right.
1101 td: db esc,'[D$' ; Cursor left
1102 te: db '$',0,0,0 ; (can't) Clear display
1103 tf: db '$',0,0,0 ; (don't) Enter Graphics Mode
1104 tg: db '$',0,0,0 ; (don't) Exit Graphics mode
1105 th: db esc,'[H$' ; Cursor home.
1106 ti: db esc,'M$',0 ; Reverse linefeed.
1107 tj: db esc,'[J$' ; Clear to end of screen.
1108 tk: db esc,'[K$' ; Clear to end of line.
1112 sysver: db 'MikroMikko$'
1113 outlin: db subt,cr,lf,tab,'$'
1114 erascr: db subt,'$' ;Clear screen and go home.
1115 eralin: db cr,1CH,'$' ;Clear line.
1116 curldn: db esc,'=$' ;cursor leadin
1117 ttab: ;Table start location.
1118 ta: db 0BH,'$',0,0 ;Cursor up.
1119 tb: db 0AH,'$',0,0 ;Cursor down.
1120 tc: db 0CH,'$',0,0 ;Cursor right.
1121 td: db bs,'$',0,0 ;Cursor left
1122 te: db subt,'$',0,0 ;Clear display
1123 tf: db '$',0,0,0 ;(can't) Enter Graphics Mode
1124 tg: db '$',0,0,0 ;(can't) Exit Graphics mode
1125 th: db 1EH,'$',0,0 ;Cursor home.
1126 ti: db '$',0,0,0 ;(can't) Reverse linefeed.
1127 tj: db 1cH,'$',0,0 ;Clear to end of screen.
1128 tk: db 1cH,'$',0,0 ;Clear to end of line.
1132 sysver: db 'BBC (Z80)$'
1133 outlin: db 0CH,esc,'=',21H,30H,'$'
1134 erascr: db 0CH,'$' ;Clear screen and go home.
1135 eralin: db cr,esc,'@$' ;Clear line.
1136 curldn: db esc,'=$' ;cursor leadin
1137 ttab: ;Table start location.
1138 ta: db 0BH,'$',0,0 ;Cursor up.
1139 tb: db 0AH,'$',0,0 ;Cursor down.
1140 tc: db tab,'$',0,0 ;Cursor right.
1141 td: db bs,'$',0,0 ;Cursor left
1142 te: db 0CH,'$',0,0 ;Clear display
1143 tf: db '$',0,0,0 ;(can't) Enter Graphics Mode
1144 tg: db '$',0,0,0 ;(can't) Exit Graphics mode
1145 th: db 1EH,'$',0,0 ;Cursor home.
1146 ti: db '$',0,0,0 ;(can't) Reverse linefeed.
1147 tj: db esc,'?$',0,0 ;Clear to end of screen.
1148 tk: db esc,'@$',0,0 ;Clear to end of line.
1152 sysver: db 'Research Machines 380Z$'
1153 outlin: db 1FH,cr,tab,'$'
1154 erascr: db 1FH,'$' ;Clear screen and go home.
1155 eralin: db 0EH,19H,'$' ;Clear line.
1156 curldn: db 16H,'$' ;cursor leadin
1157 ttab: ;Table start location.
1158 ta: db 0BH,'$',0,0 ;Cursor up.
1159 tb: db 0AH,'$',0,0 ;Cursor down.
1160 tc: db 18H,'$',0,0 ;Cursor right.
1161 td: db bs,'$',0,0 ;Cursor left
1162 te: db 1FH,'$',0,0 ;Clear display
1163 tf: db '$',0,0,0 ;(can't) Enter Graphics Mode
1164 tg: db '$',0,0,0 ;(can't) Exit Graphics mode
1165 th: db 1DH,'$',0,0 ;Cursor home.
1166 ti: db '$',0,0,0 ;(can't) Reverse linefeed.
1167 tj: db 1EH,'$',0,0 ;Clear to end of screen.
1168 tk: db 19H,'$',0,0 ;Clear to end of line.
1172 sysver: db 'Lobo MAX-80$'
1173 outlin: db esc,'*',cr,lf,tab,tab,'$'
1174 erascr: db esc,'*$' ;[hh] clear screen and home cursor
1175 eralin: db cr,esc,'R$' ;[hh] clear line
1176 curldn: db esc,'=$' ;[hh] cursor lead-in string
1177 delstr: db bs,' ',bs,bs,'$' ;[hh] ??adjust for echoing delete
1178 ttab: ;[hh] table start location
1179 ta: db 0BH,'$',0,0 ;[hh] cursor up
1180 tb: db 0AH,'$',0,0 ;[hh] cursor down
1181 tc: db 0CH,'$',0,0 ;[hh] cursor right
1182 td: db 08H,'$',0,0 ;[hh] cursor left
1183 te: db esc,'*$',0 ;[hh] clear display (homes cursor)
1184 tf: db '$',0,0,0 ;[hh] (can't) enter graphics mode
1185 tg: db '$',0,0,0 ;[hh] (can't) exit graphics mode
1186 th: db 01EH,'$',0,0 ;[hh] home cursor
1187 ti: db esc,'E$',0 ;[hh] reverse linefeed (insert line)
1188 tj: db esc,'Y$',0 ;[hh] clear to end of screen
1189 tk: db esc,'T$',0 ;[hh] clear to end of line
1193 sysver: db 'Epson PX-8$'
1195 erascr: db esc,'*$' ; clear screen and home
1196 eralin: db cr,esc,'T$' ; clear line
1197 curldn: db esc,'=$' ; cursor lead in
1198 ttab: ; table start location
1199 ta: db 30,'$',0,0 ; cursor up
1200 tb: db 31,'$',0,0 ; cursor down
1201 tc: db 28,'$',0,0 ; cursor right
1202 td: db 29,'$',0,0 ; cursor left
1203 te: db esc,'*$',0 ; clear display
1204 tf: db '$',0,0,0 ; can't enter graphics graphics mode
1205 tg: db '$',0,0,0 ; can't exit graphics mode
1206 th: db 11,'$',0,0 ; home cursor
1207 ti: db 30,'$',0,0 ; reverse linefeed
1208 tj: db esc,'Y$',0 ; erase to end of screen
1209 tk: db esc,'T$',0 ; erase to end of line
1214 sysver: db 'Osborne 1$'
1215 outlin: db 1AH,cr,lf,tab,'$' ;(Clear screen, home cursor)
1216 erascr: db 1AH,'$' ;Clear screen and go home.
1217 eralin: db cr,esc,'T$' ;Clear line.
1218 delstr: db bs,bs,'$' ; Adjust for delete
1219 curldn: db esc,'=$' ;Cursor lead-in
1220 ttab: ;Table start location.
1221 ta: db ('K'-100O),'$',0,0 ;Cursor up.
1222 tb: db 12O,'$',0,0 ;Cursor down.
1223 tc: db ('L'-100O),'$',0,0 ;Cursor right.
1224 td: db bs,'$',0,0 ;Cursor left.
1225 te: db subt,'$',0,0 ;Clear screen.
1226 tf: db '$',0,0,0 ;(can't) Enter graphics mode
1227 tg: db '$',0,0,0 ;(can't) Exit graphics mode
1228 th: db ('^'-100O),'$',0,0 ;Cursor home.
1229 ti: db ('K'-100O),'$',0,0 ;Reverse linefeed.
1230 tj: db esc,'T$',0 ;(can't) Clear to end of screen.
1231 tk: db esc,'T$',0 ;Clear to end of line.
1235 sysver: db 'Vector Graphics$'
1236 outlin: db ('D'-100O),cr,lf,tab,tab,'$'
1237 erascr: db ('D'-100O),'$' ;Clear screen and go home.
1238 eralin: db cr,('Q'-100O),'$' ;Clear line.
1239 delstr: db bs,' ',bs,bs,'$' ; adjust for echoing delete character
1240 ttab: ;Table start location.
1241 ta: db ('U'-100O),'$',0,0 ;Cursor up.
1242 tb: db 12O,'$',0,0 ;Cursor down.
1243 tc: db ('Z'-100O),'$',0,0 ;Cursor right.
1244 td: db '$',0,0,0 ;(can't) Cursor left
1245 te: db '$',0,0,0 ;(can't) Clear display
1246 tf: db '$',0,0,0 ;(can't) Enter graphics mode
1247 tg: db '$',0,0,0 ;(can't) Exit graphics mode
1248 th: db ('B'-100O),'$',0,0 ;Cursor home.
1249 ti: db ('U'-100O),'$',0,0 ;Reverse linefeed.
1250 tj: db ('P'-100O),'$',0,0 ;Clear to end of screen.
1251 tk: db ('Q'-100O),'$',0,0 ;Clear to end of line.
1255 sysver: db 'TRS-80 II Lifeboat CP/M$'
1256 outlin: db esc,':',cr,lf,tab,tab,'$'
1257 erascr: db esc,':$' ;Clear screen and go home.
1258 eralin: db cr,esc,'T$' ;Clear line.
1259 curldn: db esc,'=$' ;Cursor lead-in
1260 ttab: ;Table start location.
1261 ta: db 0BH,'$',0,0 ;Cursor up.
1262 tb: db 0AH,'$',0,0 ;Cursor down.
1263 tc: db 0CH,'$',0,0 ;Cursor right.
1264 td: db bs,'$',0,0 ;Cursor left
1265 te: db esc,':$',0 ;Clear display
1266 tf: db '$',0,0,0 ;(can't) Enter Graphics Mode
1267 tg: db '$',0,0,0 ;(can't) Exit Graphics mode
1268 th: db 1EH,'$',0,0 ;Cursor home.
1269 ti: db 0BH,'$',0,0 ;Reverse linefeed.
1270 tj: db esc,'Y$',0 ;Clear to end of screen.
1271 tk: db esc,'T$',0 ;Clear to end of line.
1275 sysver: db 'TRS-80 II P+T CP/M$'
1276 outlin: db 0CH,cr,lf,tab,tab,'$'
1277 erascr: db 0CH,'$' ;Clear screen and go home.
1278 eralin: db cr,01H,'$' ;Clear line.
1279 curldn: db esc,'Y$' ;Cursor lead-in
1280 ttab: ;Table start location ;Must be 4 bytes each
1281 ta: db 1EH,'$',0,0 ;Cursor up.
1282 tb: db 1FH,'$',0,0 ;Cursor down.
1283 tc: db 1DH,'$',0,0 ;Cursor right.
1284 td: db 1CH,'$',0,0 ;Cursor left
1285 te: db 0CH,'$',0,0 ;Clear display
1286 tf: db 11H,'$',0,0 ;Enter Graphics Mode
1287 tg: db 14H,'$',0,0 ;Exit Graphics mode
1288 th: db 06H,'$',0,0 ;Cursor home.
1289 ti: db 1EH,'$',0,0 ;Reverse linefeed.
1290 tj: db 02H,'$',0,0 ;Clear to end of screen.
1291 tk: db 01H,'$',0,0 ;Clear to end of line.
1295 outlin: db cr,lf,'Starting ...$'
1296 erascr equ crlf ;"Home & clear" (best we can do).
1297 eralin: db '^U',cr,lf,'$' ;Clear line.
1298 prpack: db cr,lf,'RPack: $'
1299 pspack: db cr,lf,'SPack: $'
1300 ttab equ 0 ; no VT52 table
1304 defesc EQU '\'-100O ;Still Control-\ (just ran out of room...)
1305 vtval EQU 0 ; we probably don't want VT52 emulation
1307 sysver: db 'HP-125 Series 100$'
1309 outlin: db esc,'H',esc,'J',cr,lf,tab,tab,'$'
1310 erascr: db esc,'H',esc,'J$' ;Clear screen and go home.
1311 eralin: db cr,esc,'K$' ;Clear line.
1312 curldn: db esc,'&a$' ;Cursor leadin
1313 ttab: ;Table start location.
1314 ta: db esc,'A$',0 ;Cursor up.
1315 tb: db esc,'B$',0 ;Cursor down.
1316 tc: db esc,'C$',0 ;Cursor right.
1317 td: db esc,'D$',0 ;Cursor left
1318 te: db esc,'J$',0 ;Clear display
1319 tf: db '$',0,0,0 ;[hh] (can't) enter graphics mode
1320 tg: db '$',0,0,0 ;[hh] (can't) exit graphics mode
1321 th: db esc,'H$',0 ;Cursor home.
1322 ti: db esc,'M$',0 ;Reverse linefeed.
1323 tj: db esc,'J$',0 ;Clear to end of screen.
1324 tk: db esc,'K$',0 ;Clear to end of line.
1327 ; Escape sequences to map CP/M Reader/Punch to Data Comm input/output,
1328 ; respectively and to turn off these mappings
1330 mapon1: db esc,'&i10s18d9M'
1333 db esc,'&i0s25d2M$';Esc. sequences to turn off DAtacomm2/turn
1335 mapon2: db esc,'&i10s16d9M'
1338 db esc,'&i2s25d2M$';Esc. sequences to turn off Datacomm1/turn
1340 mapoff: db esc,'&i0s25d9M'
1343 db esc,'&i10s18d9M$'
1345 readin: call $-$ ;Read character into b
1346 mov a,b ;Get 8-bit character
1349 jbuf: db 7 ;bios dispatch table vector argument block
1350 db 0 ;to read RDR routine address
1356 IF lasm and termin ; if no terminal, no need to link
1358 ENDIF ; lasm and termin
1363 END ; If m80 then this ignored