Keil Logo

L251: MOVING THE STACK


Information in this article applies to:

  • C251 Version 2.14

QUESTION

I wish to locate the stack at 2000H. How do I do it?

ANSWER

You need to use the linker SEGMENTS directive as follows:

SEGMENTS(?STACK(2000H))

Note that the stack resides in the EDATA memory class; you must make sure that the address where you locate the stack is in EDATA. If not, then you may use the linker CLASSES directive to specify ranges of addresses to be in the EDATA class. For example:

CLASSES(EDATA(2000H - 21FFH))

Note that it is a bad idea to locate the stack in the middle of data segments. If the stack overflows or underflows, there is a higher chance of data being corrupted.

MORE INFORMATION

  • Refer to SEGMENTS in the LX51 User's Guide.
  • Refer to CLASSES in the LX51 User's Guide.

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.