OpCodes.Ldind_U1 Campo

Definição

Carrega um valor do tipo unsigned int8 como um int32 na pilha de avaliação indiretamente.Loads a value of type unsigned int8 as an int32 onto the evaluation stack indirectly.

public: static initonly System::Reflection::Emit::OpCode Ldind_U1;
public static readonly System.Reflection.Emit.OpCode Ldind_U1;
 staticval mutable Ldind_U1 : System.Reflection.Emit.OpCode
Public Shared ReadOnly Ldind_U1 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
4747 ldind. U1ldind.u1 Carrega o unsigned int8 valor no endereço na addr pilha como um int32 .Loads the unsigned int8 value at address addr onto the stack as an int32.

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

  1. Um endereço é enviado por push para a pilha.An address is pushed onto the stack.

  2. O endereço é retirado da pilha; o valor localizado no endereço é buscado.The address is popped from the stack; the value located at the address is fetched.

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

A ldind.u1 instrução carrega indiretamente um unsigned int8 valor do endereço especificado (do tipo native int , & ou *) na pilha como um int32 .The ldind.u1 instruction indirectly loads an unsigned int8 value from the specified address (of typenative int, &, or *) onto the stack as an int32.

Todas as ldind instruções são atalhos para uma Ldobj instrução que especifica a classe de valor interna correspondente.All of the ldind instructions are shortcuts for a Ldobj instruction that specifies the corresponding built-in value class.

Observe que os valores inteiros de menos de 4 bytes são estendidos para int32 (não native int ) quando são carregados na pilha de avaliação.Note that integer values of less than 4 bytes are extended to int32 (not native int) when they are loaded onto the evaluation stack. Os valores de ponto flutuante são convertidos em F tipo quando carregados na pilha de avaliação.Floating-point values are converted to F type when loaded onto the evaluation stack.

A MSIL (Microsoft Intermediate Language) formada corretamente garante que as ldind instruções sejam usadas de forma consistente com o tipo do ponteiro.Correctly-formed Microsoft Intermediate Language (MSIL) ensures that the ldind instructions are used in a manner consistent with the type of the pointer.

O endereço inicialmente enviado para a pilha deve estar alinhado com o tamanho natural dos objetos no computador ou um NullReferenceException pode ocorrer (consulte a Unaligned instrução de prefixo para medidas preventivas).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). Os resultados de todas as instruções MSIL que retornam endereços (por exemplo, Ldloca e Ldarga ) são alinhados com segurança.The results of all MSIL instructions that return addresses (for example, Ldloca and Ldarga) are safely aligned. Para os tipos de texto maiores que 1 byte, a ordenação de bytes depende da CPU de destino.For datatypes larger than 1 byte, the byte ordering is dependent on the target CPU. O código que depende da ordenação de bytes pode não ser executado em todas as plataformas.Code that depends on byte ordering might not run on all platforms.

NullReferenceException pode ser gerado se um endereço inválido for detectado.NullReferenceException can be thrown if an invalid address is detected.

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

Aplica-se a