Inline Assembly: Difference between revisions

m
no edit summary
[unchecked revision][unchecked revision]
m (Attempt to correct invalid information regarding asm volatile.)
mNo edit summary
Line 153:
 
Note that you might also be obliged to use '''_some_obscure_name''' (with a leading underscore), depending on your linkage options.
 
==asm goto==
Before gcc 4.5, jumping across inline assembly blocks is not supported. The compiler has no way of keeping track of what's going on,
so incorrect code is almost guaranteed to be generated.
You might have been told that "gotos are evil". If you believe that is so, then asm gotos are your worst nightmare coming true.
However, they do offer some interesting code optimization options.
 
asm goto's are not well documented, but their syntax is as follows:
<source lang="c">
asm goto( "jmp %l[labelname]" : /* no outputs */ : /* inputs */ : "memory" /* clobbers */ : labelname /* any labels used */ );
</source>
 
 
 
==Intel Syntax==
Anonymous user