System.Reflection.Emit.OpCodes Class

Assembly: Mscorlib.dll
Namespace: System.Reflection.Emit
Summary
Provides field representations of the Microsoft Intermediate Language (MSIL) instructions for emission by the ILGenerator class members (such as ILGenerator.Emit).
C# Syntax:
public class OpCodes
Thread Safety
Reflection Emit is thread-safe when using assemblies that were created with the AppDomain.DefineDynamicAssembly method with the Boolean parameter isSynchronized set to true.
Remarks
See the Common Language Infrastructure Instruction Set documentation in the Tool Developers Guide for a detailed description of the member opcodes.
See also:
System.Reflection.Emit Namespace

System.Reflection.Emit.OpCodes Member List:

Public Fields
Add Adds two values and pushes the result onto the evaluation stack.
Add_Ovf Adds two integers, performs an overflow check, and pushes the result onto the evaluation stack.
Add_Ovf_Un Adds two unsigned integer values, performs an overflow check, and pushes the result onto the evaluation stack.
And Computes the bitwise AND of two values and pushes the result onto the evalution stack.
Arglist Returns an unmanaged pointer to the argument list of the current method.
Beq Transfers control to a target instruction if two values are equal.
Beq_S Transfers control to a target instruction (short form) if two values are equal.
Bge Transfers control to a target instruction if the first value is greater than or equal to the second value.
Bge_S Transfers control to a target instruction (short form) if the first value is greater than or equal to the second value.
Bge_Un Transfers control to a target instruction if the the first value is greather than the second value, when comparing unsigned integer values or unordered float values.
Bge_Un_S Transfers control to a target instruction (short form) if if the the first value is greather than the second value, when comparing unsigned integer values or unordered float values.
Bgt Transfers control to a target instruction if the first value is greater than the second value.
Bgt_S Transfers control to a target instruction (short form) if the first value is greater than the second value.
Bgt_Un Transfers control to a target instruction if the first value is greater than the second value, when comparing unsigned integer values or unordered float values.
Bgt_Un_S Transfers control to a target instruction (short form) if the first value is greater than the second value, when comparing unsigned integer values or unordered float values.
Ble Transfers control to a target instruction if the first value is less than or equal to the second value.
Ble_S Transfers control to a target instruction (short form) if the first value is less than or equal to the second value.
Ble_Un Transfers control to a target instruction if the first value is less than or equal to the second value, when comparing unsigned integer values or unordered float values.
Ble_Un_S Transfers control to a target instruction (short form) if the first value is less than or equal to the second value, when comparing unsigned integer values or unordered float values.
Blt Transfers control to a target instruction if the first value is less than the second value.
Blt_S Transfers control to a target instruction (short form) if the first value is less than the second value.
Blt_Un Transfers control to a target instruction if the first value is less than the second value, when comparing unsigned integer values or unordered float values.
Blt_Un_S Transfers control to a target instruction (short form) if the first value is less than the second value, when comparing unsigned integer values or unordered float values.
Bne_Un Transfers control to a target instruction when two unsigned integer values or unordered float values are not equal.
Bne_Un_S Transfers control to a target instruction (short form) when two unsigned integer values or unordered float values are not equal.
Box Converts a value type to an object reference (type O).
Br Unconditionally transfers control to a target instruction.
Br_S Unconditionally transfers control to a target instruction (short form).
Break Signals the Common Language Infrastructure (CLI) to inform the debugger that a break point has been tripped.
Brfalse Transfers control to a target instruction if value is false, a null reference (not set or empty), or zero.
Brfalse_S Transfers control to a target instruction if value is false, a null reference, or zero.
Brtrue Transfers control to a target instruction if value is true, not null, or non-zero.
Brtrue_S Transfers control to a target instruction (short form) if value is true, not null, or non-zero.
Call Calls the method indicated by the passed method descriptor.
Calli Calls the method indicated on the evaluation stack (as a pointer to an entry point) with arguments described by a calling convention.
Callvirt Calls a late-bound method on an object, pushing the return value onto the evaluation stack.
Castclass Attempts to cast an object passed by reference to the specified class.
Ceq Compares two values. If they are equal, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack.
Cgt Compares two values. If the first value is greater than the second, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack.
Cgt_Un Compares two unsigned or unordered values. If the first value is greater than the second, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack.
Ckfinite Throws ArithmeticException if value is not a finite number.
Clt Compares two values. If the first value is less than the second, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack.
Clt_Un Compares the unsigned or unordered values value1 and value2. If value1 is less than value2, then the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack.
Conv_I Converts the value on top of the evaluation stack to natural int.
Conv_I1 Converts the value on top of the evaluation stack to int8, then extends (pads) it to int32.
Conv_I2 Converts the value on top of the evaluation stack to int16, then extends (pads) it to int32.
Conv_I4 Converts the value on top of the evaluation stack to int32.
Conv_I8 Converts the value on top of the evaluation stack to int64.
Conv_Ovf_I Converts the signed value on top of the evaluation stack to signed natural int, throwing OverflowException on overflow.
Conv_Ovf_I_Un Converts the unsigned value on top of the evaluation stack to signed natural int, throwing OverflowException on overflow.
Conv_Ovf_I1 Converts the signed value on top of the evaluation stack to signed int8 and extends it to int32, throwing OverflowException on overflow.
Conv_Ovf_I1_Un Converts the unsigned value on top of the evaluation stack to signed int8 and extends it to int32, throwing OverflowException on overflow.
Conv_Ovf_I2 Converts the signed value on top of the evaluation stack to signed int16 and extending it to int32, throwing OverflowException on overflow.
Conv_Ovf_I2_Un Converts the unsigned value on top of the evaluation stack to signed int16 and extends it to int32, throwing OverflowException on overflow.
Conv_Ovf_I4 Converts the signed value on top of the sevaluation tack to signed int32, throwing OverflowException on overflow.
Conv_Ovf_I4_Un Converts the unsigned value on top of the evaluation stack to signed int32, throwing OverflowException on overflow.
Conv_Ovf_I8 Converts the signed value on top of the evaluation stack to signed int64, throwing OverflowException on overflow.
Conv_Ovf_I8_Un Converts the unsigned value on top of the evaluation stack to signed int64, throwing OverflowException on overflow.
Conv_Ovf_U Converts the signed value on top of the evaluation stack to unsignednatural int, throwing OverflowException on overflow.
Conv_Ovf_U_Un Converts the unsigned value on top of the evaluation stack to unsignednatural int, throwing OverflowException on overflow.
Conv_Ovf_U1 Converts the signed value on top of the evaluation stack to unsigned int8 and extends it to int32, throwing OverflowException on overflow.
Conv_Ovf_U1_Un Converts the unsigned value on top of the evaluation stack to unsignedint8 and extends it to int32, throwing OverflowException on overflow.
Conv_Ovf_U2 Converts the signed value on top of the evaluation stack to unsigned int16 and extends it to int32, throwing OverflowException on overflow.
Conv_Ovf_U2_Un Converts the unsigned value on top of the evaluation stack to unsigned int16 and extends it to int32, throwing OverflowException on overflow.
Conv_Ovf_U4 Converts the signed value on top of the evaluation stack to unsigned int32, throwing OverflowException on overflow.
Conv_Ovf_U4_Un Converts the unsigned value on top of the evaluation stack to unsigned int32, throwing OverflowException on overflow.
Conv_Ovf_U8 Converts the signed value on top of the evaluation stack to unsignedint64, throwing OverflowException on overflow.
Conv_Ovf_U8_Un Converts the unsigned value on top of the evaluation stack to unsigned int64, throwing OverflowException on overflow.
Conv_R_Un Converts the unsigned integer value on top of the evaluation stack to float32.
Conv_R4 Converts the value on top of the evaluation stack to float32.
Conv_R8 Converts the value on top of the evaluation stack to float64.
Conv_U Converts the value on top of the evaluation stack to unsignednatural int, and extends it to natural int.
Conv_U1 Converts the value on top of the evaluation stack to unsigned int8, and extends it to int32.
Conv_U2 Converts the value on top of the evaluation stack to unsignedint16, and extends it to int32.
Conv_U4 Converts the value on top of the evaluation stack to unsigned int32, and extends it to int32.
Conv_U8 Converts the value on top of the evaluation stack to unsignedint64, and extends it to int64.
Cpblk Copies a specified number bytes from a source address to a destination address .
Cpobj Copies the value type located at the address of an object (type &, * or natural int) to the address of the destination object (type &, * or natural int).
Div Divides two values and pushes the result as a floating-point (type F) or quotient (type int32) onto the evaluation stack.
Div_Un Divides two unsigned integer values and pushes the result (int32) onto the evaluation stack.
Dup Copies the current topmost value on the evaluation stack, and then pushes the copy onto the evaluation stack.
Endfilter Transfers control from the filter clause of an exception back to the Common Language Infrastructure (CLI) exception handler.
Endfinally Transfers control from the fault or finally clause of an exception block back to the Common Language Infrastructure (CLI) exception handler.
Initblk Initializes a specified block of memory at a specific address to a given size and initial value.
Initobj Initializes all the fields of the object at a specific address to a null reference or a 0 of the appropriate primitive type.
Isinst Tests whether an object reference (type O) is an instance of a particular class.
Jmp Exits current method and jumps to specified method.
Ldarg Loads an argument (referenced by a specified index value) onto the stack.
Ldarg_0 Loads the argument at index 0 onto the evaluation stack.
Ldarg_1 Loads the argument at index 1 onto the evaluation stack.
Ldarg_2 Loads the argument at index 2 onto the evaluation stack.
Ldarg_3 Loads the argument at index 3 onto the evaluation stack.
Ldarg_S Loads the argument (referenced by a specified short form index) onto the evaluation stack.
Ldarga Load an argument address onto the evaluation stack.
Ldarga_S Load an argument address, in short form, onto the evaluation stack.
Ldc_I4 Pushes a supplied value of type int32 onto the evaluation stack as an int32.
Ldc_I4_0 Pushes the integer value of 0 onto the evaluation stack as an int32.
Ldc_I4_1 Pushes the integer value of 1 onto the evaluation stack as an int32.
Ldc_I4_2 Pushes the integer value of 2 onto the evaluation stack as an int32.
Ldc_I4_3 Pushes the integer value of 3 onto the evaluation stack as an int32.
Ldc_I4_4 Pushes the integer value of 4 onto the evaluation stack as an int32.
Ldc_I4_5 Pushes the integer value of 5 onto the evaluation stack as an int32.
Ldc_I4_6 Pushes the integer value of 6 onto the evaluation stack as an int32.
Ldc_I4_7 Pushes the integer value of 7 onto the evaluation stack as an int32.
Ldc_I4_8 Pushes the integer value of 8 onto the evaluation stack as an int32.
Ldc_I4_M1 Pushes the integer value of -1 onto the evaluation stack as an int32.
Ldc_I4_S Pushes the supplied int8 value onto the evaluation stack as an int32, short form.
Ldc_I8 Pushes a supplied value of type int64 onto the evaluation stack as an int64.
Ldc_R4 Pushes a supplied value of type float32 onto the evaluation stack as type F (float).
Ldc_R8 Pushes a supplied value of type float64 onto the evaluation stack as type F (float).
Ldelem_I Loads the element with type natural int at a specified array index onto the top of the evaluation stack as a natural int.
Ldelem_I1 Loads the element with type int8 at a specified array index onto the top of the evaluation stack as an int32.
Ldelem_I2 Loads the element with type int16 at a specified array index onto the top of the evaluation stack as an int32.
Ldelem_I4 Loads the element with type int32 at a specified array index onto the top of the evaluation stack as an int32.
Ldelem_I8 Loads the element with type int64 at a specified array index onto the top of the evaluation stack as an int64.
Ldelem_R4 Loads the element with type float32 at a specified array index onto the top of the evaluation stack as type F (float) .
Ldelem_R8 Loads the element with type float64 at a specified array index onto the top of the evaluation stack as type F (float) .
Ldelem_Ref Loads the element containing an object reference at a specified array index onto the top of the evaluation stack as type O (object reference).
Ldelem_U1 Loads the element with type unsigned int8 at a specified array index onto the top of the evaluation stack as an int32.
Ldelem_U2 Loads the element with type unsigned int16 at a specified array index onto the top of the evaluation stack as an int32.
Ldelem_U4 Loads the element with type unsigned int32 at a specified array index onto the top of the evaluation stack as an int32.
Ldelema Loads the address of the array element at a specified array index onto the top of the evaluation stack as type & (managed pointer).
Ldfld Finds the value of a field in the object whose reference is currently on the evaluation stack.
Ldflda Finds the address of a field in the object whose reference is currently on the evaluation stack.
Ldftn Pushes an unmanaged pointer (type natural int) to the native code implementing a specific method onto the evaluation stack.
Ldind_I Loads a value of type natural int as a natural int onto the evaluation stack indirectly.
Ldind_I1 Loads a value of type int8 as an int32 onto the evaluation stack indirectly.
Ldind_I2 Loads a value of type int16 as an int32 onto the evaluation stack indirectly.
Ldind_I4 Loads a value of type int32 as an int32 onto the evaluation stack indirectly.
Ldind_I8 Loads a value of type int64 as an int64 onto the evaluation stack indirectly.
Ldind_R4 Loads a value of type float32 as a type F (float) onto the evaluation stack indirectly.
Ldind_R8 Loads a value of type float64 as a type F (float) onto the evaluation stack indirectly.
Ldind_Ref Loads an object reference as a type O (object reference) onto the evaluation stack indirectly.
Ldind_U1 Loads a value of type unsigned int8 as an int32 onto the evaluation stack indirectly.
Ldind_U2 Loads a value of type unsigned int16 as an int32 onto the evaluation stack indirectly.
Ldind_U4 Loads a value of type unsigned int32 as an int32 onto the evaluation stack indirectly.
Ldlen Pushes the number of elements of a zero-based, one-dimensional array onto the evaluation stack.
Ldloc Loads the local variable at a specific index onto the evaluation stack.
Ldloc_0 Loads the local variable at index 0 onto the evaluation stack.
Ldloc_1 Loads the local variable at index 1 onto the evaluation stack.
Ldloc_2 Loads the local variable at index 2 onto the evaluation stack.
Ldloc_3 Loads the local variable at index 3 onto the evaluation stack.
Ldloc_S Loads the local variable at a specific index onto the evaluation stack, short form.
Ldloca Loads the address of the local variable at a specific index onto the evaluation stack.
Ldloca_S Loads the address of the local variable at a specific index onto the evaluation stack, short form.
Ldnull Pushes a null reference (type O) onto the evaluation stack.
Ldobj Copies the value type object pointed to by an address to the top of the evaluation stack.
Ldsfld Pushes the value of a static field onto the evaluation stack.
Ldsflda Pushes the address of a static field onto the evaluation stack.
Ldstr Pushes a new object reference to a string literal stored in the metadata.
Ldtoken Converts a metadata token to its runtime representation, pushing it onto the evaluation stack.
Ldvirtftn Pushes an unmanaged pointer (type natural int) to the native code implementing a particular virtual method associated with a specified object onto the evaluation stack.
Leave Exits a protected region of code, unconditionally tranferring control to a specific target instruction.
Leave_S Exits a protected region of code, unconditionally tranferring control to a target instruction (short form).
Localloc Allocates a certain number of bytes from the local dynamic memory pool and pushes the address (a transient pointer, type *) of the first allocated byte onto the evaluation stack.
Mkrefany Pushes a typed reference to an instance of a specific type onto the evaluation stack.
Mul Multiplies two values and pushes the result on the evaluation stack.
Mul_Ovf Multiplies two integer values, performs an overflow check, and pushes the result onto the evaluation stack.
Mul_Ovf_Un Multiplies two unsigned integer values , performs an overflow check , and pushes the result onto the evaluation stack.
Neg Negates a value and pushes the result onto the evaluation stack.
Newarr Pushes an object reference to a new zero-based, one-dimensional array whose elements are of a specific type onto the evaluation stack.
Newobj Creates a new object or a new instance of a value type, pushing an object reference (type O) onto the evaluation stack.
Nop Fills space if bytecodes are patched. No meaningful operation is performed although a processing cycle can be consumed.
Not Computes the bitwise complement of the integer value on top of the stack and pushes the result onto the evaluation stack as the same type.
Or Compute the bitwise complement of the two integer values on top of the stack and pushes the result onto the evaluation stack.
Pop Removes the value currently on top of the evaluation stack.
Prefix1 This is a reserved instruction.
Prefix2 This is a reserved instruction.
Prefix3 This is a reserved instruction.
Prefix4 This is a reserved instruction.
Prefix5 This is a reserved instruction.
Prefix6 This is a reserved instruction.
Prefix7 This is a reserved instruction.
Prefixref This is a reserved instruction.
Refanytype Retrieves the type token embedded in a typed reference .
Refanyval Retrieves the address (type &) embedded in a typed reference.
Rem Divides two values and pushes the remainder onto the evaluation stack.
Rem_Un Divides two unsigned values and pushes the remainder onto the evaluation stack.
Ret Returns from the current method, pushing a return value (if present) from the caller's evaluation stack onto the callee's evaluation stack.
Rethrow Rethrows the current exception.
Shl Shifts an integer value to the left (in zeroes) by a specified number of bits, pushing the result onto the evaluation stack.
Shr Shifts an integer value (in sign) to the right by a specified number of bits, pushing the result onto the evaluation stack.
Shr_Un Shifts an unsigned integer value (in zeroes) to the right by a specified number of bits, pushing the result onto the evaluation stack.
Sizeof Pushes the size, in bytes, of a supplied value type onto the evaluation stack.
Starg Stores the value on top of the evaluation stack in the argument slot at a specified index.
Starg_S Stores the value on top of the evaluation stack in the argument slot at a specified index , short form .
Stelem_I Replaces the array element at a given index with the natural int value on the evaluation stack.
Stelem_I1 Replaces the array element at a given index with the int8 value on the evaluation stack.
Stelem_I2 Replaces the array element at a given index with the int16 value on the evaluation stack.
Stelem_I4 Replaces the array element at a given index with the int32 value on the evaluation stack.
Stelem_I8 Replaces the array element at a given index with the int64 value on the evaluation stack.
Stelem_R4 Replaces the array element at a given index with the float32 value on the evaluation stack.
Stelem_R8 Replaces the array element at a given index with the float64 value on the evaluation stack.
Stelem_Ref Replaces the array element at a given index with the object ref value (type O) on the evaluation stack.
Stfld Replaces the value stored in the field of an object reference or pointer with a new value.
Stind_I Stores a value of type natural int at a supplied address.
Stind_I1 Stores a value of type int8 at a supplied address.
Stind_I2 Stores a value of type int16 at a supplied address.
Stind_I4 Stores a value of type int32 at a supplied address.
Stind_I8 Stores a value of type int64 at a supplied address.
Stind_R4 Stores a value of type float32 at a supplied address.
Stind_R8 Stores a value of type float64 at a supplied address.
Stind_Ref Stores a object reference value at a supplied address.
Stloc Pops the current value from the top of the evaluation stack and stores it in a the local variable list at a specified index.
Stloc_0 Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index 0.
Stloc_1 Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index 1.
Stloc_2 Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index 2.
Stloc_3 Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index 3.
Stloc_S Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index (short form) .
Stobj Copies a value of a specified type from the evaluation stack into a supplied memory address.
Stsfld Replaces the value of a static field with a value from the evaluation stack.
Sub Subtracts one value from another and pushes the result onto the evaluation stack.
Sub_Ovf Subtracts one integer value from another, performs an overflow check, and pushes the result onto the evaluation stack.
Sub_Ovf_Un Subtracts one unsigned integer value from another, performs an overflow check, and pushes the result onto the evaluation stack.
Switch Implements a jump table.
Tailcall Performs a postfixed method call instruction such that the current method's stack frame is removed before the actual call instruction is executed.
Throw Throws the exception object currently on the evaluation stack.
Unaligned Indicates that an address currently atop the evaluation stack might not be aligned to the natural size of the immediately following ldind, stind, ldfld, stfld, ldobj, stobj, initblk, or cpblk instruction.
Unbox Converts the boxed representation of a value type to its unboxed form.
Volatile Specifies that an address currently atop the evaluation stack might be volatile, and the results of reading that location cannot be cached or that multiple stores to that location cannot be suppressed.
Xor Computes the bitwise XOR of the top two values on the evaluation stack, pushing the result onto the evaluation stack.
Public Methods
Equals
(inherited from System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
GetHashCode
(inherited from System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
TakesSingleByteArgument Returns true or false if the supplied opcode takes a single byte argument.
ToString
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Reflection.Emit.OpCodes Member Details

Field: Add
Summary
Adds two values and pushes the result onto the evaluation stack.
C# Syntax:
public static readonly OpCode Add;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
58 add Adds two numeric values, returning a new numeric value.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; value1 is added to value2.
  4. The result is pushed onto the stack.

Overflow is not detected for integer operations (for proper overflow handling, see OpCodes.Add_Ovf).

Integer addition wraps, rather than saturates. For example, assuming 8-bit integers where value1 is set to 255 and value2 is set to 1, the wrapped result is 0 rather than 256.

Floating-point overflow returns +inf (PositiveInfinity) or -inf (NegativeInfinity).

The acceptable operand types and their corresponding result data type are listed in the table below. If there is no entry for a particular type combination (for example, int32 and float; int32 and int64), it is an invalid Microsoft Intermediate Language (MSIL) and generates an error.



operand value1 type value2 type result type
add int32 int32 int32
add int32 natural int natural int
add int32 & &
add int32 * *
add int64 int64 int64
add natural int int32 natural int
add natural int natural int natural int
add natural int & &
add natural int * *
add F F F
add & int32 &
add & natural int &
add * int32 *
add * natural int *

The following ILGenerator.Emit constructor overload can use the add opcode:

Return to top


Field: Add_Ovf
Summary
Adds two integers, performs an overflow check, and pushes the result onto the evaluation stack.
C# Syntax:
public static readonly OpCode Add_Ovf;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
D6 add.ovf Adds two signed integer values with an overflow check.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; value1 is added to value2 with a check for overflow.
  4. The result is pushed onto the stack.

OverflowException is thrown if the result is not represented in the result type.

You can perform this operation on signed integers. For floating-point values, use OpCodes.Add.

The acceptable operand types and their corresponding result data type are listed in the table below. If there is no entry for a particular type combination (for example, int32 and float; int32 and int64), it is an invalid Microsoft Intermediate Language (MSIL) instruction and generates an error.



operand value1 type value2 type result type
add int32 int32 int32
add int32 natural int natural int
add int32 & &
add int32 * *
add int64 int64 int64
add natural int int32 natural int
add natural int natural int natural int
add natural int & &
add natural int * *
add F F F
add & int32 &
add & natural int &
add * int32 *
add * natural int *

The following ILGenerator.Emit constructor overload can use the add.ovf opcode:

Return to top


Field: Add_Ovf_Un
Summary
Adds two unsigned integer values, performs an overflow check, and pushes the result onto the evaluation stack.
C# Syntax:
public static readonly OpCode Add_Ovf_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
D7 add.ovf.un Adds two unsigned integer values with an overflow check.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; value1 is added to value2 with a check for overflow.
  4. The result is pushed onto the stack.

OverflowException is thrown if the result is not represented in the result type.

You can perform this operation on signed integers. For floating-point values, use OpCodes.Add.

The acceptable operand types and their corresponding result data type are listed in the table below. If there is no entry for a particular type combination (for example, int32 and float; int32 and int64), it is an invalid Microsoft Intermediate Language (MSIL) instruction and generates an error.



operand value1 type value2 type result type
add int32 int32 int32
add int32 natural int natural int
add int32 & &
add int32 * *
add int64 int64 int64
add natural int int32 natural int
add natural int natural int natural int
add natural int & &
add natural int * *
add F F F
add & int32 &
add & natural int &
add * int32 *
add * natural int *

The following ILGenerator.Emit constructor overload can use the add.ovf.un opcode:

Return to top


Field: And
Summary
Computes the bitwise AND of two values and pushes the result onto the evalution stack.
C# Syntax:
public static readonly OpCode And;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Instruction Description
5F and Determines the bitwise AND of two integer values.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value1 and value2 are popped from the stack; the bitwise AND of the two values is computed.
  4. The result is pushed onto the stack.

The and instruction computes the bitwise AND of the top two values on the stack and leaves the result on the stack.

And is an integer-specific operation.

The following ILGenerator.Emit constructor overload can use the and opcode:

Return to top


Field: Arglist
Summary
Returns an unmanaged pointer to the argument list of the current method.
C# Syntax:
public static readonly OpCode Arglist;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 00 arglist Returns an argument list handle for the current method.

No evaluation stack behaviors are performed by this operation.

The arglist instruction returns an opaque handle (an unmanaged pointer, of type natural int) that represents the argument list of the current method. This handle is valid only during the lifetime of the current method. You can, however, pass the handle to other methods as long as the current method is on the thread of control. You can only execute the arglist instruction within a method that takes a variable number of arguments.

The following ILGenerator.Emit constructor overload can use the arglist opcode:

Return to top


Field: Beq
Summary
Transfers control to a target instruction if two values are equal.
C# Syntax:
public static readonly OpCode Beq;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
3B < int32 > beq Branch to the target instruction at offset if the two values are equal.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is equal to value2, the branch operation is performed.

The beq instruction transfers control to the specified target instruction if value1 is equal to value2. The effect is the same as performing a ceq instruction followed by a brtrue branch to the specific target instruction. The target instruction is represented as a 4-byte signed offset from the beginning of the instruction following the current instruction.

The acceptable operand types are encapsulated below:

If the target instruction has one or more prefix codes, control can only be transferred to the first of these prefixes.

Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction (such transfers are severely restricted and must use the OpCodes.Leave instruction instead).

The following ILGenerator.Emit constructor overload can use the beq opcode:

Return to top


Field: Beq_S
Summary
Transfers control to a target instruction (short form) if two values are equal.
C# Syntax:
public static readonly OpCode Beq_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
2E < int8 > beq.s Branch to the target instruction at offset if equal, short form

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is equal to value2, the branch operation is performed.

The beq.s instruction transfers control to to the specified target instruction if value1 is equal to value2. The effect is the same as performing a ceq instruction followed by a brtrue branch to the specific target instruction. The target instruction is represented as a 1-byte signed offset from the beginning of the instruction following the current instruction.

The acceptable operand types are encapsulated below:

If the target instruction has one or more prefix codes, control can only be transferred to the first of these prefixes.

Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction (such transfers are severely restricted and must use the OpCodes.Leave instruction instead).

The following ILGenerator.Emit constructor overload can use the beq.s opcode:

Return to top


Field: Bge
Summary
Transfers control to a target instruction if the first value is greater than or equal to the second value.
C# Syntax:
public static readonly OpCode Bge;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
3C <int32> bge Branch to the target instruction at the specified offset if the first value is greater than or equal to the second value

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is greater than or equal to value2, the branch operation is performed.

The bge instruction transfers control to the specified target instruction if value1 is greater than or equal to value2. The effect is identical to performing a clt.un instruction followed by a brfalse branch to the specific target instruction. The target instruction is represented as a 4-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the bge opcode:

Return to top


Field: Bge_S
Summary
Transfers control to a target instruction (short form) if the first value is greater than or equal to the second value.
C# Syntax:
public static readonly OpCode Bge_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
2F <int8> bge.s Branch to the target instruction at the specified offset if the first value is greater than or equal to the second value, short form.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is greater than or equal to value2, the branch operation is performed.

The bge.s instruction transfers control to the specified target instruction if value1 is greater than or equal to value2. The effect is identical to performing a clt.un instruction followed by a brfalse branch to the specific target instruction. The target instruction is represented as a 1-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the bge.s opcode:

Return to top


Field: Bge_Un
Summary
Transfers control to a target instruction if the the first value is greather than the second value, when comparing unsigned integer values or unordered float values.
C# Syntax:
public static readonly OpCode Bge_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
41 <int32> bge.un Branch to the target instruction at the specified offset if the first value is greater than or equal to the second value (unsigned values).

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is greater than or equal to value2, the branch operation is performed.

The bge.un instruction transfers control to the specified target instruction if value1 is greater than or equal to value2, when compared using unsigned integer or unordered float values. The effect is identical to performing a clt instruction followed by a brfalse branch to the specific target instruction. The target instruction is represented as a 4-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the bge.un opcode:

Return to top


Field: Bge_Un_S
Summary
Transfers control to a target instruction (short form) if if the the first value is greather than the second value, when comparing unsigned integer values or unordered float values.
C# Syntax:
public static readonly OpCode Bge_Un_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
34 < int8 > bge.un.s Branch to the target instruction at the specified offset if the first value is greater than or equal to the second value (unsigned values), short form.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is greater than or equal to value2, the branch operation is performed.

The bge.un.s instruction transfers control to the specified target instruction if value1 is greater than or equal to value2, when compared using unsigned integer or unordered float values. The effect is identical to performing a clt instruction followed by a brfalse branch to the specific target instruction. The target instruction is represented as a 1-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the bge.un.s opcode:

Return to top


Field: Bgt
Summary
Transfers control to a target instruction if the first value is greater than the second value.
C# Syntax:
public static readonly OpCode Bgt;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
3D < int32 > bgt Branch to the target instruction at the specified offset if the first value is greater than the second value.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is greater than value2, the branch operation is performed.

The bgt instruction transfers control to the specified target instruction if value1 is greater than value2. The effect is identical to performing a cgt instruction followed by a brtrue branch to the specific target instruction. The target instruction is represented as a 4-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the bgt opcode:

Return to top


Field: Bgt_S
Summary
Transfers control to a target instruction (short form) if the first value is greater than the second value.
C# Syntax:
public static readonly OpCode Bgt_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
30 < int8 > bgt.s Branch to the target instruction at the specified offset if the first value is greater than the second value, short form.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is greater than value2, the branch operation is performed.

The bgt.s instruction transfers control to the specified target instruction if value1 is greater than value2. The effect is identical to performing a cgt instruction followed by a brtrue branch to the specific target instruction. The target instruction is represented as a 1-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the bgt.s opcode:

Return to top


Field: Bgt_Un
Summary
Transfers control to a target instruction if the first value is greater than the second value, when comparing unsigned integer values or unordered float values.
C# Syntax:
public static readonly OpCode Bgt_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
42 < int32 > bgt.un Branch to the target instruction at the specified offset if the first value is greater than the second value (unsigned values).

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is greater than value2, the branch operation is performed.

The bgt.un instruction transfers control to the specified target instruction if value1 is greater than value2, when compared using unsigned integer or unordered float values. The effect is identical to performing a cgt.un instruction followed by a brtrue branch to the specific target instruction.. The target instruction is represented as a 4-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the bgt.un opcode:

Return to top


Field: Bgt_Un_S
Summary
Transfers control to a target instruction (short form) if the first value is greater than the second value, when comparing unsigned integer values or unordered float values.
C# Syntax:
public static readonly OpCode Bgt_Un_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
35 < int8 > bgt.un.s Branch to the target instruction at the specified offset if the first value is greater than the second value (unsigned values), short form.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is greater than value2, the branch operation is performed.

The bgt.un.s instruction transfers control to the specified target instruction if value1 is greater than value2, when compared using unsigned integer or unordered float values. The effect is identical to performing a cgt.un instruction followed by a brtrue branch to the specific target instruction. The target instruction is represented as a 1-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the bgt.un.s opcode:

Return to top


Field: Ble
Summary
Transfers control to a target instruction if the first value is less than or equal to the second value.
C# Syntax:
public static readonly OpCode Ble;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
3E <int32> ble Branch to the target instruction at the specified offset if the first value is less than or equal to the second value.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is less than or equal to value2, the branch operation is performed.

The ble instruction transfers control to the specified target instruction if value1 is less than or equal to value2. The effect is identical to performing a cgt instruction (cgt.un for floats) followed by a brfalse branch to the specific target instruction. The target instruction is represented as a 4-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the ble opcode:

Return to top


Field: Ble_S
Summary
Transfers control to a target instruction (short form) if the first value is less than or equal to the second value.
C# Syntax:
public static readonly OpCode Ble_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
31 <int8> ble.s Branch to the target instruction at the specified offset if the first value is less than or equal to the second value, short form.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is less than or equal to value2, the branch operation is performed.

The ble.s instruction transfers control to the specified target instruction if value1 is less than or equal to value2. The effect is identical to performing a cgt instruction (cgt.un for floats) instruction followed by a brfalse branch to the specific target instruction. The target instruction is represented as a 1-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the ble.s opcode:

Return to top


Field: Ble_Un
Summary
Transfers control to a target instruction if the first value is less than or equal to the second value, when comparing unsigned integer values or unordered float values.
C# Syntax:
public static readonly OpCode Ble_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
43 <int32> ble.un Branch to the target instruction at the specified offset if the first value is less than or equal to the second value (unsigned values).

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is less than or equal to value2, the branch operation is performed.

The ble.un instruction transfers control to the specified target instruction if value1 is less than or equal to value2, when compared using unsigned integer or unordered float values. The effect is identical to performing a cgt.un instruction (cgt for floats) followed by a brfalse branch to the specific target instruction. The target instruction is represented as a 4-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the ble.un opcode:

Return to top


Field: Ble_Un_S
Summary
Transfers control to a target instruction (short form) if the first value is less than or equal to the second value, when comparing unsigned integer values or unordered float values.
C# Syntax:
public static readonly OpCode Ble_Un_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
36 <int8> ble.un.s Branch to the target instruction at the specified offset if the first value is less than or equal to the second value (unsigned values), short form.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is less than or equal to value2, the branch operation is performed.

The ble.un.s instruction transfers control to the specified target instruction if value1 is less than or equal to value2, when compared using unsigned integer or unordered float values. The effect is identical to performing a cgt.un instruction (cgt for floats) followed by a brfalse branch to the specific target instruction. The target instruction is represented as a 1-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the ble.un.s opcode:

Return to top


Field: Blt
Summary
Transfers control to a target instruction if the first value is less than the second value.
C# Syntax:
public static readonly OpCode Blt;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
3F < int32 > blt Branch to the target instruction at the specified offset if the first value is less than the second value.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is less than value2, the branch operation is performed.

The blt instruction transfers control to the specified target instruction if value1 is less than or equal to value2. The effect is identical to performing a clt instruction followed by a brtrue branch to the specific target instruction. The target instruction is represented as a 4-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the blt opcode:

Return to top


Field: Blt_S
Summary
Transfers control to a target instruction (short form) if the first value is less than the second value.
C# Syntax:
public static readonly OpCode Blt_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
32 < int8 > blt.s Branch to the target instruction at the specified offset if the first value is less than the second value, short form.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is less than value2, the branch operation is performed.

The blt.s instruction transfers control to the specified target instruction if value1 is less than value2. The effect is identical to performing a clt instruction followed by a brtrue branch to the specific target instruction. The target instruction is represented as a 1-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the blt.s opcode:

Return to top


Field: Blt_Un
Summary
Transfers control to a target instruction if the first value is less than the second value, when comparing unsigned integer values or unordered float values.
C# Syntax:
public static readonly OpCode Blt_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
44 < int32 > blt.un Branch to the target instruction at the specified offset if the first value is less than the second value (unsigned values).

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is less than value2, the branch operation is performed.

The blt.un instruction transfers control to the specified target instruction if value1 is less than value2, when compared using unsigned integer or unordered float values. The effect is identical to performing a clt.un instruction followed by a brtrue branch to the specific target instruction. The target instruction is represented as a 4-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the blt.un opcode:

Return to top


Field: Blt_Un_S
Summary
Transfers control to a target instruction (short form) if the first value is less than the second value, when comparing unsigned integer values or unordered float values.
C# Syntax:
public static readonly OpCode Blt_Un_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
37 < int8 > blt.un.s Branch to the target instruction at the specified offset if the first value is less than the second value (unsigned values), short form.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is less than value2, the branch operation is performed.

The blt.un instruction transfers control to the specified target instruction if value1 is less than value2, when compared using unsigned integer or unordered float values. The effect is identical to performing a clt.un instruction followed by a brtrue branch to the specific target instruction. The target instruction is represented as a 4-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the blt.un.s opcode:

Return to top


Field: Bne_Un
Summary
Transfers control to a target instruction when two unsigned integer values or unordered float values are not equal.
C# Syntax:
public static readonly OpCode Bne_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
40 < int32 > bne.un Branch to the target instruction at the specified offset if two unsigned integer values are not equal (unsigned values).

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is not equal to value2, the branch operation is performed.

The bne.un instruction transfers control to the specified target instruction if value1 is not equal to value2, when compared using unsigned integer or unordered float values. The effect is identical to performing a ceq.un instruction followed by a brfalse branch to the specific target instruction. The target instruction is represented as a 4-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the bne.un opcode:

Return to top


Field: Bne_Un_S
Summary
Transfers control to a target instruction (short form) when two unsigned integer values or unordered float values are not equal.
C# Syntax:
public static readonly OpCode Bne_Un_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
33 < int8 > bne.un.s Branch to the target instruction at the specified offset if two unsigned integer values are not equal (unsigned values), short form.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; if value1 is not equal to value2, the branch operation is performed.

The bne.un instruction transfers control to the specified target instruction if value1 is not equal to value2, when compared using unsigned integer or unordered float values. The effect is identical to performing a ceq.un instruction followed by a brfalse branch to the specific target instruction. The target instruction is represented as a 4-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the bne.un.s opcode:

Return to top


Field: Box
Summary
Converts a value type to an object reference (type O).
C# Syntax:
public static readonly OpCode Box;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
8C < T > box Convert a value type (of the type specified in ) to a true object reference.

The stack transitional behavior, in sequential order, is:

  1. A value type is pushed onto the stack.
  2. The value type is popped from the stack; the box operation is performed.
  3. An object reference to the resulting "boxed" value type is pushed onto the stack.

A value type has two separate representations within the Common Language Infrastructure (CLI):

The box instruction converts the 'raw' (unboxed) value type into an object reference (type O). This is accomplished by creating a new object and copying the data from the value type into the newly allocated object.valTypeToken is a metadata token indicating the type of the value type on the stack.

OutOfMemoryException is thrown if there is insufficient memory to satisfy the request.

TypeLoadException is thrown if the class cannot be found. This is typically detected when Microsoft Intermediate Language (MSIL) is converted to native code, rather than at runtime.

The following ILGenerator.Emit constructor overload can use the box opcode:

Return to top


Field: Br
Summary
Unconditionally transfers control to a target instruction.
C# Syntax:
public static readonly OpCode Br;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
38 < int32 > br Branches to a target instruction at the specified offset

No evaluation stack behaviors are performed by this operation.

The br instruction unconditionally transfers control to a target instruction. The target instruction is represented as a 4-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the br opcode:

Return to top


Field: Br_S
Summary
Unconditionally transfers control to a target instruction (short form).
C# Syntax:
public static readonly OpCode Br_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
2B < int8 > br.s Branches to a target instruction at the specified offset short form.

No evaluation stack behaviors are performed by this operation.

The br.s instruction unconditionally transfers control to a target instruction. The target instruction is represented as a 1-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the br.s opcode:

Return to top


Field: Break
Summary
Signals the Common Language Infrastructure (CLI) to inform the debugger that a break point has been tripped.
C# Syntax:
public static readonly OpCode Break;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
01 break inform a debugger that a breakpoint has been reached.

No evaluation stack behaviors are performed by this operation.

The break instruction is for debugging support. It signals the CLI to inform the debugger that a break point has been tripped. It has no other effect on the interpreter state.

The break instruction has the smallest possible instruction size enabling code patching with a break point and generating minimal disturbance to the surrounding code.

The break instruction can trap to a debugger, do nothing, or raise a security exception. The exact behavior is implementation-defined.

The following ILGenerator.Emit constructor overload can use the break opcode:

Return to top


Field: Brfalse
Summary
Transfers control to a target instruction if value is false, a null reference (not set or empty), or zero.
C# Syntax:
public static readonly OpCode Brfalse;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
39 < int32 > brfalse target brnull target brzero target Branches to a target instruction at the specified offset if false .

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack by a previous operation.
  2. value is popped from the stack; if value is false, branch to target.

The brfalse instruction (and its aliases brnull and brzero) transfers control to the specified target instruction if value (of type int32, int64, object reference O, managed pointer &, transient pointer *, natural int) is zero (false). If value is non-zero (true) execution continues at the next instruction.

The target instruction is represented as a 4-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the brfalse opcode:

Return to top


Field: Brfalse_S
Summary
Transfers control to a target instruction if value is false, a null reference, or zero.
C# Syntax:
public static readonly OpCode Brfalse_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
2C < int8 > brfalse.s target brnull.s target brzero.s target Branches to a target instruction at the specified offset if false , short form.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack by a previous operation.
  2. value is popped from the stack; if value is false, branch to target.

The brfalse.s instruction (and its aliases brnull and brzero) transfers control to the specified target instruction if value (of type int32, int64, object reference O, managed pointer &, transient pointer *, natural int) is zero (false). If value is non-zero (true) execution continues at the next instruction.

The target instruction is represented as a 1-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the brfalse.s opcode:

Return to top


Field: Brtrue
Summary
Transfers control to a target instruction if value is true, not null, or non-zero.
C# Syntax:
public static readonly OpCode Brtrue;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
3A < int32 > brtrue target brinst target Branch to a target instruction at the specified offset if non-zero ( true ).

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack by a previous operation.
  2. value is popped from the stack; if value is true, branch to target.

The brtrue instruction transfers control to the specified target instruction if value (type natural int) is nonzero (true). If value is zero (false) execution continues at the next instruction.

If value is an object reference (type O) then brinst (an alias for brtrue) transfers control if it represents an instance of an object (for example, if it is not the null object reference; see OpCodes.Ldnull).

The target instruction is represented as a 4-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the brtrue opcode:

Return to top


Field: Brtrue_S
Summary
Transfers control to a target instruction (short form) if value is true, not null, or non-zero.
C# Syntax:
public static readonly OpCode Brtrue_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
2D < int8 > brtrue.s target brinst.s target Branch to a target instruction at the specified offset if non-zero ( true ), short form.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack by a previous operation.
  2. value is popped from the stack; if value is true, branch to target.

The brtrue.s instruction transfers control to the specified target instruction if value (type natural int) is nonzero (true). If value is zero (false) execution continues at the next instruction.

If value is an object reference (type O) then brinst (an alias for brtrue) transfers control if it represents an instance of an object (for example, if it is not the null object reference; see OpCodes.Ldnull).

The target instruction is represented as a 1-byte signed offset from the beginning of the instruction following the current instruction.

Control can only be transferred to the first of these prefixes if the target instruction has one or more prefix codes. Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

The following ILGenerator.Emit constructor overload can use the brtrue.s opcode:

Return to top


Field: Call
Summary
Calls the method indicated by the passed method descriptor.
C# Syntax:
public static readonly OpCode Call;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
28 < T > call Call the method described by

The stack transitional behavior, in sequential order, is:

  1. Method arguments arg1 through argN are pushed onto the stack.
  2. Method arguments arg1 through argN are popped from the stack; the method call is performed with these arguments and control is transferred to the method referred to by the method descriptor. When complete, a return value is generated by the callee method and sent to the caller.
  3. The return value is pushed onto the stack.

The call instruction calls the method indicated by the method descriptor passed with the instruction. The method descriptor is a metadata token that indicates the method to call and the number, type, and order of the arguments that have been placed on the stack to be passed to that method as well as the calling convention to be used. The call instruction can be immediately preceded by a tail. ( OpCodes.Tailcall) prefix instruction to specify that the current method state should be released before transferring control. If the call transfers control to a method of higher trust than the origin method, the stack frame is not released. Instead, the execution continues silently as if the tail. had not been supplied. The metadata token carries sufficient information to determine whether the call is to a static method, an instance method, a virtual method, or a global function. In all of these cases the destination address is determined entirely from the method descriptor (contrast this with the OpCodes.Callvirt instruction for calling virtual methods, where the destination address also depends upon the runtime type of the instance reference pushed before the OpCodes.Callvirt).

The arguments are placed on the stack in left-to-right order. That is, the first argument is computed and placed on the stack, then the second argument, then the third, until all necessary arguments are atop the stack in descending order. There are three important special cases:

1. Calls to an instance (or virtual) method must push that instance reference before any of the user-visible arguments. The instance reference must not be a null reference. The signature carried in the metadata does not contain an entry in the parameter list for the this pointer; instead, it uses a bit to indicate whether the method requires passing the this pointer.

2. It is valid to call a virtual method using call (rather than callvirt); this indicates that the method is to be resolved using the class specified by method rather than as specified dynamically from the object being invoked.

3. Note that a delegate's Invoke method can be called with either the call or callvirt instruction.

SecurityException may be thrown if system security does not grant the caller access to the called method. The security check may occur when the Microsoft Intermediate Language (MSIL) instructions are converted to native code rather than at runtime.

The following ILGenerator.Emit constructor overload can use the call opcode:

Return to top


Field: Calli
Summary
Calls the method indicated on the evaluation stack (as a pointer to an entry point) with arguments described by a calling convention.
C# Syntax:
public static readonly OpCode Calli;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
29 < T > calli Calls the method pointed to with arguments described by the calling convention.

The stack transitional behavior, in sequential order, is:

  1. Method arguments arg1 through argN are pushed onto the stack.
  2. The method entry pointer is pushed onto the stack.
  3. Method arguments arg1 through argN and the method entry pointer are popped from the stack; the call to the method is performed. When complete, a return value is generated by the callee method and sent to the caller.
  4. The return value is pushed onto the stack.

The calli instruction calls the method entry pointer with the arguments arg1 through argN. The types of these arguments are described by the specific calling convention (callSiteDesc). The calli instruction may be immediately preceded by a tail. prefix ( OpCodes.Tailcall) to specify that the current method state should be released before transferring control. If the call would transfer control to a method of higher trust than the origin method the stack frame will not be released; instead, the execution will continue silently as if the tail. had not been supplied.

The method entry pointer is assumed to be a specific pointer to native code (of the target machine) that can be legitimately called with the arguments described by the calling convention (a metadata token for a stand-alone signature). Such a pointer can be created using the OpCodes.Ldftn or OpCodes.Ldvirtftn instructions, or passed in from native code.

The calling convention is not checked dynamically, so code that uses a calli instruction does not work correctly if the destination does not actually use the specified calling convention.

The arguments are placed on the stack in left-to-right order. That is, the first argument is computed and placed on the stack, then the second argument, then the third, until all necessary arguments are atop the stack in descending order. The argument-building code sequence for an instance or virtual method must push that instance reference (which must not be a null reference) before any of the user-visible arguments.

SecurityException may be thrown if the system security does not grant the caller access to the called method. The security check can occur when the Microsoft Intermediate Language (MSIL) instructions are converted to native code rather than at runtime.

The following ILGenerator.EmitCalli methods can be used to perform a calli instruction on the stack. Note that calli should be called through the below methods rather than using the ILGenerator.Emit class to place the instruction directly on the stack.

Return to top


Field: Callvirt
Summary
Calls a late-bound method on an object, pushing the return value onto the evaluation stack.
C# Syntax:
public static readonly OpCode Callvirt;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
6F < T > callvirt Calls a specific method associated with

The stack transitional behavior, in sequential order, is:

  1. An object reference obj is pushed onto the stack.
  2. Method arguments arg1 through argN are pushed onto the stack.
  3. Method arguments arg1 through argN and the object reference obj are popped from the stack; the method call is performed with these arguments and control is transferred to the method in obj referred to by the method metadata token. When complete, a return value is generated by the callee method and sent to the caller.
  4. The return value is pushed onto the stack.

The callvirt instruction calls a late-bound method on an object. That is, the method is chosen based on the runtime type of obj rather than the compile-time class visible in the method pointer.Callvirt can be used to call both virtual and instance methods. The callvirt instruction may be immediately preceded by a tail. ( OpCodes.Tailcall) prefix to specify that the current stack frame should be released before transferring control. If the call would transfer control to a method of higher trust than the original method the stack frame will not be released.

The method metadata token provides the name, class and signature of the method to call. The class associated with obj is the class of which it is an instance. If the class defines a non-static method that matches the indicated method name and signature, this method is called. Otherwise all classes in the base class chain of this class are checked in order. It is an error if no method is found.

Callvirt pops the object and the associated arguments off the evaluation stack before calling the method. If the method has a return value, it is pushed on the stack upon method completion. On the callee side, the obj parameter is accessed as argument 0, arg1 as argument 1, and so on.

The arguments are placed on the stack in left-to-right order. That is, the first argument is computed and placed on the stack, then the second argument, then the third, until all necessary arguments are atop the stack in descending order. The instance reference obj (always required for callvirt) must be pushed before any of the user-visible arguments. The signature (carried in the metadata token) need not contain an entry in the parameter list for the this pointer.

Note that a virtual method can also be called using the OpCodes.Call instruction.

MissingMethodException is thrown if a non-static method with the indicated name and signature could not be found in the class associated with obj or any of its base classes. This is typically detected when Microsoft Intermediate Language (MSIL) instructions are converted to native code, rather than at runtime.

NullReferenceException is thrown if obj is null.

SecurityException is thrown if system security does not grant the caller access to the called method. The security check may occur when the CIL is converted to native code rather than at runtime.

The following ILGenerator.Emit constructor overload can use the callvirt opcode:

Return to top


Field: Castclass
Summary
Attempts to cast an object passed by reference to the specified class.
C# Syntax:
public static readonly OpCode Castclass;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
74 < T > castclass Casts an object to a new object of type .

The stack transitional behavior, in sequential order, is:

  1. An object reference is pushed onto the stack.
  2. The object reference is popped from the stack; the referenced object is cast as the specified class.
  3. If successful, a new object reference is pushed onto the stack.

The castclass instruction attempts to cast the object reference (type O) atop the stack to a specified class. The new class is specified by a metadata token indicating the desired class. If the class of the object on the top of the stack does not implement the new class (assuming the new class is an interface) and is not a derived class of the new class then an InvalidCastException is thrown. If the object reference is a null reference, castclass succeeds and returns the new object as a null reference.

InvalidCastException is thrown if obj cannot be cast to class.

TypeLoadException is thrown if class cannot be found. This is typically detected when a Microsoft Intermediate Language (MSIL)instruction is converted to native code rather than at runtime.

The following ILGenerator.Emit constructor overload can use the castclass opcode:

Return to top


Field: Ceq
Summary
Compares two values. If they are equal, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ceq;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 01 ceq Pushes 1 if equals else pushes 0.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; value1 is added to value2.
  4. The result is pushed onto the stack.

The ceq instruction compares value1 and value2. If value1 is equal to value2, then 1 (of type int32) is pushed on the stack. Otherwise 0 (of type int32) is pushed on the stack.

For floating-point number, ceq will return 0 if the numbers are unordered (either or both are NaN). The infinite values are equal to themselves.

The following ILGenerator.Emit constructor overload can use the ceq opcode:

Return to top


Field: Cgt
Summary
Compares two values. If the first value is greater than the second, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack.
C# Syntax:
public static readonly OpCode Cgt;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 02 cgt Pushes 1 if is greater than else pushes 0.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; cgt tests if value1 is greater than value2.
  4. If value1 is greater than value2, 1 is pushed onto the stack; otherwise 0 is pushed onto the stack.

The cgt instruction compares value1 and value2. If value1 is strictly greater than value2, then an int32 value of 1 is pushed on the stack. Otherwise, an int32 value of 0 is pushed on the stack.

The following ILGenerator.Emit constructor overload can use the cgt opcode:

Return to top


Field: Cgt_Un
Summary
Compares two unsigned or unordered values. If the first value is greater than the second, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack.
C# Syntax:
public static readonly OpCode Cgt_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 03 cgt.un Pushes 1 if is greater than ; else pushes 0 (unsigned values).

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; cgt.un tests if value1 is greater than value2.
  4. If value1 is greater than value2, 1 is pushed onto the stack; otherwise 0 is pushed onto the stack.

An int32 value of 1 is pushed on the stack if any of the following is true:

For floating-point numbers, value1 is not ordered with respect to value2.

For integer values, value1 is strictly greater than value2 when considered as unsigned numbers.

Otherwise an int32 value of 0 is pushed on the stack.

The following ILGenerator.Emit constructor overload can use the cgt.un opcode:

Return to top


Field: Ckfinite
Summary
Throws ArithmeticException if value is not a finite number.
C# Syntax:
public static readonly OpCode Ckfinite;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
C3 ckfinite throw ArithmeticException if value is not a finite number.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack..
  2. value is popped from the stack and the ckfinite instruction is performed on it.
  3. value is pushed back onto the stack if no exception is thrown.

The ckfinite instruction throws ArithmeticException if value (a floating-point number) is either a "not a number" value (NaN) or a +- infinity value.Ckfinite leaves the value on the stack if no exception is thrown. Execution is unspecified if value is not a floating-point number.

ArithmeticException is thrown if value is not a 'normal' number.

Note that a special exception or a derived class of ArithmeticException may be more appropriate, passing the incorrect value to the exception handler.

The following ILGenerator.Emit constructor overload can use the ckfinite opcode:

Return to top


Field: Clt
Summary
Compares two values. If the first value is less than the second, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack.
C# Syntax:
public static readonly OpCode Clt;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 04 clt Pushes 1 if is less than else pushes 0.

The stack transitional behavior, in sequential order, is: value1 is pushed onto the stack.

  1. value2 is pushed onto the stack.
  2. value2 and value1 are popped from the stack; clt tests if value1 is less than value2.
  3. If value1 is less than value2, 1 is pushed onto the stack; otherwise 0 is pushed onto the stack.

The clt instruction compares value1 and value2. If value1 is strictly less than value2, then an int32 value of 1 is pushed on the stack. Otherwise, an int32 value of 0 is pushed on the stack.

The following ILGenerator.Emit constructor overload can use the clt opcode:

Return to top


Field: Clt_Un
Summary
Compares the unsigned or unordered values value1 and value2. If value1 is less than value2, then the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack.
C# Syntax:
public static readonly OpCode Clt_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 03 clt.un Pushes 1 if is less than else pushes 0 (unsigned values).

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; clt.un tests if value1 is less than value2.
  4. If value1 is less than value2, 1 is pushed onto the stack; otherwise 0 is pushed onto the stack.

The clt.un instruction compares value1 and value2. An int32 value of 1 is pushed on the stack if any of the following is true:

Otherwise, an int32 value of 0 is pushed on the stack.

The following ILGenerator.Emit constructor overload can use the clt.un opcode:

Return to top


Field: Conv_I
Summary
Converts the value on top of the evaluation stack to natural int.
C# Syntax:
public static readonly OpCode Conv_I;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
D3 conv.i Convert to natural int , pushing natural int on stack.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.i opcode converts the value on top of the stack to the type specified in the opcode, and leave that converted value on the top of the stack. Integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.i or conv.u is used, in which case the result is also natural int). Floating-point values are converted to the F type.

Conversion from floating-point numbers to integer values truncates the number toward zero. When converting from an float64 to an float32, precision can be lost. If value is too large to fit in a float32 (F), positive infinity (if value is positive) or negative infinity (if value is negative) is returned. If overflow occurs converting one integer type to another, the high order bits are truncated. If the result is smaller than an int32, the value is sign-extended to fill the slot.

If overflow occurs converting a floating-point type to an integer the value returned is unspecified.

No exceptions are ever thrown when using this field. See OpCodes.Conv_Ovf_I and OpCodes.Conv_Ovf_I_Un for equivalent instructions that will throw an exception when the result type can not properly represent the result value.

The following ILGenerator.Emit constructor overload can use the conv.i opcode:

Return to top


Field: Conv_I1
Summary
Converts the value on top of the evaluation stack to int8, then extends (pads) it to int32.
C# Syntax:
public static readonly OpCode Conv_I1;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
67 conv.i1 Convert to int8 , pushing int32 on stack.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.i1 opcode converts the value on top of the stack to the type specified in the opcode, and leave that converted value on the top of the stack. Integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.i or conv.u is used, in which case the result is also natural int). Floating-point values are converted to the F type.

