Keil Logo

C51: Stack and Reentrant Stack Symbolic Names


Information in this article applies to:

  • C51

QUESTION

I wish to perform some debugging on my project and in order to set watchpoints I need to know the symbolic names given to the system stack and reentrant stack pointers. What are they?

ANSWER

The system stack is actually an SFR with the name SP.

The symbolic name of the reentrant stack depends on which memory model you are using:

  • Small: ?C_IBP
  • Compact: ?C_PBP
  • Large: ?C_XBP

You will be able to set watchpoints on these symbols to watch the system stack and reentrant stack pointers. If your debugging software allows it you may be able to do such things as stop execution when the stack pointer reaches the top of IDATA or the system and reentrant stack pointers point to the same location, thus detecting stack overflows.

MORE INFORMATION

SEE ALSO


Last Reviewed: Thursday, February 25, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.