0
votes

I do not understand why when Mars runs the function it prints the numbers in the array but not the new line. Can you help me?

stampaC:

lw $t6,0($a1)       

#Stampo c[i]
li $v0, 1
move $a0, $t6   
syscall

li $v0, 4
la $a0, a_capo
syscall

addi $a1,$a1, 4     
addi $a3,$a3, 1     #i++

bne $a3, 10, stampaC    #Continua fino a quando i=10
jr $ra
1

1 Answers

0
votes

Assuming you are trying to print a newline with the a_capo literal, I guess you are not defining correctly that literal.

In your .data section you should write

a_capo: .asciiz "\n"

Then, this snippet should print a newline:

  li $v0, 4
  la $a0, a_capo
  syscall