Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. .data
  2. prompt0: .asciiz "Did "
  3. prompt2: .asciiz " iterations"
  4.  
  5. .text
  6. .globl main
  7.  
  8. main:
  9. li $s1, 0
  10. li $t0, 5
  11. li $t2, 2
  12. li $t3, 1
  13. li $t4, 10
  14.  
  15. loop:
  16. bge $s1, $t4, end
  17. add $s1, $s1, $t2
  18. sub $t0, $t0, $t3
  19. j loop
  20.  
  21. end:
  22. li $v0, 4
  23. la $a0, prompt0
  24. syscall
  25. li $v0, 1
  26. move $a0, $t0
  27. syscall
  28. li $v0, 4
  29. la $a0, prompt2
  30. syscall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement