• 1000 объясни мне, где я не прав? Потерпите пожалуйста :) Спасибо
.data
str: .asciiz " "
v1 : .word 3, 10, 5, 22, 13
v2 : .word 7, 1, 9, 16, 8
.text
la $a1, v1
la $a2, v2
addi $sp, $sp, -20
sw $s1, 0($sp)
add $t0, $0, $0 # i = 0
somma: slti $t1, $t0, 5 #if i < 5 continua else esci
beq $t1, $0, esci
sll $t2, $t0, 2 # i = i * 4
add $t3, $a1, $t2 # $t2 = v1 + i*4
add $t4, $a2, $t2 # $t3 = v2 + i*4
lw $t3, 0($t3) #$t3 = v1[i]
lw $t4, 0($t4) #$t4 = v2[i]
add $s1, $t3, $t4 # v3 = v1 + v2
addi $t0, $t0, 1
j somma
esci:
add $t0, $0, $0 # i = 0
stampa: slti $t1, $t0, 5 # se i<5 continua else fine
beq $t1, $0, fine
lw $a0, 0($sp)
li $v0, 1
syscall
li $v0, 4
la $a0, str
addi $t0, $t0, 1
addi $sp, $sp, 4
syscall
j stampa
fine: li $v0, 10
syscall