|
|||||||||||
Technical Support Support Resources
Product Information |
C51: Locating Variables to Far Const SpaceInformation in this article applies to:
QUESTIONI need to write portable code for my programs, and I am using a header file that defines the memory types for the program in a generic way. For example, to put a constant into ROM I have used the syntax:
With #define _code_ code the resulting syntax is:
Everything works fine this way, but now I want to put the constants into the far const space. However, the definition #define _code_ const far results in syntax errors. What can I do? Note that I do not want to use the following syntax, since I need to have portable code that works on several platforms:
ANSWERThe correct syntax is #define _code_ far const which results in:
This compiles fine with the CX51 Compiler or with the C51 Compiler when you use the OMF2 Directive. MORE INFORMATION
SEE ALSO
Last Reviewed: Thursday, February 25, 2021 | ||||||||||
|
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.