Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

MPLAB
®
XC16 C Compiler Users Guide
DS50002071C-page 306 2012-2013 Microchip Technology Inc.
__builtin_divmodud
Description: Issues the 16-bit architectures native unsigned divide support with the same restrictions
given in the dsPIC30F/33F Programmers Reference Manual (DS70157). Notably, if the
quotient does not fit into a 16-bit result, the results (including remainder) are unexpected.
This form of the built-in function will capture both the quotient and remainder.
Prototype: unsigned int __builtin_divmodud(
unsigned long dividend, unsigned int divisor,
unsigned int *remainder);
Argument: dividend number to be divided
divisor number to divide by
remainder pointer to remainder
Return Value: Quotient and remainder.
Assembler Operator/
Machine Instruction:
divmodud
Error Messages None.
__builtin_divsd
Description: Computes the quotient num / den. A math error exception occurs if den is zero. Function
arguments are signed, as is the function result. The command-line option -Wconversions
can be used to detect unexpected sign conversions.
Prototype: int __builtin_divsd(const long num, const int den);
Argument: num numerator
den denominator
Return Value: Returns the signed integer value of the quotient num / den.
Assembler Operator/
Machine Instruction:
div.sd
__builtin_divud
Description: Computes the quotient num / den. A math error exception occurs if den is zero. Function
arguments are unsigned, as is the function result. The command-line option -Wconver-
sions can be used to detect unexpected sign conversions.
Prototype: unsigned int __builtin_divud(const unsigned
long num, const unsigned int den);
Argument: num numerator
den denominator
Return Value: Returns the unsigned integer value of the quotient num / den.
Assembler Operator/
Machine Instruction:
div.ud

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh