moduw
Modulo Unsigned Word
moduw RT, RA, RB
Calculates remainder of unsigned word division.
Details
Calculates the unsigned remainder (modulo) of a 32-bit word division, storing the result in RT. The dividend is in RA and the divisor is in RB. No status flags are affected; division by zero is not trapped and produces undefined results.
Pseudocode Operation
RT ← (RA mod RB)
Programming Note
The moduw instruction is used for performing modulo operations on unsigned integers. Ensure the divisor in RB32:63 is not zero to avoid division by zero exceptions. The result is placed in RT32:63, while RT0:31 remains undefined and should not be relied upon.
Example
moduw r3, r4, r5
Encoding
Binary Layout
31
0
RT
6
RA
11
RB
16
267
21
/
31
Operands
-
RT
Target -
RA
Dividend -
RB
Divisor