Conversion from floating-point numbers to integer values truncates the number toward zero. When converting from an float64 to an float32, precision can be lost. If value is too large to fit in a float32 (F), positive infinity (if value is positive) or negative infinity (if value is negative) is returned. If overflow occurs converting one integer type to another, the high order bits are truncated. If the result is smaller than an int32, the value is sign-extended to fill the slot.

If overflow occurs converting a floating-point type to an integer the value returned is unspecified.

No exceptions are ever thrown when using this field. See OpCodes.Conv_Ovf_I1 and OpCodes.Conv_Ovf_I1_Un for equivalent instructions that will throw an exception when the result type can not properly represent the result value.

The following ILGenerator.Emit constructor overload can use the conv.i1 opcode:

Return to top


Field: Conv_I2
Summary
Converts the value on top of the evaluation stack to int16, then extends (pads) it to int32.
C# Syntax:
public static readonly OpCode Conv_I2;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
68 conv.i2 Convert to int16 , pushing int32 on stack.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.i2 opcode converts the value on top of the stack to the type specified in the opcode, and leave that converted value on the top of the stack. Integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.i or conv.u is used, in which case the result is also natural int). Floating-point values are converted to the F type.

Conversion from floating-point numbers to integer values truncates the number toward zero. When converting from an float64 to an float32, precision can be lost. If value is too large to fit in a float32 (F), positive infinity (if value is positive) or negative infinity (if value is negative) is returned. If overflow occurs converting one integer type to another, the high order bits are truncated. If the result is smaller than an int32, the value is sign-extended to fill the slot.

