int x;
__asm __volatile("movl %0, %%sp":"=r"(x)::"%sp");
I want to store sp to x.
The error:
error: unexpected token in operand
__asm __volatile("movl %0, %%sp":"=r"(x)::"%sp");
^
:1:13: note: instantiated into assembly here
movl r0, %sp
^
1 warning and 1 error generated.
I have found my solution:
asm volatile("mov %0, sp \n\t":"=r"(x));
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