12.9.3 Addressing Information
The upper byte of Flash does not have a unique address, which is a
requirement for C. Therefore, the compiler has to invent one. The tool chain remaps Flash
to linear addresses for all bytes starting with program address word 0. This means that the
real Flash address of a __pack_upper_byte
variable will not be the address
that is stored in a pointer or symbol table. The Flash address can be determined by:
- word offset = address div 3
- program address offset = word offset * 2
- byte offset = address mod 3
The byte to reference is located in Flash at program address offset.
The remapped addressing scheme for __pack_upper_byte
objects prevents the compiler from accepting fixed address requests.