Hello Peter,
You can allocate a constant variable at an absolute address using the @ modifier.
For example allocating a constant called VersionNbr at address 0xF000 and initializing it to 2 is done as follows:
const int VersionNbr @0xF000 = 2;
Same notation can be used for a constant string as follows
const char VersionStr[] @0xF000 ="Version 5.1";
if no @0xF000 keyword. CW will allocation a ROM address to const variable automatically.
As this version number is not used anywhere in the application, you have to instruct the Linker to link it to the application even though it is not used.
This is done specifying the constant name in the .prm file ENTRIES block.
For example:
ENTRIES
VersionNbr VersionStr
END
Last, please enable –Cc option in Compiler option setting panel.
===========================================
this answer is for you. if it helps, please click on "correct answer" button. thanks!
Best Regards.
Zhang Jun