Dear eqqman,
The example given by Chris is correct. value is an lvalue.
Another alternative that is codewarrior specific is to use the '@' notation as shown in the examples below:
int example1@0x1000; // Codewarrior specific method
#define EXAMPLE2 (*(volatile unsigned int *) 0x1000) // Standard C
int main(void)
{
example1 = 0x12345678;
EXAMPLE2 = 0x12345678;
}
Both assignments produce similar code. The second is more portable but since accesssing a specific location is almost certainly target specific I can't really see much argument about this being an advantage.
The advantage of the 1st is that example1 will appear as a variable in the debugger - EXAMPLE2 is invisible since while an lvalue it's not actually a named variable, just pointer magic.
bye
Message Edited by pgo on 2009-04-19 12:58 PM