Mail Archives: djgpp/1999/07/21/06:22:22
On Wed, 21 Jul 1999, Timmy wrote:
> How do I program the parallel port? I need access to every
> IN and OUT line.
AFAIK, this can only be done through I/O ports with inp() and outp()
library functions. The base address of the LPT1 printer is stored at
0040:0008h in the BIOS data area (that's linear address 0x408 in _dos_ds,
in DJGPP parlance). There are 3 registers at that base address, and
you need to use them to control the port, get status and send data.
I suggest to get a good reference about direct programming of PC
peripherals. DJ Delorie's site incldues several good book titles (under
Bookstore).
> Will I have to dive into *interrupts*?
I don't think yo'll need interrupts, but if you need them, the printer
port can be programmed to generate an interrupt when data arrives and is
acknowledged by the destination.
- Raw text -