- JMP (x86 instruction)
In the
x86 assembly language , the JMP instruction is amnemonic for an unconditional JuMP. Such an instruction transfers the flow of execution by changing theinstruction pointer register. The x86 assembly language actually contains a number of differentopcode s that perform a jump. Depending on whether the processor is inreal mode orprotected mode , and an override instruction is used, the instructions may take16-bit ,32-bit , or segment:offsetpointers . [cite web |url=http://download.intel.com/design/PentiumII/manuals/24319102.PDF|format = PDF| title=Intel Architecture Software Developer's Manual, Volume 2: Instruction Set Reference Manual|accessdate=2007-07-13]There are many different forms of jumps;
Relative jump s,conditional jump s,absolute jump s and register-indirect jumps.JMP $ is commonly used to hang the computer. The $ is used to refer to the same location where the instruction starts. That means that the instruction will jump to itself and thereby creating an endless loop.
The following examples illustrate the following types of jumps: 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.
"Note that although the first and third jumps are relative, commonly the destination address is shown instead of the relative offset as encoded in the opcode." JMP 0x89AB ; loads IP with the new value 0x89AB JMP 0xACDC:0x5578 ; loads CS with 0xACDC and IP with 0x5578
JMP 0x56789AB1 ; loads IP with the value 0x56789AB1 ; only works in
protected mode orunreal mode JMP EAX ; Jumps to the value stored in the register EAX. ; only works in
protected mode See also
*
conditional jump References
Wikimedia Foundation. 2010.