Greater than
cmp eax, ebx
ja a_label
Greater than or equal
cmp eax, ebx
jae a_label
Less than
cmp eax, ebx
jb a_label
Less than or equal
cmp eax, ebx
jbe a_label
Equal
cmp eax, ebx
je a_label
Not equal
cmp eax, ebx
jne a_label
Greater than
cmp eax, ebx
jg a_label
Greater than or equal
cmp eax, ebx
jge a_label
Less than
cmp eax, ebx
jl a_label
Less than or equal
cmp eax, ebx
jle a_label
Equal
cmp eax, ebx
je a_label
Not equal
cmp eax, ebx
jne a_label
a_label
In examples above the a_label
is target destination for CPU when the tested condition is "true". When tested condition is "false", the CPU will continue on the next instruction following the conditional jump.
There are instruction synonyms that can be used to improve the readability of the code.
For example ja
and jnbe
(Jump non below nor equal) are the same instruction.
Operation | Unsigned | Signed |
---|---|---|
> | ja | jg |
>= | jae | jge |
< | jb | jl |
<= | jbe | jle |
= | je | je |
≠, !=, <> | jne | jne |