Keil Logo



Is there a way to put constants in code space using the C251 tools?


Yes. You may receive a syntax error if you try to assign your constant a type, initialize its value, and absolutely locate it. Fortunately, there is a much easier way to do this.

First, move all of the constants that you want relocated into a file of their own.

Next, declare the constants code space with the appropriate types and intialize their values. For example:

int code junk = 0x1234;

Finally, use the SEGMENTS tab in the L251 Linker Options to locate the constants in your new module at the address you want. For example:

In one of the segment fields, enter: ?CO?<module name>(FF8000H) This locates all of the constants in <module name> at address 0xFF8000.

Last Reviewed: Sunday, May 16, 2004

Did this article provide the answer you needed?
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.