Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .data
- vectorA: .word 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
- vectorB: .word 100, 102, 102, 103, 104, 105, 106, 107, 108, 109
- .text
- main:
- la $t0 vectorA
- la $t1 vectorB
- li $t2 10
- add $t1 $t1 36 #NOS SITUAMOS EN ULTIMA POSICIÓN DEL VECTOR
- #la $t5 9
- loop:
- lw $t3 ($t0)
- lw $t4 ($t1)
- #add $t4 $t4 $t5
- #sub $t5 $t5 2
- move $t3 $t4
- sw $t3 ($t0)
- add $t0 $t0 4
- sub $t1 $t1 4 #VAMOS BAJANDO DE POSICIÓN DEL VECTOR
- sub $t2 $t2 1
- beqz $t2 fin
- b loop
- fin:
- li $v0 10
- syscall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement