How to take input in main function in mips?
Asked
Active
Viewed 371 times
1 Answers
1
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.

Ashir
- 511
- 2
- 8
- 24