Assembly:

MODU rd, rs, rt

nanoMIPS

Modulo Unsigned

Purpose:

Modulo Unsigned. Compute unsigned division of register $rs by register $rt, and place theremainder in register $rd.

Availability:

nanoMIPS

Format:

001000

rt

rs

rd

x

0111011

000

6

5

5

5

1

7

3

Operation:

numerator = zero_extend(GPR[rs], from_nbits=32)
denominator = zero_extend(GPR[rt], from_nbits=32)
if denominator == 0:
    quotient, remainder = (UNKNOWN, UNKNOWN)
else:
    quotient, remainder = divide_integers(numerator, denominator)
GPR[rd] = sign_extend(remainder, from_nbits=32)

Exceptions:

None.