为什么我的.s文件无法使用Raspberry Pi VM组装?

时间:2018-09-28 19:50:24

标签: assembly raspberry-pi arm gnu risc

我使用this version of raspberry pi创建了一个虚拟机。我正在尝试汇编简单的汇编程序“ program.s”

.global _start
_start: 
        mov    r0,#0 @ exit status code 0 for normal completion
        mov    r7,#1 @ service command 1 terminates this program
        svc    0     @ issue linux command to terminate program

组装
as -o program.o program.s

给予

GNU assembler version 2.28 (i686-linux-gnu) using BFD version (GNU Binutils 
for Debian) 2.28
e.s: Assembler messages:
e.s:6: Error: expecting operand after ','; got nothing
e.s:7: Error: expecting operand after ','; got nothing
e.s:8: Error: no such instruction: `svc 0'

我不认为问题出在代码上,而是与汇编程序试图汇编的汇编类型有关。我是Raspberry Pi和组装的入门者,所以我完全不知所措。

0 个答案:

没有答案