C# Class Reko.Arch.X86.X86Rewriter

Mostrar archivo Open project: uxmal/reko

Public Methods

Method Description
EmitBinOp ( Reko.Core.Operators.BinaryOperator binOp, MachineOperand dst, DataType dtDst, Expression left, Expression right, CopyFlags flags ) : void
EmitCommonFpuInstruction ( Func op, bool fReversed, bool fPopStack ) : void
EmitCommonFpuInstruction ( Func op, bool fReversed, bool fPopStack, DataType cast ) : void
MatchesFstswSequence ( ) : bool
MaybeCast ( DataType type, Expression e ) : Expression
Mem ( Expression defaultSegment, Expression effectiveAddress ) : MemoryAccess
MemDi ( ) : MemoryAccess
MemSi ( ) : MemoryAccess
OperandAsCodeAddress ( MachineOperand op ) : Address
RewriteAdcSbb ( Func opr ) : void
RewriteAddSub ( Reko.Core.Operators.BinaryOperator op ) : void

Doesn't handle the x86 idiom add ... adc => long add (and sub ..sbc => long sub)

RewriteBinOp ( Reko.Core.Operators.BinaryOperator opr ) : void
RewriteBswap ( ) : void
RewriteCbw ( ) : void
RewriteFld ( ) : void
RewriteIret ( ) : void
RewriteLahf ( ) : void
RewriteLea ( ) : void
RewriteRet ( ) : void

Private Methods

Method Description
Branch ( ConditionCode code, MachineOperand op ) : void
CreateTestCondition ( ConditionCode cc, Opcode opcode ) : Expression
EmitCcInstr ( Expression expr, FlagM defFlags ) : void

Emits an assignment to a flag-group pseudoregister.

EmitDaaDas ( string fnName ) : void
EmitFchs ( ) : void
EmitPop ( RegisterStorage reg ) : void
FpuRegister ( int reg ) : Identifier
GetIncrementOperator ( ) : Func
IntelSizeSuffix ( int size ) : string
IsRealModeReboot ( Reko.Arch.X86.X86Instruction instrCur ) : bool

A jump to 0xFFFF:0x0000 in real mode is a reboot.

RewriteAaa ( ) : void
RewriteAad ( ) : void
RewriteAam ( ) : void
RewriteAas ( ) : void
RewriteArpl ( ) : void
RewriteBound ( ) : void
RewriteBsr ( ) : void
RewriteBt ( ) : void
RewriteBtr ( ) : void
RewriteBts ( ) : void
RewriteCall ( MachineOperand callTarget, PrimitiveType opsize ) : void
RewriteCli ( ) : void
RewriteCmp ( ) : void
RewriteCmpxchg ( ) : void
RewriteConditionalGoto ( ConditionCode cc, MachineOperand op1 ) : void
RewriteConditionalMove ( ConditionCode cc, MachineOperand dst, MachineOperand src ) : void
RewriteCpuid ( ) : void
RewriteCwd ( ) : void
RewriteDivide ( Reko.Core.Operators.BinaryOperator op, Domain domain ) : void
RewriteEnter ( ) : void
RewriteExchange ( ) : void
RewriteFUnary ( string name ) : void
RewriteFabs ( ) : void
RewriteFbld ( ) : void
RewriteFbstp ( ) : void
RewriteFclex ( ) : void
RewriteFcom ( int pops ) : void
RewriteFdecstp ( ) : void
RewriteFfree ( ) : void
RewriteFicom ( bool pop ) : void
RewriteFild ( ) : void
RewriteFincstp ( ) : void
RewriteFist ( bool pop ) : void
RewriteFldConst ( Constant c ) : void
RewriteFldConst ( double constant ) : void
RewriteFldcw ( ) : void
RewriteFldenv ( ) : void
RewriteFpatan ( ) : void
RewriteFprem ( ) : void
RewriteFrstor ( ) : void
RewriteFsave ( ) : void
RewriteFscale ( ) : void
RewriteFsincos ( ) : void
RewriteFst ( bool pop ) : void
RewriteFstenv ( ) : void
RewriteFstsw ( ) : void
RewriteFtst ( ) : void
RewriteFxam ( ) : void
RewriteFyl2x ( ) : void
RewriteHlt ( ) : void
RewriteIn ( ) : void
RewriteIncDec ( int amount ) : void
RewriteInt ( ) : void
RewriteInto ( ) : void
RewriteJcxz ( ) : void
RewriteJmp ( ) : void
RewriteLeave ( ) : void
RewriteLock ( ) : void
RewriteLogical ( Reko.Core.Operators.BinaryOperator op ) : void
RewriteLoop ( FlagM useFlags, ConditionCode cc ) : void
RewriteLxs ( RegisterStorage seg ) : void
RewriteMov ( ) : void
RewriteMovsx ( ) : void
RewriteMovzx ( ) : void
RewriteMultiply ( BinaryOperator op, Domain resultDomain ) : void
RewriteNeg ( ) : void
RewriteNot ( ) : void
RewriteOut ( ) : void
RewritePop ( ) : void
RewritePop ( Identifier dst, PrimitiveType width ) : void
RewritePop ( MachineOperand op, PrimitiveType width ) : void
RewritePopa ( ) : void
RewritePopf ( ) : void
RewritePush ( ) : void
RewritePush ( PrimitiveType dataWidth, Expression expr ) : void
RewritePush ( RegisterStorage reg ) : void
RewritePusha ( ) : void
RewritePushf ( ) : void
RewriteRdtsc ( ) : void
RewriteRep ( ) : void

