You should use service 5 to read an integer, 6 to read a float, 7 for a double and service 8 to read a string. See MARS reference for syscall services provided.
Here goes an example that reads an integer and a string from console and holds the results in variables number
and buffer
:
.data
number: .word 0
buffer: .space 80
.text
li $v0, 5 # service 5 reads integer from console
syscall
sw $v0, number # Store read integer into number
li $v0, 8 # service 8 reads a string
la $a0, buffer
li $a1, 80 # buffer size
syscall # input text will be stored in buffer
li $v0, 7 # service 7 reads double
syscall # $f0-$f1 contains the double read
mov.d $f2, $f0
syscall # read another double
div.d $f12, $f2, $f0 # Divide the first double by the second double
li $v0, 3
syscall # Print result of division