13.4 Use of the Printer Adapter for Data Input

If 5 bits are sufficient for input, BIOS call 17h, subfunction 2, can be used to read the printer status lines into bits 3-7 of register AH--see Section 13.2. Note that the signals appearing in bits 7, 6, and 3 will have been complemented either by the printer adapter hardware or BIOS software, bits 2 and 1 will be low, and bit 0 will be set to the timeout flag value.

Either the 5 status lines or the 4 control lines can be read into register AL with machine language instructions--see Table 13-3 and Table 13-4 for the bit assignments and signal complementations. The control lines can safely be used for input since the Control Out Latch outputs are buffered properly. Unconnected lines will float high.

If 8-bit parallel input via the printer DATA lines is desired the adapter hardware must be modified so that the ~OE (OUTPUT ENABLE) input to the Data Out Latch is under program control. Bit 5 of the Control Out Latch can be used for this purpose; in fact, since bit 5 of the control byte is held low by the present version of BIOS this modification would not interfere with normal BIOS use. An improved adapter design would allow bit 5 of the Control Out Latch to be read back via the Control In Buffer.