我正在编写一个 RISC-V 汇编程序,需要将一个字(保存到寄存器中)存储到一个 .data 段中:
.section .rodata
msg:
.string "Hello World\n"
.section .data
num:
.word 97
.section .text
.global _start
_start:
li a1, 100
sw a1, num
loop:
j loop
Run Code Online (Sandbox Code Playgroud)
但是当程序到达时,sw a1, num我收到错误“非法操作数`sw a1,num'”。如何将数据存储到 .data 段内的内存位置?你能给我一些提示吗?