本文整理汇总了C#中Reko.Assemblers.x86.ParsedOperand类的典型用法代码示例。如果您正苦于以下问题:C# ParsedOperand类的具体用法?C# ParsedOperand怎么用?C# ParsedOperand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParsedOperand类属于Reko.Assemblers.x86命名空间,在下文中一共展示了ParsedOperand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Shr
public void Shr(ParsedOperand dst, byte c)
{
ProcessShiftRotation(0x05, dst, new ParsedOperand(new ImmediateOperand(Constant.Byte(c))));
}
示例2: ProcessUnary
internal void ProcessUnary(int operation, ParsedOperand op)
{
PrimitiveType dataWidth = EnsureValidOperandSize(op);
EmitOpcode(0xF6 | IsWordWidth(dataWidth), dataWidth);
EmitModRM(operation, op);
}
示例3: EmitModRM
internal void EmitModRM(int reg, ParsedOperand op, byte b)
{
RegisterOperand regOp = op.Operand as RegisterOperand;
if (regOp != null)
{
modRm.EmitModRM(reg, regOp);
emitter.EmitByte(b);
}
else
{
EmitModRM(reg, (MemoryOperand) op.Operand, b, op.Symbol);
}
}
示例4: Mul
public void Mul(ParsedOperand op)
{
PrimitiveType dataWidth = EnsureValidOperandSize(op);
// Single operand doesn't accept immediate values.
if (op.Operand is ImmediateOperand)
Error("Immediate operand not allowed for single-argument multiplication");
EmitOpcode(0xF6 | IsWordWidth(dataWidth), dataWidth);
EmitModRM(4, op);
}
示例5: ProcessSetCc
internal void ProcessSetCc(byte bits, ParsedOperand op)
{
PrimitiveType dataWidth = EnsureValidOperandSize(op);
if (dataWidth != PrimitiveType.Byte)
Error("Instruction takes only a byte operand");
EmitOpcode(0x0F, dataWidth);
emitter.EmitByte(0x90 | (bits & 0xF));
EmitModRM(0, op);
}
示例6: ProcessFst
internal void ProcessFst(bool pop, ParsedOperand operand)
{
FpuOperand fop = operand.Operand as FpuOperand;
MemoryOperand mop = operand.Operand as MemoryOperand;
int regBits = pop ? 3 : 2;
if (mop != null)
{
switch (mop.Width.Size)
{
case 4: EmitOpcode(0xD9, null); break;
case 8: EmitOpcode(0xDD, null); break;
default: Error("Unexpected operator width"); break;
}
EmitModRM(regBits, operand);
}
else if (fop != null)
{
EmitOpcode(0xDD, null);
EmitModRM(regBits, new ParsedOperand(fop, null));
}
else
Error("Unexpected operator type");
}
示例7: ProcessInt
internal void ProcessInt(ParsedOperand vector)
{
ImmediateOperand op = (ImmediateOperand) vector.Operand;
EmitOpcode(0xCD, null);
emitter.EmitByte(op.Value.ToInt32());
}
示例8: Bsr
public void Bsr(ParsedOperand dst, ParsedOperand src)
{
ProcessBitScan(0xBD, dst, src);
}
示例9: Cmp
public void Cmp(ParsedOperand src, int dst)
{
ProcessBinop(0x7, src, Imm(dst));
}
示例10: Shld
public void Shld(ParsedOperand op1, ParsedOperand op2, ParsedOperand op3)
{
ProcessDoubleShift(0, op1, op2, op3);
}
示例11: Shrd
public void Shrd(ParsedOperand op1, ParsedOperand op2, byte count)
{
ProcessDoubleShift(8, op1, op2, new ParsedOperand(ImmediateOperand.Byte(count)));
}
示例12: ProcessDoubleShift
internal void ProcessDoubleShift(byte bits, ParsedOperand op0, ParsedOperand op1, ParsedOperand count)
{
PrimitiveType dataWidth = EnsureValidOperandSize(op0);
RegisterOperand regSrc = op1.Operand as RegisterOperand;
if (regSrc == null)
Error("Second operand of SHLD/SHRD must be a register");
ImmediateOperand immShift = count.Operand as ImmediateOperand;
RegisterOperand regShift = count.Operand as RegisterOperand;
if (regShift != null && regShift.Register == Registers.cl)
{
bits |= 0x01;
}
else if (immShift == null)
{
Error("SHLD/SHRD instruction must be followed by a constant or CL");
}
EmitOpcode(0x0F, dataWidth);
emitter.EmitByte(0xA4 | bits);
EmitModRM(RegisterEncoding(regSrc.Register), op0);
if (immShift != null)
emitter.EmitByte((byte) immShift.Value.ToUInt32());
}
示例13: ProcessCallJmp
internal void ProcessCallJmp(bool far, int indirect, ParsedOperand op)
{
if (far) indirect |= 1;
EmitOpcode(0xFF, SegmentDataWidth);
EmitModRM(indirect, op);
}
示例14: ProcessBitScan
internal void ProcessBitScan(byte opCode, ParsedOperand dst, ParsedOperand src)
{
PrimitiveType dataWidth = EnsureValidOperandSize(src);
RegisterOperand regDst = dst.Operand as RegisterOperand;
if (regDst == null)
Error("First operand of bit scan instruction must be a register");
EmitOpcode(0x0F, dataWidth);
emitter.EmitByte(opCode);
EmitModRM(RegisterEncoding(regDst.Register), src);
}
示例15: EnsureValidOperandSize
internal PrimitiveType EnsureValidOperandSize(ParsedOperand op)
{
PrimitiveType w = op.Operand.Width;
if (w == null)
Error("Width of the operand is unknown");
return w;
}