Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Waiting for 3 (or 3.3) microseconds? 286 and up. (Developers)

posted by myrkraverk, 10.12.2012, 21:16

Here is an email I received with CC Rugxulo.

> You ask on BTTR how to wait for a tiny amount of time:
> Doing a loop is a bad idea as modern CPU get faster and
> faster, so your delay gets too short or you have to use
> at least 32 bit counting and have to determine a "good"
> number of repetitions somehow, eg. by counting how many
> repetitions you can do in 1 second. Which is a classic
> reason for old software to overflow on new CPU, because
> you may need even 64 bit for that.
>
> I believe a classic method would be to do something as
> "in al,0x80" (Rugxulo? What is a good port for this?)
> based on the assumption that I/O for ISA-ish ports is
> taking a relatively constant amount of time even when
> the CPU is fast. You then do that as part of you loop
> and voila 255 repetitions are more than enough again.
>
> Also there are indeed int 15 delay functions, but I am
> not sure how well they work for tiny delays. I believe
> they use the 18.2 Hz timer for long delays? And may use
> the 1.19 MHz clock driving that for shorter delays in a
> polling loop style? Or maybe they use the RTC 32768 Hz
> clock for those? Or some sort of calibrated-number-of-
> repetitions style looping, with or without port read as
> delay activity? Again maybe Rugxulo knows a bit more :-)
>
> Regards, Eric
>
> PS: AMD now has a CPU with 8 cores a 4 GHz which claims
> to need only 125 Watt style cooling. Can loop a lot :-D

 

Complete thread:

Back to the forum
Board view  Mix view
22762 Postings in 2122 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum