How do I send the commands to lpt in winnt-xp
like _outp,_outd
Printable View
How do I send the commands to lpt in winnt-xp
like _outp,_outd
Do you want to talk to the parallel port or to a printer?
Try opening the file "LPT1:" and writing to it.
As the following codes but that works only with win9x.
# include <dos.h>
main( )
{
int i = 0 ;
unsigned char seg[ ] = {
64 | 1 | 2 | 4 | 16 | 32, /* 0 */
16 | 4, /* 1 */
32 | 16 | 128 | 1 | 2, /* 2 */
32 | 16 | 128 | 4 | 2, /* 3 */
64 | 128 | 16 | 4, /* 4 */
32 | 64 | 128 | 4 | 2, /* 5 */
32 | 64 | 1 | 2 | 4 | 128, /* 6 */
32 | 16 | 4, /* 7 */
32 | 64 | 128 | 4 | 2 | 1 | 16, /* 8 */
32 | 64 | 128 | 16 | 4 | 2 /* 9 */
} ;
while ( ! kbhit( ) )
{
outportb ( 0x378, seg[ i ] ) ;
delay ( 1000 ) ;
i++ ;
if ( i == 10 )
i = 0 ;
}
outportb ( 0x378, 0 ) ;
}