5.2 Assembler-provided Psects

The PIC Assembler provides psect definitions (tabulated below), can be used to hold code and data, if required. These psects are available once you include <xc.inc> into your source file and have names that resemble the MPASM directive that creates similar sections in the MPASM assembler. For example, to have instructions placed into the code psect, use the following.
#include <xc.inc>
PSECT code
;place instructions here

The linker class associated with each of these psects and the device families for which they are defined are indicated in the table. The linker classes shown are also already predefined by the PIC Assembler, so you do not need to define them.

You can instead use psects and linker classes that you define, if required. In situations where a psect must reside at a specific location, you must use a unique psect so that it can be linked independently to others. See Psect Directive and P: Position Psect.

Table 5-2. Assembler-provided Psects and Linker Classes
Psect nameLinker classTarget device familiesPurpose
codeCODEAllTo hold executable code
edataEEDATAAllTo hold data in EEPROM
dataSTRCODEBaseline, Mid-rangeTo hold data in program memory
dataCONSTPIC18To hold data in program memory
udataRAMAllTo hold objects allocatable anywhere in GPR
udata_acsCOMRAMPIC18To hold objects allocatable in the Access bank GPR
udata_banknBANKNAllTo hold object allocatable in a particular data memory bank
udata_shrCOMMONBaseline, Mid-rangeTo hold objects allocatable in common memory