#include <dos.h>

main()
   {
    union REGS inregs;
    union REGS outregs;

    inregs.h.ah = 2;	/* read printer status */
    inregs.x.dx = 0;	/* for lpt 0 */
    int86(0x17,&inregs,&outregs);	/* BIOS call 17 - printer support */
    printf("LPT1/PRN = 0x%x\n",outregs.h.ah);

    inregs.h.ah = 2;	/* read printer status */
    inregs.x.dx = 1;	/* for lpt 0 */
    int86(0x17,&inregs,&outregs);	/* BIOS call 17 - printer support */
    printf("LPT2 = 0x%x\n",outregs.h.ah);

   }