SW006012 Microchip Technology, SW006012 Datasheet - Page 35

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
© 2007 Microchip Technology Inc.
Differences Between MPLAB C30 and ANSI C
To extract the real part of a complex-valued expression exp, write __real__ exp.
Similarly, use __imag__ to extract the imaginary part. For example;
The operator '~' performs complex conjugation when used on a value with a complex
type.
MPLAB C30 can allocate complex automatic variables in a noncontiguous fashion; it’s
even possible for the real part to be in a register while the imaginary part is on the stack
(or vice-versa). The debugging information format has no way to represent noncontig-
uous allocations like these, so MPLAB C30 describes noncontiguous complex
variables as two separate variables of noncomplex type. If the variable’s actual name
is foo, the two fictitious variables are named foo$real and foo$imag.
2.3.6
MPLAB C30 supports data types for integers that are twice as long as long int.
Simply write long long int for a signed integer, or unsigned long long int
for an unsigned integer. To make an integer constant of type long long int, add the
suffix LL to the integer. To make an integer constant of type unsigned long long
int, add the suffix ULL to the integer.
You can use these types in arithmetic like any other integer types. Addition, subtraction
and bitwise boolean operations on these types are open-coded, but division and shifts
are not open-coded. The operations that are not open-coded use special library
routines that come with MPLAB C30.
2.3.7
Another way to refer to the type of an expression is with the typeof keyword. The
syntax for using this keyword looks like sizeof, but the construct acts semantically like
a type name defined with typedef.
There are two ways of writing the argument to typeof: with an expression or with a
type. Here is an example with an expression:
typeof (x[0](1))
This assumes that x is an array of functions; the type described is that of the values of
the functions.
Here is an example with a typename as the argument:
typeof (int *)
Here the type described is a pointer to int.
If you are writing a header file that must work when included in ANSI C programs, write
__typeof__ instead of typeof.
__
float r;
float i;
r =
i =
Double-Word Integers
Referring to a Type with typeof
complex
__
__
real
imag
__
__
__
float z;
z;
z;
DS51284F-page 29

Related parts for SW006012