Green
Green

Reputation: 115

Compare two numbers without jle

Is there a way tompare two numbers stored in registers without using a conditional jump other than JE / JNE ? Only the following instructions: ADD, SUB, AND, OR, XOR, NEG, left and right arithmetic shift, CMP, and MOV.

Upvotes: 0

Views: 305

Answers (1)

Egor Skriptunoff
Egor Skriptunoff

Reputation: 23737

cmp EAX,EDX
jle xxx

is equivalent to

sub EDX,EAX
shr EDX,31
jz xxx

Upvotes: 1

Related Questions