Mail Archives: djgpp/1997/07/04/14:22:26
>I'd like to use djgpp to write data to the parallel port. I know that
>djgpp 2.0 has
>its own versions of outpw , etc. and I found the instructions on how to
>use those
>commands, but I don't know what address the parallel port is or whether
>there is
>another set of commands that should be used to write output to the PC
>parallel
>port. Any information (or pointers to where the info would be located)
>would be
>greatly appreciated.
>
outpw, etc is probably the way to go. Here is some info on the parallel port
interface. This is from Ralf Brown's Interrupt List Release 53, which I
recommend for anyone doing low level programming. See info/inter*.zip on
Simtelnet.
PORT 03BC-03BF - PARALLEL PRINTER PORT (MDA's LPT1)
Range: PORT 0278h, PORT 0378h, or PORT 03BCh
03BC -W data port
03BC R- bidirectional port: input from connector
unidirectional port: last value written to port
03BD RW status port (see #P150)
03BE RW control port (see #P151)
Bitfields for parallel interface status port:
Bit(s) Description (Table P150)
7 busy
6 NOT acknowledge (approx. 5us low pulse)
5 out of paper
4 printer is selected
3 *no* error
2 IRQ has *not* occurred
(PS/2) printer returned -ACK
1-0 reserved
SeeAlso: #P151
Bitfields for parallel interface control port:
Bit(s) Description (Table P151)
7-5 reserved
7 (see PORT 037Bh bit 7)
5 enable bidirectional port
(PS/2 also requires enabling via PORT 0102h)
4 enable IRQ (via -ACK)
3 select printer (SLCT IN line)
2 =0 initialize printer (-RESET line)
1 automatic line feed
0 strobe (must be set for minimum of 5 microseconds)
You will have to figure out just which parallel port you want. Also drawn
from the Interrupt List is the fact that the the port addresses of the
first, second and third parallel ports (usually LPT1, LPT2 and LPT3) can be
found at real-mode addresses
0x0040:0x0008
0x0040:0x000A
0x0040:0x000C
respectively.
HTH
Nate Eldredge
eldredge AT ap DOT net
- Raw text -