reverse engineering - Conditional Flags Assembly - cmp, test -


i'm having hard time understanding conditional code in assembly. assembly on right funa() on left, i'm having trouble lines 3-4 in assembly.

here thought process:

cmp rax, rcx // a[idx] <= *b 

however, actual if statement in code exact opposite. know has how in assembly, conditional executed reverse...therefore makes a[idx] > *b instead. have "jle"? mind explaining me?

enter image description hereenter image description here

if @ .l1 , .l2, jit compiler has decided reverse order - it's put else code first, , reversed condition. jle "jump if less or equal" it's become equivalent of c#:

if (a[idx] <= *b) {     *b = *b + *b; } else {     *b = a[idx]; } 

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -