0

因此,正如您从标题中看到的那样,我面临一个问题,我使用sw 命令将“虚拟”数据初始化为 0,这样我就可以存储其他字母。这是我的代码,我也使用过sb,但出现“超出范围”错误。

main:
            addi a7,x0,9  # Direction to ecall for memory allocation
            addi a0,x0,8  # a0 specifies size for allocation
            ecall
            # a7 contains the pointer to newly allocated Memory
            sw x0,0(a7) # dummy's data = zero
            sw x0,4(a7) # dummy's pointer = zero

我在 main 之前使用.align 2,有人能告诉我为什么我会收到这个错误吗?

4

0 回答 0