![](http://datasheet.mmic.net.cn/380000/-PD98501_datasheet_16745028/-PD98501_102.png)
CHAPTER 2 V
R
4120A
102
Preliminary User’s Manual S14767EJ1V0UM00
(2) Computational instructions
Computational instructions perform arithmetic, logical, and shift operations on values in registers. There are four
categories of Computational instructions: ALU Immediate, Two/Three-Operand Register-Type, Shift, and
Multiply/Divide.
Table 2-36. ALU Immediate Instructions (1/2)
Instruction
Format and Description
Load Immediate
LI rx, immediate
The 8-bit immediate is zero extended and loaded to general register rx.
ADDIU ry, rx, immediate
The 4-bit immediate is sign extended and then added to the contents of general register rx to form a
32-bit result. The result is placed into general register ry. No integer overflow exception occurs under
any circumstances. In the 64-bit mode, the operand must be a 64-bit value formed by sign-extending a
32-bit value.
ADDIU rx, immediate
The 8-bit immediate is sign extended and then added to the contents of general register rx to form a
32-bit result. The result is placed into general register rx. No integer overflow exception occurs under
any circumstances. In the 64-bit mode, the operand must be a 64-bit value formed by sign-extending a
32-bit value.
ADDIU sp, immediate
The 8-bit immediate is shifted left three bits, sign extended, and then added to the contents of general
register sp to form a 32-bit result. The result is placed into general register sp. No integer overflow
exception occurs under any circumstances. In the 64-bit mode, the operand must be a 64-bit value
formed by sign-extending a 32-bit value.
ADDIU rx, pc, immediate
The two lower bits of the BasePC value associated with the instruction are cleared to form the masked
BasePC value. The 8-bit immediate is shifted left two bits, zero extended, and then added to the
masked BasePC value to form the virtual address. This address is placed into general register rx. No
integer overflow exception occurs under any circumstances.
Add Immediate
Unsigned
ADDIU rx, sp, immediate
The 8-bit immediate is shifted left two bits, zero extended, and then added to the contents of register
sp to form a 32-bit result. The result is placed into general register rx. No integer overflow exception
occurs under any circumstance. In the 64-bit mode, the operand must be a 64-bit value formed by
sign-extending a 32-bit value.