Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 User Manual

Product codes
SW006021-1
Page of 518
MPLAB
®
 XC8 C Compiler User’s Guide
DS52053B-page 256
 2012 Microchip Technology Inc.
6.4.9.3
PSECT
The PSECT directive declares or resumes a program section. For an introductory guide 
to psects, see Section 5.15.1 “Program Sections”.
The directive takes as argument a name and, optionally, a comma-separated list of 
flags. The allowed flags are listed in Table 6-6 and specify attributes of the psect.
The psect name is in a separate name space to ordinary assembly symbols, so a psect 
may use the same identifier as an ordinary assembly identifier. However, a psect name 
cannot be one of the assembler directives, keywords, or psect flags.
Once a psect has been declared it may be resumed later by another PSECT directive; 
however, the flags need not be repeated and will be propagated from the earlier decla-
ration. If two PSECT directives are encountered with contradicting flags, then an error 
will be generated.
Some examples of the use of the PSECT directive follow:
PSECT fred 
PSECT bill,size=100h,global 
PSECT joh,abs,ovrld,class=CODE,delta=2
6.4.9.3.1
Abs
The abs flag defines the current psect as being absolute; i.e., it is to start at location 0. 
This does not mean that this module’s contribution to the psect will start at 0, since 
other modules may contribute to the same psect. See also Section 6.4.9.3.9 “Ovrld”.
An abs-flagged psect is not relocatable and an error will result if a linker option is 
issued that attempts to place such a psect at any location.
6.4.9.3.2
Bit
The bit flag specifies that a psect holds objects that are 1 bit long. Such psects will 
have a scale value of 8 to indicate that there are 8 addressable units to each byte of 
storage and all addresses associated with this psect will be bit address, not byte 
addresses. The scale value is indicated in the map file, see Section 7.4 “Map Files”.
TABLE 6-6:
PSECT FLAGS
Flag
 Meaning
abs
Psect is absolute
bit
Psect holds bit objects
class=name
Specify class name for psect
delta=size
Size of an addressing unit
global
Psect is global (default)
limit=address
Upper address limit of psect
local
Psect is not global
merge=allow
Allow or prevent merging of this psect
ovrld
Psect will overlap same psect in other modules
pure
Psect is to be read-only
reloc=boundary
Start psect on specified boundary
size=max
Maximum size of psect
space=area
Represents area in which psect will reside
split=allow
Allow or prevent splitting of this psect
with=psect
Place psect in the same page as specified psect