Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我有一个直接的价值,比如:
.data sum: .word 0
在代码中进行了一些计算,并想将结果放回主内存中的“sum”中,我该怎么做?我一直在阅读该命令的手册,但我一定没有像我应该的那样理解概念。
对新手有帮助吗?
使用Store Word指令,sw。像往常一样,您必须使用寄存器来获取地址,或者如果汇编器提供此类支持,则让汇编器来处理。
Store Word
sw
假设您要$t0写入sum:
$t0
sum
la $t1, sum sw $t0, ($t1)
或者只是sw $t0, sum您的汇编程序将转换为等效代码。
sw $t0, sum