Modi - Intel i960 Jx Developer's Manual

Microprocessor
Table of Contents

Advertisement

INSTRUCTION SET REFERENCE
6.2.41

modi

Mnemonic:
modi
Format:
modi
Description:
Divides src2 by src1, where both are integers and stores the modulo
remainder of the result in dst. When the result is nonzero, dst has the same
sign as src1.
if(src1 == 0)
Action:
{
}
dst = src2 - (src2/src1) * src1;
if((src2 *src1 < 0 ) && (dst != 0))
dst = dst + src1;
STANDARD
Faults:
ARITHMETIC.ZERO_DIVIDE
Example:
modi r9, r2, r5
Opcode:
modi
See Also:
divi, divo, remi, remo
Notes:
modi
the corresponding 32-bit division does overflow, it does not generate a fault.
6-76
Modulo Integer
src1,
src2,
reg/lit
reg/lit
dst = undefined_value;
generate_fault(ARITHMETIC.ZERO_DIVIDE);
Refer to
# r5
749H
REG
generates the correct result (0) when computing -2
dst
reg
section 6.1.6, "Faults" (pg.
The src1 operand is zero.
modulo (r2/r9)
31
mod -1, although
6-5).

Advertisement

Table of Contents
loading

Table of Contents