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 Technology// exception, with error code that indicates this idt gateEXCEPTION [#GP(vector*8+2)]IF (temp_desc.attr.type is illegal for the current mode)// exception, with error code that indicates this idt gateEXCEPTION [#GP(vector*8+2)]IF (temp_desc.attr.p=0)EXCEPTION [#NP(vector*8+2)]// segment-not-present exception, with an error code that// indicates this idt gateRETURN (temp_desc)/////////////////////////////////////////////////////////////////////////////////// READ_INNER_LEVEL_STACK_POINTER// Read a new stack pointer (rsp or ss:esp) from the tss/////////////////////////////////////////////////////////////////////////////////usage:temp_SS_desc:temp_RSP = READ_INNER_LEVEL_STACK_POINTER (new_cpl, ist_index)definition:IF (LONG_MODE){IF (ist_index>0)// if IST is selected, read an ISTn stack pointer from the tsstemp_RSP = READ_MEM.q [tss:ist_index*8+28]ELSE // (ist_index=0)// otherwise read an RSPn stack pointer from the tsstemp_RSP = READ_MEM.q [tss:new_cpl*8+4]temp_SS_desc.sel = NULL + new_cpl// in long mode, changing to lower cpl sets SS.sel to// NULL+new_cpl}ELSE // (LEGACY_MODE){temp_RSP = READ_MEM.d [tss:new_cpl*8+4]// read ESPn from the tsstemp_sel = READ_MEM.d [tss:new_cpl*8+8]// read SSn from the tsstemp_SS_desc = READ_DESCRIPTOR (temp_sel, ss_chk)}return (temp_RSP:temp_SS_desc)/////////////////////////////////////////////////////////////////////////////////// READ_BIT_ARRAY // Read 1 bit from a bit array in memory/////////////////////////////////////////////////////////////////////////////////Chapter 2: Instruction Overview 57

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

Saved successfully!

Ooh no, something went wrong!