Tool/software: TI C/C++ Compiler
Hi,
I am working on an application on TMS320c6713 dsk board. I have few question:
1) I know that when a function is called, its return address, parameters, and local auto variables are pushed to stack in a frame called stack frame. consider the following function:
void foo () {
int x,y, z,;
}
stack:
| z |
---------
| y |
---------
| x |
---------
Now if x,y, and z is pushed to stack as shown above, how they are randomly accessed even stack follow LIFO mechanism. I mean i can access any variable in random order, but on stack only the variable that is pushed last, should be accessible or on each random use of variable, the stack should pop all the entries until it reaches that variable which i think may not be the case. So again, how variables are randomly accessed after they are pushed to stack???
2) How can i calculate the max stack used in application and at which point??? what are the common methods used in embedded systems for stack calculation?? i think there is an option in CCS but i asking for platform independent methods.