I don't know QtSpim's syntax but the syntax of sw instruction is sw $t, offset($s)
. So you need to use
sw $t0, n($zero)
or
la $t1, n
sw $t0, 0($t1)
Вопрос
I am using QtSpim
say I have this code to get the input:
.data
n: .word
.text
.global main
main:
li $v0, 5
syscall
move $t0, $v0
is it possible to store the value of $t0 into n ?
Решение
I don't know QtSpim's syntax but the syntax of sw instruction is sw $t, offset($s)
. So you need to use
sw $t0, n($zero)
or
la $t1, n
sw $t0, 0($t1)