X86InstructionSemantics< Policy, WordType > Struct Template Reference

#include <x86InstructionSemantics.h>

Collaboration diagram for X86InstructionSemantics< Policy, WordType >:

Collaboration graph
[legend]
List of all members.

template<typename Policy, template< size_t > class WordType>
struct X86InstructionSemantics< Policy, WordType >


Public Member Functions

 Word (32) orig_eip
 X86InstructionSemantics (Policy &policy)
virtual ~X86InstructionSemantics ()
WordType< 1 > rep_enter ()
 Beginning of a 'rep', 'repe', or 'repne' loop.
void rep_repeat (SgAsmx86Instruction *insn, WordType< 1 > repeat, WordType< 1 > cond)
 Decrement the counter for a 'rep', 'repe', or 'repne' loop and adjust the instruction pointer.
template<size_t N>
WordType< 8 *N > stringop_load_si (SgAsmx86Instruction *insn, WordType< 1 > cond)
 Return the value of the memory pointed to by the SI register.
template<size_t N>
WordType< 8 *N > stringop_load_di (WordType< 1 > cond)
 Return the value of memory pointed to by the DI register.
template<size_t N>
void stos_semantics (SgAsmx86Instruction *insn, WordType< 1 > cond)
 Instruction semantics for stosN where N is 1 (b), 2 (w), or 4 (d).
template<size_t N>
void rep_stos_semantics (SgAsmx86Instruction *insn)
 Instruction semantics for rep_stosN where N is 1 (b), 2 (w), or 4 (d).
template<size_t N>
void movs_semantics (SgAsmx86Instruction *insn, WordType< 1 > cond)
 Instruction semantics for movsN where N is 1 (b), 2 (w), or 4 (d).
template<size_t N>
void rep_movs_semantics (SgAsmx86Instruction *insn)
 Instruction semantics for rep_movsN where N is 1 (b), 2 (w), or 4 (d).
template<size_t N>
void cmps_semantics (SgAsmx86Instruction *insn, WordType< 1 > cond)
 Instruction semantics for cmpsN where N is 1 (b), 2 (w), or 4 (d).
template<size_t N>
void repe_cmps_semantics (SgAsmx86Instruction *insn)
 Instruction semantics for one iteration of the repe_cmpsN instruction, where N is 1 (b), 2 (w), or 4 (d).
template<size_t N>
void repne_cmps_semantics (SgAsmx86Instruction *insn)
 Instruction semantics for one iteration of the repne_cmpsN instruction, where N is 1 (b), 2 (w), or 4 (d).
template<size_t N>
void scas_semantics (SgAsmx86Instruction *insn, WordType< 1 > cond)
 Instruction semantics for scasN where N is 1 (b), 2 (w), or 4 (d).
template<size_t N>
void repe_scas_semantics (SgAsmx86Instruction *insn)
 Instruction semantics for one iteration of repe_scasN where N is 1 (b), 2 (w), or 4 (d).
template<size_t N>
void repne_scas_semantics (SgAsmx86Instruction *insn)
 Instruction semantics for one iterator of repne_scasN where N is 1 (b), 2 (w), or 4 (d).
void lods_semantics_regupdate (WordType< 8 > v)
 Helper for lods_semantics() to load one byte into the AL register.
void lods_semantics_regupdate (WordType< 16 > v)
 Helper for lods_semantics() to load one word into the AX register.
void lods_semantics_regupdate (WordType< 32 > v)
 Helper for lods_semantics() to load one doubleword into the EAX register.
template<size_t N>
void lods_semantics (SgAsmx86Instruction *insn)
 Instruction semantics for lodsN where N is 1 (b), 2 (w), or 4 (d).
