flat assembler
Message board for the users of flat assembler.
Index
> Windows > Hot to use the REGISTERS correctly ? |
Author |
|
StringCheesian 21 Apr 2004, 21:57
Although some registers have prescribed uses (like ECX is traditionally the loop counter), that's merely a suggestion - you can use them for whatever you want. It doesn't matter.
|
|||
21 Apr 2004, 21:57 |
|
vid 22 Apr 2004, 08:29
but better do not use ESP, if you dont know what you are doing.
don't use EBP if you use standard procedure (macros like "proc", "enter", "return" etc.) in callback procedures (those called by windows, for example window procedure) preserve value of ESI, EDI, EBP, EBX other genereal purpose registers (GPRs, that are EAX, EBX, ECX, EDX, ESI, EDI, ESP, EBP and their parts like AX, DL, CH etc.) are used idfferently, not with "mov", "add" etc. |
|||
22 Apr 2004, 08:29 |
|
Stcherbatchenko 22 Apr 2004, 08:33
heh you lost me there VID *blushes* can you explain more breifly am just a new
|
|||
22 Apr 2004, 08:33 |
|
roticv 22 Apr 2004, 08:43
ebx, edi and esi are usually used as pointers, and used when the coder do not want to have values changed after calling some winapi. Some opcodes are shorter with certain registers. For instance xchg eax, ebx is 1 byte shorter than xchg ebx, ecx. Also for the case of div xx, where xx is a register or a memory, it is assumed that the 64bit to be divided is in eax and edx. eax containing the lower 32bit and edx the upper 32 bits
My word of advice for esp and ebp is not to touch it unless you know what you are doing. |
|||
22 Apr 2004, 08:43 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.