ARM Technical Support Knowledge Articles

LOCATING CONSTANTS IN CODE SPACE

Applies to: C251 C Compiler

Answer

QUESTION

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

ANSWER

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.

Article last edited on: 2004-05-16 17:38:54

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