#include<stdio.h>
#include<bios.h>
union REGS regs;
void main(void)
{
regs.h.ah=2;
regs.x.dx=0;
int86(0x17,®s,®s);
if ((regs.h.ah & 0x01)==0x01)
{
//if bit # 0 of status byte is set, it means there is a time out error
printf("\n Printer Time out");
}
else
if ((regs.h.ah & 0x08)==0x08)
{
//if bit # 3 of status byte is set, it means there is some data transfer error
printf("\n Data transfer error");
}
else
if ((regs.h.ah & 0x10)==0)
{
//if bit # 4 of status byte is cleared, it means printer is offline
printf("\n Printer is offline");
}
else
if ((regs.h.ah & 0x20)==0x20)
{
//if bit # 5 of status byte is set, it means printer is out of paper
printf("\n Printer is out of paper");
}
else
if ((regs.h.ah & 0x80)==0)
{
//if bit # 7 of status byte is cleared, it means printer is busy
printf("\n Printer is busy");
}
else
{
printf("\n Ready to print");
}
}
cs609 ENJOY
- abdulsaboor
- ADMIN
- Posts: 2004
- Joined: Fri Sep 28, 2007 3:42 am
- Location: vehari-punjab-pakistan
- Contact:
cs609 ENJOY
DR ABDUL SABOOR
PHD Scholar at Superior University Lahore- Pakistan
MS Business Administration (HRM)
BS Business Administration (Marketing)
Member Editorial Board Science Publishing Group USA
Member Editorial Board International Journal of Marketing Studies
Cell=0308-6837987
Pakistan
PHD Scholar at Superior University Lahore- Pakistan
MS Business Administration (HRM)
BS Business Administration (Marketing)
Member Editorial Board Science Publishing Group USA
Member Editorial Board International Journal of Marketing Studies
Cell=0308-6837987
Pakistan