DaveP,
There is no standard as to where variables are placed in memory. That
is a detail left to the compiler implementation. Auto variables are
ON, not above, the stack. The stack can grow up like on the PIC24 or
down, another implementation detail. Static variables are at a fixed
address but could be anywhere. The C30 implementation for the PIC24
generally places static variables, then the heap, then the stack. See
chapter 4 of the C30 manual for more details.
And, as there can be multiple instances of a function “running”, there
can be multiple simultaneous instances of it’s auto variables on the
stack at different addresses. They are addressed by relative
displacements from the stack pointer, W15 on the PIC24, or the frame
pointer if used.
> > - Show quoted text -- Hide quoted text -