flat assembler
Message board for the users of flat assembler.
Index
> Windows > WinAPI clobbered registers, win32 |
Author |
|
Picnic 19 Apr 2010, 15:57
|
|||
19 Apr 2010, 15:57 |
|
cod3b453 19 Apr 2010, 21:02
ebx is the only register I've never seen get clobbered. It's also very random from what I remember.
|
|||
19 Apr 2010, 21:02 |
|
LocoDelAssembly 19 Apr 2010, 21:14
So, there actually exist violations to stdcall convention in the Windows API? Do you remember an example?
|
|||
19 Apr 2010, 21:14 |
|
cod3b453 19 Apr 2010, 21:35
GetPixel (gdi32) trashes ecx
|
|||
19 Apr 2010, 21:35 |
|
mindcooler 19 Apr 2010, 21:36
Hmm, I must have been dreaming. I checked all the calls in my current project, and they only clobber eax, ecx and edx. Of course esp and eip change too, but I could have sworn I saw esi and edi change. Must have been tired :S
|
|||
19 Apr 2010, 21:36 |
|
LocoDelAssembly 19 Apr 2010, 21:45
Quote:
I mean, any that violates the stdcall convention, i.e., not returning you EBX, ESI, EDI and EBP untouched and ESP restored to the value previous to the first pushed argument. [edit]Of course, I mean only those that are specified to be stdcall, so don't mention wsprintf as one not restoring ESP as per stdcall convention [/edit] |
|||
19 Apr 2010, 21:45 |
|
Tyler 20 Apr 2010, 05:14
WinAPI = stdcall, here's a good explanation of stdcall.
|
|||
20 Apr 2010, 05:14 |
|
revolution 20 Apr 2010, 05:18
Tyler wrote: WinAPI = stdcall wsprintf wrote: Unlike other Windows functions, wsprintf uses the C calling convention (_cdecl), rather than the Pascal calling convention. As a result, it is the responsibility of the calling process to pop arguments off the stack, and arguments are pushed on the stack from right to left. In C-language modules, the C compiler performs this task. |
|||
20 Apr 2010, 05:18 |
|
Tyler 20 Apr 2010, 06:50
A function defined as WinAPI is stdcall, otherwise it's not WinAPI because WINAPI is macro defined as _stdcall in the Windows headers. I see your point though, I meant only functions that were literally defined as WINAPI in Window's headers.
|
|||
20 Apr 2010, 06:50 |
|
cod3b453 20 Apr 2010, 09:51
LocoDelAssembly wrote:
|
|||
20 Apr 2010, 09:51 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.