Am 09/24/2021 09:56 PM, Robert Kincaid schrieb:
I've managed to get it working as intended. But if anyone *wants* to add any additional help (possibly for others) feel free.
Implement the I/O Byte!
If you ever want to do serial communication, you will need it.
The READER/PUNCH is mostly unusable without it.
It works in this way:
You switch the input to BAT:
You use CONST for polling the READER
You use CONIN for reading from the READER
You switch the input back to TTY:
This is very fast, just set the relevant bits in the I/O Byte.
Normally you save the existing state at startup and restore on exit.
*Kermit* is one of the best examples.
In its "generic" implementation,
it does *everyhing* only using the I/O Byte!
Want an example implementation?
In my BIOS, I have done it the following way...
1) Addidional jump verctors:
============================
[...]
;*****************************************************
; jump vector for indiviual routines
;
JP BOOT
WBOOTE: JP WBOOT
JP CONST
JP CONIN
JP CONOUT
JP LIST
JP PUNCH
JP READER
JP HOME
JP SELDSK
JP SETTRK
JP SETSEC
JP SETDMA
JP READ
JP WRITE
JP LISTST
JP SECTRAN
;
JP CONOST ; <<< Console output status
JP AUXIST ; <<< Reader input status
JP AUXOST ; <<< Punch output status
;
[...]
2) Implementing the I/O Byte:
=============================
[...]
;*****************************************************
;
VCONST:
DW S1RXSE ; TTY:
DW S1RXSE ; CRT:
DW AUXIST ; BAT:
DW NONST ; UC1:
VCONIN:
DW S1RXIE ; TTY:
DW S1RXIE ; CRT:
DW READER ; BAT:
DW NONIN ; UC1:
VCONOST:
DW S1TXSE ; TTY:
DW S1TXSE ; CRT:
DW LISTST ; BAT:
DW NONST ; UC1:
VCONOUT:
DW S1TXOE ; TTY:
DW S1TXOE ; CRT:
DW LIST ; BAT:
DW NONOUT ; UC1:
;
VAUXIST:
DW S1RXSE ; TTY:
DW S2RXS ; PTR:
DW S2RXS ; UR1:
DW NONST ; UR2:
VREADER:
DW S1RXIE ; TTY:
DW S2RXI ; PTR:
DW S2RXIN ; UR1:
DW NONIN ; UR2:
;
VAUXOST:
DW S1TXSE ; TTY:
DW S2TXST ; PTP:
DW NONST ; UP1:
DW NONST ; UP2:
VPUNCH:
DW S1TXOE ; TTY:
DW S2TXOTE ; PTP:
DW NONOUT ; UP1:
DW NONOUT ; UP2:
;
VLISTST:
DW S1TXSE ; TTY:
DW S1TXSE ; CRT:
DW S2TXST ; LPT:
DW NONST ; UL1:
VLIST:
DW S1TXOE ; TTY:
DW S1TXOE ; CRT:
DW S2TXOTE ; LPT:
DW NONOUT ; UL1:
;
;
CONST:
XOR A
LD HL,VCONST
JR IODISP
CONIN:
XOR A
LD HL,VCONIN
JR IODISP
CONOST:
XOR A
LD HL,VCONOST
JR IODISP
CONOUT:
XOR A
LD HL,VCONOUT
JR IODISP
;
AUXIST:
LD A,1
LD HL,VAUXIST
JR IODISP
READER:
LD A,1
LD HL,VREADER
JR IODISP
;
AUXOST:
LD A,2
LD HL,VAUXOST
JR IODISP
PUNCH:
LD A,2
LD HL,VPUNCH
JR IODISP
;
LISTST:
LD A,3
LD HL,VLISTST
JR IODISP
LIST:
LD A,3
LD HL,VLIST
JR IODISP
;
IODISP: LD B,A
OR A
LD A,(IOBYTE)
JR Z,IODISC
IODISL: RRCA
RRCA
DJNZ IODISL
IODISC: AND 3
RLCA
LD D,B
LD E,A
ADD HL,DE
LD A,(HL)
INC HL
LD H,(HL)
LD L,A
JP (HL)
;
[...]
;*****************************************************
;
NONIN: LD A,1AH
RET
;
NONST: XOR A
NONOUT: RET
[...]
The source speaks for itself :-)
Martin
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)