MIPS Input Taking
How to take input in main function开发者_JS百科 in mips?
It depends. If you are going to ask for an integer it should be
li $v0, 5
syscall
If you are going to ask for a float should be
li $v0, 6
syscall
If you are going to ask for a double it should be
li $v0, 7
syscall
And if you are going to ask for an string it should be
li $v0, 8
syscall
But, if you are going to ask for an string and the input is going to take maximum number of characters, then you should use $a1
instead of $a0
when printing it.
精彩评论