.data
message: .asciiz "Hello, "
userInput: .space 20
.text
.globl main
main:
#get the message of userInput to $a0
li $v0,8
la $a0,userInput
li $a1,20 #tell how long the array is
syscall
#input message-> $a0 -> the storage : userInput
li $v0,4
la $a0,message
syscall
li $v0,4
la $a0,userInput
syscall
#tell the system this is the end of the main
li $v0,10
syscall
22_getting_user_input_text(MIPS)
最新推荐文章于 2024-07-22 18:58:45 发布