Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 User Manual
Product codes
SW006021-1
MPLAB
®
XC8 C Compiler User’s Guide
DS52053B-page 64
2012 Microchip Technology Inc.
3.6.10
How Do I Utilize the Linear Memory on Enhanced Mid-range PIC
Devices?
Devices?
The linear addressing mode is a means of accessing the banked data memory as one
contiguous and linear block, see Section 5.5.1 “Address Spaces”. Use of the linear
memory is fully automatic. Objects that are larger than a data bank can be defined in
the usual way and will be accessed using the linear addressing mode, see
Section 5.5.2.3 “Size Limits of Auto Variables” and Section 5.5.2.1.2 “Non-Auto
Variable Size Limits”. If you define absolute objects at a particular location in memory,
you can use a linear address, if you prefer, or the regular banked address, see
Section 5.5.4.1 “Absolute Variables in Data Memory”.
contiguous and linear block, see Section 5.5.1 “Address Spaces”. Use of the linear
memory is fully automatic. Objects that are larger than a data bank can be defined in
the usual way and will be accessed using the linear addressing mode, see
Section 5.5.2.3 “Size Limits of Auto Variables” and Section 5.5.2.1.2 “Non-Auto
Variable Size Limits”. If you define absolute objects at a particular location in memory,
you can use a linear address, if you prefer, or the regular banked address, see
Section 5.5.4.1 “Absolute Variables in Data Memory”.
3.6.11
What Devices are Supported by the Compiler?
Support for new devices usually takes place with each compiler release. To find
whether a device is supported by your compiler, you can do several things, see also
Section 5.3.1 “Device Support”.
whether a device is supported by your compiler, you can do several things, see also
Section 5.3.1 “Device Support”.
• HTML listings are provided in the compiler’s docs directory. Open these in your
favorite web browser. They are called pic_chipinfo.html and
pic18_chipinfo.html
pic18_chipinfo.html
.
• Run the compiler driver on the command line (see Section 4.2 “Invoking the
Compiler”) with the --CHIPINFO option, see Section 4.8.21 “--CHIPINFO: Dis-
play List of Supported Devices”. A full list of all devices is printed to the screen.
play List of Supported Devices”. A full list of all devices is printed to the screen.
3.6.12
How Do I Know What Code the Compiler Is Producing?
The assembly list file (see Section 6.6 “Assembly List Files”) shows the assembly
output for almost the entire program, including library routines linked in to your pro-
gram, as well a large amount of the runtime startup code, see Section 5.10.1 “Run-
time Startup Code”. The list file is produced by default if you are using MPLAB IDE.
If you are using the command-line, the option --ASMLIST will produce this file for you,
see Section 4.8.17 “--ASMLIST: Generate Assembler List Files”. The assembly list
file will have a .lst extension.
output for almost the entire program, including library routines linked in to your pro-
gram, as well a large amount of the runtime startup code, see Section 5.10.1 “Run-
time Startup Code”. The list file is produced by default if you are using MPLAB IDE.
If you are using the command-line, the option --ASMLIST will produce this file for you,
see Section 4.8.17 “--ASMLIST: Generate Assembler List Files”. The assembly list
file will have a .lst extension.
The list file shows assembly instructions, some assembly directives and information
about the program, such as the call graph, see Section 6.6.6 “Call Graph”, pointer
reference graph, see Section 6.6.5 “Pointer Reference Graph” and information for
every function. Not all assembly directives are shown in the list file if the assembly opti-
mizers are enabled (they are produced in the intermediate assembly file). Temporarily
disable the assembly optimizers (Section 4.8.42 “--OPT: Invoke Compiler Optimiza-
tions”) if you wish to see all the assembly directives produced by the compiler.
about the program, such as the call graph, see Section 6.6.6 “Call Graph”, pointer
reference graph, see Section 6.6.5 “Pointer Reference Graph” and information for
every function. Not all assembly directives are shown in the list file if the assembly opti-
mizers are enabled (they are produced in the intermediate assembly file). Temporarily
disable the assembly optimizers (Section 4.8.42 “--OPT: Invoke Compiler Optimiza-
tions”) if you wish to see all the assembly directives produced by the compiler.
3.6.13
How Can I Tell How Big a Function Is?
This size of a function (the amount of assembly code generated for that function) can
be determined from the assembly list file, see Section 6.6 “Assembly List Files”, or
a ’funclist’ file generated by the compiler. Recent compilers define a symbol whose
assigned value is equal to the size of the function. The symbol has the form
__size_of_func
be determined from the assembly list file, see Section 6.6 “Assembly List Files”, or
a ’funclist’ file generated by the compiler. Recent compilers define a symbol whose
assigned value is equal to the size of the function. The symbol has the form
__size_of_func
, where func is the name of the function. The units of this symbol
will be the same as the addressability of the program memory for the particular device:
words for PIC10/12/16 and bytes for PIC18. You can also search for the labels that
mark the beginning and end of the function. The function starts at the label _func:,
where func is the name of the function, and ends just prior to the label
__end_of_func
words for PIC10/12/16 and bytes for PIC18. You can also search for the labels that
mark the beginning and end of the function. The function starts at the label _func:,
where func is the name of the function, and ends just prior to the label
__end_of_func
. For example, the function main may have associated symbols
__size_of_main
, _main and __end_of_main. These will be found in the symbol
table at the end of the assembly list file.