13.07.2015 Views

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

24594 Rev. 3.10 February 2005 AMD64 TechnologyJMP (Near)Near JumpUnconditionally transfers control to a new address without saving the current rIPvalue. This form of the instruction jumps to an address in the current code segment<strong>and</strong> is called a near jump. The target oper<strong>and</strong> can specify a register, a memorylocation, or a label.If the JMP target is specified in a register or memory location, then a 16-, 32-, or 64-bitrIP is read from the oper<strong>and</strong>, depending on oper<strong>and</strong> size. This rIP is zero-extended to64 bits.If the JMP target is specified by a displacement in the instruction, the signeddisplacement is added to the rIP (of the following instruction), <strong>and</strong> the result istruncated to 16, 32, or 64 bits depending on oper<strong>and</strong> size. The signed displacementcan be 8 bits, 16 bits, or 32 bits, depending on the opcode <strong>and</strong> the oper<strong>and</strong> size.For near jumps in 64-bit mode, the oper<strong>and</strong> size defaults to 64 bits. The E9 opcoderesults in RIP = RIP + 32-bit signed displacement, <strong>and</strong> the FF /4 opcode results in RIP= 64-bit offset from register or memory. No prefix is available to encode a 32-bitoper<strong>and</strong> size in 64-bit mode.See JMP (Far) for information on far jumps—jumps to procedures located outside ofthe current code segment. For details about control-flow instructions, see “ControlTransfers” in <strong>Volume</strong> 1, <strong>and</strong> “Control-Transfer Privilege Checks” in <strong>Volume</strong> 2.Mnemonic Opcode DescriptionJMP rel8offJMP rel16offJMP rel32offEB cbE9 cwE9 cdShort jump with the target specified by an 8-bit signeddisplacement.Near jump with the target specified by a 16-bit signeddisplacement.Near jump with the target specified by a 32-bit signeddisplacement.JMP reg/mem16 FF /4 Near jump with the target specified reg/mem16.JMP reg/mem32 FF /4Near jump with the target specified reg/mem32.(No prefix for encoding in 64-bit mode.)JMP reg/mem64 FF /4 Near jump with the target specified reg/mem64.JMP (Near) 171

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!