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++ Language Reference - _bios_printer http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   _bios_printer

   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 <stdio.h>
   #include <bios.h>

   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",status);
        printf("press return to initialize printer\n");
        getchar();
        status = _bios_printer(1,0,data);
        printf("status after printer initialized:%x\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",i,data,status);
   }

   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

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