helinix 0 Newbie Poster

Hi , i want to write Mips Assembly code to increment the elements of an array. i've written this :
#AIncrement.s -- A program that increments the elements of an array
##################################
main:
.data

list : .word 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
.text
move $t4,$zero
addi $t4,$t4,1
addi $t4,$t4,1
addi $t4,$t4,1
addi $t4,$t4,1
Loop:

la $s0, list # put address of list into $s0
move $t3,$zero # loop variable= 0 int i = 0
add $t1,$t3,$t3 #Temp reg $t1 = 2 * i
add $t1,$t1,$t1 #Temp reg $t1 = 4 * i
add $t1,$t1,$s0 #$t1 = address of A
lw $t0,0($s0) #Temporary reg $t0 = A
addi $t0,$t0,1 #incrementing
sw $t0,0($s0)
addi $t3,$t3,1
bne $t3,$t4,Loop

li $v0,10
syscall
#end of the program
########################
When i use SPIM simulator the file is successfully loaded, but when i
hit the go button just nothing happens, is there anything wrong with my code ?

thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.