In the codevision compiler for Atmel processors, there is a possibility to specify the storage address of a global variable, for example
int a @0x100; // will place the variable at the address 0x100 in RAM
Of course, as per standard C, variables can be initialized upon declaration
int a=42;
However, I did not find any possibility to do them both. int a @0x100 = 42 or int a = 42 @0x100; don't work, they cause compiler errors.
You might ask why it is so important to do it, because one could simply have
int a @0x100;
int main()
{
a = 42;
//...
}
However, if I have variables in the EEPROM, I need to initialize them, because this is the only way to automatically generate the eeprom file with the values in it. I can't assign those values later, because in that case it would actually write the values into the eeprom at each start of the program.