diff --git a/README.md b/README.md index 5615c59..33a18b7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ # rc2014-tools -Utilities and programs adapted for use on my RC2014 CP/M microcomputer \ No newline at end of file +Utilities and programs adapted for use on my RC2014 CP/M microcomputer + +* [QTerm](qterm/) - a terminal program + diff --git a/qterm/README.md b/qterm/README.md new file mode 100644 index 0000000..2b3a388 --- /dev/null +++ b/qterm/README.md @@ -0,0 +1,65 @@ +# QTERM + +QTERM is a terminal program which provides the following: + +* Capture of text files +* Send text files to remote +* Xmodem / Modem7 / Ymodem protocol transfer +* Kermit protocol transfer +* VT100 emulation +* Split screen mode to separate typed and received text +* Script mechanism for automatic dialing and automation of other operations +* Transfer of text to printer +* Full user area support + +(c) David Goodenough + +It also has a huge advantage (at least for me, Anna) over KERMIT: It does not strip the 8th bit from received characters, so using a VT100 ANSI compatible terminal, you can just log into Telnet BBSes and see the full glory of ANSI/ASCII BBS graphics :) + +## RC2014 patch + +The RC2014 patch is created by Anna Christina Naß. +It is based on the IMSAI8080 patch by Udo Munk, the SIO initialization code by Steve Cousins and the XMODEM patch for RomWBW by Wayne Warthen. + +At the moment, the patches provided here are tested on a RC2014 running RomWBW and using 2x SC104 serial ports (SIO/2). + +If you start from QTERM43F.LBR, the patches are applied using `ZSM` and `ZPATCH`, which are included in `QTERM84F.LBR`. +To assemble the patch, use: + + ZSM QT-RCxx.Z + +This creates QT-RCxx.O, which then has to be applied to the .COM file: + + ZPATCH QTERM43F QT-RCxx + +Now QTERM43F.COM has the patch applied and should be ready to use. + +## Using + +The patches (and the final .COM files provided here) work either with the second serial port on a SIO/2 card (base address 0x82) or on the first serial port on a second SIO/2 card (base address 0x84) - hence the naming of the files. + +So for a RC2014 with one SIO/2 card, `QTERM82.COM` (and the patch file `QT-RC82.Z`) should work. + +The escape key is `^Y`, so to get help, just press `^Y` and `?` in sequence. + +## Details + +When started, the patch initializes the serial port and it should "just work". + +When exiting QTERM, the "uninitialization" routine is running, which calls the RomWBW function for "Reset with current settings". + +I don't know (yet) what will happen on a RC2014 with the default ROM or with SCM. +If you have problems, you can change the patch file: +In the part: + + .org 0x0273 ;exit subroutine + exit: jp uninit + +change the `exit:` line into: + exit: ret + +so the un-initialization routine won't be called. +You can then also remove the `uninit:` routine at the bottom of the code. + +But then, other programs that will use the same serial port (e.g. KERMIT) won't run correctly until you reboot your system. + diff --git a/qterm/qt-rc82.z b/qterm/qt-rc82.z new file mode 100644 index 0000000..33043e2 --- /dev/null +++ b/qterm/qt-rc82.z @@ -0,0 +1,170 @@ +; QT2014.Z - QTerm patch for RC2014 with VT 100 terminal +; +; September 2019, Anna Christina Nass +; based on IMSAI8080 patch: September 2019, Udo Munk +; +.var SIOC 0x82 ;sio control port (2nd port) +.var SIOD 0x83 ;sio data port (2nd port) +.var SDEV 1 ;RomWBW device number +;.var SIOC 0x84 ;sio control port (3rd port) +;.var SIOD 0x85 ;sio data port (3rd port) +;.var SDEV 2 ;RomWBW device number + +.var RXRDY 1 ;receiver ready +.var TXRDY 4 ;transmitter ready + +.org 0x0110 ; modem input status +modist: in a,(SIOC) + and RXRDY + ret + +.org 0x0120 ; modem input +modin: in a,(SIOD) + ret + +.org 0x0130 ; modem output status +modost: in a,(SIOC) + and TXRDY + ret + +.org 0x0140 ; modem output +modout: out (SIOD),a + 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 + +.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 'RC2014 SIO/2 - VT100\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 0b11000011 ;terminal capabilities + +.org 0x0230 +brites: db '\e[2m\0' ;bright + +.org 0x0238 +dims: db '\e[1m\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: ld hl,SIOINI + ld B,9 + ld C,SIOC + otir + ret +SIOINI: db 0b00011000 ; Wr0 Channel reset + db 0b00010100 ; Wr0 Pointer R4 + reset ex st int + db 0b11000100 ; Wr4 /64, async mode, no parity + db 0b00000011 ; Wr0 Pointer R3 + db 0b11000001 ; Wr3 Receive enable, 8 bit + db 0b00000101 ; Wr0 Pointer R5 + db 0b11101010 ; Wr5 Transmit enable, 8 bit, flow ctrl + db 0b00010001 ; Wr0 Pointer R1 + reset ex st int + db 0b00000000 ; Wr1 No Tx interrupts +uninit: ld B,4 ; HBIOS CIOINIT function 0x04 + ld C,SDEV ; device number (0,1,2,3) + ld DE,-1 ; "Reset with current settings" + rst 8 ; do it + ret ; not initialized, so no un-initialize + + \ No newline at end of file diff --git a/qterm/qt-rc84.z b/qterm/qt-rc84.z new file mode 100644 index 0000000..8c2d938 --- /dev/null +++ b/qterm/qt-rc84.z @@ -0,0 +1,170 @@ +; QT2014.Z - QTerm patch for RC2014 with VT 100 terminal +; +; September 2019, Anna Christina Nass +; based on IMSAI8080 patch: September 2019, Udo Munk +; +;.var SIOC 0x82 ;sio control port (2nd port) +;.var SIOD 0x83 ;sio data port (2nd port) +;.var SDEV 1 ;RomWBW device number +.var SIOC 0x84 ;sio control port (3rd port) +.var SIOD 0x85 ;sio data port (3rd port) +.var SDEV 2 ;RomWBW device number + +.var RXRDY 1 ;receiver ready +.var TXRDY 4 ;transmitter ready + +.org 0x0110 ; modem input status +modist: in a,(SIOC) + and RXRDY + ret + +.org 0x0120 ; modem input +modin: in a,(SIOD) + ret + +.org 0x0130 ; modem output status +modost: in a,(SIOC) + and TXRDY + ret + +.org 0x0140 ; modem output +modout: out (SIOD),a + 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 + +.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 'RC2014 SIO/2 - VT100\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 0b11000011 ;terminal capabilities + +.org 0x0230 +brites: db '\e[2m\0' ;bright + +.org 0x0238 +dims: db '\e[1m\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: ld hl,SIOINI + ld B,9 + ld C,SIOC + otir + ret +SIOINI: db 0b00011000 ; Wr0 Channel reset + db 0b00010100 ; Wr0 Pointer R4 + reset ex st int + db 0b11000100 ; Wr4 /64, async mode, no parity + db 0b00000011 ; Wr0 Pointer R3 + db 0b11000001 ; Wr3 Receive enable, 8 bit + db 0b00000101 ; Wr0 Pointer R5 + db 0b11101010 ; Wr5 Transmit enable, 8 bit, flow ctrl + db 0b00010001 ; Wr0 Pointer R1 + reset ex st int + db 0b00000000 ; Wr1 No Tx interrupts +uninit: ld B,4 ; HBIOS CIOINIT function 0x04 + ld C,SDEV ; device number (0,1,2,3) + ld DE,-1 ; "Reset with current settings" + rst 8 ; do it + ret ; not initialized, so no un-initialize + + \ No newline at end of file diff --git a/qterm/qterm43f.lbr b/qterm/qterm43f.lbr new file mode 100644 index 0000000..feab3fe Binary files /dev/null and b/qterm/qterm43f.lbr differ diff --git a/qterm/qterm82.com b/qterm/qterm82.com new file mode 100644 index 0000000..79d7eaf Binary files /dev/null and b/qterm/qterm82.com differ diff --git a/qterm/qterm84.com b/qterm/qterm84.com new file mode 100644 index 0000000..c475f5e Binary files /dev/null and b/qterm/qterm84.com differ