JMP (x86 Instruction)
   HOME

TheInfoList



OR:

In the
x86 assembly language x86 assembly language is the name for the family of assembly languages which provide some level of backward compatibility with CPUs back to the Intel 8008 microprocessor, which was launched in April 1972. It is used to produce object code for t ...
, the JMP instruction performs an unconditional jump. Such an instruction transfers the flow of
execution Capital punishment, also known as the death penalty, is the State (polity), state-sanctioned practice of deliberately killing a person as a punishment for an actual or supposed crime, usually following an authorized, rule-governed process to ...
by changing the
program counter The program counter (PC), commonly called the instruction pointer (IP) in Intel x86 and Itanium microprocessors, and sometimes called the instruction address register (IAR), the instruction counter, or just part of the instruction sequencer, is ...
. There are a number of different
opcode In computing, an opcode (abbreviated from operation code, also known as instruction machine code, instruction code, instruction syllable, instruction parcel or opstring) is the portion of a machine language instruction that specifies the operat ...
s that perform a jump; depending on whether the processor is in
real mode Real mode, also called real address mode, is an operating mode of all x86-compatible CPUs. The mode gets its name from the fact that addresses in real mode always correspond to real locations in memory. Real mode is characterized by a 20-bit seg ...
or
protected mode In computing, protected mode, also called protected virtual address mode, is an operational mode of x86-compatible central processing units (CPUs). It allows system software to use features such as virtual memory, paging and safe multi-tasking d ...
, and an override instruction is used, the instructions may take
16-bit 16-bit microcomputers are microcomputers that use 16-bit microprocessors. A 16-bit register can store 216 different values. The range of integer values that can be stored in 16 bits depends on the integer representation used. With the two mos ...
,
32-bit In computer architecture, 32-bit computing refers to computer systems with a processor, memory, and other major system components that operate on data in 32-bit units. Compared to smaller bit widths, 32-bit computers can perform large calculation ...
, or segment:offset
pointers Pointer may refer to: Places * Pointer, Kentucky * Pointers, New Jersey * Pointers Airport, Wasco County, Oregon, United States * The Pointers, a pair of rocks off Antarctica People with the name * Pointer (surname), a surname (including a l ...
. There are many different forms of jumps: relative, conditional, absolute and register-indirect jumps. The following examples illustrate: # a relative jump with a 16-bit pointer; # a long jump (inter-segment), a relative jump with a 32-bit pointer; # and a register-indirect absolute jump using the
EAX register x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel based on the Intel 8086 microprocessor and its Intel 8088, 8088 variant. The 808 ...
. (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 0x89AB, then load CS with 0xACDC and IP with 0x5578. JMP 0x89AB JMP 0xACDC:0x5578 Example two: Load EIP with the value 0x56789AB1, only in
protected mode In computing, protected mode, also called protected virtual address mode, is an operational mode of x86-compatible central processing units (CPUs). It allows system software to use features such as virtual memory, paging and safe multi-tasking d ...
or
unreal mode In x86 computing, unreal mode, also big real mode, huge real mode, flat real mode, or voodoo mode is a variant of real mode, in which one or more segment descriptors has been loaded with non-standard values, like 32-bit limits allowing access to ...
. JMP 0x56789AB1 Example three: Jump to the value stored in the EAX register, only in protected mode. JMP EAX


References

{{reflist


External links


Using SHORT (Two-byte) Relative Jump Instructions
X86 instructions