Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

OpCodes.Ldind_I8 Field

Loads a value of type int64 as an int64 onto the evaluation stack indirectly.

[Visual Basic]
Public Shared ReadOnly Ldind_I8 As OpCode
public static readonly OpCode Ldind_I8;
public: static OpCode Ldind_I8;
public static var Ldind_I8 : OpCode;


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 addr 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 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 Unaligned prefix instruction for preventative measures). The results of all MSIL instructions that return addresses (for example, Ldloca and 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 Emit constructor overload can use the ldind.i8 opcode:

  • ILGenerator.Emit(OpCode)


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

OpCodes Class | OpCodes Members | System.Reflection.Emit Namespace

© 2016 Microsoft