COM ports address 
Author Message
 COM ports address

hello,
        i would like to know the address of the com ports of my
computer but don't know the method ( i have 4 com ports & like to know
the address of them all).  i try the command VAR??? ( i just forgot the
??? ) and that doesn't work as it doesn't understand the variable com1.
the command is like VAR???(com1).  and it gives me some answer like
15542.  but i read from some other article with the address format like
&H400.  i couldn't figure out if the answer i got is wrong or if i have
to convert to some other format, like hexidecimal.  well, would someone
please give some suggestions?
        thanks.
kin

--

  ru n   a   w    a     y      .      .       . ru n   a   w    a     y

        home:    a city of sadness      telephone:  paris texas       .
  n     office:  faraway  so close      telephone:  moon river        
        Without music life would be a mistake.  -  Nietzsche          .
   a  w   a    y      .       .       .   ru n   a   w    a     y   .



Tue, 02 Dec 1997 03:00:00 GMT  
 COM ports address

Quote:

>hello,
>    i would like to know the address of the com ports of my
>computer but don't know the method ( i have 4 com ports & like to know
>the address of them all).  i try the command VAR??? ( i just forgot the
>??? ) and that doesn't work as it doesn't understand the variable com1.
>the command is like VAR???(com1).  and it gives me some answer like
>15542.  but i read from some other article with the address format like
>&H400.  i couldn't figure out if the answer i got is wrong or if i have
>to convert to some other format, like hexidecimal.  well, would someone
>please give some suggestions?
>    thanks.

First, you have to distinguish between what memory addresses and I/O ports
are.  The functions VARSEG and VARPTR return the memory address of a variable
(VARSEG returns the memory segment, and VARPTR returns the offset into that
segment).  When you type PRINT VARSEG(COM1) you are getting the memory address
of the variable COM1.  COM ports are I/O ports; they are accessed with the INP
and OUT statements.  For instance, to output the letter "A" to I/O port 9, you
would use OUT 9,ASC("A").  

The &H prefix translates a number from hexadecimal to decimal.  &H40 is the
same as 64, because 40 in hex is 64 in decimal.

The usual base I/O ports for COM ports are as follows:

COM1: &H3F8
COM2: &H2F8
COM3: &H3E8
COM4: &H2E8

The actual port designation is stored in the following memory locations (as
2-byte words)

COM1: 0040:0000
COM2: 0040:0002
COM3: 0040:0004
COM4: 0040:0006

Hope this helps...

---
Boyd Ross

FidoNet E-Mail: 1:255/200 (put "Boyd Ross" in "To:" field)

- Don't blame me for my mistakes.  My modem is error-correcting.

- May the farce be with you!

* Install failed. Attempting to transfer virus to c:



Tue, 02 Dec 1997 03:00:00 GMT  
 COM ports address

Quote:

>hello,
>        i would like to know the address of the com ports of my
>computer but don't know the method ( i have 4 com ports & like to know
>the address of them all).  

If you have MS-DOS 6.2, then simply type MSD from the C:\ prompt and  
the Microsoft Diagnostics program will tell you the address of your
COM and LPT ports.

Terry in Pflugerville



Tue, 02 Dec 1997 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Com Port address

2. Finding COM Ports - Mouse dies when VB talks to its COM Port

3. Reading address(Bios) of a COM-Port

4. Addressing COM port ?

5. Addressing COM port ?

6. How does one write to a hardware address (not a com port)

7. VB4.0 sending commands to rs232 (com port) and printer port

8. How determine client IP address, port, and computer name

9. How to address and write and read each parallel port pin

10. Addressing Parallel Port Bit by Bit!?

11. Printer Port addresses

12. Addressing Serial Ports through Quick Basic?

 

 
Powered by phpBB® Forum Software