9.9.2 __prog__ Type Qualifier

The __prog__ qualifier is similar to the __psv__ qualifier (see 9.9.1 __psv__ Type Qualifier), but indicates to the compiler that the qualified variable or pointer target may straddle PSV pages. As a result, the compiler will generate code so these qualified objects can be read correctly, regardless of which page they are allocated to. This code may be longer than that to access variables or pointer targets which are qualified __psv__. For example:

__prog__ unsigned int __attribute__((space(prog))) myPROGvar = 0x1234;

__prog__ char * myPROGpointer;

The pointer in this example does not use the space attribute as it is located in data memory, but the qualifier indicates how the pointer targets are to be accessed. For more information on the space attribute and how to allocate variables to the Flash memory, see 9.10 Variable Attributes and 11.1 Address Spaces for basic information on the memory layout and how program memory is accessed by the device.