Codewarrior for DSC - how do I assign a constant to be at a specific address in code ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Codewarrior for DSC - how do I assign a constant to be at a specific address in code ?

1,573 Views
Radar99
Contributor I
How can I assign a constant to be at a specific address in code. I want the const variable "CAL_DATA" to be at the address F000 ? In Codewarrior for Microcontrollers  I used the following:
 
const word CAL_DATA @0xF000 = 0x1234;
 
However, this does not work for Codewarior for DSC compiler.
 
Thanks
 
Labels (1)
Tags (1)
0 Kudos
1 Reply

242 Views
Visitor08
NXP Employee
NXP Employee
Only limited support exists for non-constant data.
 The constant value specified after ":" is the word address of the global variable, i.e. for 
    int OneReg : 0xBCD ;
  the global variable OneReg resides at word address 0xBCD
  NOTE: the linker does not reserve space for global variables declared with ":" operator
0 Kudos