开发者

MIPS Input Taking

开发者 https://www.devze.com 2023-02-01 05:59 出处:网络
How to take input in main function开发者_JS百科 in mips?It depends.If you are going to ask for an integer it should be

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 $a1instead of $a0 when printing it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号