I will make a little bit wider answer here.
There are generally speaking two types of conditional jumps in x86:
Arithmetic jumps - like JZ (jump if zero), JC (jump if carry), JNC (jump if not carry), etc.
Comparison jumps - JE (jump if equal), JB (jump if below), JAE (jump if above or equal), etc.
So, use the first type only after arithmetic or logical instructions:
sub eax, ebx
jnz .result_is_not_zero
and ecx, edx
jz .the_bit_is_not_set
Use the second group only after CMP instructions:
cmp eax, ebx
jne .eax_is_not_equal_to_ebx
cmp ecx, edx
ja .ecx_is_above_than_edx
This way, the program becomes more readable and you need never be confused.
Note, that sometimes these instructions are actually synonyms. JZ == JE; JC == JB; JNC == JAE and so on. The full table is following. As you can see, there are only 16 conditional jump instructions, but 30 mnemonics - they are provided to allow creation of more readable source code:
Mnemonic |
Condition tested |
Description |
jo |
OF = 1 |
overflow |
jno |
OF = 0 |
not overflow |
jc, jb, jnae |
CF = 1 |
carry / below / neither above nor equal |
jnc, jnb, jae |
CF = 0 |
not carry / not below / above or equal |
je, jz |
ZF = 1 |
equal / zero |
jne, jnz |
ZF = 0 |
not equal / not zero |
jbe, jna |
(CF or ZF) = 1 |
below or equal / not above |
ja, jnbe |
(CF or ZF) = 0 |
above / neither below nor equal |
js |
SF = 1 |
sign |
jns |
SF = 0 |
not sign |
jp, jpe |
PF = 1 |
parity / parity even |
jnp, jpo |
PF = 0 |
not parity / parity odd |
jl, jnge |
(SF xor OF) = 1 |
less / neither greater nor equal |
jge, jnl |
(SF xor OF) = 0 |
greater or equal / not less |
jle, jng |
((SF xor OF) or ZF) = 1 |
less or equal / not greater |
jg, jnle |
((SF xor OF) or ZF) = 0 |
greater / neither less nor equal |