I've been using GCC pretty much exclusively for the last several months, and I really like it compared to MSVC, but there is one aspect of GCC that I cant stand and luckily have not had to use too much, until now, and that is inline ASM.
First off, I can't stand AT&T syntax, which is the default. I refuse to even look at the stuff, I'll run it through a conversion program if I have to. That by itself isn't too much of a problem since GCC does have a
-masm=intel option, but the other problem I have is how you inline the code. It's extremely clumsy and confusing for me. In MSVC, it's so easy and clean there is no contest.
Code: Select all
int FuncAdd(int a, int b)
{
_asm
{
mov eax, a
add eax, b
}
}
It doesn't get any simpler or cleaner than that, at least not from my point of view. I realise GCC has to support more architectures than I could even name off the top of my head, and this is probably why they chose to do it the way they did, but I need something that works for me, and I don't target hardware other than x86/AMD64. I've read that Apples' GCC has a option
-fasm-blocks which allows you to use the same style asm syntax as MSVC. Is there some sort of identical extension I could use with GCC?