首页 > 解决方案 > 为什么我的 .s 文件不能使用我的 Raspberry Pi VM 组装?

问题描述

我使用这个版本的 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 和一般组装的初学者,所以我完全不知所措。

标签: assemblyraspberry-piarmgnu

解决方案


推荐阅读