System.Reflection.Emit.OpCodes.TakesSingleByteArgument Method

Returns true or false if the supplied opcode takes a single byte argument.

Syntax

public static bool TakesSingleByteArgument (OpCode inst)

Parameters

inst
An instance of an Opcode object.

Returns

True or false.

Remarks

This method can be used to find which MSIL opcodes are "short form", for use in optimized code.

TakesSingleByteArgument returns true if the System.Reflection.Emit.OpCode instance takes a single byte argument in the following cases:

Otherwise, it returns false.

The example below demonstrates the use of TakesSingleByteArgument by reflecting on to the OpCodes class and testing to see whether each OpCode field takes a single-byte argument.

code reference: System.Reflection.Emit.OpCodes.TakesSingleByteArgument Example#1

Requirements

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0