• Please review our updated Terms and Rules here

PS/2 Com Ports vs. BASIC

MykeLawson

Experienced Member
Joined
Mar 21, 2014
Messages
396
I'm really not 100% sure where to even post this, but this looks to be as good as any. In my digging through the BASICA, QuickBASIC, GW-BASIC, etc. books, I never seem to be able to find any reference to a Com port other than 1 or 2; as in, OPEN "COM3:9600,N,8,1,RS,CS,DS,CD" AS #3. I know you can have hardware to address ports 3 and up, but is there some limit in those flavors of BASIC that only allowed for 2 Com ports? Either that, or I am overlooking something really 'basic' in BASIC......
 
Well, darn.... Looks like I will have to shift gears a bit now. I'd love to know what the logic was for limiting it to just two ports. I was hoping to have three serial devices hooked to my PS/2 8560 and write what I needed in GW-BASIC..... And given it is only an 80286..... The one on the motherboard can only be Serial 1 or 2, but my Dual Async card can be 1 thru 8 (I think). Guess I will disable the one on the motherboard and have the two on the Dual Async card be Serial 1 and 2...... Oh well, live and learn..... Well, I'll keep the link to that GitHub post in case I get enough projects finished to where I can utilize that. I did a brief look and I guess I need to figure out what is in the documentation so I know how to use it. Thanks.
 
You could check the PDQ source code and see if there is an easy way to use the extra PS/2 port addresses. What I remember was that getting 3 or more serial ports working at the same time was very tricky. The drivers that supported it were usually expensive.
 
From [here], a typical 4-port configuration is:

COM1 = I/O port 3F8h, Interrupt 4 (IRQ 4)
COM2 = I/O port 2F8h, Interrupt 3 (IRQ 3)
COM3 = I/O port 3E8h, Interrupt 4 (IRQ 4)
COM4 = I/O port 2E8h, Interrupt 3 (IRQ 3)

COM1 and COM3 use the same hardware interrupt.
COM2 and COM4 use the same hardware interrupt.

If (repeat: if) that is the hardware configuration is use, then things can get tricky if hardware interrupt usage is wanted/needed.

Example:

If you are using both COM1 and COM3, and your implementation is that both COM1 and COM3 are configured to generate interrupts, then the interrupt handler code for interrupt 4 needs to cater for the fact that an interrupt 4 could have been triggered by the UART in either COM1 or COM3.

Imagine a multi-session terminal program, with one session using COM1, one session using COM2, and one session using COM3.
 
Granted, I have not done much digging in the IBM Dual Async Tech Manual, given the port addresses, it does not look like I could use the INP and OUT BASIC commands to interact with the hardware to manually configure them...... Hmm, looks like a bit more thinking is in order....
 
Back
Top