Jump Instructions
-----------------
0B33:0100 E9FD00JMP0200
0B33:0200 B041 MOVAL,41
0B33:0202 3C41 CMPAL,41
0B33:0204 7F7F JG 0285 ; 0285 = 0206 + 7f (Max Range forward)
0B33:0206 7280 JB 0188 ; 0188 = 0208 - 80 (Max Range backward)
0B33:0208 747F JZ 0289 ; 0289 = 020a + 7f (Max Range forward)

As the above (debug) code segment shows, most jumps take place to nearby places in the code. Thus, the Intel 80x86 encodes all conditional jumps as two bytes, the numeric opcode of the jump (e.g., 74 for JZ and 7F for JG) and the displacement to the jump destination.

A two-byte jump such as (JZ opcode+disp) is processed by the CPU's fetch-execute cycle as follows:

1. The instruction is fetched and the IP updated to point to the following (next) instruction.

2. The flags are checked, and if the "greater than" condition holds, the CPU sign-extends disp to a word and updates IP by computing IP := IP + disp.

Displacements are treated as 2's complement numbers, making both forward and backward jumps possible. Hence, it is clear that a two-byte jump has a range of 127 (7F in hex) bytes forward and 128 (80 in hex) bytes backward.

Conditions may arise when a program needs to jump further than the above range. The unconditional jump instruction JMP provides the needed escape hatch. In the JMP instruction, the displacement is a word (2 bytes), allowing a jump forward of 32,767 (7FFF in hex) bytes and backward of 32,768 (8000 in hex) bytes.

The assembler does its best to decide which form of jmp to use. When jumping backward, it knows how far back the destination is. For jumping forward, however, it must guess. It assumes that a three-byte jump will be needed, and if it later finds that two bytes will suffice, it changes the three-byte jump to a two-byte jump followed by a nop (no-operation) instruction.

Note also that there are Signed and Unsigned Conditional Jumps. When comparing addresses, for instance, Unsigned form must be used:

Signed Conditional Jumps Unsigned Conditional Jumps
----------------------------------------------------
jg (jump if greater) ja (jump if above)
jge (jump if greater or =)jae (jump if above or =)
jl (jump if less) jb (jump if below)
jle (jump if less or =) jbe (jump if below or =)