Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. .data
  2. array: .space 400 .align 2
  3. test: .asciiz "test: "
  4.  
  5. .text
  6.  
  7. main:
  8.  
  9. la $t0, array #load array address onto register
  10. move $t1, $0 #variable i initialized as zero
  11. li $t2, 8 #initialize to a, also loop limit condition
  12. move $t3, $0 #initialize b as zero
  13.  
  14. array_start:
  15.  
  16. beq $t1, $t2, array_end
  17. add $t3, $t2, $t1
  18. sw $t3, ($t0)
  19. addi $t0, $t0, 4
  20. addi $t1, $t1, 1
  21.  
  22. li $v0, 11
  23. li $a0, 0xA
  24. syscall
  25. li $v0, 4
  26. la $a0, test
  27. syscall
  28. li $v0, 11
  29. li $a0, 0xA
  30. syscall
  31.  
  32.  
  33. j array_start
  34.  
  35.  
  36.  
  37. li $v0, 10
  38. syscall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement