I wanted to know if a jump instruction as JE
must directly follow to a CMP
instruction. Until now, I did always see that first a CMP
comes and after that a JMP
. But today I have discover the following:
...
CMP DWORD PTR SS:[EBP+0xC], EAX
MOV ECX, DWORD PTR SS:[EBP+0x18]
PUSH ESI
MOV ECX, DWORD PTR SS:[EBP+0x18]
MOV DWORD PTR SS:[ECX],EAX
MOV EAX, DWORD PTR SS:[EBP+0x10]
MOV DWORD PTR SS:[EDI], 0x1
JE SHORT crtdll.6C250E66
....
First of all, I am beginner. So, I try to understand the assembly language. Logically, I would say that the JE
instruction is related to the CMP
instruction at the beginning of that sequence.
So, my self-explanation was that we first compare, then do some MOV
and PUSH
operations, after that all we are jumping, is that right?
But, as I mentioned above, normally the jump comes in the next line after the comparison, could one say the reason for that late jump instruction here ? Or is it normal ?