This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: inline assembly question
- To: egcs at cygnus dot com
- Subject: Re: inline assembly question
- From: Marc Lehmann <pcg at goof dot com>
- Date: Fri, 23 Jan 1998 22:21:29 +0100
- References: <m0xv5jp-000oLQC@mail.be.com>
On Wed, Jan 21, 1998 at 11:13:16AM -0800, Ficus Kirkpatrick wrote:
> and the Metrowerks format is like this:
>
> asm {
> push ecx
> mov ecx, [esp + 0xc]
> call [esp + 8]
> pop ecx
> ret
> }
pushl %ecx
movl 12(%esp),%ecx
call 8(%esp)
popl %ecx
ret
But please note that [esp+0xc] is probably refereing to a memory
location (either local variable or function parameter), and this
offset might be different when using gcc..
Please read the info files on how to correctly give an asm()
parameters (like function addresses etc..)
-----==- |
----==-- _ |
---==---(_)__ __ ____ __ Marc Lehmann +--
--==---/ / _ \/ // /\ \/ / pcg@goof.com |e|
-=====/_/_//_/\_,_/ /_/\_\ --+
The choice of a GNU generation |
|