Yasm 使用 intel 语法编译 64 位代码

Posted

技术标签:

【中文标题】Yasm 使用 intel 语法编译 64 位代码【英文标题】:Yasm compiling 64 bit code with intel syntax 【发布时间】:2013-01-08 14:26:23 【问题描述】:

我有这个文件:

.code64
pop %rbx

使用 yasm 编译得很好,带有以下指令:

yasm.exe asm.asm -o asm.bin -m amd64 --parser=gas

我的问题是:有没有办法使用 nasm 解析器通过 intel 语法编译 64 位代码?我不太喜欢 AT&T 语法

【问题讨论】:

【参考方案1】:

请参阅yasm manual about the BITS directive。

bits 64
pop rbx
yasm.exe asm.asm -o asm.bin -m amd64

【讨论】:

以上是关于Yasm 使用 intel 语法编译 64 位代码的主要内容,如果未能解决你的问题,请参考以下文章