Keil™, An ARM® Company

Technical Support

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