SW006013 Microchip Technology, SW006013 Datasheet - Page 103

MPLAB C Compiler For DsPIC DSCs

SW006013

Manufacturer Part Number
SW006013
Description
MPLAB C Compiler For DsPIC DSCs
Manufacturer
Microchip Technology
Series
DsPIC30F/33Fr
Type
MPLAB® C Compilerr
Datasheet

Specifications of SW006013

Supported Families
DsPIC30F, DsPIC33F
Core Architecture
DsPIC
Kit Contents
Software And Docs
Mcu Supported Families
DsPIC30F And DsPIC33F
Tool Function
Compiler
Tool Type
Compiler
Processor Series
dsPIC
Lead Free Status / RoHS Status
na
For Use With/related Products
dSPIC DSCs
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
© 2008 Microchip Technology Inc.
div (Continued)
Example:
#include <stdlib.h> /* for div, div_t */
#include <stdio.h>
void __attribute__((__interrupt__))
_MathError(void)
{
}
int main(void)
{
}
printf("Illegal instruction executed\n");
abort();
int x, y;
div_t z;
x = 7;
y = 3;
printf("For div(%d, %d)\n", x, y);
z = div(x, y);
printf("The quotient is %d and the "
x = 7;
y = -3;
printf("For div(%d, %d)\n", x, y);
z = div(x, y);
printf("The quotient is %d and the "
x = -5;
y = 3;
printf("For div(%d, %d)\n", x, y);
z = div(x, y);
printf("The quotient is %d and the "
x = 7;
y = 7;
printf("For div(%d, %d)\n", x, y);
z = div(x, y);
printf("The quotient is %d and the "
x = 7;
y = 0;
printf("For div(%d, %d)\n", x, y);
z = div(x, y);
printf("The quotient is %d and the "
"remainder is %d\n\n", z.quot, z.rem);
"remainder is %d\n\n", z.quot, z.rem);
"remainder is %d\n\n", z.quot, z.rem);
"remainder is %d\n\n", z.quot, z.rem);
"remainder is %d\n\n", z.quot, z.rem);
/* for printf
*/
DS51456E-page 99

Related parts for SW006013