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?
The gcc -S option will generate assembly code in AT&T syntax, is there a
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
-masm=intelThat works with GCC, and Clang 3.5 and later. GCC manual:
For macOS, note that by default, the
gcccommand actually runs Clang unless you’ve installed actual GCC (e.g. from Brew). Modern clang supports-masm=intelas a synonym for this, but this always works with clang:Note that until clang 14, this does not change how clang processes inline
asm()statements, unlike for GCC.These are the options used by Matt Godbolt’s Compiler Explorer site by default: https://godbolt.org/
See also How to remove "noise" from GCC/clang assembly output? for other options and tips for getting asm output that’s interesting to look at.