ABSTRACT

Listing 4.1 is a routine that reads the memory of the PC and finds out the base address of the parallel adapter. The program allows the user to detect whether the PC

or 3. Accordingly, the program reads the BIOS area and determines if the parallel adapter is present. If the parallel adapter is present, the value read is nonzero and is the base address of the adapter. The base address of the adapter is the port address of the DATA port. The STATUS port is at an address location one higher than the DATA port address, and the STATUS port is at an address location two higher than the DATA port address. Listing 4.1 is a stand-alone piece of code that can be executed on a DOS-based PC to detect if a printer adapter is present. In real application circuits, this piece of code is vital for the functioning of the add-on circuits.