delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/21/06:22:22

Date: Wed, 21 Jul 1999 13:18:16 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Timmy <timethy AT gnt DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: Parallel port HELP!
In-Reply-To: <379576FA.A3747558@gnt.net>
Message-ID: <Pine.SUN.3.91.990721130746.17137A-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019