Assembly:

ADD rd, rs, rt

nanoMIPS, not available in NMS

Add

Purpose:

Add. Add two 32-bit signed integers in registers $rs and $rt, placing the 32-bit result inregister $rd, and trapping on overflow.

Availability:

nanoMIPS, not available in NMS

Format:

001000

rt

rs

rd

x

0100010

000

6

5

5

5

1

7

3

Operation:

if C0.Config5.NMS == 1:
    raise exception('RI')
sum = GPR[rs] + GPR[rt]
if overflows(sum, nbits=32):
    raise exception('OV')
GPR[rd] = sign_extend(sum, from_nbits=32)

Exceptions:

Overflow.