Question: Given the following assembly language program snippet: sum: slti $t 0 , $s 0 , 1 # test $s 0 bne $t 0 , $zero,
Given the following assembly language program snippet:
sum: slti $t $s # test $s
bne $t $zero, sumexit # go to sumexit if $s
add $s $s $s # add $s to $s
addi $s $s # subtract from $s
j sum
sumexit:
Answer the following parts of this question with answers that are no more than sentences long. Please do not provide any answers that are more than sentences long:
a Which of the following instructions use Immediate addressing mode?
b What register or registers have their contents changed in the assembly language program snippet?
c What register or registers do not have their contents changed in the assembly language program snippet?
d Suppose the $s register has the value and the $s register has the value before the instructions of the snippet are executed. What value does $s have once the sumexit label is branched to
e The $t register has a minimum integer value it will hold by the time all of the instructions of the snippet are executed. What is that minimum integer value, or Please state your answer as or or or
f Suppose $s contains some unsigned integer value N before the before the instructions of the snippet are executed. Since $s contains the value N before the instructions of the snippet are executed, how many total times will the j instruction be executed?
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
