Forum Discussion
Altera_Forum
Honored Contributor
16 years agoGet stack top/bottom pointers at run time?
Hi folks- I want to write a stack test function to detemine stack usage during run time testing. For that I need to be able to get stack top and bottom pointers at run time. Can anyone p...
Altera_Forum
Honored Contributor
16 years agoYou could get the current value of 'sp' using an asm() statement.
However it is probably enough to take the address of a local variable (or argument) as this will be an on-stack address in the current stack frame.