|
Re: EDU Mini Controller & 2005 Nav Code
.map will only list variables with a fixed, permanent location. Those that are declared to be static or are declared within a project or header file, but outside any function.
The way rc is declared (within a function and not static -- int rc) means it doesn't persist between calls to that function, so it doesn't have a permanent location or home so to speak.
You'll also notice that rc is actually declared 14 or so times, but these are all really different variables, not the same one. By design the code happens to reuse the name just to make it easier for a reader to trace the data flow.
Not having a fixed "home" none of these variables will be explicitly called out in the link map, instead they are dynamically allocated only when the function is active. When the variable is required. When active it will get placed in whatever free data space is available, but the actual location will vary based on what other functions are also active at that particular time.
A chunk of Data space is reserved by the linker for these transient variables, but that space is shared by the transient variables of every function.
If you really want to see the dynamic location allocated for rc you can add a debug printf within the function to print the address of rc, e.g., printf(" rc address=%dr", &rc);
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Last edited by Mark McLeod : 16-12-2005 at 10:45.
|