Volatile Objects and Absolute Variables

The Compiler does not do register and constant tracing on volatile or absolute global objects. Accesses to volatile or a bsolute global objects are not eliminated. See the following listing for one reason to use a volatile declaration.

Listing: Using a Volatile Declaration to Avoid an Adverse Side Effect
volatile int x;
void main(void) {

  x = 0;

  ...

  if (x == 0) { // without volatile attribute, the

                // comparison may be optimized away!

    Error();    // Error() is called without compare!

  }

}