[fpc-pascal]dos approx delay fn that releases cpu

Thomas Schatzl tom_at_work at yline.com
Sun May 6 14:16:55 CEST 2001


Hello,

> > Btw, isn't the accuracy of the delay quite bad when using the timer IR?
> > Because It only changes ~18.2 times per second giving a resolution of
~54
> > ms. The variance of the result is also quite high; +- a full timer tick
>
>The interrupt comes quite rare, that's true, but the timer counters count
>quite fast. You can measure in the range of microseconds if you read the
>counter value as well. There is no need to reprogram the timer to do that.

Actually this was just meant as a side note and was not really the key point
imho. Never talked about reprogramming the timer; this isn't possible under
the NT-VM anyway afaik under normal circumstances (e.g. ring 3).
I'm sorry if I couldn't clearly point out what my main concern was:

The hlt instruction not being available with NT and int 28 (dos idle IR
call) not having the desired effect too (or at least I'm not using it
correctly).
Example programs which demonstrate int 28h install their own int28 IR
handler which issues a hlt instruction. This is not possible as I told you
before, and the default handler is a 'nop'.
Another IR call (Release current VM time slice, int 2Fh / 2680h) which
probably would fit too doesn't work either with W2k. (It seems to be just
another wonderful idea which never managed to become reality since it's a
DPMI 1.0 call).

Or is there any other IR / system / whatever call I don't know of ?
Additionally I'm interested if my small program I posted yesterday has the
desired effect under W9x systems (plain curiousity). Because if it does
there it might be an argument to implement it regardless of it not working
with NT. Then at least W9x could systems profit from this enhancement, can't
they ?

Regards,
    Thomas





More information about the fpc-pascal mailing list