
BASIC INSTRUCTION SET
3.6.1 Unconditional Transfer Instructions
JMP, CALL, RET, INT and IRET instructions transfer control from one code segment location to another. These locations can be within the same code segment or in different code segments.
3.6.1.1 JUMP INSTRUCTION
JMP (Jump) unconditionally transfers control to the target location. JMP is a
The JMP instruction always performs the same basic function of transferring control from the current location to a new location. Its implementation varies depending on the following factors:
Is the address specified directly within the instruction or indirectly through a register or memory?
Is the target location inside or outside the current code segment selected in CS?
A direct JMP instruction includes the destination address as part of the instruction. An indirect JMP instruction obtains the destination address indirectly through a register or a pointer variable.
Control transfers through a gate or to a task state segment are available only in Protected Mode opera- tion of the 80286. The formats of the instructions that transfer control through a call gate, a task gate, or to a task state segment are the same. The label included in the instruction selects one of these three paths to a new code segment.
Direct JMP within the current code segment. A direct JMP that transfers control to a target location within the current code segment uses a relative displacement value contained in the instruction. This can be either a
Example: JMP NEAlLNEWCODE. Transfers control to the target location labeled NEAlL NEWCODE, which is within the code segment currently selected in CS.
Indirect JMP within the current code segment. Indirect JMP instructions that transfer control to a location within the current code segment specify an absolute address in one of several ways. First, the program can JMP to a location specified by a
Example: JMP SI. Transfers control to the target address formed by adding the
The processor can also obtain the destination address within a current segment from a memory word operand specified in the instruction.
Example: JMP PTlLX. Transfers control to the target address formed by adding the
A register can modify the address of the memory word pointer to select a destination address.
Example: JMP CASE_TABLE [BX]. CASE_TABLE is the first word in an array of word pointers. The value of BX determines which pointer the program selects from the array. The JMP instruction then transfers control to the location specified by the selected pointer.