Microchip Technology SW006022-2N Data Sheet
MPLAB
®
XC16 C COMPILER
USER’S GUIDE
2012 Microchip Technology Inc.
DS52071B-page 207
Chapter 17. Linking Programs
17.1
INTRODUCTION
The compiler will automatically invoke the linker unless the compiler has been
requested to stop after producing an intermediate file.
requested to stop after producing an intermediate file.
The linker will run with options that are obtained from the command-line driver. These
options specify the memory of the device and how objects should be placed in the
memory. Device-specific linker scripts are used.
options specify the memory of the device and how objects should be placed in the
memory. Device-specific linker scripts are used.
The linker operation can be controlled using the driver, see Section 3.7.9 “Options for
Linking” for more information.
Linking” for more information.
The linker creates a map file which details the memory assigned and some objects
within the code. The map file is the best place to look for memory information. See
MPLAB Assembler, Linker and Utilities for PIC24 MCUs and dsPIC DSCs User’s Guide
(DS51317) for an explanation of the detailed information in this file.
within the code. The map file is the best place to look for memory information. See
MPLAB Assembler, Linker and Utilities for PIC24 MCUs and dsPIC DSCs User’s Guide
(DS51317) for an explanation of the detailed information in this file.
17.2
DEFAULT MEMORY SPACES
The compiler defines several special purpose memory spaces to match architectural
features of 16-bit devices. Static and external variables may be allocated in the special
purpose memory spaces through use of the space attribute, described in
Section 6.11 “Variable Attributes”.
features of 16-bit devices. Static and external variables may be allocated in the special
purpose memory spaces through use of the space attribute, described in
Section 6.11 “Variable Attributes”.
data
General data space. Variables in general data space can be accessed using ordinary
C statements. This is the default allocation.
C statements. This is the default allocation.
xmemory
- dsPIC30F, dsPIC33EP/F devices only
X data address space. Variables in X data space can be accessed using ordinary C
statements. X data address space has special relevance for DSP-oriented libraries
and/or assembly language instructions.
statements. X data address space has special relevance for DSP-oriented libraries
and/or assembly language instructions.
ymemory
- dsPIC30F, dsPIC33EP/F devices only
Y data address space. Variables in Y data space can be accessed using ordinary C
statements. Y data address space has special relevance for DSP-oriented libraries
and/or assembly language instructions.
statements. Y data address space has special relevance for DSP-oriented libraries
and/or assembly language instructions.
DD
DD