12.9 Packing Data Stored in Flash

The 16-bit core families use a 24-bit Flash word size. The architecture supports the mapping of areas of Flash into the data space, as discussed in the Variables in Program Space section. Unfortunately this mapping is only 16 bits wide to fit in with data space dimensions.

The compiler supports using the upper byte of Flash via packed storage. Use of this upper byte can offer a code-size savings for large structures, but this is more expensive to access. The type-qualifier __pack_upper_byte added to a declaration indicates that the variable should be placed into Flash memory and use the upper byte. Unlike other qualifiers in use with MPLAB XC16 C Compiler, such as __psv__, this qualifier combines placement and access control.