28.2.79 __builtin_minv_excess

Architecture

dsPIC33C/E/F, dsPIC30

Description

Force (Signed) Data Range Minimum Limit with Limit Excess Result. Compares a 16-bit signed data value to a minimum signed limit value and stores excess result.

Prototype

int16_t __builtin_minv_excess(int16_t value, int16_t low, int16_t *excess);

Arguments

value – Data value

low – Minimum limit value

excess – Value of excess under limit

Return Value

Returns value limited by low.

Updates excess variable to value of excess under min limit value, else set to 0.

Machine Instruction

min.v

Error Messages

None

Example

Assume Accumulator Register A contains 3

Assume Accumulator Register B contains 5

volatile register int accumA asm("A");
volatile register int accumB asm("B");
int16_t excess;
accumA = __builtin_minv_excess(accumA, accumB, &excess);

In assembly:

min.v A,[excess]

For this example, the value in A will be 5, since A is less than the min value in B. The excess will be set to 2, which is the excess value.