Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. .data #in: n, n intregi; out: poz maxim
  2. v: .space 400
  3. n: .space 4
  4.  
  5. .text
  6. main:
  7. li $v0 5
  8. syscall
  9. move $t0 $v0
  10. sw $t0 n
  11. li $t1 0 #iterator
  12. li $t2 0 #pointer
  13. li $t3 0 #max pos
  14.  
  15. readloop: bge $t1 $t0 finish
  16. li $v0 5
  17. syscall
  18. sw $v0 v($t2)
  19. lw $t4 v($t3)
  20.  
  21. bge $t4 $v0 cond
  22. move $t3 $t2
  23.  
  24. cond:
  25. addi $t1 1
  26. addi $t2 4
  27. j readloop
  28.  
  29. finish:
  30. li $v0 1
  31. move $a0 $t3
  32. syscall
  33.  
  34. li $v0 10
  35. syscall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement