In OllyDbg the registers window, among other things, lists the standard cpu-registers:
EAX
ECX
EDX
EBX
Is there a particular reason why EBX is displayed last?
In OllyDbg the registers window, among other things, lists the standard cpu-registers:
EAX
ECX
EDX
EBX
Is there a particular reason why EBX is displayed last?
PUSHAD
is the instruction which gave me more insight for this question. It pushes the values of EAX, ECX, EDX, EBX, original ESP, EBP, ESI, and EDI to the stack. This is most probably the reason why OllyDbg sorts them in that order in the registers view. A description of PUSHAD
can be found here.
Since i've been into reverse engineering with ollydbg for years, i can tell you that this is the order of importance when debugging. Eax is used everywhere because of its nature. It gets the return values, it's used a lot. Then, ecx and edx are of equal occurence i would say. Instructions like loop, repsb and the likes use ecx, while divs,muls and more use edx. Moreover, when we program in assembly, we tend to use eax,edx and ecx a lot. Esi and edi are used sometimes as well, mostly in repeat string functions or as secondary registers in some cases.
I suppose that the reason behind the order is really the way intel uses the order, but it would be really weird to have esi on top of my ollydebug registers, since eax is used everywhere. Thus, it has an ergonomic point also :D
My guess is that it's because EAX, ECX and EDX are used as scratch registers by functions both in the cdecl ,stdcall and other calling conventions, that is they are not preserved after function calls. Besided the remaining registers special use is as pointers which is documented in the Intel Developer Manual (2.36MB PDF). That's just my two cents.