SW006012 Microchip Technology, SW006012 Datasheet - Page 203

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.7
D.8
D.9
D.10 STRING CONSTANTS
D.11 ACCESS MEMORY
D.12 INLINE ASSEMBLY
© 2007 Microchip Technology Inc.
STORAGE QUALIFIERS
PREDEFINED MACRO NAMES
INTEGER PROMOTIONS
MPLAB C18 uses the non-ANSI far, near, rom and ram type qualifiers.
MPLAB C30 uses the non-ANSI far, near and space attributes.
EXAMPLE D-1:
EXAMPLE D-2:
EXAMPLE D-3:
MPLAB C18 defines __18CXX, __18F242, ... (all other processors with __ prefix) and
__SMALL__ or __LARGE__, depending on the selected memory model.
MPLAB C30 defines __dsPIC30.
MPLAB C18 performs integer promotions at the size of the largest operand even if both
operands are smaller than an int. MPLAB C18 provides the -Oi+ option to conform
to the standard.
MPLAB C30 performs integer promotions at int precision or greater as mandated by
ISO.
MPLAB C18 keeps string constants in program memory in its .stringtable section.
MPLAB C18 supports several variants of the string functions. For instance, the strcpy
function has four variants allowing the copying of a string to and from both data and
program memory.
MPLAB C30 accesses string constants from data memory or from program memory
through the PSV window, allowing constants to be accessed like any other data.
dsPIC30F devices do not have access memory.
MPLAB C18 uses non-ANSI _asm and _endasm to identify a block of inline assembly.
MPLAB C30 uses non-ANSI asm, which looks more like a function call. The MPLAB
C30 use of the asm statement is detailed in Section 8.4 “Using Inline Assembly
Language”.
C18
C30
C18
C30
C18
C30
MPLAB C18 vs. MPLAB C30 C Compiler
near int gVariable;
__attribute__((near)) int gVariable;
far int gVariable;
__attribute__((far)) int gVariable;
rom int gArray[6] = {0,1,2,3,4,5};
__attribute__((section(".romdata"), space(prog) ))
int gArray[6] = {0,1,2,3,4,5};
DEFINING A NEAR VARIABLE
DEFINING A FAR VARIABLE
CREATING A VARIABLE IN PROGRAM MEMORY
DS51284F-page 197

Related parts for SW006012