You are on page 1of 1

.

text
.globl main
main:

addi
addi
addi
li
mul

$s1, $0,0
#g=0
$s2, $0,5
#h=5
$s4, $0,1
#i=1 which would correspond to 1 in list
$t2,4
$t1, $s4,$t2
#t1=i*4

lw

$t0, list($t1)

#t0=A[i]

add

$s1, $s2, $t0

#answer should be 6 in reg.s1

list: .word 10,1,2,3,4,5,6,7,8,9

You might also like