pc386 LPT question

Camilo Alejandro Arboleda camilo.arboleda at spymac.com
Thu Dec 1 20:03:40 UTC 2005


Data register: BASE_ADDRESS + 0x00
Status register: BASE_ADDRESS + 0x01
Control register: BASE_ADDRESS + 0x02

LPT1 is usualy at BASE_ADDRESS 0x378, so you could use:

char status;
inport_byte(0x379, status);


Status register bits:
7 *BUSY
6 *ACK
5 NO_MORE_PAPER / *PAPER
4 ONLINE/*OFFLINE
3 *ERROR

Control register bits:
4 IRQ_ENABLED
3 PRINTER_SELECTED
2 *INITIALIZATION
1 AUTOMATIC_LINE_FEED
0 STROBE




Joel Sherrill <joel at OARcorp.com> wrote:

>
> Hi,
>
> I finally have the old software for our scout's pinewood derby
> timer and it is a DOS program using a BIOS call to read the printer
> status.
>
> The macro to read the status of the starting gate and finish
> looks like this:
>
> #define         START_GATE              (0x80)
> #define         ALL_LANES               (0x70)
> #define         LANE_2                  (0x40)
> #define         LANE_1                  (0x20)
> #define         LANE_3                  (0x10)
>
> /* bit #3 in the printer status regiser is connected to the start gate */
> #define GATE_POSITION \
>     (_bios_printer(_PRINTER_STATUS,0,uiDummy) & START_GATE)
>
> /* define macro to test if a car has crossed the finish line */
> #define FINISH_STATUS \
>    (_bios_printer(_PRINTER_STATUS,0,uiDummy) & ALL_LANES)
>
> Does anyone know how to get the same information with or without a 
> BIOS call using the pc386 BSP?
>
>
> Please... Thanks. :)
>




More information about the users mailing list