[comp.sys.ibm.pc] BIOS printer error handling

twb@cbnewsh.att.com (thomas.w.beattie) (01/26/91)

Posting for a co-worker, please reply to her directly at:
gris@hoqaa.att.com  or  att!hoqaa!gris.
---
Tom Beattie
att!hoqaa!twb
t.w.beattie@att.com
----------------------------------------------------------------------

I am having problems with the error codes returned by BIOS interrupt  0x17,
the parallel printer services. My code is actually in Microsoft C version 6:

   status = _bios_printer( _PRINTER_STATUS, port_num, 0 );
   if ( status & 0x29 != 0 )
      return( FAILURE );
   status = _bios_printer( _PRINTER_WRITE, port_num, byte_out );
   if ( status & 0x29 ) 
        return( FAILURE );
(The _bios_printer function uses Int 0x17 and returns the results from the 
AX register. The result 0x29 means that bits 0, 3, and 5 were set:
timeout, I/O error, and out-of-paper, respectively.)

The problem is that certain printer/PC combinations return the error status,
although there is no error (ie, printer on, paper loaded, etc).
Some other printer/PC combinations return no error when no paper is loaded.
Most printer/PC combinations always work as expected, so I think that
I am using the function correctly. The problems occur when printing graphics,
but not when printing text characters.

Does anyone know why this problem occurs, how to predict when it will arise,
and how to deal with it?