Question: 1 . Show the machine code for the branch not equal ( bne ) instruction in the following program. ( PC Relative Addressing ) #

1. Show the machine code for the branch not equal (bne) instruction in the following program. (PC Relative Addressing)
# MIPS assembly code
0x40 loop: add $t1, $a0, $s0
0x44 lb $t1,0($t1)
0x48 add $t2, $a1, $s0
0x4C sb $t1,0($t2)
0x50 addi $s0, $s0,1
0x54 bne $t1, $0, loop
0x58 lw $s0,0($sp)
a) What addressing type does the bne instruction use?
b) Calculate the immediate field and write the machine code in binary and hex.
2. Convert the following I type instructions from MIPS to Machine code. (base addressing)
a) lw $s0,12($t0)
3. Convert the following I type instructions from MIPS to Machine code. (immediate addressing).
a) addi $t0, $t1,25
b) andi $t0, $t1,0xABCD1234
4. Machine to MIPS Code. Assume PC =0x 40404040. Find where the address where the label named "target" is located.
a)00001101000000000000000000000101

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!