LegoDrifter

MIPS - scanf za char

Apr 18th, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. .data
  2. message: .asciiz "Hello, "
  3. userInput: .space 20
  4. .text
  5. main:
  6. # Getting user's input as text
  7. li $v0, 8
  8. la $a0, userInput
  9. li $a1, 20
  10. syscall
  11.  
  12. #displays Hello
  13. li $v0, 4
  14. la $a0, message
  15. syscall
  16. #Displays the name
  17. li $v0, 4
  18. la $a0, userInput
  19. syscall
  20.  
  21. #Tell the system this is the end
  22. li $v0,10
  23. syscall
Advertisement
Add Comment
Please, Sign In to add comment