OpCodes.Stelem_I2 Campo

Definição

Substitui o elemento de matriz em um determinado índice pelo valor int16 na pilha de avaliação.Replaces the array element at a given index with the int16 value on the evaluation stack.

public: static initonly System::Reflection::Emit::OpCode Stelem_I2;
public static readonly System.Reflection.Emit.OpCode Stelem_I2;
 staticval mutable Stelem_I2 : System.Reflection.Emit.OpCode
Public Shared ReadOnly Stelem_I2 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
9D9D stelem. i2stelem.i2 Substitui um elemento de matriz no índice fornecido pelo int16 valor na pilha.Replaces an array element at the supplied index with the int16 value on the stack.

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

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

  2. Um índice válido para um elemento em array é enviado por push para a pilha.A valid index to an element in array is pushed onto the stack.

  3. Um valor é enviado por push para a pilha.A value is pushed onto the stack.

  4. O valor, o índice e a referência de matriz são retirados da pilha; o valor é colocado no elemento de matriz no índice fornecido.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.

A stelem.i2 instrução substitui o valor do elemento index na matriz unidimensional array pelo int16 valor enviado para a pilha.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.

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 índice é tipo native int .The index is type native int.

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 de array .IndexOutOfRangeException is thrown if index is negative, or larger than the bound of array.

ArrayTypeMismatchException será gerado se não array mantiver elementos do tipo necessário.ArrayTypeMismatchException is thrown if array does not hold elements of the required type.

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

Aplica-se a