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

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

scs.stanford.edu
from scs.stanford.edu More from this publisher
13.07.2015 Views

AMD64 Technology 24594 Rev. 3.10 February 2005ExceptionsExceptionGeneral protection,#GPRealVirtual8086 Protected Cause of ExceptionX X X The target offset exceeded the code segment limit or was non-canonical170 JrCXZ

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 segmentand is called a near jump. The target operand 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 operand, depending on operand 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), and the result istruncated to 16, 32, or 64 bits depending on operand size. The signed displacementcan be 8 bits, 16 bits, or 32 bits, depending on the opcode and the operand size.For near jumps in 64-bit mode, the operand size defaults to 64 bits. The E9 opcoderesults in RIP = RIP + 32-bit signed displacement, and the FF /4 opcode results in RIP= 64-bit offset from register or memory. No prefix is available to encode a 32-bitoperand 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 Volume 1, and “Control-Transfer Privilege Checks” in Volume 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

AMD64 Technology 24594 Rev. 3.10 February 2005ExceptionsException<strong>General</strong> protection,#GPRealVirtual8086 Protected Cause of ExceptionX X X The target offset exceeded the code segment limit or was non-canonical170 JrCXZ

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

Saved successfully!

Ooh no, something went wrong!