# Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

### Protego

# MPLAB XC16 C-Compiler

- 1
- 2
…
- 221
- 222
- 223
- 224
- 225
…
- 365
- 366

MPLAB
®
XC16 C COMPILER
USERS GUIDE
 2012-2013 Microchip Technology Inc. DS50002071C-page 223
Chapter 20. Linking Programs
20.1 INTRODUCTION
The compiler will automatically invoke the linker unless the compiler has been
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.
The linker operation can be controlled using the driver, see Section 5.7.9 Options for
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 XC16 Assembler, Linker and Utilities Users Guide (DS52106) for an explana-
tion of the detailed information in this file.
20.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 8.12 Variable Attributes.
data
General data space. Variables in general data space can be accessed using ordinary
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.
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.
prog
General program space, which is normally reserved for executable code. Variables in
this program space can not be accessed using ordinary C statements. They must be
explicitly accessed by the programmer, usually using table-access inline assembly
instructions, using the program space visibility window, or by qualifying with
__prog__.
DD
DD

- 1
- 2
…
- 221
- 222
- 223
- 224
- 225
…
- 365
- 366