No, actually it probably means you're a EE.Originally Posted by Kennedy
No, actually it probably means you're a EE.Originally Posted by Kennedy
Hehe...pm OS , Protected Mode Operating System (the ones using CPU in protected mode). I think this is more clear
Ok, thanks for the clarification fnoyan. I tried google for pm OS, and didn't have much luck. And from what you're saying, accesssing the BIOS may be a problem, starting with windows NT and up.Originally Posted by fnoyan
I would think if the OP has the C stadard library, he could simply use that. As Quzah hinted, the question is vague.
The program run on 386 40Mhz (embedded tiny board), test on PC DOS 7.01 with Turbo c++ 3.0 compiler.Originally Posted by Salem
Here is one of the code i have test...
While i using this code, it really give me what i want. But when the program run in looping for a while(about 10 min), the date will increased by one day and the increment keep going onCode:#include <stdio.h> #include <dos.h> main() { clrscr(); while(!kbhit()) { unsigned char day,month; unsigned int year; union REGS regin,regout; regin.h.ah=0x2A; intdos(®in,®out); day=regout.h.dl; month=regout.h.dh; year=regout.x.cx; printf("The date %d-%d-%d\r",day,month,year); } return 0; }
...who doesn't know how to count to 24.Originally Posted by swoopy
"The Internet treats censorship as damage and routes around it." - John Gilmore
> the date will increased by one day and the increment keep going on
If you quit the program and restart it, is the date back to normal (for a while), or is it permanently wrong?
I can't think of anything off-hand to explain it.
If you're doing serious DOS low-level work, you definitely need this
http://www.cs.cmu.edu/afs/cs.cmu.edu...WWW/files.html
or a handy online version
http://www.ctyme.com/rbrown.htm
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Hi bro, if i quit the program and restart it, the date still got error(date increment) unless i restart the OS (DOS) and the date back to normal.Originally Posted by Salem
I have to put the code in looping because i need to do some data logging which included the date.
i'm setup the timer interrupt follows the guide from
http://www.inversereality.org/files/timerinterrupt.pdf and
http://www.beyondlogic.org/interrupts/interupt.htm
The interrupt working well as i expected. But in order to retrive the date without using system timer, some effort need to be put in...