"Interfacing the IBM PC parallel printer port" - читать интересную книгу автора (Stewart Z.)

| | | |____________________ 1 = "Selected" (C4+; +SelectIn pin high)
| | |________________________ 1 = "Paper Out" (C5+; +PaperEnd pin high)
| |____________________________ 1 = "Acknowledge" (inv C6+; -Ack pin low)
|________________________________ 1 = "Not Busy" (C7-; +Busy pin low)

The high 5 bits of this are essentially the Status In register from the
printer port, with bits 6 and 3 inverted (ie: XORed with 0x48). The low
bit is generated by BIOS software after a timeout. In the original PC,
timeout delays were generated by delay loops.

10. IRQ's

The primary IBM Printer Adapter (base 0x378) and the IBM Monochrome Display
and Printer Adapter (base 0x3BC) are allocated hardware interrupt 7 (IRQ 7),
which is wired to INT 0x0F. If bit C4 of the Control Out register is high,
then input line "-ACK" (DB 25 pin 10, Status Register bit S6) will be wired
to the IRQ 7 bus line. A rising edge (low to high) on -Acknowledge will be
cause a rising edge on IRQ 7, which will trigger an interrupt if that IRQ is
enabled in the 8259 interrupt controller chip. (Note: the MCA bus is level
sensitive rather than edge triggered). Both cards use the same interrupt,
and the ISA bus does not share interrupts correctly, so no more than one
of these ports should be enabled at the same time (or the 74LS125 chips
driving the PC bus will fight).

Secondary Printer Adapters (base 0x278) are supposed to use IRQ 5 (INT 0x0D)
for their interrupt; note that on the PC (pre-AT) this would have conflicted
with the floppy disk controller. This IRQ is even more commonly "stolen"
for other usage: EGA, soundcards, network cards, etc.

The idea was apparently to use this IRQ as part of the printer driver, much
as the serial port IRQs can be used as part of comm drivers. Unfortunately,
typical timing on printers did not allow this, so most (nearly all) DOS
software does not use the printer port IRQ for driving printers. It's often
considered "up for grabs" and some soundcards like to use IRQ 7. Some other
operating systems may use it for the printer port, as may some parallel port
transfer programs.

11. Bidirectional Ports

The IBM PS/2 series added one feature to the parallel ports: bidirectional
support. This was done by using one more bit in the Control Out register
to control tristating of the Data Out port. When bit C5 is 0, the Data
Out port operates as it did for earlier parallel ports (driver enabled);
when C5 is set to 1, though, the Data Out port is tristated, which means
that it is essentially electically disconnected from the pins (high
impedance state), not driving them high nor low. This allows the data
feedback register to correctly read any externally applied TTL signals
on the corresponding data pins, effectively making this an input port.

Interestingly, the original IBM Printer Adapter, and many early clones,