5.12.3.5 Absolute Psects

MPLAB XC8 is able to determine the address bounds of absolute psects (defined using the abs and ovrld, PSECT flags) and reserves that data memory prior to the compilation stage so it is not used by C source. Any data memory required by assembly code must use an absolute psect, but these do not need to be used for psects to be located in program memory.

The following example code contained in an assembly code file defines a table that must be located at address 0x110 in the data space.

PSECT lkuptbl,class=RAM,space=1,abs,ovrld
ORG 110h
lookup:
    DS 20h

When the project is compiled, the memory range from address 0x110 to 0x12F in memory space 1 (data memory) is recorded as being used and is reserved before compiling the C source. An absolute psect always starts at address 0. For such psects, you can specify a non-zero starting address by using the ORG directive. See 6.1.9.33  Org Directive for important information on this directive.