1

这是我要组装的文件(文件名:asmtut3.s):

.global _start
_start:
MOV R0, #20
MOV R7, #1
SWI 0

当我尝试使用以下方法组装它时:

as -o asmtut3.o asmtut3.s

我得到错误:

asmtut3.s: Assembler messages:
asmtut3.s:3: Error: expecting operand after ','; got nothing
asmtut3.s:4: Error: expecting operand after ','; got nothing
asmtut3.s:5: Error: no such instruction: `swi 0'

我正在运行 Fedora 25,如果这有帮助吗?

4

1 回答 1

1

使用arm-none-eabi-as代替as

arm-none-eabi-as -o asmtut3.o asmtut3.s
于 2021-12-12T07:04:15.707 回答