28.2.28 __builtin_divmodud

Architecture

dsPIC33C/E/F, dsPIC30

Description

Issues the DSC architecture’s native unsigned divide support with the same restrictions given in the dsPIC30F/33F Programmer’s Reference Manual (DS-70000157). 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

uint16_t __builtin_divmodud(
uint32_t dividend, uint16_t divisor,
 uint16_t *remainder);

Arguments

dividend – number to be divided

divisor – number to divide by

remainder – pointer to remainder

Return Value

Quotient and remainder.

Machine Instruction

div.ud

Error Messages

None