How can I print an array in Mips64? I've succeeded in printing the array in QtSPIM (MIPS32), with this code:
.data
array: .word 10 20 30 40 50
.text
#load base address of array
la $t1,array
#load number of elements
ld $t2,num
loop:
#load word
lw $a0, ($t1)
#print element
li $v0,1
syscall
#print space
la $a0, space
li $v0,4
syscall
addi $t1,4
#increase counter
addi $t0, 1
bne $t0,$t2,loop
#end
li $v0,10
syscall
I know that MIPS64 has daddi
instead of addi
but I am still missing something.