|ARM Technical Support Knowledge Articles|
Applies to: C251 C Compiler
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.
Article last edited on: 2004-05-16 17:38:54
Did you find this article helpful? Yes No
How can we improve this article?