SW006012 Microchip Technology, SW006012 Datasheet - Page 81

C COMPILER FOR DSPIC30F FAMILY

SW006012

Manufacturer Part Number
SW006012
Description
C COMPILER FOR DSPIC30F FAMILY
Manufacturer
Microchip Technology
Type
MPLAB® C30 Compilerr
Series
PIC24 & DsPICr
Datasheets

Specifications of SW006012

Supported Families
PIC24, DsPIC30F And DsPIC33F
Core Architecture
PIC, DsPIC
Kit Contents
Software And Docs
Mcu Supported Families
PIC24 MCUs And DsPIC DSCs
Tool Type
Compiler
Processor Series
PIC24, dsPIC
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
dsPIC30F
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
4.11
© 2007 Microchip Technology Inc.
THE C HEAP USAGE
MPLAB C30 C Compiler Runtime Environment
Finally, any callee-saved registers that are used in the function are pushed
(Figure 4-6).
FIGURE 4-6:
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 input/output
function, then a heap must be created. A heap is created by specifying its size on the
linker command line, using the --heap linker command-line option. An example of
allocating a heap of 512 bytes using the command line is:
pic30-gcc foo.c -Wl,--heap=512
The linker allocates the heap immediately below the stack (Figure 4-2).
If you use a standard C library input/output function, then a heap must be allocated. If
stdout is the only file that you use, then the heap size can be zero, that is, use the
command-line option:
-Wl,--heap=0
If you open files, then the heap size must include 40 bytes for each file that is simulta-
neously open. If there is insufficient heap memory, then the open function will return an
error indicator. For each file that should be buffered, 514 bytes of heap space is
required. If there is insufficient heap memory for the buffer, then the file will be opened
in unbuffered mode.
Stack grows
toward
greater
addresses
PUSH CALLEE-SAVED REGISTERS
Callee-Saved
Registers
Local Variables
and Temporaries
Previous FP
Return addr [23:16]
Return addr [15:0]
Parameter 1
Parameter n-1
Parameter n
Caller’s Frame
:
[W14+n] accesses
local context
[W14-n] accesses
stack-based
function parameters
SP (W15)
FP (W14)
DS51284F-page 75

Related parts for SW006012