作者:小短腿Tel | 来源:互联网 | 2023-05-19 01:02
Accordingtosomedocumentationandthisanswer,itispossibletouseGASinLinuxwiththeIntels
According to some documentation and this answer, it is possible to use GAS in Linux with the Intel syntax instead of the default AT&T syntax.
根据一些文档和这个答案,可以在Linux中使用带有英特尔语法的GAS,而不是默认的AT&T语法。
I tried to compile the following simple code, contained in a dedicated file file.s
:
我试着编译以下简单的代码,包含在一个专门的文件文件中。
.intel_syntax noprefix
section .data
section .text
global _start
_start:
mov eax, 1 # some random comments
mov ebx, 0
int 80h
If I run as file.s -o file.o
, the following error is produced:
如果我以文件的形式运行。s - o文件。o产生以下错误:
is2_exit.s: Assembler messages:
is2_exit.s:3: Error: no such instruction: `section .data'
is2_exit.s:5: Error: no such instruction: `section .text'
is2_exit.s:6: Error: no such instruction: `global _start'
is2_exit.s:13: Error: junk `h' after expression
It seems that the .intel_syntax
is not considered at all. What's wrong?
似乎根本不考虑.intel_syntax。怎么了?
1 个解决方案