EBX use (was Issues about cygwin)

Trevor Yann TYann@vet.com.au
Mon Jun 12 16:16:00 GMT 2000

It appears the Visual C generates code that assumes that the EBX
register is preserved across function calls. From the Visual C doco:

Argument Passing and Naming Conventions

All arguments are widened to 32 bits when they are passed. Return values
are also widened to 32 bits and returned in the EAX register, except for
8-byte structures, which are returned in the EDX:EAX register pair.
Larger structures are returned in the EAX register as pointers to hidden
return structures. Parameters are pushed onto the stack from right to

The compiler generates prolog and epilog code to save and restore the
ESI, EDI, EBX, and EBP registers, if they are used in the function.

"cgf@cygnus.com" wrote:
> Does anyone know if this is necessary.  Is there actually code out there which
> relies on ebx being saved?
> As a side note, does anyone understand the fascination some people have with
> exclamation points?
> cgf
> ----- Forwarded message from Nick Kurshev <nickols_k@mail.ru> -----
> From: "Nick Kurshev" <nickols_k@mail.ru>
> To: "cgf@cygnus.com" <cgf@cygnus.com>
> Subject: Issues about cygwin
> Date: Fri, 09 Jun 2000 15:01:48 +0000 (:)
> Reply-To: "Nick Kurshev" <nickols_k@mail.ru>
> Priority: Normal
> Hello!
> I have done some tests of my project under Win32.  As suggestions I want
> to tell you, that win32 dll's is not always save register ebx! Better to
> recompile cygwin with -fcall-used-ebx key! It some grow size of code,
> but produced most reliable code under Win32!
> Best regards! Nick
> ----- End forwarded message -----

More information about the Cygwin-developers mailing list