SW006013 Microchip Technology, SW006013 Datasheet - Page 104

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
DS51456E-page 100
div (Continued)
exit
Description:
Include:
Prototype:
Argument:
Remarks:
Example:
Output:
For div(7, 3)
The quotient is 2 and the remainder is 1
For div(7, -3)
The quotient is -2 and the remainder is 1
For div(-5, 3)
The quotient is -1 and the remainder is -2
For div(7, 7)
The quotient is 1 and the remainder is 0
For div(7, 0)
Illegal instruction executed
ABRT
Terminates program after clean up.
<stdlib.h>
void exit(int status);
status
exit calls any functions registered by atexit in reverse order of reg-
istration, flushes buffers, closes stream, closes any temporary files
created with tmpfile, and resets the processor. This function is
customizable. See pic30-libs.
#include <stdio.h>
#include <stdlib.h> /* for exit
int main(void)
{
}
Output:
Cannot open samp.fil
FILE *myfile;
if ((myfile = fopen("samp.fil", "r" )) == NULL)
{
}
else
{
}
printf("This will not be printed");
printf("Cannot open samp.fil\n");
exit(EXIT_FAILURE);
printf("Success opening samp.fil\n");
exit(EXIT_SUCCESS);
exit status
/* for fopen, printf, */
/* FILE, NULL
© 2008 Microchip Technology Inc.
*/
*/

Related parts for SW006013