Assignments Past Papers Ebooks Old Virtualians Login RSS Facebook

All times are UTC + 5 hours

Post new topic Reply to topic  [ 1 post ] 
On: Mon May 10, 2010 7:14 pm
cs609 ENJOY
#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
MS Business administration(HRM)

BS/BA Marketing
CELL 0334-7165488
+92-334-7165488
 Profile  
 
User avatar
abdulsaboor
  • Rank: ADMIN
  • ADMIN
  • Joined on: Fri Sep 28, 2007 3:42 am
  • From: vehari-punjab-pakistan
  • Total Posts: 1826
  • Thanked Others:
  • Thanks Received:
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 5 hours

Are You A VU Student?


Worried of your Project/ Course Work/ Internship Report


Relax! We will do it for you as we have Already Done for a number of your fellow students. Just give us a try, you will not be dissappointed.

Our Recent Work

  • Mobile FTP Client
  • Offline Website Downloader

  • Call Us Now: 0334-7165488