Jumps
After the compare instruction, there will
most likely be a conditional jump instruction after. If we wanted to jump
if AX is less than BX (which it is), then there would be an instruction
like "JB 200". This instruction says Jump if Below to instruction 200h.
What about if we wanted to jump if AX is greater than BX. Then we might
have "JA 200". This is read Jump if Above to instruction 200. What about
AX equal to BX. We would then have "JZ 200" or "JE 200". (Please note that
the previous instructions are synonymous.) This is read Jump if Equal to
instruction 200h. Here are the jumps you will most likely encounter:
-
JB/JNAE CF=1 Jump if below/not above or equal (unsigned)
-
JAE/JNB CF=0 Jump if above or equal/not above (unsigned)
-
JBE/JNA CF=1 or ZF=1 Jump if below or equal/not above (unsigned)
-
JE/JZ ZF=1 Jump if equal/zero
-
JNE/JNZ ZF=0 Jump if not equal/not zero
-
JL/JNGE SF not equal Jump if less/not greater or to OF equal
(signed)
-
JGE/JNL SF=OF Jump if greater or equal/not less (signed)
-
JLE/JNG ZF=1 or SFJump is less or equal/not not equal OF
greater (signed)
-
JG/JNLE ZF=0 or SF=OF Jump if greater/not less or equal (signed)
-
JS SF=1 Jump if sign JNSSF=0 Jump if no sign
-
JC CF=1 Jump if carry JNCCF=0 Jump if no carry
-
JO OF=1 Jump if overflow JNOOF=0 Jump if not overflow
-
JP/JPE PF=1 Jump if parity/parity even
-
JNP/JPO PF=0 Jump if no parity/parity odd
Return