View Single Post
  #4 (permalink)  
Old 08-09-2007, 03:45 PM
jdev jdev is offline
Member
 
Join Date: Aug 2007
Posts: 2
jdev is on a distinguished road
goldhouse example is a good one. I'll give you a different example.

Volatile comes from the C language (not sure C was the first to use it, though!). If you have a hardware register which represents a temperature value, for example, if you don't tell the compiler that that address is volatile the compiler might use an internal register to store that value, which would be wrong because the value keeps changing (in the external device) while the value in internal register won't change. In this case volatile means "get always the value from this address".
Hope this helps
Reply With Quote