biosprint
Printer I/O using BIOS services directly.
Defined in header <bios.h>
Syntax
#include <bios.h>
int biosprint(int cmd, int abyte, int port);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ |
Remarks
biosprint performs various printer functions on the printer identified by the parameter port using BIOS interrupt 0x17.
A port value of 0 corresponds to LPTl; a port value of 1 corresponds to LPT2; and so on.
The value of cmd can be one of the following:
0 Prints the character in abyte. 1 Initializes the printer port. 2 Reads the printer status.
The value of abyte can be 0 to 255.
Return value
The value returned from any of these operations is the current printer status, which is obtained by ORing these bit values together:
Bit 0 0x01 Device time out Bit 3 0x08 I/O error Bit 4 0x10 Selected Bit 5 0x20 Out of paper Bit 6 0x40 Acknowledge Bit, 7 0x80 Not busy
Example
#include <stdio.h>
#include <conio.h>
#include <bios.h>
int main(void)
{
#define STATUS 2 /* printer status command */
#define PORTNUM 0 /* port number for LPTl V
int status, abYte=0;
printf("Please turn off your printer. Press any key to continue\n"
getchO;
status = biosprint (STATUS, abyte, PORTNUM);
if (status & 0x01)
printf("Device time out.\n");
if (status & 0x08)
printf("I/0 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;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/bios.h/biosprint/
· short form /3.1/biosprint/