문제

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)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top