Reading an integer into a local variable in MIPS

2020-06-17 04:15发布

问题:

How can I read an integer into a local variable in MIPS ? Is it possible? The problem asks me to use the concept of assigning integer variables as local variables. #A question from my text book. And by the way , not a homework!

Thanx in advance! :D

回答1:

li $v0, 5
syscall
move $t0, $v0

The value is now in $t0. This will read the integer from the console.