The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Bora on December 30, 2007, 12:01:30 PM

Title: The changes in the registers and flags in the c functions
Post by: Bora on December 30, 2007, 12:01:30 PM
Some functions change some registers , flags . Is there any list about this. Maybe you will say the implementations change from compiler to compiler , so i need the list of msvcrt.dll if there is one.
Title: Re: The changes in the registers and flags in the c functions
Post by: Vortex on December 30, 2007, 12:43:38 PM
Hello Bora,

Calls to API functions are preserving the value of ebx,esi,edi,ebp. If you create your own callback functions, don't forget to preserve the value of those registers. The other registers for general purpose usage eax,ecx and edx can be modified by API functions or user-defined functions. The value of esp should be observed after a call to a C function like wsprintf. ( Normally, invoke takes care of stack balancing. )

To get the list of exported functions by msvcrt.dll :

\masm32\bin\dumpbin /EXPORTS C:\windows\system32\msvcrt.dll

For more information about register preservation :

http://win32assembly.online.fr/tut1.html
Title: Re: The changes in the registers and flags in the c functions
Post by: Bora on December 30, 2007, 01:40:39 PM
Thank you  :U