Question: 6. Consider the following MIPS machine code. bne $0, $0, 2 addi $t0, $0, 5 addi $t1, $0, 10 What will be in $t0 and

6. Consider the following MIPS machine code.

bne $0, $0, 2

addi $t0, $0, 5

addi $t1, $0, 10

What will be in $t0 and $t1 after the above program is executed?

a. $t0 = 5, $t1 is unknown because 3rd statement will not be executed

b. $t1 = 10, $t0 is unknown because 2nd statement will not be executed

c. $t0 = 5, $t1 = 10

d. $t0 = 0, $t1 = 0

BONUS (5 points)

7.

addi $t0, $0, 3 add $s0, $0, 0 doLoop: addi $t0, $t0, -1 add $s0, $s0, $t0 bne $t0, $0, doLoop

addi $t0, $0, 3 add $s0, $0, 0 addi $t0, $t0, -1 add $s0, $s0, $t0 bne $t0, $0, -2

Consider the following code: What will be in $s0 after the program is executed?

OR

a. 1

b. 3

c. 6

d. Program will not terminate- it will loop forever.

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!