Inline Assembly: Difference between revisions

Undo revision 7409 by Nekros (Talk)
[unchecked revision][unchecked revision]
m (Reverted edits by Nekros (Talk); changed back to last version by Walling)
(Undo revision 7409 by Nekros (Talk))
Line 44:
 
These labels are in a namespace of their own, and will not collide with any C identifiers. The same can be done for input operands, too.
==Input Operands==
 
The Input Operands allow to parameterize the ASM code; i.e., passing parameters from C code to ASM block. Again, string literals are used to specify the details.
Line 63:
 
The correct thing to do when input operands are written to is to list them as dummy outputs (instead of trying to list them as clobbers).
 
Here is a simple example:
<pre>
asm("mov %%eax,%%ebx": : "a" (amount));//useless but it gets the idea
</pre>
 
Eax will contain "amount" and be moved into ebx.
 
==Clobbered Registers List==
Anonymous user