本文整理汇总了C#中SimInstruction类的典型用法代码示例。如果您正苦于以下问题:C# SimInstruction类的具体用法?C# SimInstruction怎么用?C# SimInstruction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SimInstruction类属于命名空间,在下文中一共展示了SimInstruction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override void Execute(CPUx86 cpu, SimInstruction instruction)
{
uint a = LoadValue(cpu, instruction.Operand1);
uint b = LoadValue(cpu, instruction.Operand2);
int size = instruction.Operand1.Size;
int shift = ((int)b) & 0x1F;
if (shift == 0)
return; // no changes
bool sign = IsSign(a, size);
uint u = a >> shift;
if (sign)
{
uint m = (uint.MaxValue << (int)(32 - shift));
u = u | m;
}
StoreValue(cpu, instruction.Operand1, (uint)u, size);
UpdateFlags(cpu, size, (long)u, u, true, true, false, false, false);
cpu.EFLAGS.Overflow = (shift != 1);
cpu.EFLAGS.Carry = ((a >> (shift - 1)) & 0x1) == 1;
cpu.EFLAGS.Sign = sign;
}
示例2: Execute
public override void Execute(CPUx86 cpu, SimInstruction instruction)
{
uint address = GetAddress(cpu, instruction.Operand2);
int size = instruction.Operand1.Size;
StoreValue(cpu, instruction.Operand1, address, size);
}
示例3: Execute
public override void Execute(CPUx86 cpu, SimInstruction instruction)
{
if (IsSign(cpu.EAX.Value))
cpu.EDX.Value = ~(uint)0;
else
cpu.EDX.Value = 0;
}
示例4: Execute
public override void Execute(CPUx86 cpu, SimInstruction instruction)
{
if (!cpu.EFLAGS.Zero)
{
StoreValue(cpu, instruction.Operand1, 1, 8);
}
}
示例5: Execute
public override void Execute(CPUx86 cpu, SimInstruction instruction)
{
if (cpu.EFLAGS.Carry || cpu.EFLAGS.Zero)
{
cpu.EIP.Value = ResolveBranch(cpu, instruction.Operand1);
}
}
示例6: Execute
public override void Execute(CPUx86 cpu, SimInstruction instruction)
{
var a = LoadFloatValue(cpu, instruction.Operand1, instruction.Size).Low;
var b = LoadFloatValue(cpu, instruction.Operand2, instruction.Size).Low;
int size = instruction.Size;
if (double.IsNaN(a) || double.IsNaN(b))
{
cpu.EFLAGS.Zero = true;
cpu.EFLAGS.Parity = true;
cpu.EFLAGS.Carry = true;
}
else if (a == b)
{
cpu.EFLAGS.Zero = true;
cpu.EFLAGS.Parity = false;
cpu.EFLAGS.Carry = false;
}
else if (a > b)
{
cpu.EFLAGS.Zero = false;
cpu.EFLAGS.Parity = false;
cpu.EFLAGS.Carry = false;
}
else
{
cpu.EFLAGS.Zero = false;
cpu.EFLAGS.Parity = false;
cpu.EFLAGS.Carry = true;
}
cpu.EFLAGS.Overflow = false;
cpu.EFLAGS.Adjust = false;
cpu.EFLAGS.Sign = false;
}
示例7: Execute
public override void Execute(CPUx86 cpu, SimInstruction instruction)
{
if (!cpu.EFLAGS.Parity)
{
cpu.EIP.Value = ResolveBranch(cpu, instruction.Operand1);
}
}
示例8: Execute
public override void Execute(CPUx86 cpu, SimInstruction instruction)
{
var a = LoadFloatValue(cpu, instruction.Operand1, instruction.Size);
uint p = LoadValue(cpu, instruction.Operand2);
int size = instruction.Size;
float r;
if ((p & 0x3) == 0x3)
{
r = (float)Math.Truncate(a.LowF);
}
else if ((p & 0x2) == 0x2)
{
r = (float)Math.Ceiling(a.LowF);
}
else if ((p & 0x1) == 0x1)
{
r = (float)Math.Floor(a.LowF);
}
else
{
r = (float)Math.Round(a.LowF);
}
StoreFloatValue(cpu, instruction.Operand1, r, size);
}
示例9: Execute
public override void Execute(CPUx86 cpu, SimInstruction instruction)
{
int a = (int)LoadValue(cpu, instruction.Operand2);
int size = instruction.Operand1.Size;
StoreFloatValue(cpu, instruction.Operand1, (double)a, size);
}
示例10: Execute
public override void Execute(CPUx86 cpu, SimInstruction instruction)
{
var r = LoadFloatValue(cpu, instruction.Operand1, instruction.Operand1.Size);
int size = instruction.Operand1.Size;
cpu.ST0.Value = r;
}
示例11: Execute
public override void Execute(CPUx86 cpu, SimInstruction instruction)
{
uint a = LoadValue(cpu, instruction.Operand1);
uint b = LoadValue(cpu, instruction.Operand2);
int size = instruction.Operand1.Size;
int shift = ((int)b) & 0x1F;
if (shift == 0)
return; // no changes
uint u = a << shift;
bool sign = IsSign(a, size);
//if (cpu.FLAGS.Carry)
//{
// u = u | 0x1;
//}
StoreValue(cpu, instruction.Operand1, u, size);
UpdateFlags(cpu, size, u, u, true, true, true, false, false);
cpu.EFLAGS.Overflow = sign ^ IsSign(u, size);
cpu.EFLAGS.Carry = sign;
}
示例12: Execute
public override void Execute(CPUx86 cpu, SimInstruction instruction)
{
if (cpu.EFLAGS.Sign != cpu.EFLAGS.Overflow)
{
StoreValue(cpu, instruction.Operand1, 1, 8);
}
}
示例13: Execute
public override void Execute(CPUx86 cpu, SimInstruction instruction)
{
uint a = LoadValue(cpu, instruction.Operand2);
int size = instruction.Operand1.Size;
StoreValue(cpu, instruction.Operand1, a, size);
}
示例14: Execute
public override void Execute(CPUx86 cpu, SimInstruction instruction)
{
double a = LoadFloatValue(cpu, instruction.Operand1);
double b = LoadFloatValue(cpu, instruction.Operand2);
int size = instruction.Operand1.Size;
if (double.IsNaN(a) || double.IsNaN(b))
{
cpu.EFLAGS.Zero = true;
cpu.EFLAGS.Parity = true;
cpu.EFLAGS.Carry = true;
}
else if (a == b)
{
cpu.EFLAGS.Zero = true;
cpu.EFLAGS.Parity = false;
cpu.EFLAGS.Carry = false;
}
else if (a > b)
{
cpu.EFLAGS.Zero = false;
cpu.EFLAGS.Parity = false;
cpu.EFLAGS.Carry = false;
}
else
{
cpu.EFLAGS.Zero = false;
cpu.EFLAGS.Parity = false;
cpu.EFLAGS.Carry = true;
}
}
示例15: AddInstruction
public void AddInstruction(LinkerSymbol baseSymbol, long offset, SimInstruction instruction)
{
lock (mylock2)
{
instructions.Add(new Tuple<LinkerSymbol, long, SimInstruction>(baseSymbol, offset, instruction));
}
}