Program for 1-40 counting with the delay of 1 second
Asked By
30 points
N/A
Posted on - 07/30/2011
Write the C program that should print 1-40 counting with the delay of 1second by using the timer count value from the BIOS data area.
Write the C program that should print 1-40 counting with the delay of 1second by using the timer count value from the BIOS data area.
I wrote the following piece of code for you; please check it:
#include<stdio.h>
#include<conio.h>
unsigned long int far *time = (unsigned long int far*) 0x0040006C;
void main()
{
unsigned long int tx,count=0;
tx = (*time);
while( count<=40)
{
while((*time) <= tx);
clrscr();
printf("%d Secdonds ",count);
tx+=18;
count++;
}
//getch();
}