Toshiba TX39 Computer Hardware User Manual


 
Architecture
27
3.4 Computational Instructions
Computational instructions perform arithmetic, logical or shift operations on values in registers. The
instruction format can be R-type or I-type. With R-type instructions, the two operands and the result are
register values. With I-type instructions, one of the operands is 16-bit immediate data. Computational
instructions can be classified as follows.
ALU immediate (Table 3-4)
Three-operand register-type (Table 3-5)
Shift (Table 3-6)
Multiply/Divide (Table 3-7,Table3-8)
Table 3-4. ALU immediate instructions
Instruction Format and Description
Add
Immediate
ADDI rt, rs, immediate
Add 32-bit sign-extended immediate to the contents of register rs, and store the
result in register rt. An exception is raised in the event of a two’s-complement
overflow.
Add
Immediate
Unsigned
ADDIU rt, rs, immediate
Add 32-bit sign-extended immediate to the contents of register rs, and store the
result in register rt. No exception is raised on a two’s-complement overflow.
Set on Less
Than
Immediate
SLTI rt, rs, immediate
Compare 32-bit sign-extended immediate with the contents of register rs as
signed 32-bit data. If rs is less than immediate, set 1 in rt as the result;
otherwise store 0 in rt.
Set on Less
Than
Unsigned
Immediate
SLTUI rt, rs, immediate
Compare 32-bit sign-extended immediate with the contents of register rs as
unsigned 32-bit data. If rs is less than immediate, set 1 in rt as the result;
otherwise store 0 in rt.
AND
Immediate
ANDI rt, rs, immediate
AND 32-bit zero-extended immediate with the contents of register rs, and store
the result in register rt.
OR
Immediate
ORI rt, rs, immediate
OR 32-bit zero-extended immediate with the contents of register rs, and store
the result in register rt.
Exclusive
OR
Immediate
XORI rt, rs, immediate
Exclusive-OR 32-bit zero-extended immediate with the contents of register rs,
and store the result in register rt.
Load Upper
Immediate
LUI rt, immediate
Shift 16-bit immediate left 16 bits, zero-fill the least significant 16 bits of the
word, and store the result in register rt.
immediatertrsop