Abstract
I
because it is Instruction that contains Immediate Value- 4 parts - Opcode, Source Register, Target Register & Immediate Value
- Meaning: Add the Source Register with the Immediate Value, and store the result to the Target Register
Examples
andi
- Perform a bitwise AND operation between a register and an immediate value
- Get last 4 significant Bit of t0 -
andi $t0, $s0 , 0xF
slti
- Set Less Than Immediate
- If value in Source Register is smaller than Immediate Value, then Target Register is set to 1 else 0
- The mips code -
slti $t0, $t0, 100
- The equivalent more high-level code -
R[rt] = (R[rs]<SignExtImm) ? 1 : 0
bne
- Branch if Not Equal
Terminologies
Immediate Value
- Value is 2’s Complement (补码)
- 16-bits, can represent up to +-2^15 Word, 2^17 Memory Address because 4-bytes Word Addressing
- Used for PC-Relative Addressing