moduw
Modulo Unsigned Word
moduw RT, RA, RB
Calculates remainder of unsigned word division.
Details
The moduw instruction computes the modulo operation for unsigned integers. It takes a 64-bit dividend from two registers (RA)32:63 and (RB)32:63, divides it by a 32-bit divisor from (RB)32:63, and places the 32-bit remainder into RT32:63. The contents of RT0:31 are undefined.
Pseudocode Operation
RT32:63 ← (RA)32:63 % (RB)32:63
RT0:31 ← undefined
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