SW006012 Microchip Technology, SW006012 Datasheet - Page 120

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
MPLAB
DS51284F-page 114
®
C30 User’s Guide
TABLE 8-1:
TABLE 8-2:
EXAMPLE 8-3:
This example demonstrates how to use the swap instruction (which the compiler does
not generally use):
asm ("swap %0" : "+r"(var));
Here var is the C expression for the operand, which is both an input and an output
operand. The operand is constrained to be of type r, which denotes a register operand.
The + in +r indicates that the operand is both an input and output operand.
Each operand is described by an operand-constraint string followed by the C expres-
sion in parentheses. A colon separates the assembler template from the first output
operand, and another separates the last output operand from the first input, if any.
Commas separate output operands and separate inputs.
a
b
c
d
e
g
i
r
v
w
x
y
z
0, 1, … ,
9
T
U
=
+
&
d
q
t
Letter
Letter
Claims WREG
Divide support register W1
Multiply support register W2
General purpose data registers W1 - W14
Non-divide support registers W2 - W14
Any register, memory or immediate integer operand is allowed, except for
registers that are not general registers.
An immediate integer operand (one with constant value) is allowed. This
includes symbolic constants whose values will be known only at assembly time.
A register operand is allowed provided that it is in a general register.
AWB register W13
Accumulator register A - B
x prefetch registers W8 - W9
y prefetch registers W10 - W11
MAC prefetch registers W4 - W7
An operand that matches the specified operand number is allowed. If a digit is
used together with letters within the same alternative, the digit should come last.
By default, %n represents the first register for the operand (n). To access the
second, third, or fourth register, use a modifier letter.
A near or far data operand.
A near data operand.
Means that this operand is write-only for this instruction: the previous value is
discarded and replaced by output data.
Means that this operand is both read and written by the instruction.
Means that this operand is an earlyclobber operand, which is modified
before the instruction is finished using the input operands. Therefore, this
operand may not lie in a register that is used as an input operand or as part of
any memory address.
Second register for operand number n, i.e., %dn..
Fourth register for operand number n, i.e., %qn..
Third register for operand number n, i.e., %tn..
CONSTRAINT LETTERS SUPPORTED BY MPLAB
CONSTRAINT MODIFIERS SUPPORTED BY MPLAB
PASSING C VARIABLES
Constraint
Constraint
© 2007 Microchip Technology Inc.
®
C30
®
C30

Related parts for SW006012