Converts a rep [string instruction] into a loop: while ([e]cx != 0) [string instruction] --ecx; if (zF) ; only cmps[b] and scas[b] goto follow; follow: ...

RewriteRotation ( string operation, bool useCarry, bool left ) : void
RewriteSet ( ConditionCode cc ) : void
RewriteSetFlag ( FlagM flagM, Constant value ) : void
RewriteShxd ( string name ) : void
RewriteSti ( ) : void
RewriteStringInstruction ( ) : bool

Rewrites the current instruction as a string instruction.

RewriteTest ( ) : void
RewriteUnaryOperator ( Expression>.Func op, MachineOperand opDst, MachineOperand opSrc, CopyFlags flags ) : void
RewriteWait ( ) : void
RewriteXadd ( ) : void
RewriteXgetbv ( ) : void
RewriteXlat ( ) : void
RewriterFstcw ( ) : void
StackPointer ( ) : Identifier
WriteFpuStack ( int offset ) : void

Method Details

EmitBinOp() public method

public EmitBinOp ( Reko.Core.Operators.BinaryOperator binOp, MachineOperand dst, DataType dtDst, Expression left, Expression right, CopyFlags flags ) : void
binOp Reko.Core.Operators.BinaryOperator
dst Reko.Core.Machine.MachineOperand
dtDst DataType
left Expression
right Expression
flags CopyFlags
return void

EmitCommonFpuInstruction() public method

public EmitCommonFpuInstruction ( Func op, bool fReversed, bool fPopStack ) : void
op Func
fReversed bool
fPopStack bool
return void

EmitCommonFpuInstruction() public method

public EmitCommonFpuInstruction ( Func op, bool fReversed, bool fPopStack, DataType cast ) : void
op Func
fReversed bool
fPopStack bool
cast DataType
return void

MatchesFstswSequence() public method

public MatchesFstswSequence ( ) : bool
return bool

MaybeCast() public method

public MaybeCast ( DataType type, Expression e ) : Expression
type DataType
e Expression
return Expression

Mem() public method

public Mem ( Expression defaultSegment, Expression effectiveAddress ) : MemoryAccess
defaultSegment Expression
effectiveAddress Expression
return MemoryAccess

MemDi() public method

public MemDi ( ) : MemoryAccess
return MemoryAccess

MemSi() public method

public MemSi ( ) : MemoryAccess
return MemoryAccess

OperandAsCodeAddress() public method

public OperandAsCodeAddress ( MachineOperand op ) : Address
op Reko.Core.Machine.MachineOperand
return Address

RewriteAdcSbb() public method

public RewriteAdcSbb ( Func opr ) : void
opr Func
return void

RewriteAddSub() public method

Doesn't handle the x86 idiom add ... adc => long add (and sub ..sbc => long sub)
public RewriteAddSub ( Reko.Core.Operators.BinaryOperator op ) : void
op Reko.Core.Operators.BinaryOperator
return void

RewriteBinOp() public method

public RewriteBinOp ( Reko.Core.Operators.BinaryOperator opr ) : void
opr Reko.Core.Operators.BinaryOperator
return void

RewriteBswap() public method

public RewriteBswap ( ) : void
return void

RewriteCbw() public method

public RewriteCbw ( ) : void
return void

RewriteFld() public method

public RewriteFld ( ) : void
return void

RewriteIret() public method

public RewriteIret ( ) : void
return void

RewriteLahf() public method

public RewriteLahf ( ) : void
return void

RewriteLea() public method

public RewriteLea ( ) : void
return void

RewriteRet() public method

public RewriteRet ( ) : void
return void