ARM Technical Support Knowledge Articles

REENTRANT FUNCTIONS AND THE REENTRANT STACK POINTER

Applies to: C51 C Compiler

Answer


Information in this article applies to:


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 KEILC51LIB 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

Article last edited on: 2005-07-15 10:36:47

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential