Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Way to detect installed serial ports?

Status
Not open for further replies.

BobTheMad

Programmer
Jun 11, 1999
81
US
What would be the best way to go about detecting the number of serial ports that a PC presently has? I have some older assembly routines that can tell me, but they seem to lock up some of the newer PC's that I have tested it on.

Thanks! Thought for the day: Beware of Gods who cannot laugh...
 
Try this:

Code:
DEF SEG = &H40
PRINT "Address of COM1": PEEK(0) + 256& * PEEK(1)
PRINT "Address of COM2": PEEK(2) + 256& * PEEK(3)
PRINT "Address of COM3": PEEK(4) + 256& * PEEK(5)
PRINT "Address of COM4": PEEK(6) + 256& * PEEK(7)

If the address displayed is 0, the port does not exist, or is not installed for DOS. Antoni
 
That seems to be working. Follow-up question... Is there a FAQ or document that has a list of what all the addresses point to (if I wanted to check parallel ports or anything else for example)

thanks! Thought for the day: Beware of Gods who cannot laugh...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top