public static MsilInstruction Create(MsilOpCode code, IList <MsilInstruction> operand) { if (code.OperandType != MsilOperandType.InlineSwitch) { throw new ArgumentException("Opcode does not accept an instruction array operand.", "code"); } return(new MsilInstruction(0, code, operand)); }
public static MsilInstruction Create(MsilOpCode code, float operand) { if (code.OperandType != MsilOperandType.ShortInlineR) { throw new ArgumentException("Opcode does not accept a float32 operand.", "code"); } return(new MsilInstruction(0, code, operand)); }
public static MsilInstruction Create(MsilOpCode code, string operand) { if (code.OperandType != MsilOperandType.InlineString) { throw new ArgumentException("Opcode does not accept a string operand.", "code"); } return(new MsilInstruction(0, code, operand)); }
public static MsilInstruction Create(MsilOpCode code, MsilInstruction instruction) { if (code.OperandType != MsilOperandType.ShortInlineBrTarget && code.OperandType != MsilOperandType.InlineBrTarget) { throw new ArgumentException("Opcode does not accept an instruction operand.", "code"); } return(new MsilInstruction(0, code, instruction)); }
public static MsilInstruction Create(MsilOpCode code) { if (code.OperandType != MsilOperandType.InlineNone) { throw new ArgumentException("Opcode requires an operand.", "code"); } return(new MsilInstruction(0, code, null)); }
public static MsilInstruction Create(MsilOpCode code, ParameterSignature operand) { if (code.OperandType != MsilOperandType.InlineArgument && code.OperandType != MsilOperandType.ShortInlineArgument) { throw new ArgumentException("Opcode does not accept a parameter operand.", "code"); } return(new MsilInstruction(0, code, operand)); }
public static MsilInstruction Create(MsilOpCode code, VariableSignature operand) { if (code.OperandType != MsilOperandType.InlineVar && code.OperandType != MsilOperandType.ShortInlineVar) { throw new ArgumentException("Opcode does not accept a local variable operand.", "code"); } return(new MsilInstruction(0, code, operand)); }
private void WriteOpCode(MsilOpCode opCode) { if (opCode.Size == 2) { _writer.WriteByte(opCode.Op1); } _writer.WriteByte(opCode.Op2); }
public static MsilInstruction Create(MsilOpCode code, IMemberReference operand) { switch (code.OperandType) { case MsilOperandType.InlineField: case MsilOperandType.InlineMethod: case MsilOperandType.InlineTok: case MsilOperandType.InlineType: return(new MsilInstruction(0, code, operand)); } throw new ArgumentException("Opcode does not accept a member operand operand.", "code"); }
public MsilInstruction(int offset, MsilOpCode opCode, object operand) { Offset = offset; OpCode = opCode; Operand = operand; }