SW006012 Microchip Technology, SW006012 Datasheet - Page 205

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
D.14 MEMORY MODELS
D.15 CALLING CONVENTIONS
D.16 STARTUP CODE
D.17 COMPILER-MANAGED RESOURCES
© 2007 Microchip Technology Inc.
EXAMPLE D-7:
EXAMPLE D-8:
MPLAB C18 uses non-ANSI small and large memory models. Small uses the 16-bit
pointers and restricts program memory to be less than 64 KB (32 KB words).
MPLAB C30 uses non-ANSI small code and large code models. Small code restricts
program memory to be less than 96 KB (32 KB words). In large code, pointers may go
through a jump table.
There are many differences in MPLAB C18 and MPLAB C30 calling conventions.
Please refer to Section 4.12 “Function Call Conventions” for a discussion of
MPLAB C30 calling conventions.
MPLAB C18 provides three startup routines – one that performs no user data
initialization, one that initializes only variables that have initializers, and one that
initializes all variables (variables without initializers are set to zero as required by the
ANSI standard).
MPLAB C30 provides two startup routines – one that performs no user data
initialization and one that initializes all variables (variables without initializers are set to
zero as required by the ANSI standard) except for variables in the persistent data
section.
MPLAB C18 has the following managed resources: PC, WREG, STATUS, PROD,
section .tmpdata, section MATH_DATA, FSR0, FSR1, FSR2, TBLPTR, TABLAT.
MPLAB C30 has the following managed resources: W0-W15, RCOUNT, SR.
C18
C30
C18
C30
MPLAB C18 vs. MPLAB C30 C Compiler
#pragma code myTextSection=0x8000;
int PrintString(const char *s){...};
int __attribute__((address(0x8000))) PrintString
#pragma interrupt isr0 save=var1, var2
void __attribute__((__interrupt__(__save__(var1,var2))))
(const char *s) {...};
isr0(void)
{
/* perform interrupt function here */
}
void isr0(void)
{
/* perform interrupt function here */
}
LOCATE THE FUNCTION PRINTSTRING AT ADDRESS
0X8000 IN PROGRAM MEMORY
COMPILER AUTOMATICALLY SAVES AND RESTORES THE
VARIABLES VAR1 AND VAR2
DS51284F-page 199

Related parts for SW006012