12.9.2 Usage Considerations
When using this qualifier, consider the following:
- The following attributes are not compatible with
__pack_upper_byte
:boot
near
reverse
dma
noload
xmemory
eedata
psv, auto_psv
ymemory
__pack_upper_byte
data is best used for large data sets that do not need to be accessed frequently or that do not have important access timing.- Sequential accesses to
__pack_upper_byte
data objects will improve access performance. - A version of mempcy is defined in
libpic30.h
, and its prototype is:void _memcpy_packed(void *dst, __pack_upper_byte void *src, unsigned int len);
- The following style of declaration is invalid for packed memory:
Here,__pack_upper_byte char *message = "Hello World!\n";
message
is a pointer to__pack_upper_byte
space, but the string"Hello World!\n"
, is in normal const data space, which is not compatible with__pack_upper_byte
. There is no standard C way to specify a different source address space for the literal string. Instead declaremessage
as an object (such as an array declaration in Packed Example). - The TBLPAG SFR may be corrupted during access of a packed variable.