Assembly:

SRL rt, rs, shift

nanoMIPS

Shift Right Logical.

Purpose:

Shift Right Logical.Right shift word value in register $rs by amount shift, filling the

emptied bits with zeroes. Place the result in register $rt.

Availability:

nanoMIPS

Format:

SRL[32]

100000

rt

rs

1100

x

0010

shift

6

5

5

4

3

4

5

SRL[16]

001100

rt3

rs3

1

shift3

6

3

3

1

3

rt = decode_gpr(rt3, 'gpr3')
rs = decode_gpr(rs3, 'gpr3')
shift = 8 if shift3 == 0 else shift3

Operation:

result = zero_extend(GPR[rs], from_nbits=32) >> shift
GPR[rt] = sign_extend(result, from_nbits=32)

Exceptions:

None.