本文整理汇总了C#中OperandType类的典型用法代码示例。如果您正苦于以下问题:C# OperandType类的具体用法?C# OperandType怎么用?C# OperandType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OperandType类属于命名空间,在下文中一共展示了OperandType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Encode
public void Encode(byte[] code, ref int offset, out OperandType operand, IState state)
{
operand = OperandType.None;
Array.Copy(BitConverter.GetBytes(this.Routine.LittleEndian()), 0, code, offset + 2, 2);
code[offset + 4] = this.ArgumentCount;
offset += 5;
}
示例2: MSILOpCode
internal MSILOpCode(string name, byte[] bytes, OperandType operandType, StackBehaviour stackBehaviour)
{
Name = name;
Bytes = bytes;
OperandType = operandType;
StackBehaviour = stackBehaviour;
}
示例3: Decode
public void Decode(byte[] code, ref int offset, OperandType operand, IState state)
{
this.Unknown1 = BitConverter.ToInt16(code, offset + 2).BigEndian();
this.Unknown2 = BitConverter.ToInt16(code, offset + 4).BigEndian();
this.Unknown3 = BitConverter.ToInt16(code, offset + 6).BigEndian();
offset += 8;
}
示例4: GetRegister
public void GetRegister(OperandType operandType, RegisterIndex registerIndex, out Number4[] register, out int index)
{
switch (operandType)
{
case OperandType.ConstantBuffer:
register = _virtualMachine.ConstantBuffers[registerIndex.Index2D_0];
index = registerIndex.Index2D_1;
return;
case OperandType.Input:
// Only GS requires 2-dimensional inputs, but for simplicity we always use a 2-dimensional input array.
register = Inputs[registerIndex.Index2D_0];
index = registerIndex.Index2D_1;
return;
case OperandType.Output:
register = Outputs;
index = registerIndex.Index1D;
return;
case OperandType.Temp:
register = Temps;
index = registerIndex.Index1D;
return;
case OperandType.IndexableTemp:
register = IndexableTemps[registerIndex.Index2D_0];
index = registerIndex.Index2D_1;
return;
default:
throw new ArgumentException("Unsupported operand type: " + operandType);
}
}
示例5: Instruction
public Instruction(ushort pos, InstrCode code, OperandType operandType, ulong operand)
{
Pos = pos;
Code = code;
OperandType = operandType;
Operand = operand;
}
示例6: RegData
public RegData(OperandType type, int size, int id, int code)
{
_op = checked((byte)type);
_size = checked((byte)size);
_id = id;
_code = code;
}
示例7: Decode
public void Decode(byte[] code, ref int offset, OperandType operand, IState state)
{
if (operand != OperandType.None)
{
throw new InvalidOperationException();
}
offset += 2;
}
示例8: AutoSizedOperand
protected AutoSizedOperand(OperandType type,
OperandValueType valueType = OperandValueType.Dword,
bool isPointer = false,
bool isOffset = false,
Register offsetRegister = Register.R0,
int payload = 0)
: base(type, valueType, isPointer, isOffset, offsetRegister, payload)
{
}
示例9: Decode
public void Decode(byte[] code, ref int offset, OperandType operand, IState state)
{
if (operand != OperandType.None)
{
throw new InvalidOperationException();
}
this.Value = BitConverter.ToInt32(code, offset + 2).BigEndian();
offset += 6;
}
示例10: Decode
public void Decode(byte[] code, ref int offset, OperandType operand, IState state)
{
if (operand != OperandType.IntegerInteger &&
operand != OperandType.FloatFloat)
{
throw new InvalidOperationException();
}
this.Operand = operand;
offset += 2;
}
示例11: Decode
public void Decode(byte[] code, ref int offset, OperandType operand, IState state)
{
if (operand != OperandType.None)
{
throw new InvalidOperationException();
}
this.Routine = BitConverter.ToInt16(code, offset + 2).BigEndian();
this.ArgumentCount = code[offset + 4];
offset += 5;
}
示例12: Operand
public Operand(Processor cpu, OperandType optype)
{
Type = optype;
switch (Type)
{
case OperandType.AddressBlock:
Address = new AddressBlock(cpu, cpu.ReadULong());
break;
case OperandType.Register:
// add
break;
case OperandType.StackIndex:
// add
break;
case OperandType.NumericByte:
Value = new ByteBlock(cpu.ReadByte());
break;
case OperandType.NumericSByte:
Value = new ByteBlock(cpu.ReadSByte());
break;
case OperandType.NumericShort:
Value = new ByteBlock(cpu.ReadShort());
break;
case OperandType.NumericUShort:
Value = new ByteBlock(cpu.ReadUShort());
break;
case OperandType.NumericInt:
Value = new ByteBlock(cpu.ReadInt());
break;
case OperandType.NumericUInt:
Value = new ByteBlock(cpu.ReadUInt());
break;
case OperandType.NumericLong:
Value = new ByteBlock(cpu.ReadLong());
break;
case OperandType.NumericULong:
Value = new ByteBlock(cpu.ReadULong());
break;
case OperandType.NumericFloat:
Value = new ByteBlock(cpu.ReadFloat());
break;
case OperandType.NumericDouble:
Value = new ByteBlock(cpu.ReadDouble());
break;
case OperandType.LPString:
uint length = cpu.ReadUInt();
ByteBlock bytes = cpu.Read(length);
Value = new ByteBlock(System.Text.Encoding.UTF8.GetString(bytes.ToByteArray()));
break;
default:
break;
}
}
示例13: OpCode
internal OpCode(string name, Code code, OperandType operandType, FlowControl flowControl, OpCodeType opCodeType, StackBehaviour push, StackBehaviour pop) {
this.Name = name;
this.Code = code;
this.OperandType = operandType;
this.FlowControl = flowControl;
this.OpCodeType = opCodeType;
this.StackBehaviourPush = push;
this.StackBehaviourPop = pop;
if (((ushort)code >> 8) == 0)
OpCodes.OneByteOpCodes[(byte)code] = this;
else if (((ushort)code >> 8) == 0xFE)
OpCodes.TwoByteOpCodes[(byte)code] = this;
}
示例14: Decode
public void Decode(byte[] code, ref int offset, OperandType operand, IState state)
{
this.Operand = operand;
if (operand == Script.OperandType.StructureStructure)
{
this.StructureSize = BitConverter.ToInt16(code, offset + 2).BigEndian();
offset += 4;
}
else
{
offset += 2;
}
}
示例15: Operand
protected Operand(OperandType type,
OperandValueType valueType = OperandValueType.Dword,
bool isPointer = false,
bool isOffset = false,
Register offsetRegister = Register.R0,
int payload = 0)
{
Type = type;
ValueType = valueType;
IsPointer = isPointer;
IsOffset = isOffset;
OffsetRegister = offsetRegister;
Payload = payload;
}