Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1.  
  2. main:
  3. la $t0, vals #declares the array
  4. li $t4, 1111 #declares the 1111 loop termination
  5. li $t5, 0 #declares array index counter
  6. li $t6, 0 #declares the variable i
  7. li $t7, 0 #declares the variable j
  8. li $s6, 0
  9. li $t9, 0 #counter for memory address +4
  10.  
  11.  
  12. la $a0, inputdirections #loads the syscall to print the input directions
  13. li $v0, 4
  14. syscall
  15.  
  16. li $v0, 5 #loads the syscall to read an interger
  17. syscall
  18. move $t1, $v0
  19.  
  20.  
  21. LOOP:
  22. beq $t1, $t4, DONE
  23.  
  24. li $v0, 5
  25. syscall
  26. move $t0, $v0
  27.  
  28. addi $t9, $t9, 4 # keeps track of memory address.
  29. sw $t1, ($t0)
  30.  
  31. addi $t5, $t5, 1 #incriments n
  32.  
  33. j LOOP
  34.  
  35. DONE:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement