Encoding:

LI16

111011

rd

Encoded

Immediate

6

3

7

Format:

LI16 rd, decoded_immediate

microMIPS

Load Immediate Word (16-bit instr size)

Purpose:

Load Immediate Word (16-bit instr size)

To load a 6-bit constant into a register.

Description:

GPR[rd] = decoded_immediate

The 7-bit encoded Immediate field is decoded to obtain the actual immediate value. Table 5.12 shows the encoded values of the Immeidiate field and the actual immediate values.

Table 5.12 LI16 -1, 0..126 Immediate Field Encoding Range

Encoded Input

(Hex)

Decoded Value

(Decimal)

0

0

1

1

2

2

3

3

...

...

7e

126

7f

-1

The actual decoded immediate value is sign-extended and placed into GPR rd.

No Integer Overflow exception occurs under any circumstances.

Restrictions:

The 3-bit register fields can only specify GPRs $2-$7, $16, $17.

Operation:

   decoded_immediate = Decode(encoded_immediate)
   temp = sign_extend(decoded_immediate)
   GPR[rd] = temp63..0

Exceptions:

None