Contents
JMP (x86 instruction)
In** the x86 assembly language, the **** **** instruction performs an unconditional **jump. Such an instruction transfers the flow of execution by changing the program counter. There are a number of different opcodes that perform a jump; depending on whether the processor is in real mode or protected mode, and an override instruction is used, the instructions may take 16-bit, 32-bit, or segment:offset pointers. There are many different forms of jumps: relative, conditional, absolute and register-indirect jumps. The following examples illustrate: (Note that although the first and second jumps are relative, commonly the destination address is shown instead of the relative offset as encoded in the opcode.) Example one: Load IP with the new value, then load CS with and IP with. Example two: Load EIP with the value, only in protected mode or unreal mode. Example three: Jump to the value stored in the EAX register, only in protected mode. The (Jump) instruction transfers the program's control to a specified location in the code. Unlike function calls, it doesn’t save return information. Instead, it directs execution to a target address, which can be:
Types of Jumps
The instruction supports four types of jumps:
Short and Near Jumps
Short Jump
Near Jump
Operand Size
Far Jumps
Real-Address or Virtual-8086 Mode
The target can be specified:
Protected Mode
In protected mode, far jumps can be used for:
Special Notes on Task Switching
This article is derived from Wikipedia and licensed under CC BY-SA 4.0. View the original article.
Wikipedia® is a registered trademark of the
Wikimedia Foundation, Inc.
Bliptext is not
affiliated with or endorsed by Wikipedia or the
Wikimedia Foundation.