Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Andy Neil
02/18/09 10:30
Read: 9313 times
Basingstoke
Uk


 
#162556 - It's IMPOSSIBLE - but here's how...
Responding to: Erik Malund's previous message
Erik Malund said:
you can NEVER predict the duration of a delay in 'C'.

In fact, you can never predict the duration of any piece of high-level language (HLL) source code[1].

You can, of course, examine the generated machine code after compilation - but the effort is (far) more than just writing it in assembler in the first place!

any change (related or not) to your code may change the delay

true

write it in assembler.

exactly!

And here's how: http://www.8052.com/forum/read/149030

See also: http://www.8052.com/forum/read/150987

and: http://www.8052.com/forum/read/98544



[1] Unless you have some explicit, compiler-specific extension; eg, the _nop_() "intrinsic" function in Keil.

List of 5 messages in thread
TopicAuthorDate
Delay loop in C Programming      Harrison Cheung      02/18/09 09:54      
   you can't        Erik Malund      02/18/09 09:59      
      Timer ticks        Per Westermark      02/18/09 10:28      
      It's IMPOSSIBLE - but here's how...      Andy Neil      02/18/09 10:30      
   You do not      Per Westermark      03/24/09 02:35      

Back to Subject List