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 2005ELSE // (temp_desc.attr.type = ’callgate16’)V=2-byte// Legacy mode, using a 16-bit call-gate, force 2-byte opsize.temp_RIP = temp_desc.offsetIF (LONG_MODE){}// In long mode, we need to read the 2nd half of a// 16-byte call-gate from the GDT/LDT, to get the upper// 32 bits of the target RIP.temp_upper = READ_MEM.q [temp_sel+8]IF (temp_upper’s extended attribute bits != 0)EXCEPTION [#GP(temp_sel)]temp_RIP = tempRIP + (temp_upper SHL 32)// Concatenate both halves of RIPCS = READ_DESCRIPTOR (temp_desc.segment, clg_chk)IF (CS.attr.conforming=1)temp_CPL = CPLELSEtemp_CPL = CS.attr.dplIF (CPL=temp_CPL){PUSH.v old_CSPUSH.v next_RIPIF ((64BIT_MODE) && (temp_RIP is non-canonical)|| (!64BIT_MODE) && (temp_RIP > CS.limit)){EXCEPTION[#GP(0)]}RIP = temp_RIPEXIT}ELSE // (CPL != temp_CPL), Changing privilege level.{CPL = temp_CPLtemp_ist = 0// Call-far doesn’t use ist pointers.temp_SS_desc:temp_RSP = READ_INNER_LEVEL_STACK_POINTER (CPL, temp_ist)RSP.q = temp_RSPSS = temp_SS_descPUSH.v old_SS// #SS on this and following pushes use// SS.sel as error code.PUSH.v old_RSPIF (LEGACY_MODE) // Legacy-mode call gates have{ // a param_count field.92 CALL (Far)

24594 Rev. 3.10 February 2005 AMD64 Technologytemp_PARAM_COUNT = temp_desc.attr.param_count}}FOR (I=temp_PARAM_COUNT; I>0; I--){temp_DATA = READ_MEM.v [old_SS:(old_RSP+I*V)]PUSH.v temp_DATA}}PUSH.v old_CSPUSH.v next_RIPIF ((64BIT_MODE) && (temp_RIP is non-canonical)|| (!64BIT_MODE) && (temp_RIP > CS.limit)){EXCEPTION [#GP(0)]}RIP = temp_RIPEXITRelated InstructionsCALL (Near), RET (Near), RET (Far)rFLAGS AffectedNone, unless a task switch occurs, in which case all flags are modified.CALL (Far) 93

24594 Rev. 3.10 February 2005 AMD64 Technologytemp_PARAM_COUNT = temp_desc.attr.param_count}}FOR (I=temp_PARAM_COUNT; I>0; I--){temp_DATA = READ_MEM.v [old_SS:(old_RSP+I*V)]PUSH.v temp_DATA}}PUSH.v old_CSPUSH.v next_RIPIF ((64BIT_MODE) && (temp_RIP is non-canonical)|| (!64BIT_MODE) && (temp_RIP > CS.limit)){EXCEPTION [#GP(0)]}RIP = temp_RIPEXITRelated <strong>Instructions</strong>CALL (Near), RET (Near), RET (Far)rFLAGS AffectedNone, unless a task switch occurs, in which case all flags are modified.CALL (Far) 93

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

Saved successfully!

Ooh no, something went wrong!