Mail Archives: djgpp/2000/10/13/14:32:19
gdemont AT my-deja DOT com writes:
> > By default, this clock's
> > interrupt is disabled, but you can enable it by writing appropriate
> > values into port 70h.
>
> Nice! And is it possible to read the 1024ths of second from port 70h
> without using an interrupt ? In that case it would simplify dramatically
> things. For the moment I program the PIT, take Int 8 and repair the BIOS
> time that would go wrong otherwise by reading the values from port 70h!
> I works, but is not so nice and needs not forgetting to reset the
> normal state a the end - especially when an unhandled Ada exception
> has occured.
> Anyway, thank you very much, I'll see on that side!
If you just need a counter, and not a periodic interrupt, you can use
the CPU's timestamp counter, which increments every clock cycle.
Then, if you know the clock frequency, you can get very
high-resolution real timing. This feature is available on most
Pentium-class and newer CPUs. You can read it with the the RDTSC
instruction.
I have some sample code for this; email me if you're interested.
--
Nate Eldredge
neldredge AT hmc DOT edu
- Raw text -