Assembly:

DIV rd, rs, rt

nanoMIPS

Divide

Purpose:

Divide. Divide signed word $rs by signed word $rt and place the result in $rd.

Availability:

nanoMIPS

Format:

001000

rt

rs

rd

x

0100011

000

6

5

5

5

1

7

3

Operation:

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

Exceptions:

None.