OpCodes.Ldelem Campo

Definição

Carrega o elemento a um índice de matriz especificado na parte superior da pilha de avaliação como o tipo especificado na instrução.Loads the element at a specified array index onto the top of the evaluation stack as the type specified in the instruction.

public: static initonly System::Reflection::Emit::OpCode Ldelem;
public static readonly System.Reflection.Emit.OpCode Ldelem;
 staticval mutable Ldelem : System.Reflection.Emit.OpCode
Public Shared ReadOnly Ldelem As OpCode 

Valor do campo

OpCode

Comentários

A tabela a seguir lista o formato de assembly hexadecimal e da MSIL (Microsoft Intermediate Language) da instrução, juntamente com um resumo de referência breve:The following table lists the instruction's hexadecimal and Microsoft intermediate language (MSIL) assembly format, along with a brief reference summary:

FormatarFormat Formato do assemblyAssembly Format DescriçãoDescription
A3 < T >A3 < T > ldelem typeTokldelem typeTok Carrega o elemento em na index parte superior da pilha como tipo typeTok .Loads the element at index onto the top of the stack as type typeTok.

O comportamento de transição de pilha, em ordem sequencial, é:The stack transitional behavior, in sequential order, is:

  1. Uma referência array de objeto é enviada por push para a pilha.An object reference array is pushed onto the stack.

  2. Um valor de índice index é enviado por push para a pilha.An index value index is pushed onto the stack.

  3. index e array são retirados da pilha; o valor armazenado na posição index em array é pesquisado.index and array are popped from the stack; the value stored at position index in array is looked up.

  4. O valor é enviado por push para a pilha.The value is pushed onto the stack.

A ldelem instrução carrega o valor do elemento com index index (Type native int ) na matriz unidimensional de base zero array e o coloca na parte superior da pilha.The ldelem instruction loads the value of the element with index index (type native int) in the zero-based one-dimensional array array and places it on the top of the stack. Matrizes são objetos e, portanto, representados por um valor do tipo O .Arrays are objects, and hence represented by a value of type O.

O tipo do valor de retorno é especificado pelo token typeTok na instrução.The type of the return value is specified by the token typeTok in the instruction.

NullReferenceException será gerada se array for uma referência nula.NullReferenceException is thrown if array is a null reference.

IndexOutOfRangeException será gerado se index for negativo ou maior que o limite superior de array .IndexOutOfRangeException is thrown if index is negative, or larger than the upper bound of array.

A sobrecarga do método a seguir Emit pode usar o ldelem opcode:The following Emit method overload can use the ldelem opcode:

Aplica-se a