Waiting for 3 (or 3.3) microseconds? 286 and up. (Developers)
Hi all,
Context.  I've been playing with Sound Blaster coding, so far in DOSBox.  The initialization routine is supposed to wait for 3 or 3.3 microseconds between the first two writes for the actual hardware.  The docs I've found don't seem to agree on which.  And at this point, it probably doesn't matter.
What is a good way to guarantee a wait for a few microseconds?  Can I use the same code on a 286 while still guaranteeing long enough delay on a 64bit cpu who happens to be talking to a real sound blaster in an ISA slot?  Those motherboards exists [even though I don't have one, nor a real sound blaster].
So far, I've just used interrupt 0x15 with ah=0x86 for a 1000 microsecond delay; which is long enough though quite excessive.
I believe I'm looking at the official documents, where they use a delay loop of "dec al; jnz delay" where al has been initialized to 0.  Hence looping 255 times.  I'm not sure that method is "future proof" or even sufficient with a modern CPU.
Also related.  The Sound Blaster is said to take 100 microseconds to initialize itself.  What steps can I take to wait just that long until there is 0xaa from the status port of the card?  Again, those steps should ideally work on both real 286 and a modern CPU.
Complete thread:
- Waiting for 3 (or 3.3) microseconds?  286 and up. - myrkraverk, 09.12.2012, 23:41 ![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
 
 Board view
Board view Mix view
Mix view