Hello, I have a variable of type Nat16 (unsigned int) which is called PulseWidth. In the function that fills the variable PulseWidth, there's some assembler code (#pragma asm/endasm included in the .c file), so I have to indicate to the compiler to generate an assembler src file and to assemble this src file too. Because of that, I have to open the corresponding .src file to put breakpoints (apparently, I can't put breakpoints in the 'normal' .c file). When the breakpoint is hit, I would like to see the content of this variable in the watch window #1. However, I only see the value of one byte of this variable iso the whole variable. I have to open the memory window after looking where in the memory this variable is located, and only then I can see the two bytes (so, the 'complete' variable). My question: how to show the complete variable when you have hit a breakpoint in a .src file? Is there something like PulseWidth and PulseWidth+1 to be defined in the watch window? The example I gave just now certainly does not work, because if you put PulseWidth+1, the watch window simply adds 1 to the value of PulseWidth. Is there some other way to represent the second byte (or better, the whole variable at once)? Rgds, --Geert PS.: uVision version 2.33, C-compiler version 7.03.
OVERLAYABLE is far from meaning the same as "local" would in a C program. Variables local to a C function are isolated from the rest of the program in two ways: 1) Lexical scoping. Their name isn't visible to other functions, so the possibility of a name conflict with a same-named object elsewhere is avoided. 2) "automatic" storage duration. Their value is indeterminate upon entering a function. Of these two, OVERLAYABLE only achieves the second, less useful one. It's lexical scoping, i.e. the possibility to stop worrying about variable names chosen by whoever wrote the rest of the program, that makes local variables so useful.
As I said "Have a look at the OVERLAYABLE keyword, it provides the same effect as local variables in C" YES it does, it provided the SAME effect of not clogging up space in RAM. AND you can NOT see its contents when debugging which is what this thread is about, not about semantics about whether the meaning of "same" is global or specific. Erik