ALU Shift left 2 instruction B126 Instruction 125211 Read ad
Solution
Instr 1 : Addiu $t0 ,10
The above instruction loads the result 10 into the register t0
t0 is loaded with 10
Instr 2 : lb $st1,32($t0)
The above instruction loads the value at location t0 +32 into t1 register
The value at location ( 10+32 ) will be loaded into register t1
Instr 3 : or $t2,$t0,$t1
The above instruction bitwise or’s the values in the registers t0,t1 and loads the result of the or operation into register t2
Instr 4 : bne $t2,$t0,QUIT
The above instruction checks whether the values in the registers t2,t0 are equal or not and if they are equal then the program counter loads the next instruction and if they are not equal then the program counter loads the address of the label QUIT
That is branch if not equal to QUIT
Instr 4 : j 2500
The above instruction will load the program counter with 2500 that is the next instruction to be executed is at the address 2500 . so jump to 2500 is used
Instr 1 : Addiu $t0 ,10
The above instruction loads the result 10 into the register t0
t0 is loaded with 10
Instr 2 : lb $st1,32($t0)
The above instruction loads the value at location t0 +32 into t1 register
The value at location ( 10+32 ) will be loaded into register t1
Instr 3 : or $t2,$t0,$t1
The above instruction bitwise or’s the values in the registers t0,t1 and loads the result of the or operation into register t2
Instr 4 : bne $t2,$t0,QUIT
The above instruction checks whether the values in the registers t2,t0 are equal or not and if they are equal then the program counter loads the next instruction and if they are not equal then the program counter loads the address of the label QUIT
That is branch if not equal to QUIT
Instr 4 : j 2500
The above instruction will load the program counter with 2500 that is the next instruction to be executed is at the address 2500 . so jump to 2500 is used
![ALU Shift left 2 instruction B1-26] Instruction 125-211 Read address register 1 Read truction 120-161 Read data 1 PC (6) register 2 131-01 ALU ALU Read Write n ALU Shift left 2 instruction B1-26] Instruction 125-211 Read address register 1 Read truction 120-161 Read data 1 PC (6) register 2 131-01 ALU ALU Read Write n](/WebImages/9/alu-shift-left-2-instruction-b126-instruction-125211-read-ad-1001025-1761515653-0.webp)