Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>_bios_printer</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
_bios_printer
   Note-This function is not available when using OS/2.

Usage

   #include  <bios.h>
   int _bios_printer(unsigned service, unsigned printer, unsigned
   data);

Description

   The function _bios_printer executes a BIOS interrupt 0x17, which is the
   printer interface routine. The service argument determines which of three
   possible operations to perform:


   0                Write the low order byte of data to the printer which was
                    specified in the printer argument.

   1                Intialize the selected printer. The data argument is

                    ignored.

   2                Returns the current printer status. The data argument is
                    ignored.


Example 

   #include <bios.h>
   #include <stdio.h>
   #include <stdlib.h>

   int main()
   {
       unsigned i, data = 36;
       unsigned status;

       printf("place printer offline and press return\n");
       getchar();
       status = _bios_printer(2,0,data);

       printf("status with printer offline: %x\n\n\n",status);
       printf("press return to initialize printer\n");
       getchar();
       status = _bios_printer(1,0,data);
       printf("status after printer initialized:%x\n\n\n",status);
       printf("press return to print\n");
       getchar();
       for (i = 0; i > 10; i++)
           _bios_printer(0,0,data);
       status = _bios_printer(0,0,'\n');
       printf("status after printing %d %c's: %x\n\n\n",i,data,status);
       return EXIT_SUCCESS;
   }

Return Value

   The low byte of the return value, for all three services, contains the
   printer status thus:

       0x01    Printer timed out

       0x02    Not used
       0x04    Not used
       0x08    I/O error
       0x10    Printer selected
       0x20    Out of paper
       0x40    Acknowledge
       0x80    Printer not busy

See Also

   BIOS package, _bios_equiplist



See Also: _bios_equiplist

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson