Mips Array/Loop assistance
I am working on a small Mips program for my Comp Organization class and I am having an impossible time with advancing an array which I wish to print integers from. I have a loop that terminates at the proper interval however I cannot seem to get the next value in the array.
I have tried bit shifts which leads to to either print the first value followed by a constant set of the second value or leads to memory address faults. I have tried adding 4 to the address in an attempt to move to the next 4 bytes. I am at a loss. I have reviewed the text, the class slides, and days of google searches. Can someone help me see a solution? Code attached.
bytes: .word 4
values: .word 17
.asciiz "The 32-bit integers are\n"
# Your code goes below this line
li $v0, 4 # Load print sys command
la $a0, wordString # Load wordString to $a0
la $s2, values # Load address of array
lw $a0, 0($s2) # Load address to arg
la $t2, numWords # Load number of words
lw $s1, 0($t2) # Set loop upper bound to numWords
li $s0, 0 # Set loop lower bound to 0
li $v0,1 # Load Print int sys call
add $s2, $s2, 4 # Advance memory to next four bytes
addi $s0, $s0, 1 # Add 1 to loop indexer
bne $s0, $s1, WordLoop # If loop equals less than word count continue
j Exit # Else exit
jr $ra # Jump to return addr ($ra)