Microchip Technology SW006021-2 Manual De Usuario
MPLAB
®
XC8 C Compiler User’s Guide
DS52053B-page 66
2012 Microchip Technology Inc.
3.6.17
How Do I Know How Much Memory Is Still Available?
Although the memory summary printed by the compiler after compilation (see
Section 4.8.56 “--SUMMARY: Select Memory Summary Output Type” options) or
the memory gauge available in MPLAB IDE both indicate the amount of memory used
and the amount still available, neither of these features indicate whether this memory
is one contiguous block or broken into many small chunks. Small blocks of free memory
cannot be used for larger objects and so out-of-memory errors may be produced even
though the total amount of memory free is apparently sufficient for the objects to be
positioned. (See Section 3.7.6 “How Do I Fix a "Can’t find space..." Error?”)
Section 4.8.56 “--SUMMARY: Select Memory Summary Output Type” options) or
the memory gauge available in MPLAB IDE both indicate the amount of memory used
and the amount still available, neither of these features indicate whether this memory
is one contiguous block or broken into many small chunks. Small blocks of free memory
cannot be used for larger objects and so out-of-memory errors may be produced even
though the total amount of memory free is apparently sufficient for the objects to be
positioned. (See Section 3.7.6 “How Do I Fix a "Can’t find space..." Error?”)
The "UNUSED ADDRESS RANGES" section, see Section 7.4.2.5 “Unused Address
Ranges” in the map file indicates exactly what memory is still available in each linker
class. It also indicated the largest contiguous block in that class if there are memory
bank or page divisions.
Ranges” in the map file indicates exactly what memory is still available in each linker
class. It also indicated the largest contiguous block in that class if there are memory
bank or page divisions.
3.6.18
How Do I Use Library Files In My Project?
See Section 3.3.6 “How Do I Build Libraries?” for information on how you build your
own library files. The compiler will automatically include any applicable standard library
into the build process when you compile, so you never need to control these files.
own library files. The compiler will automatically include any applicable standard library
into the build process when you compile, so you never need to control these files.
To use one or more library files that were built by yourself or a colleague, include them
in the list of files being compiled on the command line. The library files can be specified
in any position in the file list relative to the source files, but if there is more than one
library file, they will be searched in the order specified in the command line. The LPP
libraries do not need to be specified if you are compiling to an intermediate file, i.e.,
using the --PASS1 option (see Section 4.8.45 “--PASS1: Compile to P-code”). For
example:
in the list of files being compiled on the command line. The library files can be specified
in any position in the file list relative to the source files, but if there is more than one
library file, they will be searched in the order specified in the command line. The LPP
libraries do not need to be specified if you are compiling to an intermediate file, i.e.,
using the --PASS1 option (see Section 4.8.45 “--PASS1: Compile to P-code”). For
example:
xc8 --chip=16f1937 main.c int.c lcd.lpp
If you are using MPLAB X IDE to build a project, add the library file(s) to the Libraries
folder that will shown in your project, in the order in which they should be searched. The
IDE will ensure that they are passed to the compiler at the appropriate point in the build
sequence.
folder that will shown in your project, in the order in which they should be searched. The
IDE will ensure that they are passed to the compiler at the appropriate point in the build
sequence.
3.6.19
What Optimizations Are Employed By The Compiler?
Optimizations are employed at both the C and assembly level of compilation. This is
described in Section 5.13 “Optimizations” and Section 6.5 “Assembly-Level Opti-
mizations”, respectively. The options that control optimization are described in
Section 4.8.42 “--OPT: Invoke Compiler Optimizations”.
described in Section 5.13 “Optimizations” and Section 6.5 “Assembly-Level Opti-
mizations”, respectively. The options that control optimization are described in
Section 4.8.42 “--OPT: Invoke Compiler Optimizations”.
3.6.20
Why Do I Get Out-of-memory Errors When I Select a Debugger?
If you use a hardware tool debugger, such as the REAL ICE or ICD3, these require
memory for the on-board debug executive. When you select a debugger using the com-
piler’s --DEBUGGER option (Section 4.8.23 “--DEBUGGER: Select Debugger
Type”), or the IDE equivalent, the memory required for debugging is removed from that
available to your project. See Section 3.5.3 “What Do I Need to Do When Compiling
to Use a Debugger?”
memory for the on-board debug executive. When you select a debugger using the com-
piler’s --DEBUGGER option (Section 4.8.23 “--DEBUGGER: Select Debugger
Type”), or the IDE equivalent, the memory required for debugging is removed from that
available to your project. See Section 3.5.3 “What Do I Need to Do When Compiling
to Use a Debugger?”