My asm knowledge is so limited, I need to know the following codes:
movl %%esp %0
Does %0
represent a register, a memory address, or something else? What does the %0
mean?
It represents some input/output operand. It allows you to make use of your C variables in your assembly code. This page has some nice examples.
%0
is just the first input/output operand defined in your code. In practice, this could be a stack variable, a heap variable or a register depending on how the assembly code generated by the compiler.
For example:
int a=10, b;
asm ("movl %1, %%eax;
movl %%eax, %0;"
:"=r"(b) /* output */
:"r"(a) /* input */
:"%eax" /* clobbered register */
);
%0
is b
in this case and %1
is a
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With