(Answer) (Category) ImageCraft Products FAQ-O-Matic : (Category) ICCAVR V6 - and - ICC7 for AVR :
How do I put a constant at a specific address using ICCAVR?
If the address is within the first 64K bytes of the address space, then you can use the "abs_address" pragma, e.g.

#pragma abs_address:0x1000
const unsigned check_sum = 0xFFFF;
#pragma end_abs_address


If the address is beyond the first 64K bytes, then you can put the literals in a different area, e.g.:

#pragma lit:my_lit
const unsigned check_sum = 0xFFFF;
#pragma lit:lit

and then under Project->Options->Target->"Other Options," add -bmy_lit:0x????
[where 0x???? is the starting address.]

Note that the "#pragma lit:..." only works on V6.30D or beyond.


kristil@imagecraft.com

[Append to This Answer]
Previous: (Answer) What do I need to do to get interrupts working?
Next: (Answer) How do I instruct the compiler NOT to initialize some of my char variables at startup?
This document is: http://www.dragonsgate.net/cgi-bin/FAQ/fom?file=138
[Search] [Appearance]
This is a Faq-O-Matic 2.721.
This FAQ administered by Richard Man