Programs - LptSwap


Aim

The reason for writing this program was that we own three printers, and one the programs we use, uses the prn: device and therefore only prints to lpt1 by default. What this program does is it allows you to swap the port assignments around without fiddling with the cables. (at last!)

Method

One again, Norton Guides helped in regard with information about the low level programming. In memory somewhere in the abyss below 1kb, there lies data about where lpt1, lpt2 and lpt3 acctually print to. i.e. each port on the computer is assigned a i/o address, this can only be changed by the jumpers on the card, and dos only has three printer ports. Dos uses this conversion table, which we tap into to convert the printer port number into a i/o port number to find out where to send the data. All this program does, is manage this conversion table and tells dos to use a diffrent port for the printer. This is not recomended in windows, however because the printer drivers are already loaded, and therefore remember where they point!

The program presents a simple interface, listing the three printers and to which port they are currentl attached. A simple press of a number pushes the printer to the top, the other two dropping down the list. A restore function is avalible if you can’t remember what the assignments were when you started the program.