System.Reflection.Emit.OpCodes.Dup Field

Copies the current topmost value on the evaluation stack, and then pushes the copy onto the evaluation stack.

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:

25

dup

Duplicates the value on the top of the stack.

The stack transitional behavior, in sequential order, is:

[The 'ordered' type of list has not been implemented in the ECMA stylesheet.]

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

The following ILGenerator.Emit(OpCode) method overload can use the dup opcode:

  • ILGenerator.Emit(OpCode)

Requirements

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