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

Product codes
SW006021-1
Page of 518
C Language Features
 2012 Microchip Technology Inc.
DS52053B-page 237
5.15.3.2
DATA MEMORY CLASSES
RAM
 consist of ranges that cover all the general purpose RAM memory of the target 
device, but excluding any common (unbanked) memory. Thus, it is useful for 
psects that must be placed in general-purpose banked RAM, but can be 
placed in any bank,
BIGRAM
 consists of a single memory range that is designed to cover the linear data 
memory of enhanced mid-range devices. It is suitable for any psect whose 
contents are accessed using linear addressing.
ABS1
 consist of ranges that cover all the general purpose RAM memory of the target 
device, including any common (unbanked) memory. Thus, it is useful for 
psects that must be placed in general purpose RAM, but can be placed in 
any bank or the common memory,
BANKx
 (where x is a bank number) each consist of a single range that covers the 
general purpose RAM in that bank, but excluding any common (unbanked) 
memory.
COMMON
 consists of a single memory range that covers the common (unbanked) 
RAM, if present.
SFRx
 (where x is a bank number) each consists of a single range that covers the SFR 
memory in that bank. These classes would not typically be used by 
programmers as they do not represent general purpose RAM.
5.15.3.3
MISCELLANEOUS CLASSES
CONFIG
 consists of a single range that covers the memory reserved for configuration 
bit data in the hex file. This class would not typically be used by programmers 
as it does not represent general purpose RAM.
IDLOC
 consists of a single range that covers the memory reserved for ID location 
data in the hex file. This class would not typically be used by programmers 
as it does not represent general purpose RAM.
EEDATA
 consists of a single range that covers the EEPROM memory of the target de-
vice, if present. This class would typically be used for psects that contain 
data that is to be programmed into the EEPROM.
5.15.4
Replacing Library Modules
The MPLAB XC8 C compiler comes with a librarian, LIBR, which allows you to unpack 
a library file and replace modules with your own modified versions. See 
Section 8.2 “Librarian”. However, you can easily replace a library module that is 
linked into your program without having to do this.
If you add to your project a source file which contains the definition for a routine with 
the same name as a library routine, then the library routine will be replaced by your rou-
tine. This is due to the way the compiler scans source and library files.
When trying to resolve a symbol (a function name, or variable name, for example) the 
compiler first scans all the source modules for the definition. Only if it cannot resolve 
the symbol in these files does it then search the library files.
If the symbol is defined in a source file, the compiler will never actually search the librar-
ies for this symbol. No error will result if the symbol was present in both your source 
code and the library files. This may not be true if a symbol is defined twice in source 
files and an error may result if there is a conflict in the definitions.