Keil Logo

C51: REENTRANT FUNCTIONS AND THE REENTRANT STACK POINTER


Information in this article applies to:

  • C51 Version 5.50

QUESTION

I am using reentrant functions, but I have noticed that the startup.a51 file mentions reentrant stack pointers for each of the memory models (small, compact and large). What are these and do I need to modify startup.a51 to use reentrant functions?

ANSWER

If you are using reentrant functions, then you must have a reentrant stack configured and the pointer initialized. The stack allows the functions to be called many times or recursively.

In order to set up the reentrant stack, you must perform the following steps:

  1. Copy the STARTUP.A51 file from the \KEIL\C51\LIB folder into your project directory.
  2. Open STARTUP.A51.
  3. Refer to Startup Code in the C51/CX51 User's Guide.
  4. Save the modified startup.a51 file and include it in your project.

MORE INFORMATION

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Friday, July 15, 2005


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.