The QBNews Page 30 Volume 2, Number 4 December 22, 1991 ---------------------------------------------------------------------- B e g i n n e r ' s C o r n e r ---------------------------------------------------------------------- Using COM 3 and COM 4 with QB by Dick Dennison Quick Basic is limited in its handling of COM ports to COM1 and COM2. This is becomming a recurring problem in these days of installed mouse systems as a mouse installed on COM1 also eliminates COM3 (likewise for COM2/COM4). So what do you do if you have to run your modem on COM4 and want to still use BASIC's OPEN COMx statements ? Simple. Stuff the address for COM4 where COM2 used to be. [Extracted from Pete Petrakis] Published memory maps for PCs consistently claim that BIOS memory addresses 0000:400-407 contain the addresses for serial port adapters 1 through 4 (COM1 to COM4). Thus, if you have four serial ports installed, you should be able to see the following if you type D 0000:400 in DEBUG: 0000:0400 F8 03 F8 02 E8 03 E8 02 . . . You SHOULD be able to see that, but you probably won't! The chances are that you will see no more than F8 03 F8 02, which represent the port addresses for COM1 (3F8) and COM2 (2F8), and that the positions for COM3 and COM4 will contain only zeroes. The problem is that hardware that creates COM3 and COM4 is likely NOT to poke the appropriate addresses for those ports into the BIOS communications data area. [End of Extract] The addresses for the comports are: COM Port Base Port Address COM1 &H3F8 COM2 &H2F8 COM3 &H3E8 COM4 &H2E8 So (simply) what we want to do is: Step 1. Save the current addresses in the BIOS communication (&h400 - &h403) areas for later reset. Step 2. Determine which port you need and stuff (poke) the appropriate address into COM1 (&h400-&h401) or COM2 (&h402-&h403). Step 3. Use Basic's Open comx statements and do your thing. The QBNews Page 31 Volume 2, Number 4 December 22, 1991 Step 4. Reinstall the old addresses. The accompanying source code expects the user to supply the comport number on the command line. [EDITOR'S NOTE] The source code for this article is in the file DIAL.ZIP.