Microchip Technology SW006022-1N Data Sheet

Page of 338
MPLAB
®
 XC16 C Compiler User’s Guide
DS52071B-page 18
 2012 Microchip Technology Inc.
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 6.10 “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.3.7
Documentation
The compiler is supported under both the MPLAB IDE v8.xx and above, and the 
MPLAB X IDE. For simplicity, both IDEs are referred to throughout the book as simply 
MPLAB IDE.
Features that are unique to specific devices, and therefore specific compilers, are 
noted with a “DD” icon next to the section and text that identifies the specific devices to 
which the information applies (see the Preface).