# Vault 7: Projects

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

### Protego

# MPLAB XC16 C-Compiler

- 1
- 2
…
- 14
- 15
- 16
- 17
- 18
…
- 365
- 366

MPLAB
®
XC16 C Compiler Users Guide
DS50002071C-page 16  2012-2013 Microchip Technology Inc.
1.3.2 Optimization
The compiler uses a set of sophisticated optimization passes that employ many
advanced techniques for generating efficient, compact code from C source. The
optimization passes include high-level optimizations that are applicable to any C code,
as well as 16-bit device-specific optimizations that take advantage of the particular
features of the device architecture.
For more on optimizations, see Chapter 18. Optimizations.
1.3.3 ANSI Standard Library Support
The compiler is distributed with a complete ANSI C standard library. All library functions
have been validated, and conform to the ANSI C library standard. The library includes
functions for string manipulation, dynamic memory allocation, data conversion, time-
keeping and math functions (trigonometric, exponential and hyperbolic). The standard
I/O functions for file handling are also included, and, as distributed, they support full
access to the host file system using the command-line simulator. The fully functional
source code for the low-level file I/O functions is provided in the compiler distribution,
and may be used as a starting point for applications that require this capability.
1.3.4 Flexible Memory Models
The compiler supports both large and small code and data models. The small code
model takes advantage of more efficient forms of call and branch instructions, while the
small data model supports the use of compact instructions for accessing data in SFR
space.
The compiler supports two models for accessing constant data. The constants in data
model uses data memory, which is initialized by the run-time library. The constants in
code model uses program memory, which is accessed through the Program Space
Visibility (PSV) window.
1.3.5 Attributes and Qualifiers
The compiler keyword __attribute__ allows you to specify special attributes of
variables, structure fields or functions. This keyword is followed by an attribute
specification inside double parentheses, as in:
int last_mode __attribute__ ((persistent));
In other compilers, qualifiers are used to create qualified types:
persistent int last_mode;
The MPLAB XC16 C Compiler does have some non-standard qualifiers described in
Section 8.11 Compiler-Specific type Qualifiers.
Generally speaking, qualifiers indicate how an object should be accessed, whereas
attributes indicate where objects are to be located. Attributes also have many other
purposes.
1.3.6 Compiler Driver
The compiler includes a powerful command-line driver program. Using the driver
program, application programs can be compiled, assembled and linked in a single step.

- 1
- 2
…
- 14
- 15
- 16
- 17
- 18
…
- 365
- 366