Advertisement
11eimilia11

Untitled

Oct 6th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1.  
  2. .data
  3. v: .space 40 # criando o vetor 'v' e alocando 40 bytes
  4.  
  5. .text
  6. # colocando o endereço inicial de v em $s0 (irá ser o endereço base do vetor)
  7. la $s0, v
  8.  
  9. # setando os valores de cada posição do vetor em registradores temporários
  10. addi $t0, $zero, 1
  11. addi $t1, $zero, 3
  12. addi $t2, $zero, 2
  13. addi $t3, $zero, 1
  14. addi $t4, $zero, 4
  15. addi $t5, $zero, 5
  16.  
  17.  
  18. # escrevendo na memória os valores do vetor, usando $s0 como endereço base do vetor
  19. sw $t0, 0($s0)
  20. sw $t1, 4($s0)
  21. sw $t2, 8($s0)
  22. sw $t3, 12($s0)
  23. sw $t4, 16($s0)
  24. sw $t5, 20($s0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement