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 312 2012-2013 Microchip Technology Inc.
__builtin_modsd
Description: Issues the 16-bit architectures native signed 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 only the remainder.
Prototype: signed int __builtin_modsd(signed long dividend,
signed int divisor);
Argument: dividend number to be divided
divisor number to divide by
Return Value: Remainder.
Assembler Operator/
Machine Instruction:
modsd
Error Messages None.
__builtin_modud
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 only the remainder.
Prototype: unsigned int __builtin_modud(unsigned long dividend,
unsigned int divisor);
Argument: dividend number to be divided
divisor number to divide by
Return Value: Remainder.
Assembler Operator/
Machine Instruction:
modud
Error Messages None.
Protego_Release_01_05-Related-OEM-Documentation-MPLAB-XC16-C-Compiler.pdf