Question: 4 MIPS: Understand MIPS Code [ 1 8 pts ] An array of integers S is defined in the following code. Try to understand the
MIPS: Understand MIPS Code pts
An array of integers S is defined in the following code. Try to understand the code
and answer the following questions.
S: word
la $# load address of into $; suppose $
addi $$
move $$ #move the value of $ into $
$$
move $$
loop: addi $$
$$
ble $t $v skip # go to skip if $$
move $ $
move $ $
skip: bne $$ loop
What flowcontrol statement does ble $t $v implement? pts
To show that you fully understand the function of this program, briefly explain the usage
of the following registers in the program. That is what are these registers used for in
the program. For example, for register $ it stores the address of the last element of
array, indicating the end of array. pts
Registers: $$$$
Briefly explain the usage of the two instructions move $v $t; move $v $t
pts
Briefly explain the usage of the instruction bne $t $a loop. pts
Briefly explain the function of this program, suppose the desired outputs of the program
are the contents of the registers $ and $ pts
Determine the contents of the registers $v and $v after executing the code. pts
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