If overflow occurs converting a floating-point type to an integer the value returned is unspecified.

No exceptions are ever thrown when using this field. See OpCodes.Conv_Ovf_I2 and OpCodes.Conv_Ovf_I2_Un for equivalent instructions that will throw an exception when the result type can not properly represent the result value.

The following ILGenerator.Emit constructor overload can use the conv.i2 opcode:

Return to top


Field: Conv_I4
Summary
Converts the value on top of the evaluation stack to int32.
C# Syntax:
public static readonly OpCode Conv_I4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
69 conv.i4 Convert to int32 , pushing int32 on stack.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.i4 opcode converts the value on top of the stack to the type specified in the opcode, and leave that converted value on the top of the stack. Integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.i or conv.u is used, in which case the result is also natural int). Floating-point values are converted to the F type.

Conversion from floating-point numbers to integer values truncates the number toward zero. When converting from an float64 to an float32, precision can be lost. If value is too large to fit in a float32 (F), positive infinity (if value is positive) or negative infinity (if value is negative) is returned. If overflow occurs converting one integer type to another, the high order bits are truncated. If the result is smaller than an int32, the value is sign-extended to fill the slot.

If overflow occurs converting a floating-point type to an integer the value returned is unspecified.

No exceptions are ever thrown when using this field. See OpCodes.Conv_Ovf_I4 and OpCodes.Conv_Ovf_I4_Un for equivalent instructions that will throw an exception when the result type can not properly represent the result value.

The following ILGenerator.Emit constructor overload can use the conv.i4 opcode:

Return to top


Field: Conv_I8
Summary
Converts the value on top of the evaluation stack to int64.
C# Syntax:
public static readonly OpCode Conv_I8;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
6A conv.i8 Convert to int64 , pushing int64 on stack.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.i8 opcode converts the value on top of the stack to the type specified in the opcode, and leave that converted value on the top of the stack. Integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.i or conv.u is used, in which case the result is also natural int). Floating-point values are converted to the F type.

Conversion from floating-point numbers to integer values truncates the number toward zero. When converting from an float64 to an float32, precision can be lost. If value is too large to fit in a float32 (F), positive infinity (if value is positive) or negative infinity (if value is negative) is returned. If overflow occurs converting one integer type to another, the high order bits are truncated. If the result is smaller than an int32, the value is sign-extended to fill the slot.

If overflow occurs converting a floating-point type to an integer the value returned is unspecified.

No exceptions are ever thrown when using this field. See OpCodes.Conv_Ovf_I8 and OpCodes.Conv_Ovf_I8_Un for equivalent instructions that will throw an exception when the result type can not properly represent the result value.

The following ILGenerator.Emit constructor overload can use the conv.i8 opcode:

Return to top


