This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: inline assembly question


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                        |
                                                          |


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]