public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Inline ASM and stack/base pointer
@ 2011-06-09 15:22 Daniel Mierswa
  2011-06-09 18:09 ` Ian Lance Taylor
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Mierswa @ 2011-06-09 15:22 UTC (permalink / raw)
  To: gcc-help

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-06-09 20:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-09 15:22 Inline ASM and stack/base pointer Daniel Mierswa
2011-06-09 18:09 ` Ian Lance Taylor
2011-06-09 18:47   ` kevin diggs
2011-06-09 19:53     ` Ian Lance Taylor
2011-06-09 20:26   ` Daniel Mierswa
2011-06-09 20:41   ` Daniel Mierswa
     [not found]     ` <BANLkTikg+N_E=OYU-wU2Od=2rsh=K=Ktsg@mail.gmail.com>
2011-06-09 23:12       ` Daniel Mierswa
2011-06-10  1:21         ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).