SW006015 Microchip Technology, SW006015 Datasheet - Page 63

C COMPILER MPLAB C32

SW006015

Manufacturer Part Number
SW006015
Description
C COMPILER MPLAB C32
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC32r
Datasheets

Specifications of SW006015

Supported Families
PIC32MX5, MX6, And MX7
Core Architecture
PIC
Kit Contents
Software And Docs
Mcu Supported Families
PIC32 MCUs
Tool Function
Compiler
Supported Devices
PIC32 MCUs
Tool Type
Compiler
Processor Series
PIC32
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC32
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
5.5
5.6
© 2007 Microchip Technology Inc.
HEAP USAGE
FUNCTION CALLING CONVENTION
The C runtime heap is an uninitialized area of data memory that is used for dynamic
memory allocation using the standard C library dynamic memory management
functions, calloc, malloc and realloc. If you do not use any of these functions,
then you do not need to allocate a heap. By default, a heap is not created.
If you do want to use dynamic memory allocation, either directly, by calling one of the
memory allocation functions, or indirectly, by using a standard C library function that
uses one of these functions, then a heap must be created. A heap is created by
specifying its size on the linker command line using the --defsym_min_heap_size
linker command line option. An example of allocating a heap of 512 bytes using the
command line is:
pic32-gcc foo.c -Wl,--defsym,_min_heap_size=512
The linker allocates the heap immediately before the stack.
The Stack Pointer is always aligned on a 4-byte boundary.
• All integer types smaller than a 32-bit integer are first converted to a 32-bit value.
• Although some arguments may be passed in registers, space is still allocated on
• When calling a function:
TABLE 5-2:
char
short
int
long
long long
float
double
long double
Structure
The first four 32 bits of arguments are passed via registers a0-a3 (see Table 5-2
for how many registers are required for each data type).
the stack for all arguments to be passed to a function (see Figure 5-2).
- Registers a0-a3 are used for passing arguments to functions. Values in these
- Registers t0-t7 and t8-t9 are caller saved registers. The calling function
- Registers s0-s7 are called saved registers. The function being called must
- Register s8 is a saved register if the optimizer eliminates its use as the Frame
- Register ra contains the return address of a function call.
registers are not preserved across function calls.
must push these values onto the stack for the registers’ values to be saved.
save any of these registers it modifies.
Pointer. s8 is a reserved register otherwise.
REGISTERS REQUIRED
Data Type
1
1
1
1
2
1
2
2
Up to 4, depending on the size of the struct.
Number of Registers Required
DS51686A-page 59

Related parts for SW006015