Question: 1. Consider the program: .data myArray: .word 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 .text la $s0, myArray li $s1, 0 loop:
1.Consider the program:
.data
myArray: .word 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
.text
la $s0, myArray
li $s1, 0
loop: sll $t0, $s1, 2
add $t0, $t0, $s0
lw $s2, 0($t0)
lw $s3, 4($t0)
add $s2, $s2, $s3
sw $s2, 0($t0)
addi $s1, $s1, 1
slti $t1, $s1, 9
bne $t1, $zero, loop
.end
Explain what does this program do? How is the data bound from the .data segment to the base address register $s0? What address does Spim use for 0th element of array in $s0?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
