3 ms·
Trust me, at least on Intel, you do not want to write assembly inside your C/C++ code, unless it's just a couple of lines. The usual AT&T syntax will drive you
by jwr 3y ago
Trust me, at least on Intel, you do not want to write assembly inside your C/C++ code, unless it's just a couple of lines. The usual AT&T syntax will drive you nuts, and the additional syntax for embedding assembly only adds to the misery.
For any reasonable amounts (say, you want a function or several) of assembly, you want Intel syntax and standalone assembly files.
NASM is a great tool, although YASM should also be mentioned: https://yasm.tortall.net https://yasm.tortall.net — YASM is what I used when I optimized an H.264 decoder for Intel-compatible CPUs way back in 2005 or so.
- kouteiheika 3y ago> The usual AT&T syntax will drive you nuts, and the additional syntax for embedding assembly only adds to the misery. It's trivial to enable Intel syntax in inline assembly even under GCC. And if you're using Rust instead of C or C++ then the inline assembly syntax is actually really great and very pleasant to use.