SW006012 Microchip Technology, SW006012 Datasheet - Page 37

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
2.5
© 2007 Microchip Technology Inc.
EXPRESSION DIFFERENCES
Differences Between MPLAB C30 and ANSI C
Such an array of label values serves a purpose much like that of the switch
statement. The switch statement is cleaner and therefore preferable to an array.
Another use of label values is in an interpreter for threaded code. The labels within the
interpreter function can be stored in the threaded code for fast dispatching.
This mechanism can be misused to jump to code in a different function. The compiler
cannot prevent this from happening, so care must be taken to ensure that target
addresses are valid for the current function.
2.4.2
The middle operand in a conditional expression may be omitted. Then if the first
operand is nonzero, its value is the value of the conditional expression.
Therefore, the expression:
x ? : y
has the value of x if that is nonzero; otherwise, the value of y.
This example is perfectly equivalent to:
x ? x : y
In this simple case, the ability to omit the middle operand is not especially useful. When
it becomes useful is when the first operand does, or may (if it is a macro argument),
contain a side effect. Then repeating the operand in the middle would perform the side
effect twice. Omitting the middle operand uses the value already computed without the
undesirable effects of recomputing it.
2.4.3
You can specify a range of consecutive values in a single case label, like this:
case low ... high:
This has the same effect as the proper number of individual case labels, one for each
integer value from low to high, inclusive.
This feature is especially useful for ranges of ASCII character codes:
case 'A' ... 'Z':
Be careful: Write spaces around the ..., otherwise it may be parsed incorrectly when
you use it with integer values. For example, write this:
case 1 ... 5:
rather than this:
case 1...5:
This section describes the expression differences between plain ANSI C and the C
accepted by MPLAB C30.
2.5.1
A sequence of binary digits preceded by 0b or 0B (the numeral '0' followed by the letter
'b' or 'B') is taken to be a binary integer. The binary digits consist of the numerals '0' and
'1'. For example, the (decimal) number 255 can be written as 0b11111111.
Like other integer constants, a binary constant may be suffixed by the letter 'u' or 'U', to
specify that it is unsigned. A binary constant may also be suffixed by the letter 'l' or 'L',
to specify that it is long. Similarly, the suffix 'll' or 'LL' denotes a long long binary
constant.
Conditionals with Omitted Operands
Case Ranges
Binary Constants
DS51284F-page 31

Related parts for SW006012