We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Does anyone knows a methode, to declare a const struct in code-space at a specific CODE address in C51? Background: I use a philips 87LPC767-MC and i want to store some code-revision-info in the 32Byte customer code space. I will define a C-Structure like typedef struct { unsigned char uc_software_code; unsigned char uc_main_version; unsigned char uc_sub_version; unsigned long ul_checksum; } CodeRefInfo_ts; CodeRefInfo_ts tsCodeRefInfo= { 0x04, 0x01, 0x01, 0x012345678 } at 0xFC0E; But it seems it is not possible to use the at-Keyword to locate a struct in the codespace?! Any suggestion? Thanks Markus
That's right, the _at_ directive cannot take initialized variables. E.g. you can place an object somewhere using the compiler (a weird concept since the linker is usually told to do such things) but you cannot assign the object an initial value. As previously noted, assembler is the way to do this. - Mark