This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Inline ASM and stack/base pointer
- From: Daniel Mierswa <impulze at impulze dot org>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 09 Jun 2011 16:38:30 +0000
- Subject: Inline ASM and stack/base pointer
Hi list,
I was wondering how to overcome the issue that evolves when parameters
(inputs) to the inline assembly are passed relative to ebp/esp and
modifying those pointers in the inline assembly. Basically
__asm__("push %ecx\nmov %0, %edx\n"::"m"(variable)); could set '%0' to
4(%esp) or similar which would no longer represent the same location
once I use push/pop in my asm. Is it possible to explicitly state that
GCC passes those relative to esp _or_ ebp so I can safely modify at
least one pointer (i.e. reserve stack space)? Or are there any other
ways to overcome this issue? Thanks in advance.
--
Mierswa, Daniel
If you still don't like it, that's ok: that's why I'm boss. I simply
know better than you do.
--- Linus Torvalds, comp.os.linux.advocacy, 1996/07/22