Advertisement
Silver_Smoulder

[ASM} Project 1 I/O

Oct 15th, 2019
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. .globl main
  2. .text
  3.  
  4. main:
  5. li $v0, 4 #output the string
  6. la $a0, inline
  7. syscall
  8.  
  9. li $v0, 5 #read in the number
  10. syscall
  11.  
  12. move $t1, $v0 # store in t0 (technically unnecessary)
  13.  
  14. li $v0, 4 #output the endstring
  15. la $a0, outline
  16. syscall
  17.  
  18. move $a0, $t1 #put the integer into a0
  19. li $v0, 1 #output the integer
  20. syscall
  21.  
  22. li $v0, 10 #end the program
  23. syscall
  24.  
  25.  
  26. .data
  27. inline:
  28. .asciiz "Please input your integer: "
  29. outline:
  30. .asciiz "Your output is: "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement