Date : Thu, 05 May 1983 10:36:17-PDT (Thu)
From : ihnp4!spanky!burl!duke!mcnc!unc!bch@ucb-vax.arpa
Subject: Re: vt180 & mboot3
I have gotten a version of Modem working on the VT-180 but have used
a slightly different approach than that reported earlier. Rather
than check the status of the port by attacking the magic control block
location in the bios, I installed an interrupt trap between the
RST location and the system interrupt handler. This gives me first
crack at incoming data from the communication line before the vt-180
BIOS can get its hands on it. As it turns out, the device handler
for the communication line likes to ignore certain characters (like
NUL) which can thoroughly upset file transfer. This method gives
me everything and allows me to sense disconnection, parity errors,
overruns and framing errors as well.
As part of INITMOD:
...
LHLD 00011H ;load interrupt handler address
SHLD INTHAND+1 ;store in jump location
LXI H,RXINT ;load trap routine address
DI ;be careful
SHLD 00011h ;save in RST10 JMP address
EI ;let it go
...
Now, in an independent module:
RXINT PUSH A ;save register
IN 059H ;read status port
STA COMSTAT ;save value
ANI 02H ;is this our interrupt?
JZ RXRET ;no
IN 058H ;get incoming character
STA COMBYTE ;save it
RXRET POP A ;restore accumulator
INTHAND JMP $-$ ;exit through system
COMSTAT DB 0 ;result of status port read
COMBYTE DB 0 ;result of data port read
Your recieve data handler can then treat the locations COMSTAT and
COMBYTE as if they were memory mapped IO, though your transmit
data routine must use ported IO.
Clearly, there are a number of more complicated things one can do
with this approach, including building a ring buffer to buffer
incoming data until something as slow as Microsoft Basic can get to
it.
Good Luck,
Byron