This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: bnez$t1, loop#check if zero, if not, keep going in loop la$t4, Array1#begin array address again move$t1, $t2#reinitialize li$v0, 4#load print string la$a0, promptsum#load address of "prompt sum" syscall#print it la$t5, Zero#load a zero value lw$a0, 0($t5)#zero $a0 register to reset the value sumloop: lw$t3, 0($t4)#load the element from array to $t3 add$a0, $a0, $t3#add and place in the field addi$t4, $t4, 4 addi$t1, $t1, -1 bnez$t1, sumloop Sheet1 Page 2 move$t6, $a0 la$v0, 1 syscall la$t4, Array1#begin array address again la$t7, Array1#begin array address again move$t1, $t2#reinitialize move$a0, $t5 li$v0, 4 la$a0, promptavg syscall div$t6, $t1 mflo$a0 li$v0, 1 syscall setnumb: lw$t3, 0($t4)#load the element from array to $t3 #UNFINISHED End: li $v0, 10 syscall...
View Full Document
This note was uploaded on 03/11/2008 for the course CS 264 taught by Professor Salloum during the Spring '08 term at Cal Poly Pomona.
- Spring '08