IBM-PC Parallel Printer Port
Finding out how many ports are present and where

Normally, a PC can have up to 3 parallel printer ports - LPT1, LPT2 & LPT3. Their (16-bit) base addresses in the processor's I/O space are loaded into memory when the machine is booted, starting at address 408 Hex.

A well-written program requiring direct access to any of these ports should endeavour to find out which are present and where at run-time (rather than use constant declarations as in my earlier examples!)

Due to 80x86 processors being " little-endian", the addresses are stored as follows -

40840940a40b40c40d
LPT1LPT2LPT3
low
byte
high
byte
low
byte
high
byte
low
byte
high
byte

For example, the following values -

40840940a40b40c40d
780378020000

mean that LPT1 is at 378 Hex, LPT2 is at 278 Hex, and LPT3 is not present.



[ Previous ] [ Index ]

last updated: 18-Apr-97 Ian Harries <ih@doc.ic.ac.uk>