template<size_t Len>
 Word (Len) invertMaybe(const Word(Len)&w
size_t size_t Len Word (To-From) extract(Word(Len) w)
template<size_t From, size_t To>
 Word (To) signExtend(Word(From) w)
template<size_t Len>
 Word (Len) readRegister(const RegisterDescriptor &reg)
 Reads from a named register.
template<size_t Len>
void writeRegister (const RegisterDescriptor &reg, const Word(Len)&value)
 Writes to a named register.
template<size_t Len>
 Word (1) greaterOrEqualToTen(Word(Len) w)
template<size_t Len>
 Word (Len) readMemory(X86SegmentRegister segreg
const Word (32)&addr
const Word (1) cond)
 Word (32) readEffectiveAddress(SgAsmExpression *expr)
 Word (8) read8(SgAsmExpression *e)
 Word (16) read16(SgAsmExpression *e)
 Word (32) read32(SgAsmExpression *e)
void write8 (SgAsmExpression *e, const Word(8)&value)
void write16 (SgAsmExpression *e, const Word(16)&value)
void write32 (SgAsmExpression *e, const Word(32)&value)
 Word (1) parity(Word(8) w)
template<size_t Len>
void setFlagsForResult (const Word(Len)&result)
template<size_t Len>
void setFlagsForResult (const Word(Len)&result, Word(1) cond)
template<size_t Len>
 Word (Len) doAddOperation(const Word(Len)&a
const Word (Len)&b
const bool Word (1) carryIn)
template<size_t Len>
 Word (Len) doAddOperation(const Word(Len)&a
const Word (Len)&b
const bool Word (1) carryIn
const bool Word (1) cond)
template<size_t Len>
 Word (Len) doIncOperation(const Word(Len)&a

Public Attributes

Policy & policy
SgAsmInstructioncurrent_instruction
RegisterDescriptor REG_EAX
RegisterDescriptor REG_EBX
RegisterDescriptor REG_ECX
RegisterDescriptor REG_EDX
RegisterDescriptor REG_EDI
RegisterDescriptor REG_EIP
RegisterDescriptor REG_ESI
RegisterDescriptor REG_ESP
RegisterDescriptor REG_EBP
RegisterDescriptor REG_AX
RegisterDescriptor REG_CX
RegisterDescriptor REG_DX
RegisterDescriptor REG_AL
RegisterDescriptor REG_AH
RegisterDescriptor REG_EFLAGS
RegisterDescriptor REG_AF
RegisterDescriptor REG_CF
RegisterDescriptor REG_DF
RegisterDescriptor REG_OF
RegisterDescriptor REG_PF
RegisterDescriptor REG_SF
RegisterDescriptor REG_ZF
size_t To
const bool invertCarries
bool dec

Classes

struct  Exception

Constructor & Destructor Documentation

template<typename Policy, template< size_t > class WordType>
X86InstructionSemantics< Policy, WordType >::X86InstructionSemantics ( Policy &  policy  )  [inline]

template<typename Policy, template< size_t > class WordType>
virtual X86InstructionSemantics< Policy, WordType >::~X86InstructionSemantics (  )  [inline, virtual]


Member Function Documentation

template<typename Policy, template< size_t > class WordType>
X86InstructionSemantics< Policy, WordType >::Word ( 32   ) 

template<typename Policy, template< size_t > class WordType>
WordType<1> X86InstructionSemantics< Policy, WordType >::rep_enter (  )  [inline]

Beginning of a 'rep', 'repe', or 'repne' loop.

The return value is the condition status, and is true if the loop body should execute, false otherwise.

template<typename Policy, template< size_t > class WordType>
void X86InstructionSemantics< Policy, WordType >::rep_repeat ( SgAsmx86Instruction insn,
WordType< 1 >  repeat,
WordType< 1 >  cond 
) [inline]

Decrement the counter for a 'rep', 'repe', or 'repne' loop and adjust the instruction pointer.

The instruction pointer is reset to the beginning of the instruction if the loop counter, cx register, is non-zero after decrementing and repeat is true. Otherwise the instruction pointer is not adjusted and the loop effectively exits. If cond is false then this function has no effect on the state.

template<typename Policy, template< size_t > class WordType>
template<size_t N>
WordType<8*N> X86InstructionSemantics< Policy, WordType >::stringop_load_si ( SgAsmx86Instruction insn,
WordType< 1 >  cond 
) [inline]

Return the value of the memory pointed to by the SI register.

template<typename Policy, template< size_t > class WordType>
template<size_t N>
WordType<8*N> X86InstructionSemantics< Policy, WordType >::stringop_load_di ( WordType< 1 >  cond  )  [inline]

Return the value of memory pointed to by the DI register.

template<typename Policy, template< size_t > class WordType>
template<size_t N>
void X86InstructionSemantics< Policy, WordType >::stos_semantics ( SgAsmx86Instruction insn,
WordType< 1 >  cond 
) [inline]

Instruction semantics for stosN where N is 1 (b), 2 (w), or 4 (d).

If cond is false then this instruction does not change any state.

template<typename Policy, template< size_t > class WordType>
template<size_t N>
void X86InstructionSemantics< Policy, WordType >::rep_stos_semantics ( SgAsmx86Instruction insn  )  [inline]

Instruction semantics for rep_stosN where N is 1 (b), 2 (w), or 4 (d).

This method handles semantics for one iteration of stosN. See https://siyobik.info/index.php?module=x86&id=279

template<typename Policy, template< size_t > class WordType>
template<size_t N>
void X86InstructionSemantics< Policy, WordType >::movs_semantics ( SgAsmx86Instruction insn,
WordType< 1 >  cond 
) [inline]

Instruction semantics for movsN where N is 1 (b), 2 (w), or 4 (d).

If cond is false then this instruction does not change any state.

template<typename Policy, template< size_t > class WordType>
template<size_t N>
void X86InstructionSemantics< Policy, WordType >::rep_movs_semantics ( SgAsmx86Instruction insn  )  [inline]

Instruction semantics for rep_movsN where N is 1 (b), 2 (w), or 4 (d).

This method handles semantics for one iteration of the instruction.

template<typename Policy, template< size_t > class WordType>
template<size_t N>
void X86InstructionSemantics< Policy, WordType >::cmps_semantics ( SgAsmx86Instruction insn,
WordType< 1 >  cond 
) [inline]

Instruction semantics for cmpsN where N is 1 (b), 2 (w), or 4 (d).

If cond is false then this instruction does not change any state. See Intel Instruction Set Reference 3-154 Vol 2a, March 2009 for opcodes 0xa6 and 0xa7 with no prefix.

template<typename Policy, template< size_t > class WordType>
template<size_t N>
void X86InstructionSemantics< Policy, WordType >::repe_cmps_semantics ( SgAsmx86Instruction insn  )  [inline]

Instruction semantics for one iteration of the repe_cmpsN instruction, where N is 1 (b), 2 (w), or 4 (d).

template<typename Policy, template< size_t > class WordType>
template<size_t N>
void X86InstructionSemantics< Policy, WordType >::repne_cmps_semantics ( SgAsmx86Instruction insn  )  [inline]

Instruction semantics for one iteration of the repne_cmpsN instruction, where N is 1 (b), 2 (w), or 4 (d).

template<typename Policy, template< size_t > class WordType>
template<size_t N>
void X86InstructionSemantics< Policy, WordType >::scas_semantics ( SgAsmx86Instruction insn,
WordType< 1 >  cond 
) [inline]

Instruction semantics for scasN where N is 1 (b), 2 (w), or 4 (d).

If cond is false then this instruction does not change any state.

template<typename Policy, template< size_t > class WordType>
template<size_t N>
void X86InstructionSemantics< Policy, WordType >::repe_scas_semantics ( SgAsmx86Instruction insn  )  [inline]

Instruction semantics for one iteration of repe_scasN where N is 1 (b), 2 (w), or 4 (d).

template<typename Policy, template< size_t > class WordType>
template<size_t N>
void X86InstructionSemantics< Policy, WordType >::repne_scas_semantics ( SgAsmx86Instruction insn  )  [inline]

Instruction semantics for one iterator of repne_scasN where N is 1 (b), 2 (w), or 4 (d).

template<typename Policy, template< size_t > class WordType>
void X86InstructionSemantics< Policy, WordType >::lods_semantics_regupdate ( WordType< 8 >  v  )  [inline]

Helper for lods_semantics() to load one byte into the AL register.

template<typename Policy, template< size_t > class WordType>
void X86InstructionSemantics< Policy, WordType >::lods_semantics_regupdate ( WordType< 16 >  v  )  [inline]

Helper for lods_semantics() to load one word into the AX register.

template<typename Policy, template< size_t > class WordType>
void X86InstructionSemantics< Policy, WordType >::lods_semantics_regupdate ( WordType< 32 >  v  )  [inline]

Helper for lods_semantics() to load one doubleword into the EAX register.

template<typename Policy, template< size_t > class WordType>
template<size_t N>
void X86InstructionSemantics< Policy, WordType >::lods_semantics ( SgAsmx86Instruction insn  )  [inline]

Instruction semantics for lodsN where N is 1 (b), 2 (w), or 4 (d).

template<typename Policy, template< size_t > class WordType>
template<size_t Len>
X86InstructionSemantics< Policy, WordType >::Word ( Len   )  const

template<typename Policy, template< size_t > class WordType>
size_t size_t Len X86InstructionSemantics< Policy, WordType >::Word ( To From  )  [inline]

template<typename Policy, template< size_t > class WordType>
template<size_t From, size_t To>
X86InstructionSemantics< Policy, WordType >::Word ( To   )  [inline]

template<typename Policy, template< size_t > class WordType>
template<size_t Len>
X86InstructionSemantics< Policy, WordType >::Word ( Len   )  const [inline]

Reads from a named register.

Delegated to policy.

template<typename Policy, template< size_t > class WordType>
template<size_t Len>
void X86InstructionSemantics< Policy, WordType >::writeRegister ( const RegisterDescriptor reg,
const Word(Len)&  value 
) [inline]

Writes to a named register.

Delegated to policy.

template<typename Policy, template< size_t > class WordType>
template<size_t Len>
X86InstructionSemantics< Policy, WordType >::Word (  )  [inline]

template<typename Policy, template< size_t > class WordType>
template<size_t Len>
X86InstructionSemantics< Policy, WordType >::Word ( Len   ) 

template<typename Policy, template< size_t > class WordType>
const X86InstructionSemantics< Policy, WordType >::Word ( 32   ) 

template<typename Policy, template< size_t > class WordType>
const X86InstructionSemantics< Policy, WordType >::Word (  )  [inline]

template<typename Policy, template< size_t > class WordType>
X86InstructionSemantics< Policy, WordType >::Word ( 32   )  [inline]

template<typename Policy, template< size_t > class WordType>
X86InstructionSemantics< Policy, WordType >::Word (  )  [inline]

template<typename Policy, template< size_t > class WordType>
X86InstructionSemantics< Policy, WordType >::Word ( 16   )  [inline]

template<typename Policy, template< size_t > class WordType>
X86InstructionSemantics< Policy, WordType >::Word ( 32   )  [inline]

template<typename Policy, template< size_t > class WordType>
void X86InstructionSemantics< Policy, WordType >::write8 ( SgAsmExpression e,
const Word(8)&  value 
) [inline]

template<typename Policy, template< size_t > class WordType>
void X86InstructionSemantics< Policy, WordType >::write16 ( SgAsmExpression e,
const Word(16)&  value 
) [inline]

template<typename Policy, template< size_t > class WordType>
void X86InstructionSemantics< Policy, WordType >::write32 ( SgAsmExpression e,
const Word(32)&  value 
) [inline]

template<typename Policy, template< size_t > class WordType>
X86InstructionSemantics< Policy, WordType >::Word (  )  [inline]

template<typename Policy, template< size_t > class WordType>
template<size_t Len>
void X86InstructionSemantics< Policy, WordType >::setFlagsForResult ( const Word(Len)&  result  )  [inline]

template<typename Policy, template< size_t > class WordType>
template<size_t Len>
void X86InstructionSemantics< Policy, WordType >::setFlagsForResult ( const Word(Len)&  result,
Word(1)  cond 
) [inline]

template<typename Policy, template< size_t > class WordType>
template<size_t Len>
X86InstructionSemantics< Policy, WordType >::Word ( Len   )  const

template<typename Policy, template< size_t > class WordType>
const X86InstructionSemantics< Policy, WordType >::Word ( Len   ) 

template<typename Policy, template< size_t > class WordType>
const bool X86InstructionSemantics< Policy, WordType >::Word (  )  [inline]

template<typename Policy, template< size_t > class WordType>
template<size_t Len>
X86InstructionSemantics< Policy, WordType >::Word ( Len   )  const

template<typename Policy, template< size_t > class WordType>
const X86InstructionSemantics< Policy, WordType >::Word ( Len   ) 

template<typename Policy, template< size_t > class WordType>
const bool X86InstructionSemantics< Policy, WordType >::Word (  ) 

template<typename Policy, template< size_t > class WordType>
const bool X86InstructionSemantics< Policy, WordType >::Word (  )  [inline]

template<typename Policy, template< size_t > class WordType>
template<size_t Len>
X86InstructionSemantics< Policy, WordType >::Word ( Len   )  const


Member Data Documentation

template<typename Policy, template< size_t > class WordType>
Policy& X86InstructionSemantics< Policy, WordType >::policy

template<typename Policy, template< size_t > class WordType>
SgAsmInstruction* X86InstructionSemantics< Policy, WordType >::current_instruction

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_EAX

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_EBX

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_ECX

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_EDX

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_EDI

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_EIP

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_ESI

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_ESP

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_EBP

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_AX

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_CX

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_DX

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_AL

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_AH

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_EFLAGS

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_AF

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_CF

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_DF

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_OF

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_PF

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_SF

template<typename Policy, template< size_t > class WordType>
RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_ZF

template<typename Policy, template< size_t > class WordType>
size_t X86InstructionSemantics< Policy, WordType >::To

template<typename Policy, template< size_t > class WordType>
const bool X86InstructionSemantics< Policy, WordType >::invertCarries

template<typename Policy, template< size_t > class WordType>
bool X86InstructionSemantics< Policy, WordType >::dec


The documentation for this struct was generated from the following file:
Generated on Tue Jan 31 05:45:03 2012 for ROSE by  doxygen 1.4.7