SLAU132V October 2004 – February 2020
The compiler supports the ability to specify the run-time address of a variable at the source level. This can be accomplished with the LOCATION pragma or the GCC-style location attribute.
The LOCATION pragma has the same effect as using the GCC-style location function attribute. See Section 5.17.2.
The syntax of the pragma in C is:
#pragma LOCATION(x,address) |
intx |
The syntax of the pragmas in C++ is:
#pragma LOCATION(address) |
intx |
The syntax of the pragma for IAR is:
#pragma location=address |
intx |
The syntax of the GCC-style attribute (see Section 5.17.3) is:
intx__attribute__((location(address))) |
The NOINIT pragma may be used in conjunction with the LOCATION pragma to map variables to special memory locations; see Section 5.12.22.