cs609 ENJOY

Suggestions & Comments
& Gup Shup

cs609 ENJOY

Postby abdulsaboor » Mon May 10, 2010 7:14 pm

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

union REGS regs;

void main(void)
{

regs.h.ah=2;

regs.x.dx=0;

int86(0x17,&regs,&regs);


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");

}

}
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
User avatar
abdulsaboor
ADMIN
ADMIN
 
Posts: 2004
Joined: Fri Sep 28, 2007 3:42 am
Location: vehari-punjab-pakistan

Return to SUGGESTION & COMMENTS

Who is online

Users browsing this forum: No registered users and 1 guest
cron