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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

24594 Rev. 3.10 February 2005 AMD64 TechnologyCALLF_PROTECTED:IF (OPCODE = callf [mem]) //CALLF Indirect{temp_offset = READ_MEM.z [mem]temp_sel = READ_MEM.w [mem+Z]}ELSE // (OPCODE = callf direct){IF (64BIT_MODE)EXCEPTION [#UD] // ’CALLF direct’ is illegal in 64-bit mode.temp_offset = z-sized offset specified in the instructionzero-extended to 64 bitstemp_sel = selector specified in the instruction}temp_desc = READ_DESCRIPTOR (temp_sel, cs_chk)IF (temp_desc.attr.type = ’available_tss’)TASK_SWITCH // Using temp_sel as the target TSS selector.ELSIF (temp_desc.attr.type = ’taskgate’)TASK_SWITCH // Using the TSS selector in the task gate// as the target TSS.ELSIF (temp_desc.attr.type = ’code’)// If the selector refers to a code descriptor, then// the offset we read is the target RIP.{temp_RIP = temp_offsetCS = temp_descPUSH.v old_CSPUSH.v next_RIPIF ((!64BIT_MODE) && (temp_RIP > CS.limit))}ELSE{EXCEPTION [#GP(0)]RIP = temp_RIPEXIT// temp_RIP can’t be non-canonical because// it’s a 16- or 32-bit offset, zero-extended// to 64 bits.// (temp_desc.attr.type = ’callgate’)// If the selector refers to a call gate, then// the target CS <strong>and</strong> RIP both come from the call gate.IF (LONG_MODE)// The size of the gate controls the size of the stack pushes.V=8-byte// Long mode only uses 64-bit call gates, force 8-byte opsize.ELSIF (temp_desc.attr.type = ’callgate32’)V=4-byte// Legacy mode, using a 32-bit call-gate, force 4-byte opsize.CALL (Far) 91

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

Saved successfully!

Ooh no, something went wrong!