Advertisement
Alhiris

Mips problem3(vector pare)

Oct 22nd, 2019
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. .data
  2. v: .space 400
  3. n: .space 4
  4. sp: .asciiz " "
  5. .text
  6. main:
  7. li $v0,5
  8. syscall
  9. sw $v0,n
  10. lw $t0,n
  11. li $t1,0
  12. li $t2,0
  13. for:
  14. bge $t1,$t0,exit
  15. li $v0,5
  16. syscall
  17. sw $v0,v($t2)
  18. lw $t5,v($t2)
  19. li $t6,2
  20. rem $t3,$t5,$t6
  21. beq $t3,$0,afisare
  22. continue:
  23. addi $t1,1
  24. addi $t2,4
  25. j for
  26. afisare:
  27. move $a0,$t5
  28. li $v0,1
  29. syscall
  30. la $a0,sp
  31. li $v0,4
  32. syscall
  33. j continue
  34. exit:
  35. li $v0,10
  36. syscall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement