Waiting for 3 (or 3.3) microseconds? 286 and up. (Developers)
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 
Complete thread:
- Waiting for 3 (or 3.3) microseconds? 286 and up. - myrkraverk, 09.12.2012, 23:41 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- Waiting for 3 (or 3.3) microseconds? 286 and up. - RayeR, 10.12.2012, 03:09
- Waiting for 3 (or 3.3) microseconds? 286 and up. - Japheth, 10.12.2012, 11:42
- Waiting for 3 (or 3.3) microseconds? 286 and up. - RayeR, 10.12.2012, 18:04
- Waiting for 3 (or 3.3) microseconds? 286 and up. - bretjohn, 10.12.2012, 15:52
- Waiting for 3 (or 3.3) microseconds? 286 and up. - myrkraverk, 10.12.2012, 21:22
- Waiting for 3 (or 3.3) microseconds? 286 and up. - myrkraverk, 10.12.2012, 21:16
- Waiting for 3 (or 3.3) microseconds? 286 and up. - Rugxulo, 10.12.2012, 22:03
- Waiting for 3 (or 3.3) microseconds? 286 and up. - myrkraverk, 13.12.2012, 14:07
- Waiting for 3 (or 3.3) microseconds? 286 and up. - marcov, 13.12.2012, 22:51
- Waiting for 3 (or 3.3) microseconds? 286 and up. - RayeR, 14.12.2012, 01:12
- Waiting for 3 (or 3.3) microseconds? 286 and up. - marcov, 13.12.2012, 22:51
- Waiting for 3 (or 3.3) microseconds? 286 and up. - myrkraverk, 13.12.2012, 14:07
Mix view