Stind_Ref Field
Collapse the table of content
Expand the table of content

OpCodes.Stind_Ref Field

Stores a object reference value at a supplied address.

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)

public static readonly OpCode Stind_Ref
public static final OpCode Stind_Ref
public static final var Stind_Ref : OpCode

The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:


Assembly Format




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 Volatile or Unaligned prefix instruction.

NullReferenceException is thrown if addr is not naturally aligned for the argument type implied by the instruction suffix.

The following Emit method overload can use the stind.ref opcode:

  • ILGenerator.Emit(OpCode)

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

© 2015 Microsoft