Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does the JE instruction work without CMP?

.L10:
    leal    (%rsi,%rsi,4), %edx
    movsbl  %al,%eax
    addq    $1, %rdi
    leal    -48(%rax,%rdx,2), %esi
    je  .L3

In the above there's no cmp preceding je. How does it work here?

like image 845
randomuser Avatar asked Aug 28 '11 09:08

randomuser


1 Answers

  • je will jump is ZF = 1.
  • add modifies the ZF.
  • lea, movsb does not affect any flags.

Keep the Intel 64 and IA32 Architecture Developer's Manual in hand. You can find all the instruction details of Intel 64 and IA32 architecture in the manual Volume 2

like image 117
phoxis Avatar answered Sep 20 '22 23:09

phoxis