Pype.Clicker wrote:
Code:
33 #define???WAIT???0xFFFFFL
36 static void wait(void)
37 {
38 ???unsigned long wait;
39
40 ???for(wait = WAIT; wait != 0; wait--)
41 ??????/* nothing */;
42 for(wait = WAIT; wait != 0; wait--)
43 ??????/* nothing */;
44 for(wait = WAIT; wait != 0; wait--)
45 ??????/* nothing */;
46 }
does it surprise you it doesn't work properly on real hardware ? i mean, what about some decent delay function for those 15ms etc. delays you're supposed to observe when programming the floppy ?
This'll wait for 3 million cycles, on bochs that'd be around 3 seconds, on a real cpu that could be about a millisecond.
Assuming you compile without optimizations, because GCC will see right through your nothing and optimize away the entire loop. All the way down to around 5 nanoseconds of delay.
And no, 5 nanoseconds for 1980 technology is not long enough.