Here is a description of the adresses involved from helppc.
(u might wanna download helppc, it is very usefull on all kinds of
hardware issues:
http://gryphon.ccs.brandeis.edu/public/jon/programming/helppc.zip)
Helppc reports 378 as base adress for the parallel ports:
270-27F Third parallel port (see PARALLEL PORT)
278 data port
279 status port
27A control port
378-37F Second Parallel Printer (see PARALLEL PORT)
First Parallel Printer (see PARALLEL PORT)
378 data port
379 status port
37A control port
3BC-3BF Primary Parallel Printer Adapter (see PARALLEL PORT)
3BC parallel 1, data port
3BD parallel 1, status port
3BE parallel 1, control port
explanation for the ports:
Port 3BC printer data output (readable)
|7|6|5|4|3|2|1|0| ports 278, 378, 3BC
| | | | | | | +---- data bit 0, hardware pin 2
| | | | | | +----- data bit 1, hardware pin 3
| | | | | +------ data bit 2, hardware pin 4
| | | | +------- data bit 3, hardware pin 5
| | | +-------- data bit 4, hardware pin 6
| | +--------- data bit 5, hardware pin 7
| +---------- data bit 6, hardware pin 8
+----------- data bit 7, hardware pin 9
Port 3BD printer status register (Parallel Printer Port)
|7|6|5|4|3|2|1|0| ports 279, 379, 3BD
| | | | | | | +---- 1 = time-out
| | | | | +------- unused
| | | | +-------- 1 = error, pin 15
| | | +--------- 1 = on-line, pin 13
| | +---------- 1 = out of paper, pin 12
| +----------- 0 = Acknowledge, pin 10
+------------ 0 = busy, pin 11
Port 3BE printer control register (Parallel Printer Port)
|7|6|5|4|3|2|1|0| ports 27A, 37A, 3BE
| | | | | | | +---- 1 = output data to printer, (pin 1)
| | | | | | +----- 1 = auto line feed, (pin 14)
| | | | | +------ 0 = initialize printer, (pin 16)
| | | | +------- 1 = printer reads output, (pin 17)
| | | +-------- 0 = IRQ disable,1=IRQ enable for ACK
+------------- unused
In pascal u can set/read these adresses with
Base := $3BC; {or $378 or $278, easy to try}
Port[Base] := random(255); {output a byte on the data lines}
Port[Base+2] := Port[Base+2] Or 4; {set initialize printer high}
or
Byt := Port[Base]; {read data lines}
Chris
Quote
Joe P. Said wrote in message <6241sr$...@mozo.cc.purdue.edu>...
>Can someone tell me how to access the parallel port
>using Borland Pascal 7.0???
>thanks sooooo much
>-joe