Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .data
- prompt: .asciiz "Enter your age: "
- message: .asciiz "\nYour age is "
- .text
- #Prompt the user to enter age.
- li $v0, 4
- la $a0, prompt
- syscall
- # Get the user's age
- li $v0, 5 # scanf za integer
- syscall
- # Store the result in $t0
- move $t0, $v0
- # Display message
- li $v0, 4
- la $a0, message
- syscall
- # Print the age
- li $v0, 1
- move $a0,$t0
- syscall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement