address The absolute address of the global or static variable for which you want an absolute location.
NAME A user-defined segment name; cannot be a segment name predefined for use by the compiler and linker.
Description
Use this pragma directive to specify the location—the absolute address—of the global or static variable whose declaration follows the pragma directive. The variable must be declared either __no_init or const. Alternatively, the directive can take a string specifying a segment for placing either a variable or a function whose declaration follows the pragma directive.
Example
#pragma location=0x22E
__no_init volatile char PORT1; /* PORT1 is located at address
0x22E */
#pragma location="foo"
char PORT1; /* PORT1 is located in segment foo */
/* A better way is to use a corresponding mechanism */
#define FLASH _Pragma("location=\"FLASH\"")
...
FLASH int i; /* i is placed in the FLASH segment */
See also
For additional information and examples, see the MSP430 IAR C/C++ Compiler Reference Guide.