Field: Conv_Ovf_I
Summary
Converts the signed value on top of the evaluation stack to signed natural int, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_I;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
D4 conv.ovf.i Convert to a natural int (on the stack as natural int ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.i opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.i opcode:

Return to top


Field: Conv_Ovf_I_Un
Summary
Converts the unsigned value on top of the evaluation stack to signed natural int, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_I_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
8A conv.ovf.i.un Converts an unsigned value to a natural int (on the stack as natural int ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.i.un opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.i.un opcode:

Return to top


Field: Conv_Ovf_I1
Summary
Converts the signed value on top of the evaluation stack to signed int8 and extends it to int32, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_I1;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
B3 conv.ovf.i1 Convert to an int8 (on the stack as int32 ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.i1 opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.i1 opcode:

Return to top


Field: Conv_Ovf_I1_Un
Summary
Converts the unsigned value on top of the evaluation stack to signed int8 and extends it to int32, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_I1_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
82 conv.ovf.i1.un Converts an unsigned value to an int8 (on the stack as int32 ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.i1.un opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.i1.un opcode:

Return to top


Field: Conv_Ovf_I2
Summary
Converts the signed value on top of the evaluation stack to signed int16 and extending it to int32, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_I2;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
B5 conv.ovf.i2 Convert to an int16 (on the stack as int32 ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.i2 opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.i2 opcode:

Return to top


Field: Conv_Ovf_I2_Un
Summary
Converts the unsigned value on top of the evaluation stack to signed int16 and extends it to int32, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_I2_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
83 conv.ovf.i2.un Converts an unsigned value to an int16 (on the stack as int32 ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.i2.un opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.i2.un opcode:

Return to top


Field: Conv_Ovf_I4
Summary
Converts the signed value on top of the sevaluation tack to signed int32, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_I4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
B7 conv.ovf.i4 Convert to an int32 (on the stack as int32 ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.i4 opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.i4 opcode:

Return to top


Field: Conv_Ovf_I4_Un
Summary
Converts the unsigned value on top of the evaluation stack to signed int32, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_I4_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
84 conv.ovf.i4.un Converts an unsigned value to an int32 (on the stack as int32 ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.i4.un opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.i4.un opcode:

Return to top


Field: Conv_Ovf_I8
Summary
Converts the signed value on top of the evaluation stack to signed int64, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_I8;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
B9 conv.ovf.i8 Convert to an int64 (on the stack as int64 ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.i8 opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.i8 opcode:

Return to top


Field: Conv_Ovf_I8_Un
Summary
Converts the unsigned value on top of the evaluation stack to signed int64, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_I8_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
85 conv.ovf.i8.un Converts an unsigned value to an int64 (on the stack as int64 ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.i8.un opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.i8.un opcode:

Return to top


Field: Conv_Ovf_U
Summary
Converts the signed value on top of the evaluation stack to unsignednatural int, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_U;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
D5 conv.ovf.u Convert to an unsignednatural int (on the stack as natural int ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.u opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.u opcode:

Return to top


Field: Conv_Ovf_U_Un
Summary
Converts the unsigned value on top of the evaluation stack to unsignednatural int, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_U_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
8B conv.ovf.u.un Converts un unsigned value to an unsigned naturalint (on the stack as natural int ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.u.un opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.uvf.u.un opcode:

Return to top


Field: Conv_Ovf_U1
Summary
Converts the signed value on top of the evaluation stack to unsigned int8 and extends it to int32, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_U1;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
B4 conv.ovf.u1 Convert to an unsignedint8 (on the stack as int32 ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.u1 opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.u1 opcode:

Return to top


Field: Conv_Ovf_U1_Un
Summary
Converts the unsigned value on top of the evaluation stack to unsignedint8 and extends it to int32, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_U1_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
86 conv.ovf.u1.un Converts an unsigned value to an unsigned int8 (on the stack as int32 ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.u1.un opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.u1.un opcode:

Return to top


Field: Conv_Ovf_U2
Summary
Converts the signed value on top of the evaluation stack to unsigned int16 and extends it to int32, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_U2;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
B6 conv.ovf.u2 Convert to an unsignedint16 (on the stack as int32 ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.u2 opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.u2 opcode:

Return to top


Field: Conv_Ovf_U2_Un
Summary
Converts the unsigned value on top of the evaluation stack to unsigned int16 and extends it to int32, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_U2_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
87 conv.ovf.u2.un Converts an unsigned value to an unsignedint16 (on the stack as int32 ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.u2.un opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.u2.un opcode:

Return to top


Field: Conv_Ovf_U4
Summary
Converts the signed value on top of the evaluation stack to unsigned int32, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_U4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
B8 conv.ovf.u4 Convert to an unsignedint32 (on the stack as int32 ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.u4 opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.u4 opcode:

Return to top


Field: Conv_Ovf_U4_Un
Summary
Converts the unsigned value on top of the evaluation stack to unsigned int32, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_U4_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
88 conv.ovf.u4.un Converts an unsigned value to an unsigned int32 (on the stack as int32 ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.u4.un opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.u4.un opcode:

Return to top


Field: Conv_Ovf_U8
Summary
Converts the signed value on top of the evaluation stack to unsignedint64, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_U8;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
BA conv.ovf.u8 Convert to an unsignedint64 (on the stack as int64 ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.u8 opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.u8 opcode:

Return to top


Field: Conv_Ovf_U8_Un
Summary
Converts the unsigned value on top of the evaluation stack to unsigned int64, throwing OverflowException on overflow.
C# Syntax:
public static readonly OpCode Conv_Ovf_U8_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
89 conv.ovf.u8.un Converts an unsigned value to an unsignedint64 (on the stack as int64 ) and throw an exception on overflow.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted. If overflow occurs, an exception is thrown.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.ovf.u8.un opcode converts the value on top of the stack to the type specified in the opcode, and places that converted value on the top of the stack. If the value is too large or too small to be represented by the target type, an exception is thrown.

Conversions from floating-point numbers to integer values truncate the number toward zero. Note that integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.ovf.i or conv.ovf.u are used, in which case the result is also natural int).

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the conv.ovf.u8.un opcode:

Return to top


Field: Conv_R_Un
Summary
Converts the unsigned integer value on top of the evaluation stack to float32.
C# Syntax:
public static readonly OpCode Conv_R_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
76 conv.r.un Convert unsigned integer to floating-point, pushing F on stack.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.r.un opcode converts the value on top of the stack to the type specified in the opcode, and leave that converted value on the top of the stack. Integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.i or conv.u is used, in which case the result is also natural int). Floating-point values are converted to the F type.

Conversion from floating-point numbers to integer values truncates the number toward zero. When converting from an float64 to an float32, precision can be lost. If value is too large to fit in a float32 (F), positive infinity (if value is positive) or negative infinity (if value is negative) is returned. If overflow occurs converting one integer type to another, the high order bits are truncated. If the result is smaller than an int32, the value is sign-extended to fill the slot.

If overflow occurs converting a floating-point type to an integer the result returned is unspecified. The conv.r.un operation takes an integer off the stack, interprets it as unsigned, and replaces it with a floating-point number to represent the integer: either a float32, if this is wide enough to represent the integer without loss of precision, or else a float64.

No exceptions are ever thrown when using this field.

The following ILGenerator.Emit constructor overload can use the conv.r.un opcode:

Return to top


Field: Conv_R4
Summary
Converts the value on top of the evaluation stack to float32.
C# Syntax:
public static readonly OpCode Conv_R4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
6B conv.r4 Convert to float32 , pushing F on stack.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.r4 opcode converts the value on top of the stack to the type specified in the opcode, and leave that converted value on the top of the stack. Integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.i or conv.u is used, in which case the result is also natural int). Floating-point values are converted to the F type.

Conversion from floating-point numbers to integer values truncates the number toward zero. When converting from an float64 to an float32, precision can be lost. If value is too large to fit in a float32 (F), positive infinity (if value is positive) or negative infinity (if value is negative) is returned. If overflow occurs converting one integer type to another, the high order bits are truncated. If the result is smaller than an int32, the value is sign-extended to fill the slot.

If overflow occurs converting a floating-point type to an integer the value returned is unspecified.

No exceptions are ever thrown when using this field.

The following ILGenerator.Emit constructor overload can use the conv.r4 opcode:

Return to top


Field: Conv_R8
Summary
Converts the value on top of the evaluation stack to float64.
C# Syntax:
public static readonly OpCode Conv_R8;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
6C conv.r8 Convert to float64 , pushing F on stack.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.r8 opcode converts the value on top of the stack to the type specified in the opcode, and leave that converted value on the top of the stack. Integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.i or conv.u is used, in which case the result is also natural int). Floating-point values are converted to the F type.

Conversion from floating-point numbers to integer values truncates the number toward zero. When converting from an float64 to an float32, precision can be lost. If value is too large to fit in a float32 (F), positive infinity (if value is positive) or negative infinity (if value is negative) is returned. If overflow occurs converting one integer type to another, the high order bits are truncated. If the result is smaller than an int32, the value is sign-extended to fill the slot.

If overflow occurs converting a floating-point type to an integer the value returned is unspecified.

No exceptions are ever thrown when using this field.

The following ILGenerator.Emit constructor overload can use the conv.r8 opcode:

Return to top


Field: Conv_U
Summary
Converts the value on top of the evaluation stack to unsignednatural int, and extends it to natural int.
C# Syntax:
public static readonly OpCode Conv_U;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
E0 conv.u Convert to unsigned natural int , pushing natural int on stack.

The stack transitional behavior, in sequential order, is:

1)value is pushed onto the stack.

2)value is popped from the stack and the conversion operation is attempted.

3) If the conversion is successful, the resulting value is pushed onto the stack.

The conv.u opcode converts the value on top of the stack to the type specified in the opcode, and leave that converted value on the top of the stack. Integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.i or conv.u is used, in which case the result is also natural int). Floating-point values are converted to the F type.

Conversion from floating-point numbers to integer values truncates the number toward zero. When converting from an float64 to an float32, precision can be lost. If value is too large to fit in a float32 (F), positive infinity (if value is positive) or negative infinity (if value is negative) is returned. If overflow occurs converting one integer type to another, the high order bits are truncated. If the result is smaller than an int32, the value is sign-extended to fill the slot.

If overflow occurs converting a floating-point type to an integer the value returned is unspecified.

No exceptions are ever thrown when using this field. See OpCodes.Conv_Ovf_I and OpCodes.Conv_Ovf_I_Un for equivalent instructions that will throw an exception when the result type can not properly represent the result value.

The following ILGenerator.Emit constructor overload can use the conv.u opcode:

Return to top


Field: Conv_U1
Summary
Converts the value on top of the evaluation stack to unsigned int8, and extends it to int32.
C# Syntax:
public static readonly OpCode Conv_U1;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
D2 conv.u1 Convert to int8 , pushing int32 on stack.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.u1 opcode converts the value on top of the stack to the type specified in the opcode, and leave that converted value on the top of the stack. Integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.i or conv.u is used, in which case the result is also natural int). Floating-point values are converted to the F type.

Conversion from floating-point numbers to integer values truncates the number toward zero. When converting from an float64 to an float32, precision can be lost. If value is too large to fit in a float32 (F), positive infinity (if value is positive) or negative infinity (if value is negative) is returned. If overflow occurs converting one integer type to another, the high order bits are truncated. If the result is smaller than an int32, the value is sign-extended to fill the slot.

If overflow occurs converting a floating-point type to an integer the value returned is unspecified.

No exceptions are ever thrown when using this field. See OpCodes.Conv_Ovf_I1 and OpCodes.Conv_Ovf_I1_Un for equivalent instructions that will throw an exception when the result type can not properly represent the result value.

The following ILGenerator.Emit constructor overload can use the conv.u1 opcode:

Return to top


Field: Conv_U2
Summary
Converts the value on top of the evaluation stack to unsignedint16, and extends it to int32.
C# Syntax:
public static readonly OpCode Conv_U2;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
D1 conv.u2 Convert to int16 , pushing int32 on stack.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.u2 opcode converts the value on top of the stack to the type specified in the opcode, and leave that converted value on the top of the stack. Integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.i or conv.u is used, in which case the result is also natural int). Floating-point values are converted to the F type.

Conversion from floating-point numbers to integer values truncates the number toward zero. When converting from an float64 to an float32, precision can be lost. If value is too large to fit in a float32 (F), positive infinity (if value is positive) or negative infinity (if value is negative) is returned. If overflow occurs converting one integer type to another, the high order bits are truncated. If the result is smaller than an int32, the value is sign-extended to fill the slot.

If overflow occurs converting a floating-point type to an integer the value returned is unspecified.

No exceptions are ever thrown when using this field. See OpCodes.Conv_Ovf_I2 and OpCodes.Conv_Ovf_I2_Un for equivalent instructions that will throw an exception when the result type can not properly represent the result value.

The following ILGenerator.Emit constructor overload can use the conv.u2 opcode:

Return to top


Field: Conv_U4
Summary
Converts the value on top of the evaluation stack to unsigned int32, and extends it to int32.
C# Syntax:
public static readonly OpCode Conv_U4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
6D conv.u4 Convert to unsignedint32 , pushing int32 on stack.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.u4 opcode converts the value on top of the stack to the type specified in the opcode, and leave that converted value on the top of the stack. Integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.i or conv.u is used, in which case the result is also natural int). Floating-point values are converted to the F type.

Conversion from floating-point numbers to integer values truncates the number toward zero. When converting from an float64 to an float32, precision can be lost. If value is too large to fit in a float32 (F), positive infinity (if value is positive) or negative infinity (if value is negative) is returned. If overflow occurs converting one integer type to another, the high order bits are truncated. If the result is smaller than an int32, the value is sign-extended to fill the slot.

If overflow occurs converting a floating-point type to an integer the value returned is unspecified.

No exceptions are ever thrown when using this field. See OpCodes.Conv_Ovf_I4 and OpCodes.Conv_Ovf_I4_Un for equivalent instructions that will throw an exception when the result type can not properly represent the result value.

The following ILGenerator.Emit constructor overload can use the conv.u4 opcode:

Return to top


Field: Conv_U8
Summary
Converts the value on top of the evaluation stack to unsignedint64, and extends it to int64.
C# Syntax:
public static readonly OpCode Conv_U8;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
6E conv.u8 Convert to int64 , pushing int64 on stack.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and the conversion operation is attempted.
  3. If the conversion is successful, the resulting value is pushed onto the stack.

The conv.u8 opcode converts the value on top of the stack to the type specified in the opcode, and leave that converted value on the top of the stack. Integer values of less than 4 bytes are extended to int32 when they are loaded onto the evaluation stack (unless conv.i or conv.u is used, in which case the result is also natural int). Floating-point values are converted to the F type.

Conversion from floating-point numbers to integer values truncates the number toward zero. When converting from an float64 to an float32, precision can be lost. If value is too large to fit in a float32 (F), positive infinity (if value is positive) or negative infinity (if value is negative) is returned. If overflow occurs converting one integer type to another, the high order bits are truncated. If the result is smaller than an int32, the value is sign-extended to fill the slot.

If overflow occurs converting a floating-point type to an integer the value returned is unspecified.

No exceptions are ever thrown when using this field. See OpCodes.Conv_Ovf_I8 and OpCodes.Conv_Ovf_I8_Un for equivalent instructions that will throw an exception when the result type can not properly represent the result value.

The following ILGenerator.Emit constructor overload can use the conv.u8 opcode:

Return to top


Field: Cpblk
Summary
Copies a specified number bytes from a source address to a destination address .
C# Syntax:
public static readonly OpCode Cpblk;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 17 cpblk Copy data from one memory block to another.

The stack transitional behavior, in sequential order, is:

  1. The destination address is pushed onto the stack.
  2. The source address is pushed onto the stack.
  3. The number of bytes to copy is pushed onto the stack.
  4. The number of bytes, the source address, and the destination address are popped from the stack; the specified number of bytes are copied from the source address to the destination address.

The cpblk instruction copies a number (type unsigned int32) of bytes from a source address (of type *, natural int, or &) to a destination address (of type *, natural int, or &). The behavior of cpblk is unspecified if the source and destination areas overlap.

cpblk assumes that both the source and destination addressed are aligned to the natural size of the machine. The cpblk instruction can be immediately preceded by the unaligned.<prefix> instruction to indicate that either the source or the destination is unaligned.

The operation of the cpblk instruction can be altered by an immediately preceding OpCodes.Volatile or OpCodes.Unaligned prefix instruction.

NullReferenceException may be thrown if an invalid address is detected.

The following ILGenerator.Emit constructor overload can use the cpblk opcode:

Return to top


Field: Cpobj
Summary
Copies the value type located at the address of an object (type &, * or natural int) to the address of the destination object (type &, * or natural int).
C# Syntax:
public static readonly OpCode Cpobj;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
70 < T > cpobj Copies a value type from a source object to a destination object.

The stack transitional behavior, in sequential order, is:

  1. The destination object reference is pushed onto the stack.
  2. The source object reference is pushed onto the stack.
  3. The two object references are popped from the stack; the value type at the address of the source object is copied to the address of the destination object.

The behavior of cpobj is unspecified if the source and destination object references are not pointers to instances of the class represented by the class token classTok (a typeref or typedef), or if classTok does not represent a value type.

NullReferenceException may be thrown if an invalid address is detected.

The following ILGenerator.Emit constructor overload can use the cpobj opcode:

Return to top


Field: Div
Summary
Divides two values and pushes the result as a floating-point (type F) or quotient (type int32) onto the evaluation stack.
C# Syntax:
public static readonly OpCode Div;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
5B div Divides two values to return a quotient or floating-point result.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; value1 is divided by value2.
  4. The result is pushed onto the stack.

result = value1 div value2 satisfies the following conditions:

| result | = | value1 | / | value2 |, and:

sign(result) = +, if sign(value1) = sign(value2), or -, if sign(value1) ~= sign(value2)

The div instruction computes the result and pushes it on the stack.

Integer division truncates towards zero.

Division of a finite number by zero produces the correctly signed infinite value.

Dividing zero by zero or infinity by infinity produces the NaN (Not-A-Number) value. Any number divided by infinity will produce a zero value.

Integral operations throw ArithmeticException if the result cannot be represented in the result type. This can happen if value1 is the maximum negative value, and value2 is -1.

Integral operations throw DivideByZeroException if value2 is zero.

Note that on Intel-based platforms an OverflowException is thrown when computing (minint div -1). Floating-point operations never throw an exception (they produce NaNs or infinities instead).

The following ILGenerator.Emit constructor overload can use the div opcode:

Return to top


Field: Div_Un
Summary
Divides two unsigned integer values and pushes the result (int32) onto the evaluation stack.
C# Syntax:
public static readonly OpCode Div_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
5C div.un Divides two values, unsigned, returning a quotient.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; value1 is divided by value2.
  4. The result is pushed onto the stack.

The div.un instruction computes value1 divided by value2, both taken as unsigned integers, and pushes the result on the stack.

The following ILGenerator.Emit constructor overload can use the div.un opcode:

Return to top


Field: Dup
Summary
Copies the current topmost value on the evaluation stack, and then pushes the copy onto the evaluation stack.
C# Syntax:
public static readonly OpCode Dup;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
25 dup Duplicates the value on the top of the stack.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped off of the stack for duplication.
  3. value is pushed back onto the stack.
  4. A duplicate value is pushed onto the stack.

The dup instruction duplicates the top element of the stack, and leaves two identical values atop it.

The following ILGenerator.Emit constructor overload can use the dup opcode:

Return to top


Field: Endfilter
Summary
Transfers control from the filter clause of an exception back to the Common Language Infrastructure (CLI) exception handler.
C# Syntax:
public static readonly OpCode Endfilter;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 11 endfilter End filter clause of SEH exception handling.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack; endfilter is executed and control is transferred to the exception handler.

Value (which must be of type int32 and is one of a specific set of values) is returned from the filter clause. It should be one of:

Other integer values will produce unspecified results.

The entry point of a filter, as shown in the method's exception table, must be the first instruction in the filter's code block. The endfilter instruction must be the last instruction in the filter's code block (hence there can only be one endfilter for any single filter block). After executing the endfilter instruction, control logically flows back to the CLI exception handling mechanism.

Control cannot be transferred into a filter block except through the exception mechanism. Control cannot be transferred out of a filter block except through the use of a throw instruction or by executing the final endfilter instruction. You cannot embed a try block within a filter block. If an exception is thrown inside the filter block, it is intercepted and a value of 0 (exception_continue_search) is returned.

The following ILGenerator.Emit constructor overload can use the endfilter opcode:

Return to top


Field: Endfinally
Summary
Transfers control from the fault or finally clause of an exception block back to the Common Language Infrastructure (CLI) exception handler.
C# Syntax:
public static readonly OpCode Endfinally;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
DC endfinally endfault Ends the finally or fault clause of an exception block.

There are no stack transition behaviors for this instruction.

Endfinally and endfault signal the end of the finally or fault clause so that stack unwinding can continue until the exception handler is invoked. The endfinally or endfault instruction transfers control back to the CLI exception mechanism. The mechanism then searches for the next finally clause in the chain if the protected block was exited with a leave instruction. If the protected block was exited with an exception, the CLI will search for the next finally or fault, or enter the exception handler chosen during the first pass of exception handling.

An endfinally instruction might only appear lexically within a finally block. Unlike the endfilter instruction, there is no requirement that the block end with an endfinally instruction, and there can be as many endfinally instructions within the block as required. These same restrictions apply to the endfault instruction and the fault block.

Control cannot be transferred into a finally (or fault) block except through the exception mechanism. Control cannot be transferred out of a finally (or fault) block except through the use of a throw instruction or executing the endfinally (or endfault) instruction. In particular, you cannot "fall out" of a finally (or fault) block or to execute a OpCodes.Ret or OpCodes.Leave instruction within a finally (or fault) block.

Note that the endfault and endfinally instructions are aliases - they correspond to the same opcode.

The following ILGenerator.Emit constructor overload can use the endfinally (endfault) opcode, as well as the ILGenerator method ILGenerator.EndExceptionBlock.

Return to top


Field: Initblk
Summary
Initializes a specified block of memory at a specific address to a given size and initial value.
C# Syntax:
public static readonly OpCode Initblk;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 18 initblk Set each location in a block of memory to a given value.

The stack transitional behavior, in sequential order, is:

  1. A starting address is pushed onto the stack.
  2. An initialization value is pushed onto the stack.
  3. The number of bytes to initialize is pushed onto the stack.
  4. The number of bytes, the initialization value, and the starting address are popped from the stack, and the initialization is performed as per their values.

The initblk instruction sets the number (unsigned int32) of bytes starting at the specified address (of type natural int, &, or *) to the initialization value (of type unsigned int8).initblk assumes that the starting address is aligned to the natural size of the machine.

The operation of the initblk instructions can be altered by an immediately preceding OpCodes.Volatile or OpCodes.Unaligned prefix instruction.

NullReferenceException may be thrown if an invalid address is detected.

The following ILGenerator.Emit constructor overload can use the initblk opcode:

Return to top


Field: Initobj
Summary
Initializes all the fields of the object at a specific address to a null reference or a 0 of the appropriate primitive type.
C# Syntax:
public static readonly OpCode Initobj;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 15 < T > initobj Initializes a value type.

The stack transitional behavior, in sequential order, is:

  1. The address of an object to initialize is pushed onto the stack.
  2. The address is popped from the stack; the value type object at the specified address is initialized as type classTok.

The initobj instruction initializes all the fields of the object specified by the pushed address (of type natural int, &, or *) to a null reference or a 0 of the appropriate primitive type. After this method is called, the instance is ready for the constructor method to be called. Behavior is unspecified if either the address is not a pointer to an instance of the class represented by classTok, or if classTok does not represent a value type.

Unlike OpCodes.Newobj, the constructor method is not called by initobj.Initobj is intended for initializing value types, while newobj is used to allocate and initialize objects.

The following ILGenerator.Emit constructor overloadscan use the initobj opcode:

Return to top


Field: Isinst
Summary
Tests whether an object reference (type O) is an instance of a particular class.
C# Syntax:
public static readonly OpCode Isinst;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
75 < T > isinst Tests if an object reference is an instance of , returning either a null reference or an instance of that class or interface.

The stack transitional behavior, in sequential order, is:

  1. An object reference is pushed onto the stack.
  2. The object reference is popped from the stack and tested to see if it is an instance of the class passed in class.
  3. The result (either an object reference or a null reference) is pushed onto the stack.

Class is a metadata token indicating the desired class. If the class of the object on the top of the stack implements class (if class is an interface) or is a derived class of class (if class is a regular class) then it is cast to type class and the result is pushed on the stack, exactly as though OpCodes.Castclass had been called. Otherwise, a null reference is pushed on the stack. If the object reference itself is a null reference, then isinst likewise returns a null reference.

TypeLoadException is thrown if class cannot be found. This is typically detected when the Microsoft Intermediate Language (MSIL) instructions are converted to native code rather than at runtime.

The following ILGenerator.Emit constructor overload can use the isinst opcode:

Return to top


Field: Jmp
Summary
Exits current method and jumps to specified method.
C# Syntax:
public static readonly OpCode Jmp;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
27 < T > jmp Exit current method and jump to specified method.

There are no stack transition behaviors for this instruction.

The jmp (jump) instruction transfers control to the method specified by method, which is a metadata token for a method reference. The current arguments are transferred to the destination method.

The evaluation stack must be empty when this instruction is executed. The calling convention, number and type of arguments at the destination address must match that of the current method.

The jmp instruction cannot be used to transferred control out of a try, filter, catch, or finally block.

The following ILGenerator.Emit constructor overload can use the jmp opcode:

Return to top


Field: Ldarg
Summary
Loads an argument (referenced by a specified index value) onto the stack.
C# Syntax:
public static readonly OpCode Ldarg;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 09 < unsigned int16 > ldarg Load argument at onto stack.

The stack transitional behavior, in sequential order, is:

  1. The argument value at index is pushed onto the stack.

The ldarg instruction pushes the argument indexed at index, where arguments are indexed from 0 onwards, onto the evaluation stack. The ldarg instruction can be used to load a value type or a primitive value onto the stack by copying it from an incoming argument. The type of the argument value is the same as the type of the argument, as specified by the current method's signature.

For procedures that take a variable-length argument list, the ldarg instruction can be used only for the initial fixed arguments, not those in the variable part of the signature (see the OpCodes.Arglist instruction for more details).

Arguments that hold an integer value smaller than 4 bytes long are expanded to type int32 when they are loaded onto the stack. Floating-point values are expanded to their native size (type F).

The following ILGenerator.Emit constructor overload can use the ldarg opcode:

Return to top


Field: Ldarg_0
Summary
Loads the argument at index 0 onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldarg_0;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
02 ldarg.0 Load argument 0 onto stack

The stack transitional behavior, in sequential order, is:

  1. The argument value at index 0 is pushed onto the stack.

The ldarg.0 instruction is an efficient encoding for loading the argument value at index 0.

The ldarg.0 instruction pushes the argument indexed at 0 onto the evaluation stack. The ldarg.0 instruction can be used to load a value type or a primitive value onto the stack by copying it from an incoming argument. The type of the argument value is the same as the type of the argument, as specified by the current method's signature.

Arguments that hold an integer value smaller than 4 bytes long are expanded to type int32 when they are loaded onto the stack. Floating-point values are expanded to their native size (type F).

The following ILGenerator.Emit constructor overload can use the ldarg.0 opcode:

Return to top


Field: Ldarg_1
Summary
Loads the argument at index 1 onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldarg_1;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
03 ldarg.1 Load argument 1 onto stack.

The stack transitional behavior, in sequential order, is:

  1. The argument value at index 1 is pushed onto the stack.

The ldarg.1 instruction is an efficient encoding for loading the argument value at index 1.

The ldarg.1 instruction pushes the argument indexed at 1 onto the evaluation stack. The ldarg.1 instruction can be used to load a value type or a primitive value onto the stack by copying it from an incoming argument. The type of the argument value is the same as the type of the argument, as specified by the current method's signature.

Arguments that hold an integer value smaller than 4 bytes long are expanded to type int32 when they are loaded onto the stack. Floating-point values are expanded to their native size (type F).

The following ILGenerator.Emit constructor overload can use the ldarg.1 opcode:

Return to top


Field: Ldarg_2
Summary
Loads the argument at index 2 onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldarg_2;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
04 ldarg.2 Load argument 2 onto stack.

The stack transitional behavior, in sequential order, is:

  1. The argument value at index 2 is pushed onto the stack.

The ldarg.2 instruction is an efficient encoding for loading the argument value at index 2.

The ldarg.2 instruction pushes the argument indexed at 2 onto the evaluation stack. The ldarg.2 instruction can be used to load a value type or a primitive value onto the stack by copying it from an incoming argument. The type of the argument value is the same as the type of the argument, as specified by the current method's signature.

Arguments that hold an integer value smaller than 4 bytes long are expanded to type int32 when they are loaded onto the stack. Floating-point values are expanded to their native size (type F).

The following ILGenerator.Emit constructor overload can use the ldarg.2 opcode:

Return to top


Field: Ldarg_3
Summary
Loads the argument at index 3 onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldarg_3;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
05 ldarg.3 Load argument 3 onto stack.

The stack transitional behavior, in sequential order, is:

  1. The argument value at index 3 is pushed onto the stack.

The ldarg.3 instruction is an efficient encoding for loading the argument value at index 3.

The ldarg.3 instruction pushes the argument indexed at 3 onto the evaluation stack. The ldarg.3 instruction can be used to load a value type or a primitive value onto the stack by copying it from an incoming argument. The type of the argument value is the same as the type of the argument, as specified by the current method's signature.

Arguments that hold an integer value smaller than 4 bytes long are expanded to type int32 when they are loaded onto the stack. Floating-point values are expanded to their native size (type F).

The following ILGenerator.Emit constructor overload can use the ldarg.3 opcode:

Return to top


Field: Ldarg_S
Summary
Loads the argument (referenced by a specified short form index) onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldarg_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
0E < unsigned int8 > ldarg.s Load argument at onto stack, short form.

The stack transitional behavior, in sequential order, is:

  1. The argument value at index is pushed onto the stack.

The ldarg.s instruction is an efficient encoding for loading arguments indexed from 4 through 255.

The ldarg.s instruction pushes the argument indexed at index, where arguments are indexed from 0 onwards, onto the evaluation stack. The ldarg.s instruction can be used to load a value type or a primitive value onto the stack by copying it from an incoming argument. The type of the argument value is the same as the type of the argument, as specified by the current method's signature.

For procedures that take a variable-length argument list, the ldarg.s instruction can be used only for the initial fixed arguments, not those in the variable part of the signature (see the OpCodes.Arglist instruction for more details).

Arguments that hold an integer value smaller than 4 bytes long are expanded to type int32 when they are loaded onto the stack. Floating-point values are expanded to their native size (type F).

The following ILGenerator.Emit constructor overload can use the ldarg.s opcode:

Return to top


Field: Ldarga
Summary
Load an argument address onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldarga;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 0A < unsigned int16 > ldarga Fetch the address of argument indexed by .

The stack transitional behavior, in sequential order, is:

  1. The address addr of the argument indexed by index is pushed onto the stack.

The ldarga instruction fetches the address (of type *) of the argument indexed by index, where arguments are indexed from 0 onwards. The address addr is always aligned to a natural boundary on the target machine.

For procedures that take a variable-length argument list, the ldarga instruction can be used only for the initial fixed arguments, not those in the variable part of the signature.

ldarga is used for by-ref parameter passing. For other cases, OpCodes.Ldarg and OpCodes.Starg should be used.

The following ILGenerator.Emit constructor overload can use the ldarga opcode:

Return to top


Field: Ldarga_S
Summary
Load an argument address, in short form, onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldarga_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
0F < unsigned int8 > ldarga.s Fetch the address of argument indexed by short form.

The stack transitional behavior, in sequential order, is:

  1. The address addr of the argument indexed by index is pushed onto the stack.

ldarga.s (the short form of ldarga) should be used for argument numbers 0 through 255, and is a more efficient encoding.

The ldarga.s instruction fetches the address (of type *) of the argument indexed by index, where arguments are indexed from 0 onwards. The address addr is always aligned to a natural boundary on the target machine.

For procedures that take a variable-length argument list, the ldarga.s instruction can be used only for the initial fixed arguments, not those in the variable part of the signature.

ldarga.s is used for by-ref parameter passing. For other cases, OpCodes.Ldarg_S and OpCodes.Starg_S should be used.

The following ILGenerator.Emit constructor overload can use the ldarga.s opcode:

Return to top


Field: Ldc_I4
Summary
Pushes a supplied value of type int32 onto the evaluation stack as an int32.
C# Syntax:
public static readonly OpCode Ldc_I4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
20 < int32 > ldc.i4 Pushes the value onto the stack.

The stack transitional behavior, in sequential order, is:

  1. The value num is pushed onto the stack.

Note that there are special short (and hence more efficient) encodings for the integers -128 through 127, and especially short encodings for -1 through 8. All short encodings push 4 byte integers on the stack. Longer encodings are used for 8 byte integers and 4 and 8 byte floating-point numbers, as well as 4-byte values that do not fit in the short forms. There are three ways to push an 8 byte integer constant onto the stack

1. Use the OpCodes.Ldc_I8 instruction for constants that must be expressed in more than 32 bits.

2. Use the OpCodes.Ldc_I4 instruction followed by a OpCodes.Conv_I8 for constants that require 9 to 32 bits.

3. Use a short form instruction followed by a OpCodes.Conv_I8 for constants that can be expressed in 8 or fewer bits.

The following ILGenerator.Emit constructor overload can use the ldc.i4 opcode:

Return to top


Field: Ldc_I4_0
Summary
Pushes the integer value of 0 onto the evaluation stack as an int32.
C# Syntax:
public static readonly OpCode Ldc_I4_0;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
16 ldc.i4.0 Pushes 0 onto the stack.

The stack transitional behavior, in sequential order, is:

  1. The value 0 is pushed onto the stack.

This is a special short encoding for the push of the integer value 0. All special short encodings push 4 byte integers on the stack.

The following ILGenerator.Emit constructor overload can use the ldc.i4.0 opcode:

Return to top


Field: Ldc_I4_1
Summary
Pushes the integer value of 1 onto the evaluation stack as an int32.
C# Syntax:
public static readonly OpCode Ldc_I4_1;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
17 ldc.i4.1 Pushes 1 onto the stack.

The stack transitional behavior, in sequential order, is:

  1. The value 1 is pushed onto the stack.

This is a special short encoding for the push of the integer value 0. All special short encodings push 4 byte integers on the stack.

The following ILGenerator.Emit constructor overload can use the ldc.i4.1 opcode:

Return to top


Field: Ldc_I4_2
Summary
Pushes the integer value of 2 onto the evaluation stack as an int32.
C# Syntax:
public static readonly OpCode Ldc_I4_2;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
18 ldc.i4.2 Pushes 2 onto the stack.

The stack transitional behavior, in sequential order, is:

  1. The value 2 is pushed onto the stack.

This is a special short encoding for the push of the integer value 0. All special short encodings push 4 byte integers on the stack.

The following ILGenerator.Emit constructor overload can use the ldc.i4.2 opcode:

Return to top


Field: Ldc_I4_3
Summary
Pushes the integer value of 3 onto the evaluation stack as an int32.
C# Syntax:
public static readonly OpCode Ldc_I4_3;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
19 ldc.i4.3 Pushes 3 onto the stack.

The stack transitional behavior, in sequential order, is:

  1. The value 3 is pushed onto the stack.

This is a special short encoding for the push of the integer value 0. All special short encodings push 4 byte integers on the stack.

The following ILGenerator.Emit constructor overload can use the ldc.i4.3 opcode:

Return to top


Field: Ldc_I4_4
Summary
Pushes the integer value of 4 onto the evaluation stack as an int32.
C# Syntax:
public static readonly OpCode Ldc_I4_4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
1A ldc.i4.4 Pushes 4 onto the stack.

The stack transitional behavior, in sequential order, is:

  1. The value 4 is pushed onto the stack.

This is a special short encoding for the push of the integer value 0. All special short encodings push 4 byte integers on the stack.

The following ILGenerator.Emit constructor overload can use the ldc.i4.4 opcode:

Return to top


Field: Ldc_I4_5
Summary
Pushes the integer value of 5 onto the evaluation stack as an int32.
C# Syntax:
public static readonly OpCode Ldc_I4_5;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
1B ldc.i4.5 Pushes 5 onto the stack.

The stack transitional behavior, in sequential order, is:

  1. The value 5 is pushed onto the stack.

This is a special short encoding for the push of the integer value 0. All special short encodings push 4 byte integers on the stack.

The following ILGenerator.Emit constructor overload can use the ldc.i4.5 opcode:

Return to top


Field: Ldc_I4_6
Summary
Pushes the integer value of 6 onto the evaluation stack as an int32.
C# Syntax:
public static readonly OpCode Ldc_I4_6;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
1C ldc.i4.6 Pushes 6 onto the stack.

The stack transitional behavior, in sequential order, is:

  1. The value 6 is pushed onto the stack.

This is a special short encoding for the push of the integer value 0. All special short encodings push 4 byte integers on the stack.

The following ILGenerator.Emit constructor overload can use the ldc.i4.6 opcode:

Return to top


Field: Ldc_I4_7
Summary
Pushes the integer value of 7 onto the evaluation stack as an int32.
C# Syntax:
public static readonly OpCode Ldc_I4_7;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
1D ldc.i4.7 Pushes 7 onto the stack.

The stack transitional behavior, in sequential order, is:

  1. The value 7 is pushed onto the stack.

This is a special short encoding for the push of the integer value 0. All special short encodings push 4 byte integers on the stack.

The following ILGenerator.Emit constructor overload can use the ldc.i4.7 opcode:

Return to top


Field: Ldc_I4_8
Summary
Pushes the integer value of 8 onto the evaluation stack as an int32.
C# Syntax:
public static readonly OpCode Ldc_I4_8;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
1E ldc.i4.8 Pushes 8 onto the stack.

The stack transitional behavior, in sequential order, is:

  1. The value 8 is pushed onto the stack.

This is a special short encoding for the push of the integer value 0. All special short encodings push 4 byte integers on the stack.

The following ILGenerator.Emit constructor overload can use the ldc.i4.8 opcode:

Return to top


Field: Ldc_I4_M1
Summary
Pushes the integer value of -1 onto the evaluation stack as an int32.
C# Syntax:
public static readonly OpCode Ldc_I4_M1;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
15 ldc.i4.m1 Pushes -1 onto the stack.

The stack transitional behavior, in sequential order, is:

  1. The value -1 is pushed onto the stack.

This is a special short encoding for the push of the integer value 0. All special short encodings push 4 byte integers on the stack.

The following ILGenerator.Emit constructor overload can use the ldc.i4.m1 opcode:

Return to top


Field: Ldc_I4_S
Summary
Pushes the supplied int8 value onto the evaluation stack as an int32, short form.
C# Syntax:
public static readonly OpCode Ldc_I4_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
1F < int8 > ldc.i4.s Pushes onto the stack as int32 , short form.

The stack transitional behavior, in sequential order, is:

  1. The value num is pushed onto the stack.

ldc.i4.s is a more efficient encoding for pushing the integers from -127 to 128 onto the evaluation stack.

The following ILGenerator.Emit constructor overload can use the ldc.i4.s opcode:

Return to top


Field: Ldc_I8
Summary
Pushes a supplied value of type int64 onto the evaluation stack as an int64.
C# Syntax:
public static readonly OpCode Ldc_I8;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
21 < int64 > ldc.i8 Pushes onto the stack as int64 .

The stack transitional behavior, in sequential order, is:

  1. The value num is pushed onto the stack.

This encoding pushes an int64 value onto the stack.

The following ILGenerator.Emit constructor overload can use the ldc.i8 opcode:

Return to top


Field: Ldc_R4
Summary
Pushes a supplied value of type float32 onto the evaluation stack as type F (float).
C# Syntax:
public static readonly OpCode Ldc_R4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
22 < float32 > ldc.r4 Pushes onto the stack as F .

The stack transitional behavior, in sequential order, is:

  1. The value num is pushed onto the stack.

This encoding pushes a float32 value onto the stack.

The following ILGenerator.Emit constructor overload can use the ldc.r4 opcode:

Return to top


Field: Ldc_R8
Summary
Pushes a supplied value of type float64 onto the evaluation stack as type F (float).
C# Syntax:
public static readonly OpCode Ldc_R8;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
23 < float64 > ldc.r8 Pushes onto the stack as F .

The stack transitional behavior, in sequential order, is:

  1. The value num is pushed onto the stack.

This encoding pushes a float64 value onto the stack.

The following ILGenerator.Emit constructor overload can use the ldc.r8 opcode:

Return to top


Field: Ldelem_I
Summary
Loads the element with type natural int at a specified array index onto the top of the evaluation stack as a natural int.
C# Syntax:
public static readonly OpCode Ldelem_I;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
97 ldelem.i Loads the element with type natural int at onto the top of the stack as a natural int .

The stack transitional behavior, in sequential order, is:

  1. An object reference array is pushed onto the stack.
  2. An index value index is pushed onto the stack.
  3. index and array are popped from the stack; the value stored at position index in array is looked up.
  4. The value is pushed onto the stack.

The ldelem.i instruction loads the value of the element with index index (type natural int) in the zero-based one-dimensional array array and places it on the top of the stack. Arrays are objects and hence represented by a value of type O.

The return value for ldelem.i is natural int.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack.

NullReferenceException is thrown if array is a null reference.

ArrayTypeMismatchException is thrown if if array does not hold elements of the required type.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

The following ILGenerator.Emit constructor overload can use the ldelem.i opcode:

Return to top


Field: Ldelem_I1
Summary
Loads the element with type int8 at a specified array index onto the top of the evaluation stack as an int32.
C# Syntax:
public static readonly OpCode Ldelem_I1;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
90 ldelem.i1 Loads the element with type int8 at onto the top of the stack as an int32 .

The stack transitional behavior, in sequential order, is:

  1. An object reference array is pushed onto the stack.
  2. An index value index is pushed onto the stack.
  3. index and array are popped from the stack; the value stored at position index in array is looked up.
  4. The value is pushed onto the stack.

The ldelem.i1 instruction loads the value of the element with index index (type natural int) in the zero-based one-dimensional array array and places it on the top of the stack. Arrays are objects and hence represented by a value of type O.

The return value for ldelem.i1 is int8.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack.

NullReferenceException is thrown if array is a null reference.

ArrayTypeMismatchException is thrown if if array does not hold elements of the required type.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

The following ILGenerator.Emit constructor overload can use the ldelem.i1 opcode:

Return to top


Field: Ldelem_I2
Summary
Loads the element with type int16 at a specified array index onto the top of the evaluation stack as an int32.
C# Syntax:
public static readonly OpCode Ldelem_I2;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
92 ldelem.i2 Loads the element with type int16 at onto the top of the stack as an int32 .

The stack transitional behavior, in sequential order, is:

  1. An object reference array is pushed onto the stack.
  2. An index value index is pushed onto the stack.
  3. index and array are popped from the stack; the value stored at position index in array is looked up.
  4. The value is pushed onto the stack.

The ldelem.i2 instruction loads the value of the element with index index (type natural int) in the zero-based one-dimensional array array and places it on the top of the stack. Arrays are objects and hence represented by a value of type O.

The return value for ldelem.i2 is int16.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack.

NullReferenceException is thrown if array is a null reference.

ArrayTypeMismatchException is thrown if array does not hold elements of the required type.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

The following ILGenerator.Emit constructor overload can use the ldelem.i2 opcode:

Return to top


Field: Ldelem_I4
Summary
Loads the element with type int32 at a specified array index onto the top of the evaluation stack as an int32.
C# Syntax:
public static readonly OpCode Ldelem_I4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
94 ldelem.i4 Loads the element with type int32 at onto the top of the stack as an int32 .

The stack transitional behavior, in sequential order, is:

  1. An object reference array is pushed onto the stack.
  2. An index value index is pushed onto the stack.
  3. index and array are popped from the stack; the value stored at position index in array is looked up.
  4. The value is pushed onto the stack.

The ldelem.i4 instruction loads the value of the element with index index (type natural int) in the zero-based one-dimensional array array and places it on the top of the stack. Arrays are objects and hence represented by a value of type O.

The return value for ldelem.i4 is int32.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack.

NullReferenceException is thrown if array is a null reference.

ArrayTypeMismatchException is thrown if if array does not hold elements of the required type.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

The following ILGenerator.Emit constructor overload can use the ldelem.i4 opcode:

Return to top


Field: Ldelem_I8
Summary
Loads the element with type int64 at a specified array index onto the top of the evaluation stack as an int64.
C# Syntax:
public static readonly OpCode Ldelem_I8;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
96 ldelem.i8 Loads the element with type int64 at onto the top of the stack as an int64 .

The stack transitional behavior, in sequential order, is:

  1. An object reference array is pushed onto the stack.
  2. An index value index is pushed onto the stack.
  3. index and array are popped from the stack; the value stored at position index in array is looked up.
  4. The value is pushed onto the stack.

The ldelem.i8 instruction loads the value of the element with index index (type natural int) in the zero-based one-dimensional array array and places it on the top of the stack. Arrays are objects and hence represented by a value of type O.

The return value for ldelem.i8 is int64.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack.

NullReferenceException is thrown if array is a null reference.

ArrayTypeMismatchException is thrown if if array does not hold elements of the required type.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

The following ILGenerator.Emit constructor overload can use the ldelem.i8 opcode:

Return to top


Field: Ldelem_R4
Summary
Loads the element with type float32 at a specified array index onto the top of the evaluation stack as type F (float) .
C# Syntax:
public static readonly OpCode Ldelem_R4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
98 ldelem.r4 Loads the element with type float32 at onto the top of the stack as a type F .

The stack transitional behavior, in sequential order, is:

  1. An object reference array is pushed onto the stack.
  2. An index value index is pushed onto the stack.
  3. index and array are popped from the stack; the value stored at position index in array is looked up.
  4. The value is pushed onto the stack.

The ldelem.r4 instruction loads the value of the element with index index (type natural int) in the zero-based one-dimensional array array and places it on the top of the stack. Arrays are objects and hence represented by a value of type O.

The return value for ldelem.r4 is float32.

Floating-point values are converted to type F when loaded onto the evaluation stack.

NullReferenceException is thrown if array is a null reference.

ArrayTypeMismatchException is thrown if if array does not hold elements of the required type.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

The following ILGenerator.Emit constructor overload can use the ldelem.r4 opcode:

Return to top


Field: Ldelem_R8
Summary
Loads the element with type float64 at a specified array index onto the top of the evaluation stack as type F (float) .
C# Syntax:
public static readonly OpCode Ldelem_R8;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
99 ldelem.r8 Loads the element with type float64 at onto the top of the stack as type F .

The stack transitional behavior, in sequential order, is:

  1. An object reference array is pushed onto the stack.
  2. An index value index is pushed onto the stack.
  3. index and array are popped from the stack; the value stored at position index in array is looked up.
  4. The value is pushed onto the stack.

The ldelem.r8 instruction loads the value of the element with index index (type natural int) in the zero-based one-dimensional array array and places it on the top of the stack. Arrays are objects and hence represented by a value of type O.

The return value for ldelem.r8 is float64.

Floating-point values are converted to type F when loaded onto the evaluation stack.

NullReferenceException is thrown if array is a null reference.

ArrayTypeMismatchException is thrown if if array does not hold elements of the required type.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

The following ILGenerator.Emit constructor overload can use the ldelem.r8 opcode:

Return to top


Field: Ldelem_Ref
Summary
Loads the element containing an object reference at a specified array index onto the top of the evaluation stack as type O (object reference).
C# Syntax:
public static readonly OpCode Ldelem_Ref;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
9A ldelem.ref Loads the element with an object reference at onto the top of the stack as type O .

The stack transitional behavior, in sequential order, is:

  1. An object reference array is pushed onto the stack.
  2. An index value index is pushed onto the stack.
  3. index and array are popped from the stack; the value stored at position index in array is looked up.
  4. The value is pushed onto the stack.

The ldelem.ref instruction loads the value of the element with index index (type natural int) in the zero-based one-dimensional array array and places it on the top of the stack. Arrays are objects and hence represented by a value of type O.

The return value for ldelem.ref is type O (object reference).

NullReferenceException is thrown if array is a null reference.

ArrayTypeMismatchException is thrown if if array does not hold elements of the required type.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

The following ILGenerator.Emit constructor overload can use the ldelem.ref opcode:

Return to top


Field: Ldelem_U1
Summary
Loads the element with type unsigned int8 at a specified array index onto the top of the evaluation stack as an int32.
C# Syntax:
public static readonly OpCode Ldelem_U1;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
91 ldelem.u1 Loads the element with type unsigned int8 at onto the top of the stack as an int32 .

The stack transitional behavior, in sequential order, is:

  1. An object reference array is pushed onto the stack.
  2. An index value index is pushed onto the stack.
  3. index and array are popped from the stack; the value stored at position index in array is looked up.
  4. The value is pushed onto the stack.

The ldelem.u1 instruction loads the value of the element with index index (type natural int) in the zero-based one-dimensional array array and places it on the top of the stack. Arrays are objects and hence represented by a value of type O.

The return value for ldelem.u1 is int8.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack.

NullReferenceException is thrown if array is a null reference.

ArrayTypeMismatchException is thrown if if array does not hold elements of the required type.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

The following ILGenerator.Emit constructor overload can use the ldelem.u1 opcode:

Return to top


Field: Ldelem_U2
Summary
Loads the element with type unsigned int16 at a specified array index onto the top of the evaluation stack as an int32.
C# Syntax:
public static readonly OpCode Ldelem_U2;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
93 ldelem.u2 Loads the element with type unsigned int16 at index onto the top of the stack as an int32 .

The stack transitional behavior, in sequential order, is:

  1. An object reference array is pushed onto the stack.
  2. An index value index is pushed onto the stack.
  3. index and array are popped from the stack; the value stored at position index in array is looked up.
  4. The value is pushed onto the stack.

The ldelem.u2 instruction loads the value of the element with index index (type natural int) in the zero-based one-dimensional array array and places it on the top of the stack. Arrays are objects and hence represented by a value of type O.

The return value for ldelem.u2 is int16.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack.

NullReferenceException is thrown if array is a null reference.

ArrayTypeMismatchException is thrown if if array does not hold elements of the required type.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

The following ILGenerator.Emit constructor overload can use the ldelem.u2 opcode:

Return to top


Field: Ldelem_U4
Summary
Loads the element with type unsigned int32 at a specified array index onto the top of the evaluation stack as an int32.
C# Syntax:
public static readonly OpCode Ldelem_U4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
94 ldelem.u4 Loads the element with type unsigned int32 at index onto the top of the stack as an int32 .

The stack transitional behavior, in sequential order, is:

  1. An object reference array is pushed onto the stack.
  2. An index value index is pushed onto the stack.
  3. index and array are popped from the stack; the value stored at position index in array is looked up.
  4. The value is pushed onto the stack.

The ldelem.u4 instruction loads the value of the element with index index (type natural int) in the zero-based one-dimensional array array and places it on the top of the stack. Arrays are objects and hence represented by a value of type O.

The return value for ldelem.u4 is int32.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack.

NullReferenceException is thrown if array is a null reference.

ArrayTypeMismatchException is thrown if array does not hold elements of the required type.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

The following ILGenerator.Emit constructor overload can use the ldelem.u4 opcode:

Return to top


Field: Ldelema
Summary
Loads the address of the array element at a specified array index onto the top of the evaluation stack as type & (managed pointer).
C# Syntax:
public static readonly OpCode Ldelema;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
8F < T > ldelema Loads the address of the array element at onto the top of the evaluation stack as type & (managed pointer).

The stack transitional behavior, in sequential order, is:

  1. An object reference array is pushed onto the stack.
  2. An index value index is pushed onto the stack.
  3. index and array are popped from the stack; the address stored at position index in array is looked up.
  4. The address is pushed onto the stack.

The ldelema is used to retrieve the address of an object at a particular index in an array of objects (of type class). The ldelema instruction loads the address of the value at index index (type natural int) in the zero-based one-dimensional array array and places it on the top of the stack. Arrays are objects and hence represented by a value of type O. The value must be of type class passed with the instruction.

The return value for ldelema is a managed pointer (type &).

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack.

NullReferenceException is thrown if array is a null reference.

ArrayTypeMismatchException is thrown if if array does not hold elements of the required type.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

The following ILGenerator.Emit constructor overload can use the ldelema opcode:

Return to top


Field: Ldfld
Summary
Finds the value of a field in the object whose reference is currently on the evaluation stack.
C# Syntax:
public static readonly OpCode Ldfld;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
7B < T > ldfld Pushes the value of a field in a specified object onto the stack.

The stack transitional behavior, in sequential order, is:

  1. An object reference (or pointer) is pushed onto the stack.
  2. The object reference (or pointer) is popped from the stack; the value of the specified field in the object is found.
  3. The value stored in the field is pushed onto the stack.

The ldfld instruction pushes the value of a field located in an object onto the stack. The object must be on the stack as an object reference (type O), a managed pointer (type &), an unmanaged pointer (type natural int), a transient pointer (type *), or an instance of a value type. The use of an unmanaged pointer is not permitted in verifiable code. The object's field is specified by a metadata token that must refer to a field member. The return type is the same as the one associated with the field. The field may be either an instance field (in which case the object must not be a null reference) or a static field.

The ldfld instruction can be preceded by either or both of the OpCodes.Unaligned and OpCodes.Volatile prefixes.

NullReferenceException is thrown if the object is null and the field is not static.

MissingFieldException is thrown if the specified field is not found in the metadata. This is typically checked when Microsoft Intermediate Language (MSIL) instructions are converted to native code, not at run time.

The following ILGenerator.Emit constructor overload can use the ldfld opcode:

Return to top


Field: Ldflda
Summary
Finds the address of a field in the object whose reference is currently on the evaluation stack.
C# Syntax:
public static readonly OpCode Ldflda;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
7C < T > ldflda Pushes the address of in a specified object onto the stack.

The stack transitional behavior, in sequential order, is:

  1. An object reference (or pointer) is pushed onto the stack.
  2. The object reference (or pointer) is popped from the stack; the address of the specified field in the object is found.
  3. The address stored in the field is pushed onto the stack.

The ldflda instruction pushes the address of a field located in an object onto the stack. The object must be on the stack as an object reference (type O), a managed pointer (type &), an unmanaged pointer (type natural int), a transient pointer (type *), or an instance of a value type. The use of an unmanaged pointer is not permitted in verifiable code. The object's field is specified by a metadata token that must refer to a field member.

The value returned by ldflda is a managed pointer (type &) unless the object is pushed onto the stack as an unmanaged pointer, in which case the return address is also an unmanaged pointer (type natural int).

The ldflda instruction can be preceded by either or both of the OpCodes.Unaligned and OpCodes.Volatile prefixes.

InvalidOperationException is thrown if the object is not within the application domain from which it is being accessed. The address of a field that is not inside the accessing application domain cannot be loaded.

NullReferenceException is thrown if the object is null and the field is not static.

MissingFieldException is thrown if the specified field is not found in the metadata. This is typically checked when Microsoft Intermediate Language (MSIL) instructions are converted to native code, not at run time.

The following ILGenerator.Emit constructor overload can use the ldflda opcode:

Return to top


Field: Ldftn
Summary
Pushes an unmanaged pointer (type natural int) to the native code implementing a specific method onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldftn;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 06 < T > ldftn Pushes a pointer to a method referenced by on the stack.

The stack transitional behavior, in sequential order, is:

  1. The unmanaged pointer to a specific method is pushed onto the stack.

The specific method (method) can be called using the OpCodes.Calli instruction if it references a managed method (or a stub that transitions from managed to unmanaged code).

The value returned points to native code using the calling convention specified by the method metadata token. Thus, a method pointer can be easily passed to unmanaged native code (specifically, as a callback routine).

The following ILGenerator.Emit constructor overload can use the ldftn opcode:

Return to top


Field: Ldind_I
Summary
Loads a value of type natural int as a natural int onto the evaluation stack indirectly.
C# Syntax:
public static readonly OpCode Ldind_I;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
4D ldind.i Loads the natural int value at address onto the stack as a natural int .

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. The address is popped from the stack; the value located at the address is fetched.
  3. The fetched value is pushed onto the stack.

The ldind.i instruction indirectly loads a natural int value from the specified address (of type natural int, &, or *) onto the stack as a natural int.

All of the ldind instructions are shortcuts for a OpCodes.Ldobj instruction that specifies the corresponding built-in value class.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack. Floating-point values are converted to F type when loaded onto the evaluation stack.

Correctly-formed Microsoft Intermediate Language (MSIL) ensures that the ldind instructions are used in a manner consistent with the type of the pointer.

The address initially pushed onto the stack must be aligned to the natural size of objects on the machine or a NullReferenceException can occur (see the OpCodes.Unaligned prefix instruction for preventative measures). The results of all MSIL instructions that return addresses (for example, OpCodes.Ldloca and OpCodes.Ldarga) are safely aligned. For datatypes larger than 1 byte, the byte ordering is dependent on the target CPU. Code that depends on byte ordering might not run on all platforms.

NullReferenceException can be thrown if an invalid address is detected.

The following ILGenerator.Emit constructor overload can use the ldind.i opcode:

Return to top


Field: Ldind_I1
Summary
Loads a value of type int8 as an int32 onto the evaluation stack indirectly.
C# Syntax:
public static readonly OpCode Ldind_I1;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
46 ldind.i1 Loads the int8 value at address onto the stack as an int32 .

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. The address is popped from the stack; the value located at the address is fetched.
  3. The fetched value is pushed onto the stack..

The ldind.i1 instruction indirectly loads an int8 value from the specified address (of type natural int, &, or *) onto the stack as an int32.

All of the ldind instructions are shortcuts for a OpCodes.Ldobj instruction that specifies the corresponding built-in value class.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack. Floating-point values are converted to F type when loaded onto the evaluation stack.

Correctly-formed Microsoft Intermediate Language (MSIL) ensures that the ldind instructions are used in a manner consistent with the type of the pointer.

The address initially pushed onto the stack must be aligned to the natural size of objects on the machine or a NullReferenceException can occur (see the OpCodes.Unaligned prefix instruction for preventative measures). The results of all MSIL instructions that return addresses (for example, OpCodes.Ldloca and OpCodes.Ldarga) are safely aligned. For datatypes larger than 1 byte, the byte ordering is dependent on the target CPU. Code that depends on byte ordering might not run on all platforms.

NullReferenceException can be thrown if an invalid address is detected.

The following ILGenerator.Emit constructor overload can use the ldind.i1 opcode:

Return to top


Field: Ldind_I2
Summary
Loads a value of type int16 as an int32 onto the evaluation stack indirectly.
C# Syntax:
public static readonly OpCode Ldind_I2;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
48 ldind.i2 Loads the int16 value at address onto the stack as an int32 .

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. The address is popped from the stack; the value located at the address is fetched.
  3. The fetched value is pushed onto the stack.

The ldind.i2 instruction indirectly loads an int16 value from the specified address (of type natural int, &, or *) onto the stack as an int32.

All of the ldind instructions are shortcuts for a OpCodes.Ldobj instruction that specifies the corresponding built-in value class.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack. Floating-point values are converted to F type when loaded onto the evaluation stack.

Correctly-formed Microsoft Intermediate Language (MSIL) ensures that the ldind instructions are used in a manner consistent with the type of the pointer.

The address initially pushed onto the stack must be aligned to the natural size of objects on the machine or a NullReferenceException can occur (see the OpCodes.Unaligned prefix instruction for preventative measures). The results of all MSIL instructions that return addresses (for example, OpCodes.Ldloca and OpCodes.Ldarga) are safely aligned. For datatypes larger than 1 byte, the byte ordering is dependent on the target CPU. Code that depends on byte ordering might not run on all platforms.

NullReferenceException can be thrown if an invalid address is detected.

The following ILGenerator.Emit constructor overload can use the ldind.i2 opcode:

Return to top


Field: Ldind_I4
Summary
Loads a value of type int32 as an int32 onto the evaluation stack indirectly.
C# Syntax:
public static readonly OpCode Ldind_I4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
4A ldind.i4 Loads the int32 value at address onto the stack as an int32 .

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. The address is popped from the stack; the value located at the address is fetched.
  3. The fetched value is pushed onto the stack.

The ldind.i4 instruction indirectly loads an int32 value from the specified address (of type natural int, &, or *) onto the stack as a int32.

All of the ldind instructions are shortcuts for a OpCodes.Ldobj instruction that specifies the corresponding built-in value class.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack. Floating-point values are converted to F type when loaded onto the evaluation stack.

Correctly-formed Microsoft Intermediate Language (MSIL) ensures that the ldind instructions are used in a manner consistent with the type of the pointer.

The address initially pushed onto the stack must be aligned to the natural size of objects on the machine or a NullReferenceException can occur (see the OpCodes.Unaligned prefix instruction for preventative measures). The results of all MSIL instructions that return addresses (for example, OpCodes.Ldloca and OpCodes.Ldarga) are safely aligned. For datatypes larger than 1 byte, the byte ordering is dependent on the target CPU. Code that depends on byte ordering might not run on all platforms.

NullReferenceException can be thrown if an invalid address is detected.

The following ILGenerator.Emit constructor overload can use the ldind.i4 opcode:

Return to top


Field: Ldind_I8
Summary
Loads a value of type int64 as an int64 onto the evaluation stack indirectly.
C# Syntax:
public static readonly OpCode Ldind_I8;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
4C ldind.i8 Loads the int64 value at address onto the stack as an int64 .

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. The address is popped from the stack; the value located at the address is fetched.
  3. The fetched value is pushed onto the stack.

The ldind.i8 instruction indirectly loads an int64 value from the specified address (of type natural int, &, or *) onto the stack as an int64.

All of the ldind instructions are shortcuts for a OpCodes.Ldobj instruction that specifies the corresponding built-in value class.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack. Floating-point values are converted to F type when loaded onto the evaluation stack.

Correctly-formed Microsoft Intermediate Language (MSIL) ensures that the ldind instructions are used in a manner consistent with the type of the pointer.

The address initially pushed onto the stack must be aligned to the natural size of objects on the machine or a NullReferenceException can occur (see the OpCodes.Unaligned prefix instruction for preventative measures). The results of all MSIL instructions that return addresses (for example, OpCodes.Ldloca and OpCodes.Ldarga) are safely aligned. For datatypes larger than 1 byte, the byte ordering is dependent on the target CPU. Code that depends on byte ordering might not run on all platforms.

NullReferenceException can be thrown if an invalid address is detected.

The following ILGenerator.Emit constructor overload can use the ldind.i8 opcode:

Return to top


Field: Ldind_R4
Summary
Loads a value of type float32 as a type F (float) onto the evaluation stack indirectly.
C# Syntax:
public static readonly OpCode Ldind_R4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
4E ldind.r4 Loads the float32 value at address onto the stack as a type F .

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. The address is popped from the stack; the value located at the address is fetched.
  3. The fetched value is pushed onto the stack.

The ldind.r4 instruction indirectly loads a float32 value from the specified address (of type natural int, &, or *) onto the stack as a type F.

All of the ldind instructions are shortcuts for a OpCodes.Ldobj instruction that specifies the corresponding built-in value class.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack. Floating-point values are converted to F type when loaded onto the evaluation stack.

Correctly-formed Microsoft Intermediate Language (MSIL) ensures that the ldind instructions are used in a manner consistent with the type of the pointer.

The address initially pushed onto the stack must be aligned to the natural size of objects on the machine or a NullReferenceException can occur (see the OpCodes.Unaligned prefix instruction for preventative measures). The results of all MSIL instructions that return addresses (for example, OpCodes.Ldloca and OpCodes.Ldarga) are safely aligned. For datatypes larger than 1 byte, the byte ordering is dependent on the target CPU. Code that depends on byte ordering might not run on all platforms.

NullReferenceException can be thrown if an invalid address is detected.

The following ILGenerator.Emit constructor overload can use the ldind.r4 opcode:

Return to top


Field: Ldind_R8
Summary
Loads a value of type float64 as a type F (float) onto the evaluation stack indirectly.
C# Syntax:
public static readonly OpCode Ldind_R8;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
4F ldind.r8 Loads the float64 value at address onto the stack as a type F .

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. The address is popped from the stack; the value located at the address is fetched.
  3. The fetched value is pushed onto the stack.

The ldind.r8 instruction indirectly loads a float64 value from the specified address (of type natural int, &, or *) onto the stack as a float64.

All of the ldind instructions are shortcuts for a OpCodes.Ldobj instruction that specifies the corresponding built-in value class.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack. Floating-point values are converted to F type when loaded onto the evaluation stack.

Correctly-formed Microsoft Intermediate Language (MSIL) ensures that the ldind instructions are used in a manner consistent with the type of the pointer.

The address initially pushed onto the stack must be aligned to the natural size of objects on the machine or a NullReferenceException can occur (see the OpCodes.Unaligned prefix instruction for preventative measures). The results of all MSIL instructions that return addresses (for example, OpCodes.Ldloca and OpCodes.Ldarga) are safely aligned. For datatypes larger than 1 byte, the byte ordering is dependent on the target CPU. Code that depends on byte ordering might not run on all platforms.

NullReferenceException can be thrown if an invalid address is detected.

The following ILGenerator.Emit constructor overload can use the ldind.r8 opcode:

Return to top


Field: Ldind_Ref
Summary
Loads an object reference as a type O (object reference) onto the evaluation stack indirectly.
C# Syntax:
public static readonly OpCode Ldind_Ref;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
50 ldind.ref Loads the object reference at address onto the stack as a type O

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. The address is popped from the stack; the object reference located at the address is fetched.
  3. The fetched reference is pushed onto the stack.

The ldind.ref instruction indirectly loads the object reference the specified address (of type natural int, &, or *) onto the stack as type O.

All of the ldind instructions are shortcuts for a OpCodes.Ldobj instruction that specifies the corresponding built-in value class.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack. Floating-point values are converted to F type when loaded onto the evaluation stack.

Correctly-formed Microsoft Intermediate Language (MSIL) ensures that the ldind instructions are used in a manner consistent with the type of the pointer.

The address initially pushed onto the stack must be aligned to the natural size of objects on the machine or a NullReferenceException can occur (see the OpCodes.Unaligned prefix instruction for preventative measures). The results of all MSIL instructions that return addresses (for example, OpCodes.Ldloca and OpCodes.Ldarga) are safely aligned. For datatypes larger than 1 byte, the byte ordering is dependent on the target CPU. Code that depends on byte ordering might not run on all platforms.

NullReferenceException can be thrown if an invalid address is detected.

The following ILGenerator.Emit constructor overload can use the ldind.ref opcode:

Return to top


Field: Ldind_U1
Summary
Loads a value of type unsigned int8 as an int32 onto the evaluation stack indirectly.
C# Syntax:
public static readonly OpCode Ldind_U1;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
47 ldind.u1 Loads the u nsigned int8 value at address onto the stack as an int32 .

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. The address is popped from the stack; the value located at the address is fetched.
  3. The fetched value is pushed onto the stack.

The ldind.u1 instruction indirectly loads an unsigned int8 value from the specified address (of type natural int, &, or *) onto the stack as an int32.

All of the ldind instructions are shortcuts for a OpCodes.Ldobj instruction that specifies the corresponding built-in value class.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack. Floating-point values are converted to F type when loaded onto the evaluation stack.

Correctly-formed Microsoft Intermediate Language (MSIL) ensures that the ldind instructions are used in a manner consistent with the type of the pointer.

The address initially pushed onto the stack must be aligned to the natural size of objects on the machine or a NullReferenceException can occur (see the OpCodes.Unaligned prefix instruction for preventative measures). The results of all MSIL instructions that return addresses (for example, OpCodes.Ldloca and OpCodes.Ldarga) are safely aligned. For datatypes larger than 1 byte, the byte ordering is dependent on the target CPU. Code that depends on byte ordering might not run on all platforms.

NullReferenceException can be thrown if an invalid address is detected.

The following ILGenerator.Emit constructor overload can use the ldind.u1 opcode:

Return to top


Field: Ldind_U2
Summary
Loads a value of type unsigned int16 as an int32 onto the evaluation stack indirectly.
C# Syntax:
public static readonly OpCode Ldind_U2;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
49 ldind.u2 Loads the unsigned int16 value at address onto the stack as an int32 .

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. The address is popped from the stack; the value located at the address is fetched.
  3. The fetched value is pushed onto the stack.

The ldind.u2 instruction indirectly loads an unsigned int16 value from the specified address (of type natural int, &, or *) onto the stack as an int32.

All of the ldind instructions are shortcuts for a OpCodes.Ldobj instruction that specifies the corresponding built-in value class.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack. Floating-point values are converted to F type when loaded onto the evaluation stack.

Correctly-formed Microsoft Intermediate Language (MSIL) ensures that the ldind instructions are used in a manner consistent with the type of the pointer.

The address initially pushed onto the stack must be aligned to the natural size of objects on the machine or a NullReferenceException can occur (see the OpCodes.Unaligned prefix instruction for preventative measures). The results of all MSIL instructions that return addresses (for example, OpCodes.Ldloca and OpCodes.Ldarga) are safely aligned. For datatypes larger than 1 byte, the byte ordering is dependent on the target CPU. Code that depends on byte ordering might not run on all platforms.

NullReferenceException can be thrown if an invalid address is detected.

The following ILGenerator.Emit constructor overload can use the ldind.u2 opcode:

Return to top


Field: Ldind_U4
Summary
Loads a value of type unsigned int32 as an int32 onto the evaluation stack indirectly.
C# Syntax:
public static readonly OpCode Ldind_U4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
4B ldind.u4 Loads the unsigned int32 value at address onto the stack as an int32 .

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. The address is popped from the stack; the value located at the address is fetched.
  3. The fetched value is pushed onto the stack.

The ldind.u4 instruction indirectly loads an unsigned int32 value from the specified address (of type natural int, &, or *) onto the stack as an int32.

All of the ldind instructions are shortcuts for a OpCodes.Ldobj instruction that specifies the corresponding built-in value class.

Note that integer values of less than 4 bytes are extended to int32 (not natural int) when they are loaded onto the evaluation stack. Floating-point values are converted to F type when loaded onto the evaluation stack.

Correctly-formed Microsoft Intermediate Language (MSIL) ensures that the ldind instructions are used in a manner consistent with the type of the pointer.

The address initially pushed onto the stack must be aligned to the natural size of objects on the machine or a NullReferenceException can occur (see the OpCodes.Unaligned prefix instruction for preventative measures). The results of all MSIL instructions that return addresses (for example, OpCodes.Ldloca and OpCodes.Ldarga) are safely aligned. For datatypes larger than 1 byte, the byte ordering is dependent on the target CPU. Code that depends on byte ordering might not run on all platforms.

NullReferenceException can be thrown if an invalid address is detected.

The following ILGenerator.Emit constructor overload can use the ldind.u4 opcode:

Return to top


Field: Ldlen
Summary
Pushes the number of elements of a zero-based, one-dimensional array onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldlen;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
8E ldlen Pushes the length (of type natural unsigned int ) of an array on the stack.

The stack transitional behavior, in sequential order, is:

  1. An object reference to an array is pushed onto the stack.
  2. The array reference is popped from the stack and the length is computed.
  3. The length is pushed onto the stack.

Arrays are objects and hence represented by a value of type O. The length is returned as a natural unsigned int.

NullReferenceException is thrown if the array reference is a null reference.

The following ILGenerator.Emit constructor overload can use the ldlen opcode:

Return to top


Field: Ldloc
Summary
Loads the local variable at a specific index onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldloc;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 06 < unsigned int16 > ldloc Loads the local variable at index onto stack.

The stack transitional behavior, in sequential order, is:

  1. The local variable value at the specified index is pushed onto the stack.

The ldloc instruction pushes the contents of the local variable number at the passed index onto the evaluation stack, where the local variables are numbered 0 onwards. Local variables are initialized to 0 before entering the method only if the initialize flag on the method is true. There are 65,535 (2^16-1) local variables possible (0-65,534). Index 65,535 is not valid since likely implementations will use a 2-byte integer to track both a local's index, along with the total number of locals for a given method. If an index of 65535 had been made valid, it would require a wider integer to track the number of locals in such a method.

The ldloc.0, ldloc.1, ldloc.2, and ldloc.3 instructions provide an efficient encoding for accessing the first four local variables.

The type of the value is the same as the type of the local variable, which is specified in the method header. See Partition I. Local variables that are smaller than 4 bytes long are expanded to type int32 when they are loaded onto the stack. Floating-point values are expanded to their native size (type F).

The following ILGenerator.Emit constructor overload can use the ldloc opcode:

Return to top


Field: Ldloc_0
Summary
Loads the local variable at index 0 onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldloc_0;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
06 ldloc.0 Loads the local variable at index 0 onto the evaluation stack.

The stack transitional behavior, in sequential order, is:

  1. The local variable value at the index 0 is pushed onto the stack.

ldloc.0 is an especially efficient encoding for OpCodes.Ldloc, allowing access to the local variable at index 0.

The type of the value is the same as the type of the local variable, which is specified in the method header. Local variables that are smaller than 4 bytes long are expanded to type int32 when they are loaded onto the stack. Floating-point values are expanded to their native size (type F).

The following ILGenerator.Emit constructor overload can use the ldloc.0 opcode:

Return to top


Field: Ldloc_1
Summary
Loads the local variable at index 1 onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldloc_1;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
07 ldloc.1 Loads the local variable at index 1 onto the evaluation stack.

The stack transitional behavior, in sequential order, is:

  1. The local variable value at the index 1 is pushed onto the stack.

ldloc.1 is an especially efficient encoding for OpCodes.Ldloc, allowing access to the local variable at index 1.

The type of the value is the same as the type of the local variable, which is specified in the method header. Local variables that are smaller than 4 bytes long are expanded to type int32 when they are loaded onto the stack. Floating-point values are expanded to their native size (type F).

The following ILGenerator.Emit constructor overload can use the ldloc.1 opcode:

Return to top


Field: Ldloc_2
Summary
Loads the local variable at index 2 onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldloc_2;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
08 ldloc.2 Loads the local variable at index 2 onto the evaluation stack.

The stack transitional behavior, in sequential order, is:

  1. The local variable value at the index 2 is pushed onto the stack.

ldloc.2 is an especially efficient encoding for OpCodes.Ldloc, allowing access to the local variable at index 2.

The type of the value is the same as the type of the local variable, which is specified in the method header. Local variables that are smaller than 4 bytes long are expanded to type int32 when they are loaded onto the stack. Floating-point values are expanded to their native size (type F).

The following ILGenerator.Emit constructor overload can use the ldloc.2 opcode:

Return to top


Field: Ldloc_3
Summary
Loads the local variable at index 3 onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldloc_3;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
09 ldloc.3 Loads the local variable at index 3 onto the evaluation stack.

The stack transitional behavior, in sequential order, is:

  1. The local variable value at the index 3 is pushed onto the stack.

ldloc.3 is an especially efficient encoding for OpCodes.Ldloc, allowing access to the local variable at index 3.

The type of the value is the same as the type of the local variable, which is specified in the method header. Local variables that are smaller than 4 bytes long are expanded to type int32 when they are loaded onto the stack. Floating-point values are expanded to their native size (type F).

The following ILGenerator.Emit constructor overload can use the ldloc.3 opcode:

Return to top


Field: Ldloc_S
Summary
Loads the local variable at a specific index onto the evaluation stack, short form.
C# Syntax:
public static readonly OpCode Ldloc_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
11 < unsigned int8 > ldloc.s Loads the local variable at index onto stack, short form.

The stack transitional behavior, in sequential order, is:

  1. The local variable value at the specified index is pushed onto the stack.

The ldloc.s instruction pushes the contents of the local variable number at the passed index onto the evaluation stack, where the local variables are numbered 0 onwards. Local variables are initialized to 0 before entering the method if the initialize flag on the method is true. There are 256 (2^8) local variables possible (0-255) in the short form, which is a more efficient encoding than ldloc.

The type of the value is the same as the type of the local variable, which is specified in the method header. See Partition I. Local variables that are smaller than 4 bytes long are expanded to type int32 when they are loaded onto the stack. Floating-point values are expanded to their native size (type F).

The following ILGenerator.Emit constructor overload can use the ldloc.s opcode:

Return to top


Field: Ldloca
Summary
Loads the address of the local variable at a specific index onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldloca;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE OD < unsigned int16 > ldloca Loads the address of the local variable at onto the evaluation stack.

The stack transitional behavior, in sequential order, is:

  1. The address stored in the local variable at the specified index is pushed onto the stack.

The ldloca instruction pushes the address of the local variable number at the passed index onto the stack, where local variables are numbered 0 onwards. The value pushed on the stack is already aligned correctly for use with instructions like OpCodes.Ldind_I and OpCodes.Stind_I. The result is a transient pointer (type *).

The following ILGenerator.Emit constructor overload can use the ldloca opcode:

Return to top


Field: Ldloca_S
Summary
Loads the address of the local variable at a specific index onto the evaluation stack, short form.
C# Syntax:
public static readonly OpCode Ldloca_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
12 < unsigned int8 > ldloca.s Loads the address of the local variable at onto the evaluation stack, short form.

The stack transitional behavior, in sequential order, is:

  1. The address stored in the local variable at the specified index is pushed onto the stack.

The ldloca.s instruction pushes the address of the local variable number at the passed index onto the stack, where local variables are numbered 0 onwards. The value pushed on the stack is already aligned correctly for use with instructions like OpCodes.Ldind_I and OpCodes.Stind_I. The result is a transient pointer (type *).

The ldloca.s instruction provides an efficient encoding for use with the local variables 0 through 255.

The following ILGenerator.Emit constructor overload can use the ldloca.s opcode:

Return to top


Field: Ldnull
Summary
Pushes a null reference (type O) onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldnull;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
14 ldnull push a null reference onto the stack

The stack transitional behavior, in sequential order, is:

  1. A null object reference is pushed onto the stack.

ldnull pushes a null reference (type O) on the stack. This is used to initialize locations before they are populated with data, or when they become deprecated.

ldnull provides a null reference that is size-independent.

The following ILGenerator.Emit constructor overload can use the ldnull opcode:

Return to top


Field: Ldobj
Summary
Copies the value type object pointed to by an address to the top of the evaluation stack.
C# Syntax:
public static readonly OpCode Ldobj;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
71 < T > ldobj Copy instance of value type to the stack.

The stack transitional behavior, in sequential order, is:

  1. The address of a value type object is pushed onto the stack.
  2. The address is popped from the stack and the instance at that particular address is looked up.
  3. The value of the object stored at that address is pushed onto the stack.

The ldobj instruction is used to pass a value type as a parameter.

The ldobj instruction copies the value pointed to by addrOfValObj (of type &, *, or natural int) to the top of the stack. The number of bytes copied depends on the size of the class (as specified by the class parameter). The class parameter is a metadata token representing the value type.

The operation of the ldobj instruction can be altered by an immediately preceding OpCodes.Volatile or OpCodes.Unaligned prefix instruction.

TypeLoadException is thrown if class cannot be found. This is typically detected when the Microsoft Intermediate Language (MSIL) instruction is converted to native code rather than at runtime.

The following ILGenerator.Emit constructor overload can use the ldobj opcode:

Return to top


Field: Ldsfld
Summary
Pushes the value of a static field onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldsfld;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
7E < T > ldsfld Push the value of on the stack.

The stack transitional behavior, in sequential order, is:

  1. The value of the specific field is pushed onto the stack.

The ldsfld instruction pushes the value of a static (shared among all instances of a class) field on the stack. The return type is that associated with the passed metadata token field.

The ldsfld instruction can have a OpCodes.Volatile prefix.

The following ILGenerator.Emit constructor overload can use the ldsfld opcode:

Return to top


Field: Ldsflda
Summary
Pushes the address of a static field onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldsflda;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
7F < T > ldsflda Push the address of on the stack

The stack transitional behavior, in sequential order, is:

  1. The address of a specific field is pushed onto the stack.

The ldsflda instruction pushes the address of a static (shared among all instances of a class) field on the stack. The address may be represented as a transient pointer (type *) if the metadata token field refers to a type whose memory is managed. Otherwise, it corresponds to an unmanaged pointer (type natural int). Note that field may be a static global with an assigned relative virtual address (the offset of the field from the base address at which its containing PE file is loaded into memory) where the memory is unmanaged.

The ldsflda instruction can have a OpCodes.Volatile prefix.

MissingFieldException is thrown if field is not found in the metadata. This is typically checked when Microsoft Intermediate Language (MSIL) instructions are converted to native code, not at runtime.

The following ILGenerator.Emit constructor overload can use the ldsflda opcode:

Return to top


Field: Ldstr
Summary
Pushes a new object reference to a string literal stored in the metadata.
C# Syntax:
public static readonly OpCode Ldstr;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
72 < T > ldstr Pushes a string object for the metadata string token .

The stack transitional behavior, in sequential order, is:

  1. An object reference to a string is pushed onto the stack.

The ldstr instruction pushes an object reference (type O) to a new string object representing the specific string literal stored in the metadata. The ldstr instruction allocates the requisite amount of memory and performs any format conversion required to convert the string literal from the form used in the file to the string format required at runtime.

The Common Language Infrastructure (CLI) guarantees that the result of two ldstr instructions referring to two metadata tokens that have the same sequence of characters return precisely the same string object (a process known as "string interning").

The following ILGenerator.Emit constructor overload can use the ldstr opcode:

Return to top


Field: Ldtoken
Summary
Converts a metadata token to its runtime representation, pushing it onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldtoken;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
D0 < T > ldtoken Converts a metadata token to its runtime representation.

The stack transitional behavior, in sequential order, is:

  1. The passed token is converted to a RuntimeHandle and pushed onto the stack.

The ldtoken instruction pushes a RuntimeHandle for the specified metadata token. A RuntimeHandle can be a fieldref/fielddef, a methodref/methoddef, or a typeref/typedef.

The value pushed on the stack can be used in calls to Reflection methods in the system class library.

For information on runtime handles, see the following classes: RuntimeFieldHandle, RuntimeTypeHandle, and RuntimeMethodHandle.

The following ILGenerator.Emit constructor overloads can use the ldtoken opcode:

Return to top


Field: Ldvirtftn
Summary
Pushes an unmanaged pointer (type natural int) to the native code implementing a particular virtual method associated with a specified object onto the evaluation stack.
C# Syntax:
public static readonly OpCode Ldvirtftn;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 07 < T > ldvirtftn Pushes the pointer to an object's virtual method on the stack.

The stack transitional behavior, in sequential order, is:

  1. An object reference is pushed onto the stack.
  2. The object reference is popped from the stack and the address of the entry point to the method (as specified by the metadata token method) is looked up.
  3. The pointer to method is pushed onto the stack.

The resulting unmanaged pointer pushed onto the stack by the ldvirtftn instruction can be called using the OpCodes.Calli instruction if it references a managed method (or a stub that transitions from managed to unmanaged code).

The unmanaged pointer points to native code using the calling convention specified by in the metadata token method. As a result, the method pointer can be passed to unmanaged native code (for example, as a callback routine) if that routine expects the corresponding calling convention.

The following ILGenerator.Emit constructor overload can use the ldvirtftn opcode:

Return to top


Field: Leave
Summary
Exits a protected region of code, unconditionally tranferring control to a specific target instruction.
C# Syntax:
public static readonly OpCode Leave;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
DD < int32 > leave Exits a protected region of code.

There is no stack transition behavior specified for this instruction.

The leave instruction unconditionally transfers control to the specific target instruction, represented as a 4-byte signed offset from the beginning of the instruction following the current instruction.

The leave instruction is similar to the br instruction, but it can be used to exit a try, filter, or catch block whereas the ordinary branch instructions can only be used in such a block to transfer control within it. The leave instruction empties the evaluation stack and ensures that the appropriate surrounding finally blocks are executed.

You cannot use a leave instruction to exit a finally block. To ease code generation for exception handlers it is valid from within a catch block to use a leave instruction to transfer control to any instruction within the associated try block.

If an instruction has one or more prefix codes, control can only be transferred to the first of these prefixes.

The following ILGenerator.Emit constructor overloads can use the leave opcode:

Return to top


Field: Leave_S
Summary
Exits a protected region of code, unconditionally tranferring control to a target instruction (short form).
C# Syntax:
public static readonly OpCode Leave_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
DE < int8 > leave.s Exit a protected region of code, short form.

There is no stack transition behavior specified for this instruction.

The leave.s instruction unconditionally transfers control to the passed target instruction, represented as a 1-byte signed offset from the beginning of the instruction following the current instruction.

The leave.s instruction is similar to the br instruction, but it can be used to exit a try, filter, or catch block whereas the ordinary branch instructions can only be used in such a block to transfer control within it. The leave.s instruction empties the evaluation stack and ensures that the appropriate surrounding finally blocks are executed.

You cannot use a leave.s instruction to exit a finally block. To ease code generation for exception handlers it is valid from within a catch block to use a leave.s instruction to transfer control to any instruction within the associated try block.

If an instruction has one or more prefix codes, control can only be transferred to the first of these prefixes.

The following ILGenerator.Emit constructor overload can use the leave.s opcode:

Return to top


Field: Localloc
Summary
Allocates a certain number of bytes from the local dynamic memory pool and pushes the address (a transient pointer, type *) of the first allocated byte onto the evaluation stack.
C# Syntax:
public static readonly OpCode Localloc;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 0F localloc Allocate space from the local heap.

The stack transitional behavior, in sequential order, is:

  1. The number of bytes to be allocated is pushed onto the stack.
  2. The number of bytes is popped from the stack; an amount of memory corresponding to the size is allocated from the local heap.
  3. A pointer to the first byte of the allocated memory is pushed onto the stack.

The localloc instruction allocates size (type natural unsigned int) bytes from the local dynamic memory pool and returns the address (a transient pointer, type *) of the first allocated byte. The block of memory returned is initialized to 0 only if the initialize flag on the method is true. When the current method executes a OpCodes.Ret, the local memory pool is made available for reuse.

The resulting address is aligned so that any primitive data type can be stored there using the stind instructions (such as OpCodes.Stind_I4) and loaded using the ldind instructions (such as OpCodes.Ldind_I4).

The localloc instruction cannot occur within a filter, catch, finally, or fault block.

StackOverflowException is thrown if there is insufficient memory to service the request.

The following ILGenerator.Emit constructor overload can use the localloc opcode:

Return to top


Field: Mkrefany
Summary
Pushes a typed reference to an instance of a specific type onto the evaluation stack.
C# Syntax:
public static readonly OpCode Mkrefany;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
C6 < T > mkrefany Pushes a typed reference of type onto the stack.

The stack transitional behavior, in sequential order, is:

  1. A pointer to piece of data is pushed onto the stack.
  2. The pointer is popped and converted to a typed reference of type class.
  3. The typed reference is pushed onto the stack.

The mkrefany instruction supports the passing of dynamically typed references. The pointer must be of type &, *, or natural int, and hold the valid address of a piece of data.Class is the class token describing the type of the data referenced by the pointer.Mkrefany pushes a typed reference on the stack, providing an opaque descriptor of the pointer and the type class.

The only valid operation permitted upon a typed reference is to pass it to a method that requires a typed reference as a parameter. The callee can then use the OpCodes.Refanytype and OpCodes.Refanyval instructions to retrieve the type (class) and the address respectively.

TypeLoadException is thrown if class cannot be found. This is typically detected when Microsoft Intermediate Language (MSIL) instructions are converted to native code rather than at runtime.

The following ILGenerator.Emit constructor overload can use the mkrefany opcode:

Return to top


Field: Mul
Summary
Multiplies two values and pushes the result on the evaluation stack.
C# Syntax:
public static readonly OpCode Mul;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
5A mul Multiplies two values on the stack.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; value1 is multiplied by value2.
  4. The result is pushed onto the stack.

The mul instruction multiplies value1 by value2 and pushes the result on the stack. Integer operations silently truncate the upper bits on overflow.

See OpCodes.Mul_Ovf for an integer-specific multiply operation with overflow handling.

For floating-point types, 0 * infinity = NaN.

The following ILGenerator.Emit constructor overload can use the mul opcode:

Return to top


Field: Mul_Ovf
Summary
Multiplies two integer values, performs an overflow check, and pushes the result onto the evaluation stack.
C# Syntax:
public static readonly OpCode Mul_Ovf;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
D8 mul.ovf Multiplies two integer values on the stack with an overflow check.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; value1 is multiplied by value2, with an overflow check.
  4. The result is pushed onto the stack.

The mul.ovf instruction multiplies integer value1 by integer value2 and pushes the result on the stack. An exception is thrown if the result will not fit in the result type.

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the mul.ovf opcode:

Return to top


Field: Mul_Ovf_Un
Summary
Multiplies two unsigned integer values , performs an overflow check , and pushes the result onto the evaluation stack.
C# Syntax:
public static readonly OpCode Mul_Ovf_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
D9 mul.ovf.un Multiplies two unsigned values on the stack with an overflow check.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; value1 is multiplied by value2, with an overflow check.
  4. The result is pushed onto the stack.

The mul.ovf.un instruction multiplies unsigned integer value1 by unsigned integer value2 and pushes the result on the stack. An exception is thrown if the result will not fit in the result type.

OverflowException is thrown if the result can not be represented in the result type.

The following ILGenerator.Emit constructor overload can use the mul.ovf.un opcode:

Return to top


Field: Neg
Summary
Negates a value and pushes the result onto the evaluation stack.
C# Syntax:
public static readonly OpCode Neg;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
65 neg Negates the value currently on top of the stack.

The stack transitional behavior, in sequential order, is:

  1. A value is pushed onto the stack.
  2. A value is popped from the stack and negated.
  3. The result is pushed onto the stack.

The neg instruction negates value and pushes the result on top of the stack. The return type is the same as the operand type.

Negation of integral values is standard two's complement negation. In particular, negating the most negative number (which does not have a positive counterpart) yields the most negative number. To detect this overflow use the OpCodes.Sub_Ovf instruction instead (that is, subtract from 0).

Negating a floating-point number cannot overflow, and negating NaN returns NaN.

The following ILGenerator.Emit constructor overload can use the neg opcode:

Return to top


Field: Newarr
Summary
Pushes an object reference to a new zero-based, one-dimensional array whose elements are of a specific type onto the evaluation stack.
C# Syntax:
public static readonly OpCode Newarr;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
8D < T > newarr Createa a new array with elements of type

The stack transitional behavior, in sequential order, is:

  1. The number of elements in the array is pushed onto the stack.
  2. The number of elementes is popped from the stack and the array is created.
  3. An object reference to the new array is pushed onto the stack.

The newarr instruction pushes an object reference (type O) to a new zero-based, one-dimensional array whose elements are of type etype (a metadata token describing the type). The number of elements in the new array should be specified as a natural int. Valid array indexes range from zero to the maximum number of elements minus one.

The elements of an array can be any type, including value types.

Zero-based, one-dimensional arrays of numbers are created using a metadata token referencing the appropriate value type ( Int32, and so on). Elements of the array are initialized to 0 of the appropriate type.

Nonzero-based one-dimensional arrays and multidimensional arrays are created using OpCodes.Newobj rather than newarr. More commonly, they are created using the methods of the Array class in the .NET Framework.

OutOfMemoryException is thrown if there is insufficient memory to satisfy the request.

OverflowException is thrown if numElems is less than 0.

The following ILGenerator.Emit constructor overload can use the newarr opcode:

Return to top


Field: Newobj
Summary
Creates a new object or a new instance of a value type, pushing an object reference (type O) onto the evaluation stack.
C# Syntax:
public static readonly OpCode Newobj;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
73 < T > newobj Allocates an uninitialized object or value type and calls the constructor method

The stack transitional behavior, in sequential order, is:

  1. Arguments arg1 through argn are pushed on the stack in sequence.
  2. Arguments argn through arg1 are popped from the stack and passed to ctor for object creation.
  3. A reference to the new object is pushed onto the stack.

The newobj instruction creates a new object or a new instance of a value type.Ctor is a metadata token (a methodref or methoddef that must be marked as a constructor) that indicates the name, class and signature of the constructor to call.

The newobj instruction allocates a new instance of the class associated with ctor and initializes all the fields in the new instance to 0 (of the proper type) or null references as appropriate. It then calls the constructor ctor with the given arguments along with the newly created instance. After the constructor has been called, the now initialized object reference (type O) is pushed on the stack.

From the constructor's point of view, the uninitialized object is argument 0 and the other arguments passed to newobj follow in order.

All zero-based, one-dimensional arrays are created using OpCodes.Newarr, not newobj. On the other hand, all other arrays (more than one dimension, or one-dimensional but not zero-based) are created using newobj.

Value types are not usually created using newobj. They are usually allocated either as arguments or local variables, using newarr (for zero-based, one-dimensional arrays), or as fields of objects. Once allocated, they are initialized using OpCodes.Initobj. However, the newobj instruction can be used to create a new instance of a value type on the stack, that can then be passed as an argument, stored in a local, and so on.

OutOfMemoryException is thrown if there is insufficient memory to satisfy the request.

MissingMethodException is thrown if a constructor method ctor with the indicated name, class and signature could not be found. This is typically detected when Microsoft Intermediate Language (MSIL) instructions are converted to native code, rather than at runtime.

The following ILGenerator.Emit constructor overload can use the newobj opcode:

Return to top


Field: Nop
Summary
Fills space if bytecodes are patched. No meaningful operation is performed although a processing cycle can be consumed.
C# Syntax:
public static readonly OpCode Nop;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
00 nop Performs an operation without behavior.

There is no stack transitional behavior defined for this instruction.

The nop operation does nothing. It is intended to fill in space if bytecodes are patched.

The following ILGenerator.Emit constructor overload can use the nop opcode:

Return to top


Field: Not
Summary
Computes the bitwise complement of the integer value on top of the stack and pushes the result onto the evaluation stack as the same type.
C# Syntax:
public static readonly OpCode Not;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
66 not Computes the bitwise complement of a value.

The stack transitional behavior, in sequential order, is:

  1. value is pushed onto the stack.
  2. value is popped from the stack and its bitwise complement computed.
  3. The result is pushed onto the stack.

The not instruction computes the bitwise complement of an integer value and pushes the result onto the stack. The return type is the same as the operand type.

The following ILGenerator.Emit constructor overload can use the not opcode:

Return to top


Field: Or
Summary
Compute the bitwise complement of the two integer values on top of the stack and pushes the result onto the evaluation stack.
C# Syntax:
public static readonly OpCode Or;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
60 or Computes the bitwise OR of two integer values, returns an integer.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack and their bitwise OR computed.
  4. The result is pushed onto the stack.

The or instruction computes the bitwise OR of two values atop the stack, pushing the result onto the stack.

Or is an integer-specific operation.

The following ILGenerator.Emit constructor overload can use the or opcode:

Return to top


Field: Pop
Summary
Removes the value currently on top of the evaluation stack.
C# Syntax:
public static readonly OpCode Pop;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
26 pop Pops the top value from the stack.

The stack transitional behavior, in sequential order, is:

  1. The top value is popped from the stack.

The pop instruction removes the top element from the stack.

The following ILGenerator.Emit constructor overload can use the pop opcode:

Return to top


Field: Prefix1
Summary
This is a reserved instruction.
This type supports the Shared Source CLI infrastructure and is not intended to be used directly from your code.
C# Syntax:
public static readonly OpCode Prefix1;
Remarks


Format Assembly Format Description
prefix1
This instruction is reserved and currently unused. Emitting this instruction will generate an error.

Return to top


Field: Prefix2
Summary
This is a reserved instruction.
This type supports the Shared Source CLI infrastructure and is not intended to be used directly from your code.
C# Syntax:
public static readonly OpCode Prefix2;
Remarks


Format Assembly Format Description
prefix2
This instruction is reserved and currently unused. Emitting this instruction will generate an error.

Return to top


Field: Prefix3
Summary
This is a reserved instruction.
This type supports the Shared Source CLI infrastructure and is not intended to be used directly from your code.
C# Syntax:
public static readonly OpCode Prefix3;
Remarks


Format Assembly Format Description
prefix3
This instruction is reserved and currently unused. Emitting this instruction will generate an error.

Return to top


Field: Prefix4
Summary
This is a reserved instruction.
This type supports the Shared Source CLI infrastructure and is not intended to be used directly from your code.
C# Syntax:
public static readonly OpCode Prefix4;
Remarks


Format Assembly Format Description
prefix4
This instruction is reserved and currently unused. Emitting this instruction will generate an error.

Return to top


Field: Prefix5
Summary
This is a reserved instruction.
This type supports the Shared Source CLI infrastructure and is not intended to be used directly from your code.
C# Syntax:
public static readonly OpCode Prefix5;
Remarks


Format Assembly Format Description
prefix5
This instruction is reserved and currently unused. Emitting this instruction will generate an error.

Return to top


Field: Prefix6
Summary
This is a reserved instruction.
This type supports the Shared Source CLI infrastructure and is not intended to be used directly from your code.
C# Syntax:
public static readonly OpCode Prefix6;
Remarks


Format Assembly Format Description
prefix6
This instruction is reserved and currently unused. Emitting this instruction will generate an error.

Return to top


Field: Prefix7
Summary
This is a reserved instruction.
This type supports the Shared Source CLI infrastructure and is not intended to be used directly from your code.
C# Syntax:
public static readonly OpCode Prefix7;
Remarks


Format Assembly Format Description
prefix7
This instruction is reserved and currently unused. Emitting this instruction will generate an error.

Return to top


Field: Prefixref
Summary
This is a reserved instruction.
This type supports the Shared Source CLI infrastructure and is not intended to be used directly from your code.
C# Syntax:
public static readonly OpCode Prefixref;
Remarks


Format Assembly Format Description
prefixref
This instruction is reserved and currently unused. Emitting this instruction will generate an error.

Return to top


Field: Refanytype
Summary
Retrieves the type token embedded in a typed reference .
C# Syntax:
public static readonly OpCode Refanytype;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 1D refanytype Pushes the type token stored in a typed reference.

The stack transitional behavior, in sequential order, is:

  1. A value type reference is pushed onto the stack.
  2. The typed reference is popped from the stack and its corresponding type token retrieved.
  3. The type token is pushed onto the stack.

A typed reference contains a type token and an address to an object instance.

The refanytype instruction retrieves the type token embedded in the typed reference. See the OpCodes.Mkrefany instruction for information on creating typed references.

The following ILGenerator.Emit constructor overload can use the refanytype opcode:

Return to top


Field: Refanyval
Summary
Retrieves the address (type &) embedded in a typed reference.
C# Syntax:
public static readonly OpCode Refanyval;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
C2 < T > refanyval Pushes the address stored in a typed reference.

The stack transitional behavior, in sequential order, is:

  1. A value type reference is pushed onto the stack.
  2. The typed reference is popped from the stack and the corresponding address retrieved.
  3. The address is pushed onto the stack.

A typed reference contains a type token and an address to an object instance.

The refanyval instruction retrieves the address embedded in the a typed reference. The type embedded in the typed reference supplied on the stack must match the type specified by type (a metadata token, either a typedef or a typeref). See the OpCodes.Mkrefany instruction for related content.

InvalidCastException is thrown if type is not identical to the type stored in the type reference (in this case, type is the class supplied to the OpCodes.Mkrefany instruction that constructed said typed reference).

TypeLoadException is thrown if type cannot be found.

The following ILGenerator.Emit constructor overload can use the refanyval opcode:

Return to top


Field: Rem
Summary
Divides two values and pushes the remainder onto the evaluation stack.
C# Syntax:
public static readonly OpCode Rem;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
5D rem Pushes the remainder of dividing by onto the stack.

The stack transitional behavior, in sequential order, is:

  1. A value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack and the remainder of value1 div value2 computed.
  4. The result is pushed onto the stack.

result = value1remvalue2 satisfies the following conditions:

result = value1-value2× (value1divvalue2), and:

0 = | result | < | value2 |, sign(result) = sign(value1), where div is the division instruction that truncates towards zero.

If value2 is zero or value1 is infinity the result is NaN. If value2 is infinity, the result is value1 (negated for -infinity).

Integral operations throw DivideByZeroException if value2 is zero.

Note that on the Intel-based platforms an OverflowException is thrown when computing (minint rem -1).

The following ILGenerator.Emit constructor overload can use the rem opcode:

Return to top


Field: Rem_Un
Summary
Divides two unsigned values and pushes the remainder onto the evaluation stack.
C# Syntax:
public static readonly OpCode Rem_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
5E rem.un Pushes the remainder of dividing unsigned by unsigned onto the stack.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack and the remainder of value1 div value2 computed.
  4. The result is pushed onto the stack.

result = value1rem.unvalue2 satisfies the following conditions:

result = value1-value2 x (value1div.unvalue2), and:

0 = result < value2, where div.un is the unsigned division instruction.

The rem.un instruction computes result and pushes it on the stack.Rem.un treats its arguments as unsigned integers, while OpCodes.Rem treats them as signed integers.

Rem.un is unspecified for floating-point numbers.

Integral operations throw DivideByZeroException if value2 is zero.

The following ILGenerator.Emit constructor overload can use the rem.un opcode:

Return to top


Field: Ret
Summary
Returns from the current method, pushing a return value (if present) from the caller's evaluation stack onto the callee's evaluation stack.
C# Syntax:
public static readonly OpCode Ret;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
2A ret Returns from method, possibly returning a value.

The stack transitional behavior, in sequential order, is:

  1. The return value is popped from the callee evaluation stack.
  2. The return value obtained in step 1 is pushed onto the caller evaluation stack.

If the return value is not present on the callee evaluation stack, no value is returned (no stack transition behaviors for either the callee or caller method).

The type of the return value, if any, of the current method determines the type of value to be fetched from the top of the stack and copied onto the stack of the method that called the current method. The evaluation stack for the current method must be empty except for the value to be returned.

The ret instruction cannot be used to transfer control out of a try, filter, catch, or finally block. From within a try or catch, use the OpCodes.Leave instruction with a destination of a ret instruction that is outside all enclosing exception blocks. Because the filter and finally blocks are logically part of exception handling and not the method in which their code is embedded, correctly generated Microsoft Intermediate Language (MSIL) instructions do not perform a method return from within a filter or finally.

The following ILGenerator.Emit constructor overload can use the ret opcode:

Return to top


Field: Rethrow
Summary
Rethrows the current exception.
C# Syntax:
public static readonly OpCode Rethrow;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 1A rethrow Rethrows the current exception

No stack transition behavior is defined for this instruction.

The rethrow instruction is only permitted within the body of a catch handler. It throws the same exception that was caught by this handler.

The following ILGenerator.Emit constructor overload can use the rethrow opcode:

Return to top


Field: Shl
Summary
Shifts an integer value to the left (in zeroes) by a specified number of bits, pushing the result onto the evaluation stack.
C# Syntax:
public static readonly OpCode Shl;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
62 shl Shifts an integer to the left (shifting in zeros).

The stack transitional behavior, in sequential order, is:

  1. A value is pushed onto the stack.
  2. The amount of bits to be shifted is pushed onto the stack.
  3. The number of bits to be shifted and the value are popped from the stack; the value is shifted left by the specified number of bits.
  4. The result is pushed onto the stack.

The shl instruction shifts the value (type int32, int64 or natural int) left by the specified number of bits. The number of bits is a value of type int32, int64 or natural int. The return value is unspecified if the number of bits to be shifted is greater than or equal to the width (in bits) of the supplied value.

Shl inserts a zero bit in the lowest position on each shift.

The following ILGenerator.Emit constructor overload can use the shl opcode:

Return to top


Field: Shr
Summary
Shifts an integer value (in sign) to the right by a specified number of bits, pushing the result onto the evaluation stack.
C# Syntax:
public static readonly OpCode Shr;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
63 shr Shifts an integer to the right (shifting in sign).

The stack transitional behavior, in sequential order, is:

  1. A value is pushed onto the stack.
  2. The amount of bits to be shifted is pushed onto the stack.
  3. The number of bits to be shifted and the value are popped from the stack; the value is shifted right by the specified number of bits.
  4. The result is pushed onto the stack.

The shr.un instruction shifts the value (type int32, int64 or natural int) right by the specified number of bits. The number of bits is a value of type int32, int64 or natural int. The return value is unspecified if the number of bits to be shifted is greater than or equal to the width (in bits) of the supplied value.

Shr replicates the high order bit on each shift, preserving the sign of the original value in the result.

The following ILGenerator.Emit constructor overload can use the shr opcode:

Return to top


Field: Shr_Un
Summary
Shifts an unsigned integer value (in zeroes) to the right by a specified number of bits, pushing the result onto the evaluation stack.
C# Syntax:
public static readonly OpCode Shr_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
64 shr.un Shifts an integer to the right (shifting in zeroes).

The stack transitional behavior, in sequential order, is:

  1. A value is pushed onto the stack.
  2. The amount of bits to be shifted is pushed onto the stack.
  3. The number of bits to be shifted and the value are popped from the stack; the value is shifted right by the specified number of bits.
  4. The result is pushed onto the stack.

The shr.un instruction shifts the value (type int32, int64 or natural int) right by the specified number of bits. The number of bits is a value of type int32, int64 or natural int. The return value is unspecified if the number of bits to be shifted is greater than or equal to the width (in bits) of the supplied value.

Shr.un inserts a zero bit in the highest position on each shift.

The following ILGenerator.Emit constructor overload can use the shr.un opcode:

Return to top


Field: Sizeof
Summary
Pushes the size, in bytes, of a supplied value type onto the evaluation stack.
C# Syntax:
public static readonly OpCode Sizeof;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 1C < T > sizeof Push the size, in bytes, of a value type as an unsigned int32 .

The stack transitional behavior, in sequential order, is:

  1. The size (in bytes) of the supplied value type (valType) is pushed onto the stack.

ValType must be a metadata token (a typeref or typedef) that specifies a value type.

The following ILGenerator.Emit constructor overload can use the sizeof opcode:

Return to top


Field: Starg
Summary
Stores the value on top of the evaluation stack in the argument slot at a specified index.
C# Syntax:
public static readonly OpCode Starg;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE OB < unsigned int16 > starg Pops the top value from the stack and stores it in argument slot

The stack transitional behavior, in sequential order, is:

  1. The value currently on top of the stack is popped and placed in argument slot num.

The starg instruction pops a value from the stack and places it in argument slot num. The type of the value must match the type of the argument, as specified in the current method's signature.

For procedures that take a variable argument list, the starg instruction can be used only for the initial fixed arguments, not those in the variable part of the signature.

Performing a store into arguments that hold an integer value smaller than 4 bytes long truncates the value as it moves from the stack to the argument. Floating-point values are rounded from their native size (type F) to the size associated with the argument.

The following ILGenerator.Emit constructor overload can use the starg opcode:

Return to top


Field: Starg_S
Summary
Stores the value on top of the evaluation stack in the argument slot at a specified index , short form .
C# Syntax:
public static readonly OpCode Starg_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
10 < unsigned int8 > starg.s Pops the top value from the stack and stores it in argument slot , short form.

The stack transitional behavior, in sequential order, is:

  1. The value currently on top of the stack is popped and placed in argument slot num.

The starg.s instruction pops a value from the stack and places it in argument slot num. The type of the value must match the type of the argument, as specified in the current method's signature.

The starg.s instruction provides an efficient encoding for use with the first 256 arguments.

For procedures that take a variable argument list, the starg.s instruction can be used only for the initial fixed arguments, not those in the variable part of the signature.

Performing a store into arguments that hold an integer value smaller than 4 bytes long truncates the value as it moves from the stack to the argument. Floating-point values are rounded from their native size (type F) to the size associated with the argument.

The following ILGenerator.Emit constructor overload can use the starg.s opcode:

Return to top


Field: Stelem_I
Summary
Replaces the array element at a given index with the natural int value on the evaluation stack.
C# Syntax:
public static readonly OpCode Stelem_I;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
9B stelem.i Replaces an array element at the supplied index with the natural int value on the stack.

The stack transitional behavior, in sequential order, is:

  1. An object reference to an array, array, is pushed onto the stack.
  2. A valid index to an element in array is pushed onto the stack.
  3. A value is pushed onto the stack.
  4. The value, the index, and the array reference are popped from the stack; the value is put into the array element at the given index.

The stelem.i instruction replaces the value of the element index in the one-dimensional array array with the natural int value pushed onto the stack.

Arrays are objects and hence represented by a value of type O. The index is type natural int.

NullReferenceException is thrown if array is a null reference.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

ArrayTypeMismatchException is thrown if array does not hold elements of the required type.

The following ILGenerator.Emit constructor overload can use the stelem.i opcode:

Return to top


Field: Stelem_I1
Summary
Replaces the array element at a given index with the int8 value on the evaluation stack.
C# Syntax:
public static readonly OpCode Stelem_I1;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
9C stelem.i1 Replaces an array element at the supplied index with the int8 value on the stack.

The stack transitional behavior, in sequential order, is:

  1. An object reference to an array, array, is pushed onto the stack.
  2. A valid index to an element in array is pushed onto the stack.
  3. A value is pushed onto the stack.
  4. The value, the index, and the array reference are popped from the stack; the value is put into the array element at the given index.

The stelem.i1 instruction replaces the value of the element index in the one-dimensional array array with the int8 value pushed onto the stack.

Arrays are objects and hence represented by a value of type O. The index is type natural int.

NullReferenceException is thrown if array is a null reference.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

ArrayTypeMismatchException is thrown if array does not hold elements of the required type.

The following ILGenerator.Emit constructor overload can use the stelem.i1 opcode:

Return to top


Field: Stelem_I2
Summary
Replaces the array element at a given index with the int16 value on the evaluation stack.
C# Syntax:
public static readonly OpCode Stelem_I2;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
9D stelem.i2 Replaces an array element at the supplied index with the int16 value on the stack.

The stack transitional behavior, in sequential order, is:

  1. An object reference to an array, array, is pushed onto the stack.
  2. A valid index to an element in array is pushed onto the stack.
  3. A value is pushed onto the stack.
  4. The value, the index, and the array reference are popped from the stack; the value is put into the array element at the given index.

The stelem.i2 instruction replaces the value of the element index in the one-dimensional array array with the int16 value pushed onto the stack.

Arrays are objects and hence represented by a value of type O. The index is type natural int.

NullReferenceException is thrown if array is a null reference.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

ArrayTypeMismatchException is thrown if array does not hold elements of the required type.

The following ILGenerator.Emit constructor overload can use the stelem.i2 opcode:

Return to top


Field: Stelem_I4
Summary
Replaces the array element at a given index with the int32 value on the evaluation stack.
C# Syntax:
public static readonly OpCode Stelem_I4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
9E stelem.i4 Replaces an array element at the supplied index with the int32 value on the stack.

The stack transitional behavior, in sequential order, is:

  1. An object reference to an array, array, is pushed onto the stack.
  2. A valid index to an element in array is pushed onto the stack.
  3. A value is pushed onto the stack.
  4. The value, the index, and the array reference are popped from the stack; the value is put into the array element at the given index.

The stelem.i4 instruction replaces the value of the element index in the one-dimensional array array with the int32 value pushed onto the stack.

Arrays are objects and hence represented by a value of type O. The index is type natural int.

NullReferenceException is thrown if array is a null reference.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

ArrayTypeMismatchException is thrown if array does not hold elements of the required type.

The following ILGenerator.Emit constructor overload can use the stelem.i4 opcode:

Return to top


Field: Stelem_I8
Summary
Replaces the array element at a given index with the int64 value on the evaluation stack.
C# Syntax:
public static readonly OpCode Stelem_I8;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
9F stelem.i8 Replaces an array element at the supplied index with the int64 value on the stack.

The stack transitional behavior, in sequential order, is:

  1. An object reference to an array, array, is pushed onto the stack.
  2. A valid index to an element in array is pushed onto the stack.
  3. A value is pushed onto the stack.
  4. The value, the index, and the array reference are popped from the stack; the value is put into the array element at the given index.

The stelem.i8 instruction replaces the value of the element index in the one-dimensional array array with the int64 value pushed onto the stack.

Arrays are objects and hence represented by a value of type O. The index is type natural int.

NullReferenceException is thrown if array is a null reference.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

ArrayTypeMismatchException is thrown if array does not hold elements of the required type.

The following ILGenerator.Emit constructor overload can use the stelem.i8 opcode:

Return to top


Field: Stelem_R4
Summary
Replaces the array element at a given index with the float32 value on the evaluation stack.
C# Syntax:
public static readonly OpCode Stelem_R4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
A0 stelem.r4 Replaces an array element at the supplied index with the float32 value on the stack.

The stack transitional behavior, in sequential order, is:

  1. An object reference to an array, array, is pushed onto the stack.
  2. A valid index to an element in array is pushed onto the stack.
  3. A value is pushed onto the stack.
  4. The value, the index, and the array reference are popped from the stack; the value is put into the array element at the given index.

The stelem.r4 instruction replaces the value of the element index in the one-dimensional array array with the float32 value pushed onto the stack.

Arrays are objects and hence represented by a value of type O. The index is type natural int.

NullReferenceException is thrown if array is a null reference.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

ArrayTypeMismatchException is thrown if array does not hold elements of the required type.

The following ILGenerator.Emit constructor overload can use the stelem.r4 opcode:

Return to top


Field: Stelem_R8
Summary
Replaces the array element at a given index with the float64 value on the evaluation stack.
C# Syntax:
public static readonly OpCode Stelem_R8;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
A1 stelem.r8 Replaces an array element at the supplied index with the float64 value on the stack.

The stack transitional behavior, in sequential order, is:

  1. An object reference to an array, array, is pushed onto the stack.
  2. A valid index to an element in array is pushed onto the stack.
  3. A value is pushed onto the stack.
  4. The value, the index, and the array reference are popped from the stack; the value is put into the array element at the given index.

The stelem.r8 instruction replaces the value of the element index in the one-dimensional array array with the float64 value pushed onto the stack.

Arrays are objects and hence represented by a value of type O. The index is type natural int.

NullReferenceException is thrown if array is a null reference.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

ArrayTypeMismatchException is thrown if array does not hold elements of the required type.

The following ILGenerator.Emit constructor overload can use the stelem.r8 opcode:

Return to top


Field: Stelem_Ref
Summary
Replaces the array element at a given index with the object ref value (type O) on the evaluation stack.
C# Syntax:
public static readonly OpCode Stelem_Ref;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
A2 stelem.ref Replaces an array element at the supplied index with the ref value (type O ) on the stack.

The stack transitional behavior, in sequential order, is:

  1. An object reference to an array, array, is pushed onto the stack.
  2. A valid index to an element in array is pushed onto the stack.
  3. A value is pushed onto the stack.
  4. The value, the index, and the array reference are popped from the stack; the value is put into the array element at the given index.

The stelem.ref instruction replaces the value of the element at the supplied index in the one-dimensional array array with the ref (type O) value pushed onto the stack.

Arrays are objects and hence represented by a value of type O. The index is type natural int.

Note that stelem.ref implicitly casts the supplied value to the element type of array before assigning the value to the array element. This cast can fail, even for verified code. Thus the stelem.ref instruction can throw InvalidCastException. For one-dimensional arrays that aren't zero-based and for multidimensional arrays, the Array class provides a Array.SetValue method.

NullReferenceException is thrown if array is a null reference.

IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

ArrayTypeMismatchException is thrown if array does not hold elements of the required type.

The following ILGenerator.Emit constructor overload can use the stelem.ref opcode:

Return to top


Field: Stfld
Summary
Replaces the value stored in the field of an object reference or pointer with a new value.
C# Syntax:
public static readonly OpCode Stfld;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
7D < T > stfld Replaces the value of of the object with a new value.

The stack transitional behavior, in sequential order, is:

  1. An object reference or pointer is pushed onto the stack.
  2. A value is pushed onto the stack.
  3. The value and the object reference/pointer are popped from the stack; the value of field in the object is replaced with the supplied value.

The stfld instruction replaces the value of a field of an object (type O) or via a pointer (type natural int, &, or *) with a givne value.Field is a metadata token that refers to a field member reference. The stfld instruction can have a prefix of either or both of OpCodes.Unaligned and OpCodes.Volatile.

NullReferenceException is thrown if the object reference or pointer is a null reference and the field isn't static.

MissingFieldException is thrown if field is not found in the metadata. This is typically checked when the Microsoft Intermediate Language (MSIL) instruction is converted to native code, not at runtime.

The following ILGenerator.Emit constructor overload can use the stfld opcode:

Return to top


Field: Stind_I
Summary
Stores a value of type natural int at a supplied address.
C# Syntax:
public static readonly OpCode Stind_I;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
DF stind.i Stores a natural int value at at a given address.

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. A value is pushed onto the stack.
  3. The value and the address are popped from the stack; the value is stored at the address.

The stind.i instruction stores a natural int value at the supplied address (type natural int, *, or &).

Type safe operation requires that the stind.i instruction be used in a manner consistent with the type of the pointer. The operation of the stind.i instruction can be altered by an immediately preceding OpCodes.Volatile or OpCodes.Unaligned prefix instruction.

NullReferenceException is thrown if addr is not naturally aligned for the argument type implied by the instruction suffix.

The following ILGenerator.Emit constructor overload can use the stind.i opcode:

Return to top


Field: Stind_I1
Summary
Stores a value of type int8 at a supplied address.
C# Syntax:
public static readonly OpCode Stind_I1;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
52 stind.i1 Stores an int8 value at at a given address.

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. A value is pushed onto the stack.
  3. The value and the address are popped from the stack; the value is stored at the address.

The stind.i1 instruction stores an int8 value at the supplied address (type natural int, *, or &).

Type safe operation requires that the stind.i1 instruction be used in a manner consistent with the type of the pointer. The operation of the stind.i1 instruction can be altered by an immediately preceding OpCodes.Volatile or OpCodes.Unaligned prefix instruction.

NullReferenceException is thrown if addr is not naturally aligned for the argument type implied by the instruction suffix.

The following ILGenerator.Emit constructor overload can use the stind.i1 opcode:

Return to top


Field: Stind_I2
Summary
Stores a value of type int16 at a supplied address.
C# Syntax:
public static readonly OpCode Stind_I2;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
53 stind.i2 Stores an int16 value at at a given address.

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. A value is pushed onto the stack.
  3. The value and the address are popped from the stack; the value is stored at the address.

The stind.i2 instruction stores an int16 value at the supplied address (type natural int, *, or &).

Type safe operation requires that the stind.2i instruction be used in a manner consistent with the type of the pointer. The operation of the stind.i2 instruction can be altered by an immediately preceding OpCodes.Volatile or OpCodes.Unaligned prefix instruction.

NullReferenceException is thrown if addr is not naturally aligned for the argument type implied by the instruction suffix.

The following ILGenerator.Emit constructor overload can use the stind.i2 opcode:

Return to top


Field: Stind_I4
Summary
Stores a value of type int32 at a supplied address.
C# Syntax:
public static readonly OpCode Stind_I4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
54 stind.i4 Stores an int32 value at at a given address.

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. A value is pushed onto the stack.
  3. The value and the address are popped from the stack; the value is stored at the address.

The stind.i4 instruction stores an int32 value at the supplied address (type natural int, *, or &).

Type safe operation requires that the stind.i4 instruction be used in a manner consistent with the type of the pointer. The operation of the stind.i4 instruction can be altered by an immediately preceding OpCodes.Volatile or OpCodes.Unaligned prefix instruction.

NullReferenceException is thrown if addr is not naturally aligned for the argument type implied by the instruction suffix.

The following ILGenerator.Emit constructor overload can use the stind.i4 opcode:

Return to top


Field: Stind_I8
Summary
Stores a value of type int64 at a supplied address.
C# Syntax:
public static readonly OpCode Stind_I8;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
55 stind.i8 Stores an int64 value at at a given address.

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. A value is pushed onto the stack.
  3. The value and the address are popped from the stack; the value is stored at the address.

The stind.i8 instruction stores an int64 value at the supplied address (type natural int, *, or &).

Type safe operation requires that the stind.i8 instruction be used in a manner consistent with the type of the pointer. The operation of the stind.i instruction can be altered by an immediately preceding OpCodes.Volatile or OpCodes.Unaligned prefix instruction.

NullReferenceException is thrown if addr is not naturally aligned for the argument type implied by the instruction suffix.

The following ILGenerator.Emit constructor overload can use the stind.i8 opcode:

Return to top


Field: Stind_R4
Summary
Stores a value of type float32 at a supplied address.
C# Syntax:
public static readonly OpCode Stind_R4;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
56 stind.r4 Stores a float32 value at at a given address.

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. A value is pushed onto the stack.
  3. The value and the address are popped from the stack; the value is stored at the address.

The stind.r4 instruction stores a float32 value at the supplied address (type natural int, *, or &).

Type safe operation requires that the stind.r4 instruction be used in a manner consistent with the type of the pointer. The operation of the stind.r4 instruction can be altered by an immediately preceding OpCodes.Volatile or OpCodes.Unaligned prefix instruction.

NullReferenceException is thrown if addr is not naturally aligned for the argument type implied by the instruction suffix.

The following ILGenerator.Emit constructor overload can use the stind.r4 opcode:

Return to top


Field: Stind_R8
Summary
Stores a value of type float64 at a supplied address.
C# Syntax:
public static readonly OpCode Stind_R8;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
57 stind.r8 Stores a float64 value at at a given address.

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. A value is pushed onto the stack.
  3. The value and the address are popped from the stack; the value is stored at the address.

The stind.r8 instruction stores a float64 value at the supplied address (type natural int, *, or &).

Type safe operation requires that the stind.r8 instruction be used in a manner consistent with the type of the pointer. The operation of the stind.r8 instruction can be altered by an immediately preceding OpCodes.Volatile or OpCodes.Unaligned prefix instruction.

NullReferenceException is thrown if addr is not naturally aligned for the argument type implied by the instruction suffix.

The following ILGenerator.Emit constructor overload can use the stind.r8 opcode:

Return to top


Field: Stind_Ref
Summary
Stores a object reference value at a supplied address.
C# Syntax:
public static readonly OpCode Stind_Ref;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
51 stind.ref Stores an object reference (type O ) value at a given address.

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. A value is pushed onto the stack.
  3. The value and the address are popped from the stack; the value is stored at the address.

The stind.ref instruction stores an object reference value at the supplied address (type natural int, *, or &).

Type safe operation requires that the stind.ref instruction be used in a manner consistent with the type of the pointer. The operation of the stind.ref instruction can be altered by an immediately preceding OpCodes.Volatile or OpCodes.Unaligned prefix instruction.

NullReferenceException is thrown if addr is not naturally aligned for the argument type implied by the instruction suffix.

The following ILGenerator.Emit constructor overload can use the stind.ref opcode:

Return to top


Field: Stloc
Summary
Pops the current value from the top of the evaluation stack and stores it in a the local variable list at a specified index.
C# Syntax:
public static readonly OpCode Stloc;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 0E < unsigned int16 > stloc Pops a value from the stack and stores it in local variable

The stack transitional behavior, in sequential order, is:

  1. A value is popped off of the stack and placed in local variable index.

The stloc instruction pops the top value off the evalution stack and moves it into local variable number index, where local variables are numbered 0 onwards. The type of the value must match the type of the local variable as specified in the current method's local signature.

Storing into locals that hold an integer value smaller than 4 bytes long truncates the value as it moves from the stack to the local variable. Floating-point values are rounded from their native size (type F) to the size associated with the argument.

Correct Microsoft Intermediate Language (MSIL) instructions require that index be a valid local index. For the stloc instruction, index must lie in the range 0 to 65534 inclusive (specifically, 65535 is not valid). The reason for excluding 65535 is pragmatic: likely implementations will use a 2-byte integer to track both a local's index, as well as the total number of locals for a given method. If an index of 65535 had been made valid, it would require a wider integer to track the number of locals in such a method.

The following ILGenerator.Emit constructor overload can use the stloc opcode:

Return to top


Field: Stloc_0
Summary
Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index 0.
C# Syntax:
public static readonly OpCode Stloc_0;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
0A stloc.0 Pops a value from the stack into local variable 0.

The stack transitional behavior, in sequential order, is:

  1. A value is popped off of the stack and placed in the local variable indexed by 0.

The stloc.0 instruction pops the top value off the evalution stack and moves it into the local variable indexed by 0. The type of the value must match the type of the local variable as specified in the current method's local signature.

stloc.0 is an especially efficient encoding for storing values in local variable 0.

Storing into locals that hold an integer value smaller than 4 bytes long truncates the value as it moves from the stack to the local variable. Floating-point values are rounded from their native size (type F) to the size associated with the argument.

The following ILGenerator.Emit constructor overload can use the stloc.0 opcode:

Return to top


Field: Stloc_1
Summary
Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index 1.
C# Syntax:
public static readonly OpCode Stloc_1;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
0B stloc.1 Pops a value from the stack into local variable 1.

The stack transitional behavior, in sequential order, is:

  1. A value is popped off of the stack and placed in the local variable indexed by 1.

The stloc.1 instruction pops the top value off the evalution stack and moves it into the local variable indexed by 1. The type of the value must match the type of the local variable as specified in the current method's local signature.

stloc.1 is an especially efficient encoding for storing values in local variable 1.

Storing into locals that hold an integer value smaller than 4 bytes long truncates the value as it moves from the stack to the local variable. Floating-point values are rounded from their native size (type F) to the size associated with the argument.

The following ILGenerator.Emit constructor overload can use the stloc.1 opcode:

Return to top


Field: Stloc_2
Summary
Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index 2.
C# Syntax:
public static readonly OpCode Stloc_2;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
0C stloc.2 Pops a value from the stack into local variable 2

The stack transitional behavior, in sequential order, is:

  1. A value is popped off of the stack and placed in the local variable indexed by 2.

The stloc.2 instruction pops the top value off the evalution stack and moves it into the local variable indexed by 2. The type of the value must match the type of the local variable as specified in the current method's local signature.

stloc.2 is an especially efficient encoding for storing values in local variable 2.

Storing into locals that hold an integer value smaller than 4 bytes long truncates the value as it moves from the stack to the local variable. Floating-point values are rounded from their native size (type F) to the size associated with the argument.

The following ILGenerator.Emit constructor overload can use the stloc.2 opcode:

Return to top


Field: Stloc_3
Summary
Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index 3.
C# Syntax:
public static readonly OpCode Stloc_3;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
0D stloc.3 Pops a value from the stack into local variable 3

The stack transitional behavior, in sequential order, is:

  1. A value is popped off of the stack and placed in the local variable indexed by 3.

The stloc.3 instruction pops the top value off the evalution stack and moves it into the local variable indexed by 3. The type of the value must match the type of the local variable as specified in the current method's local signature.

stloc.3 is an especially efficient encoding for storing values in local variable 3.

Storing into locals that hold an integer value smaller than 4 bytes long truncates the value as it moves from the stack to the local variable. Floating-point values are rounded from their native size (type F) to the size associated with the argument.

The following ILGenerator.Emit constructor overload can use the stloc.3 opcode:

Return to top


Field: Stloc_S
Summary
Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index (short form) .
C# Syntax:
public static readonly OpCode Stloc_S;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
13 < unsigned int8 > stloc.s Pops a value from the stack and stores it in local variable short form.

The stack transitional behavior, in sequential order, is:

  1. A value is popped off of the stack and placed in local variable index.

The stloc.s instruction pops the top value off the evalution stack and moves it into local variable number index, where local variables are numbered 0 onwards. The type of the value must match the type of the local variable as specified in the current method's local signature.

The stloc.s instruction provides an efficient encoding for local variables 0 through 255.

Storing into locals that hold an integer value smaller than 4 bytes long truncates the value as it moves from the stack to the local variable. Floating-point values are rounded from their native size (type F) to the size associated with the argument.

The following ILGenerator.Emit constructor overload can use the stloc.s opcode:

Return to top


Field: Stobj
Summary
Copies a value of a specified type from the evaluation stack into a supplied memory address.
C# Syntax:
public static readonly OpCode Stobj;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
81 < T > stobj Stores a value of type from the stack into memory.

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack.
  2. A value type object of type class is pushed onto the stack.
  3. The object and the address are popped from the stack; the value type object is stored at the address.

The stobj instruction copies the value type object into the address specified by the address (a pointer of type natural int, *, or &). The number of bytes copied depends on the size of the class represented by class, a metadata token representing a value type.

The operation of the stobj instruction can be altered by an immediately preceding OpCodes.Volatile or OpCodes.Unaligned prefix instruction.

TypeLoadException is thrown if class cannot be found. This is typically detected when Microsoft Intermediate Language (MSIL) instructions are converted to native code rather than at run time.

The following ILGenerator.Emit constructor overload can use the stobj opcode:

Return to top


Field: Stsfld
Summary
Replaces the value of a static field with a value from the evaluation stack.
C# Syntax:
public static readonly OpCode Stsfld;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
80 < T > stsfld Replaces the value in with a supplied value.

The stack transitional behavior, in sequential order, is:

  1. A value is pushed onto the stack.
  2. A value is popped from the stack and stored in field.

The stsfld instruction replaces the value of a static field with a value from the stack.field is a metadata token that must refer to a static field member.

The stsfld instruction may be prefixed by OpCodes.Volatile.

MissingFieldException is thrown if field is not found in the metadata. This is typically checked when Microsoft Intermediate Language (MSIL) instructions are converted to native code, not at run time.

The following ILGenerator.Emit constructor overload can use the stsfld opcode:

Return to top


Field: Sub
Summary
Subtracts one value from another and pushes the result onto the evaluation stack.
C# Syntax:
public static readonly OpCode Sub;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
59 sub Subtracts one value from another, returning a new numeric value.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; value2 is subtracted from value1.
  4. The result is pushed onto the stack.

Overflow is not detected for integer operations (for proper overflow handling, see OpCodes.Sub_Ovf).

Integer subtraction wraps, rather than saturates. For example: assuming 8-bit integers, where value1 is set to 255 and value2 is set to 1, the "wrapped" result will be 0 rather than 256.

Floating-point overflow returns +inf (PositiveInfinity) or -inf (NegativeInfinity).

The following ILGenerator.Emit constructor overload can use the sub opcode:

Return to top


Field: Sub_Ovf
Summary
Subtracts one integer value from another, performs an overflow check, and pushes the result onto the evaluation stack.
C# Syntax:
public static readonly OpCode Sub_Ovf;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
DA sub.ovf Subtracts one integer value from another with an overflow check.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; value2 is subtracted from value1 with a check for overflow.
  4. The result is pushed onto the stack.

OverflowException is thrown if the result can not be represented in the result type.

This operation is performed on signed integers; for floating-point values, use OpCodes.Sub.

The following ILGenerator.Emit constructor overload can use the sub.ovf opcode:

Return to top


Field: Sub_Ovf_Un
Summary
Subtracts one unsigned integer value from another, performs an overflow check, and pushes the result onto the evaluation stack.
C# Syntax:
public static readonly OpCode Sub_Ovf_Un;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
DB sub.ovf.un Subtracts one unsigned integer value from anotherwith an overflow check.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack; value2 is subtracted from value1 with a check for overflow.
  4. The result is pushed onto the stack.

OverflowException is thrown if the result can not be represented in the result type.

This operation is performed on signed integers; for floating-point values, use OpCodes.Sub.

The following ILGenerator.Emit constructor overload can use the sub.ovf.un opcode:

Return to top


Field: Switch
Summary
Implements a jump table.
C# Syntax:
public static readonly OpCode Switch;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
45 < unsigned int32 > < int32 > ... < int32 > switch Jumps to one of values.

The stack transitional behavior, in sequential order, is:

  1. A value is pushed onto the stack.
  2. The value is popped off the stack and execution is transferred to the instruction at the offset indexed by the value, where the value is less than N.

The switch instruction implements a jump table. The format of the instruction is an unsigned int32 representing the number of targets N, followed by N int32 values specifying jump targets. These targets are represented as offsets (positive or negative) from the beginning of the instruction following this switch instruction.

The switch instruction pops a value off the stack and compares it, as an unsigned integer, to N. If value is less than N, execution is transferred to the target indexed by value, where targets are numbered from 0 (for example, a value of 0 takes the first target, a value of 1 takes the second target, and so on). If the value is greater than or equal to N, execution continues at the next instruction (fall through).

If the target instruction has one or more prefix codes, control can only be transferred to the first of these prefixes.

Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction. (Such transfers are severely restricted and must use the leave instruction instead).

The following ILGenerator.Emit constructor overload can use the switch opcode. The Label[] argument is an array of Labels representing 32-bit offsets.

Return to top


Field: Tailcall
Summary
Performs a postfixed method call instruction such that the current method's stack frame is removed before the actual call instruction is executed.
C# Syntax:
public static readonly OpCode Tailcall;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 14 tail. Subsequent call terminates current methods

There is no stack transition behavior defined for this instruction.

The tail. prefix instruction must immediately precede a OpCodes.Call, OpCodes.Calli, or OpCodes.Callvirt instruction. It indicates that the current method's stack frame should be removed before the call instruction is executed. It also implies that the value returned from the following call is also the value returned by the current method, and the call can therefore be converted into a cross-method jump.

The stack must be empty except for the arguments being transferred by the following call. The instruction following the call instruction must be a ret. Thus the only valid code sequence is tail. call (or calli or callvirt). Correct Microsoft Intermediate Language (MSIL) instructions must not branch to the call instruction, but they may branch to the subsequent OpCodes.Ret.

The current frame cannot be discarded when control is transferred from untrusted code to trusted code, since this would jeopardize code identity security. The .NET Framework security checks can therefore cause the tail. to be ignored, leaving a standard OpCodes.Call instruction. Similarly, in order to allow the exit of a synchronized region to occur after the call returns, the tail. prefix is ignored when used to exit a method that is marked synchronized.

The following ILGenerator.Emit constructor overload can use the tail. opcode:

Return to top


Field: Throw
Summary
Throws the exception object currently on the evaluation stack.
C# Syntax:
public static readonly OpCode Throw;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
7A throw Throws an exception.

The stack transitional behavior, in sequential order, is:

  1. An object reference (to an exception) is pushed onto the stack.
  2. The object reference is popped from the stack and the exception thrown.

The throw instruction throws the exception object (type O) currently on the stack.

NullReferenceException is thrown if the object reference is a null reference.

The following ILGenerator.Emit constructor overload can use the throw opcode:

Return to top


Field: Unaligned
Summary
Indicates that an address currently atop the evaluation stack might not be aligned to the natural size of the immediately following ldind, stind, ldfld, stfld, ldobj, stobj, initblk, or cpblk instruction.
C# Syntax:
public static readonly OpCode Unaligned;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 12 < unsigned int8 > unaligned. Indicates that the subsequent pointer instruction may be unaligned.

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack .

Unaligned. specifies that the address (an unmanaged pointer, natural int) on the stack might not be aligned to the natural size of the immediately following ldind, stind, ldfld, stfld, ldobj, stobj, initblk, or cpblk instruction. That is, for a OpCodes.Ldind_I4 instruction the alignment of the address may not be to a 4-byte boundary. For initblk and cpblk the default alignment is architecture dependent (4-byte on 32-bit CPUs, 8-byte on 64-bit CPUs). Code generators that do not restrict their output to a 32-bit word size must use unaligned. if the alignment is not known at compile time to be 8-byte.

The value of alignment must be 1, 2, or 4 and means that the generated code should assume that the address is byte, double-byte, or quad-byte aligned, respectively. Note that transient pointers (type *) are always aligned.

While the alignment for a cpblk instruction would logically require two numbers (one for the source and one for the destination), there is no noticeable impact on performance if only the lower number is specified.

The unaligned. and volatile. prefixes can be combined in either order. They must immediately precede a ldind, stind, ldfld, stfld, ldobj, stobj, initblk, or cpblk instruction. Only the OpCodes.Volatile prefix is allowed for the OpCodes.Ldsfld and OpCodes.Stsfld instructions.

The following ILGenerator.Emit constructor overloads can use the unaligned opcode:

Return to top


Field: Unbox
Summary
Converts the boxed representation of a value type to its unboxed form.
C# Syntax:
public static readonly OpCode Unbox;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
79 < T > unbox Extracts the value type data from , its boxed representation.

The stack transitional behavior, in sequential order, is:

  1. An object reference is pushed onto the stack.
  2. The object reference is popped from the stack and unboxed to a value type pointer.
  3. The value type pointer is pushed onto the stack.

A value type has two separate representations within the the Common Language Infrastructre (CLI):

The unbox instruction converts the object reference (type O), the boxed representation of a value type, to a value type pointer (a managed pointer, type &), its unboxed form. The supplied value type (valType) is a metadata token indicating the type of value type contained within the boxed object.

Unlike OpCodes.Box, which is required to make a copy of a value type for use in the object, unbox is not required to copy the value type from the object. Typically it simply computes the address of the value type that is already present inside of the boxed object.

InvalidCastException is thrown if the object is not boxed as valType.

NullReferenceException is thrown if the object reference is a null reference.

TypeLoadException is thrown if the value type valType cannot be found. This is typically detected when Microsoft Internediate Language (MSIL) instructions are converted to native code, rather than at runtime.

The following ILGenerator.Emit constructor overload can use the unbox opcode:

Return to top


Field: Volatile
Summary
Specifies that an address currently atop the evaluation stack might be volatile, and the results of reading that location cannot be cached or that multiple stores to that location cannot be suppressed.
C# Syntax:
public static readonly OpCode Volatile;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
FE 13 volatile. Indicates that the subsequent pointer reference is volatile.

The stack transitional behavior, in sequential order, is:

  1. An address is pushed onto the stack .

volatile. specifies that the address is a volatile address (that is, it can be referenced externally to the current thread of execution) and the results of reading that location cannot be cached or that multiple stores to that location cannot be suppressed. Marking an access as volatile. affects only that single access; other accesses to the same location must be marked separately. Access to volatile locations need not be performed atomically.

The OpCodes.Unaligned and volatile. prefixes can be combined in either order. They must immediately precede a ldind, stind, ldfld, stfld, ldobj, stobj, initblk, or cpblk instruction. Only the volatile. prefix is allowed for the OpCodes.Ldsfld and OpCodes.Stsfld instructions.

The following ILGenerator.Emit constructor overload can use the volatile. opcode:

Return to top


Field: Xor
Summary
Computes the bitwise XOR of the top two values on the evaluation stack, pushing the result onto the evaluation stack.
C# Syntax:
public static readonly OpCode Xor;
Remarks
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

Format Assembly Format Description
61 xor Computes the bitwise XOR of two integer values and returns an integer.

The stack transitional behavior, in sequential order, is:

  1. value1 is pushed onto the stack.
  2. value2 is pushed onto the stack.
  3. value2 and value1 are popped from the stack and their bitwise XOR computed.
  4. value2 and value1 are popped from the stack and their bitwise XOR computed.

The xor instruction computes the bitwise XOR of the top two values on the stack and leaves the result on the stack.

Xor is an integer-specific operation.

The following ILGenerator.Emit constructor overload can use the xor opcode:

Return to top


Method: Equals(
   object obj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool Equals(
   object obj
);

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~OpCodes();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int GetHashCode();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: TakesSingleByteArgument(
   OpCode inst
)
Summary
Returns true or false if the supplied opcode takes a single byte argument.
C# Syntax:
public static bool TakesSingleByteArgument(
   OpCode inst
);
Parameters:

inst

An instance of an Opcode object.

Return Value:
True or false.
Remarks
TakesSingleByteArgument returns true if the Opcode instance has an operand of:

Otherwise, it returns false.

Return to top


Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

For more information on members inherited from System.Object click on the link above.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.