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 (Far)Far JumpUnconditionally transfers control to a new address without saving the current CS:rIPvalues. This form of the instruction jumps to an address outside the current codesegment <strong>and</strong> is called a far jump. The oper<strong>and</strong> specifies a target selector <strong>and</strong> offset.The target oper<strong>and</strong> can be specified by the instruction directly, by containing the farpointer in the jmp far opcode itself, or indirectly, by referencing a far pointer inmemory. In 64-bit mode, only indirect far jumps are allowed, executing a direct farjmp (opcode EA) will generate an undefined opcode exception.In all modes, the target selector used by the instruction can be a code selector.Additionally, the target selector can also be a call gate in protected mode, or a taskgate or TSS selector in legacy protected mode.• Target is a code segment—Control is transferred to the target CS:rIP. In this case,the target offset can only be a 16 or 32 bit value, depending on oper<strong>and</strong>-size, <strong>and</strong>is zero-extended to 64 bits. No CPL change is allowed.• Target is a call gate—The call gate specifies the actual target code segment <strong>and</strong> offset,<strong>and</strong> control is transferred to the target CS:rIP. When jumping through a callgate, the size of the target rIP is 16, 32, or 64 bits, depending on the size of the callgate. If the target rIP is less than 64 bits, it's zero-extended to 64 bits. In longmode, only 64-bit call gates are allowed, <strong>and</strong> they must point to 64-bit code segments.No CPL change is allowed.• Target is a task gate or a TSS—If the mode is legacy protected mode, then a taskswitch occurs. See “Hardware Task-Management in Legacy Mode” in volume 2 fordetails about task switches. Hardware task switches are not supported in longmode.See JMP (Near) for information on near jumps—jumps to procedures located insidethe 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 FAR pntr16:16JMP FAR pntr16:32EA cdEA cpFar jump direct, with the target specified by a far pointercontained in the instruction. (Invalid in 64-bit mode.)Far jump direct, with the target specified by a far pointercontained in the instruction. (Invalid in 64-bit mode.)JMP (Far) 173

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

Saved successfully!

Ooh no, something went wrong!