This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Calculate free remaining stack space

Hi,
I would like to calculate the free remaining stack space during run time.

I tried to access the r13 register with:

LPSTR pcSP;
{
  register volatile int mySP __asm("sp");
  pcSP= (LPSTR)mySP;
}

This compiles, but this does NOT load the contents of r13 into my pcSP pointer variable.

I also tried many other things (e. g. "r13" instead of "sp"), but the compiler will refuse to access "r13".

Anyone how knows, how I can read the contents of the stack pointer register r13?

0