I am learning inline assembly in C. As far as I can tell, the only difference between __asm { ... };
and __asm__("...");
is that the first uses mov eax, var
and the second uses movl %0, %%eax
with :"=r" (var)
at the end. Also, there are a lot less websites about the first. What other differences are there?
views:
132answers:
1
+4
A:
Which one you use depends on your compiler. This isn't standard like the C language.
Ben Voigt
2010-07-24 01:33:31
Uhm, yeah. The whole point of those leading underbars is to make it clear that this is non-standard.
Steven Sudit
2010-07-24 01:35:29