Advertisement
LegoDrifter

MIPS kolku godini imas

Apr 18th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. .data
  2. prompt: .asciiz "Enter your age: "
  3. message: .asciiz "\nYour age is "
  4. .text
  5. #Prompt the user to enter age.
  6. li $v0, 4
  7. la $a0, prompt
  8. syscall
  9.  
  10. # Get the user's age
  11. li $v0, 5 # scanf za integer
  12. syscall
  13. # Store the result in $t0
  14.  
  15. move $t0, $v0
  16.  
  17. # Display message
  18. li $v0, 4
  19. la $a0, message
  20. syscall
  21. # Print the age
  22. li $v0, 1
  23. move $a0,$t0
  24. syscall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement