[c]代码库
#include <stdio.h>
#include <conio.h>
#include <bios.h>
int main ( void )
{
#define STATUS 2 /* printer status command */
#define PORTNUM 0 /* port number for LPT1 */
int status, abyte=0;
printf ( "Please turn off your printer. Press any key to continue\n" );
getch();
status = biosprint ( STATUS, abyte, PORTNUM );
if ( status & 0x01 )
printf ( "Device time out.\n" );
if ( status & 0x08 )
printf ( "I/O error.\n" );
if ( status & 0x10 )
printf ( "Selected.\n" );
if ( status & 0x20 )
printf ( "Out of paper.\n" );
if ( status & 0x40 )
printf ( "Acknowledge.\n" );
if ( status & 0x80 )
printf ( "Not busy.\n" );
return 0;
}