[comp.sys.ibm.pc] Accessing COM2 from assembly language: Help Needed

arena@endor.harvard.edu (Mike Arena) (01/13/87)

I have been trying to write a small terminal emulation program in assembly
language by directly manipulating the serial port registers and taking over
the communications interrupts.
The serial port registers for COM1 are at 3F8-3FE.
I use the OUT command to write directly to the transmit register.
I Take over the interrupt 0C which monitors the Data Available Interrupt
and captures characters asynchronously into a 1K buffer.
I use the BIOS Interrupt 14 to initialize the comm port.

This works great for COM1 even at 9600 baud.

The problem is that I tried to make another version which would run on COM2.
I changed all of the addresses for the serial port to 2F8-2FE (which is COM2)
and still used interrupt 0C to capture incoming data.
I also changed my call to INT 14 so that it initialized COM2 instead of COM1.
So then I had an exact duplicate of the first program except that some addresses
were changed and a few data bytes.
The program could transmit data but not receive.

I poked around in some other tiny comm programs (JaxTalk and TTalk, both just
a few hunderd bytes) which I got off of a bulletin board and they used 
interrupt 0B instead of 0C to capture data for COM2.
So I made the change but still no effect.
In fact JaxTalk and TTalk did not work on COM2!!!!

The computer I was using was a Compaq which might be the source of the problem
but I doubt it since they are so compatible.  I don't have access to a regular
IBM PC with two comm ports so I don't know if it even works on that machine.

If anyone has an idea what the problem is, please post an answer or mail to me
at arena@harvard.harvard.edu.

Michael J. Arena
316 Conant Hall
36 Oxford Street
Harvard University
Cambridge, MA  02138