inline assembly question

Marc Lehmann pcg@goof.com
Fri Jan 23 13:22:00 GMT 1998


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



More information about the Gcc mailing list