User`s manual

220 digi.com Keywords
xmem
Indicates that a function is to be placed in extended memory. This keyword is semantically meaningful in
function prototypes. Good programing style dictates its use be consistent between the prototype and the
function definition. That is, if a function is defined as:
xmem int func(){}
the function prototype should be:
xmem int func();
Any of the following will put the function in xmem:
xmem int func();
xmem int func(){}
or
xmem int func();
int func(){}
or
int func();
xmem int func(){}
In addition to flagging individual functions, the xmem keyword can be used with the compiler directive
#memmap to send all functions not declared as root to extended memory.
#memmap xmem
This construct is helpful if an application is running out of root code space. Another strategy is to use sepa-
rate I&D space. Using both #memmap xmem and separate I&D space might cause an application to run
out of xmem, depending on the size of the application and the size of the flash. If this occurs, the program-
mer should consider using only one of the #memmap xmem or separate I&D space options. If the applica-
tion is extremely tight for xmem code memory but has root code memory to spare, the programmer may
also consider explicitly tagging some xmem or anymem functions with the root keyword.
xstring
Declares a table of strings in extended memory. The strings are allocated in flash memory at compile time
which means they can not be rewritten directly.
The table entries are 20-bit physical addresses. The name of the table represents the 20-bit physical
address of the table; this address is assigned to name by the compiler.
xstring name { “string_1”, . . . “string_n” };