Quote Originally Posted by George2 View Post
Thanks Elysia and Mats,


Do you know whether Microsoft provides online free manual for the assembly language guide with Visual Studio (i.e. how Visual Studio compiler's assembly language looks like, e.g. which register is used to hold this pointer or something, other than a general assembly language guide)?


regards,
George
The calling conventions for each of the supported language and processor type is documented in the respective language on MSDN, e.g: http://msdn2.microsoft.com/en-us/lib...58(VS.71).aspx

For C/C++ 32-bit x86 it is roughly (I wrote that before looking at MSDN):
EAX - return value, otherwise scratch register.
EDX - upper 32-bits of 64-bit return value, otherwise scratch register.
ECX - this when using "thiscall", otherwise scratch.
EBX - preserved by callee.
EDI - preserved by callee.
ESI - preserved by callee.
EBP - preserved by callee.
ESP - stack pointer - varying between call form whether caller or callee cleans up arguments.

I think EAX, EDX and ECX are used for the three first args in "fastcall" calling convention - but I may be wrong on the exact registers.

--
Mats