This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Header File & Simulate

I using a header file to declare all the global variable, such as:

Global.h
#define ctemp0 (*(char *)0x0010)
This work fine in every respect, however, I can't get its value in simulator.
Is anyone know how to correct this.

Thanks
Jack, Taiwan

Parents
  • "I can't get its value in simulator"

    Of course you can't - #define defines a preprocessor symbol - it is expanded by the preprocessor before the compiler ever gets to see the source file.

    Thus the compiler knowns nothing about ctemp0 and, therefore, cannot generate any debug information to tell the debugger about it!

    The debugger can directly view the contents of any memory location anyway.

Reply
  • "I can't get its value in simulator"

    Of course you can't - #define defines a preprocessor symbol - it is expanded by the preprocessor before the compiler ever gets to see the source file.

    Thus the compiler knowns nothing about ctemp0 and, therefore, cannot generate any debug information to tell the debugger about it!

    The debugger can directly view the contents of any memory location anyway.

Children
No data