你怎么使用gcc来生成Intel语法装配code? [英] How do you use gcc to generate assembly code in Intel syntax?

查看:235
本文介绍了你怎么使用gcc来生成Intel语法装配code?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GCC -S 选项将产生AT&放组装code; T语法,是有办法产生Intel语法文件?或者是有没有办法在两者之间转换?

The gcc -S option will generate assembly code in AT&T syntax, is there a way to generate files in Intel syntax? Or is there a way to convert between the two?

推荐答案

您是否尝试过这个?

gcc -S -masm=intel test.c

未经检验的,但我发现它在这个论坛如果有人声称,它为他们工作。

Untested, but I found it in this forum where someone claimed it worked for them.

我只是尝试这样做在Mac和它失败了,所以我在手册页看了看:

I just tried this on the mac and it failed, so I looked in my man page:

   -masm=dialect
       Output asm instructions using selected dialect.  Supported choices
       are intel or att (the default one).  Darwin does not support intel.

也许你的平台上运行。

It may work on your platform.

对于Mac OSX:

clang++ -S -mllvm --x86-asm-syntax=intel test.cpp

来源: http://stackoverflow.com/a/11957826/950427

这篇关于你怎么使用gcc来生成Intel语法装配code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