1
0
qterm/qt-cpm3.z

155 lines
2.6 KiB
Plaintext
Raw Normal View History

2020-09-08 09:46:40 +02:00
; QT-CPM3.Z - QTerm patch for CP/M 3 AUX: device
;
; August 2020, Anna Christina Nass
;
.var BDOS 5
.var RDY 0xF0
.org 0x0110 ; modem input status
; ZERO flag if no char is available
modist: ld c, 7
call BDOS
and RDY
ret
.org 0x0120 ; modem input
modin: ld c, 3
call BDOS
ret
.org 0x0130 ; modem output status
; ZERO flag if output is busy
modost: ld c, 8
call BDOS
and RDY
ret
.org 0x0140 ; modem output
modout: ld e, a
ld c, 4
call BDOS
ret
.org 0x0150 ; start break
sbreak: ret
.org 0x0160 ; stop break
ebreak: ret
.org 0x0170 ; drop DTR
dtroff: ret
db 0x0c ;length of modem hang up string
db 0xfe,0xfe ;two delays
db 0x2b,0x2b,0x2b ;+++
db 0xfe,0xfe ;two delays
db 'ATH0',0x0d ;ATH0 <return>
.org 0x0180 ; restore DTR
dtron: ret
.org 0x0190 ; set baud rate
setbd: ret
.org 0x01a0 ; baud rate table
baudtb:
db 0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0
.org 0x01b0 ; set communication mode
setmod: ret
.org 0x01c0 ; communication mode table
modetb:
db 0,0,0,0,0,0,0,0
db 0,0,0,0
.org 0x01cc
resrvd: db 0 ; reserved for later use
.org 0x01cd ; protocol transfer size
xfersz: db 8
.org 0x01ce ; processor speed
speed: db 8 ; cpu speed in Mhz;
.org 0x01cf ; escape character
escape: db 0x19 ; 0x19: ^Y
.org 0x01d0 ; signon message
signon: db 'CP/M 3 by @acn128\0'
.org 0x01f0 ; clear screen
clrs: db '\e[2J'
db '\e[1;1H\0'
.var scrout 0x0109 ; print character in C
.var decout 0x010c ; print string of value in HL
.org 0x0200 ; moveto routine
moveto: push HL
ld C,'\e'
call scrout
ld C,'['
call scrout
pop HL
push HL
ld L,H
ld H,00
inc L
call decout
ld C,';'
call scrout
pop HL
ld H,00
inc L
call decout
ld C,'H'
jp scrout
.org 0x022f
tcbits: db 0b00000011 ;terminal capabilities
.org 0x0230
;brites: db '\e[1m\0' ;bright
brites: db '\0' ;bright
.org 0x0238
;dims: db '\e[0m\0' ;dim
dims: db '\0' ;dim
.org 0x0240
dlstr: db '\0' ;delete line
.org 0x0248
ilstr: db '\0' ;insert line
.org 0x0250
dcstr: db '\0' ;Delete character
.org 0x0258
icstr: db '\0' ;Insert character
.org 0x0260
ceol: db '\e[K\0' ;Clear to end of line
.org 0x0268
ceos: db '\e[J\0' ;Clear to end of screen
.org 0x0270 ;entry subroutine
entry: jp init
.org 0x0273 ;exit subroutine
exit: jp uninit
.org 0x0276 ;user subroutine
user: ret
.org 0x0279 ;keyboard map subroutine
kbmap: ret
.org 0x0280 ;user patch area
init: ret
uninit: ret