I using a header file to declare all the global variable, such as:
Global.h #define ctemp0 (*(char *)0x0010)
"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.