News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Multithreaded Application Sharing Code.

Started by AgentSmithers, June 11, 2009, 03:46:21 AM

Previous topic - Next topic

MichaelW

QuoteWhat does ECX and EDX return from something as simple as sleep?

EAX, ECX, and EDX are by convention "scratch" registers that the called function can use without preserving their values. If the value of one of these registers needs to be preserved around a function call then you need to add code to do that. As an alternative, you can place values that need to be preserved in registers that the called function will preserve (e.g. EBX, ESI, EDI), but if the code is in a callback, or might be called from a callback, the values in these registers must be preserved around the code that is altering the value. The general recommendation for procedures is to preserve any of these registers that the procedure alters on entry, and restore them on exit.

See calling_conventions.pdf here.
eschew obfuscation