|ARM Technical Support Knowledge Articles|
Applies to: C51 C Compiler
Information in this article applies to:
In the SMALL memory model (all RAM internal, all code in 8K), do reentrant functions use the push and pop instructions to put variables on the stack or do they overlay variables?
The reentrant stack is simulated using R0 and R1. Variables are "pushed" and "popped" using the MOV @R0/R1 instructions. The hardware stack is not used for these variables.
When you use the reentrant stack in internal memory, the hardware stack (accessed with SP) starts at the bottom of memory and grows up. The simulated reentrant stack starts at the top of memory (255) and grows down.
You may use a debugger watch and test for the collision of these two stacks.
Article last edited on: 2004-06-15 13:52:51
Did you find this article helpful? Yes No
How can we improve this article?