Thread: Port Address

    #1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    Philippines
    Posts
    30
    Rep Power
    13

    Port Address


    I was thinking of creating a program in C that can determine port addresses, which will be used in inport() and outport() functions. I need to have the port address of input and output of the printer port. My problem is, I don't have any idea or any reference in doing so. Any help will do.

    __________________
    btw,
    I'll be using the program to simulate Bitwise Operations with the use of LEDs (Light Emmiting Diodes) [outport()]. And evaluate incoming signals from the printer port [inport()].



    Thnx!
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,638
    Rep Power
    4247
    I believe the ports in question are:
    0x378 - 0x37F - Parallel Port 1
    0x278 - 0x27F - Parallel Port 2

    According to my reference book here, after the PS/2, models used:
    0x3BC - 0x3BF - Parallel Port 1
    0x378 - 0x37B - Parallel Port 2
    0x278 - 0x27B - Parallel Port 3

    Here's a reference to the pin-out, if you don't have one already:
    http://nemesis.lonestar.org/referenc...entronics.html

    [edit] Another URL http://www.linuxjournal.com/article.php?sid=4480 [/edit]
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    Philippines
    Posts
    30
    Rep Power
    13
    Thnx for the Info. It's just what I need.

    One thing I may ask?... What book or other URL would you sugges me when it comes to Serial and Parallel Programming in C/C++?
  6. #4
  7. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,638
    Rep Power
    4247
    That is a very good question. Personally, I haven't done any port programming in years, but when I did it, I learned by trial and error really. All I had was a good book that had all the documented (and undocumented) BIOS calls for an IBM PC architecture. The book also had a very good set of diagrams for serial and parallel port. This book was written way back in 1989 or so and I don't remember the name now, but there are several similar books (and now free documents on the web) available now, that contain the information. Maybe you should try google to see if you can find the information. If not, I'll dig into my pile of books and see if I can still find it. :)

IMN logo majestic logo threadwatch logo seochat tools logo