OpCodes.Ldarg_S 字段

定义

将自变量(由指定的短格式索引引用)加载到计算堆栈上。Loads the argument (referenced by a specified short form index) onto the evaluation stack.

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

字段值

注解

下表列出了指令的十六进制和 Microsoft 中间语言(MSIL)程序集格式以及简短的参考摘要: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
0E < unsigned int8 >0E < unsigned int8 > ldarg indexldarg.s index index 的参数加载到堆栈上(短格式)。Load argument at index onto stack, short form.

堆栈转换行为顺序如下:The stack transitional behavior, in sequential order, is:

  1. index 的参数值推送到堆栈上。The argument value at index is pushed onto the stack.

@No__t-0 指令是用于加载从4到255的索引参数的有效编码。The ldarg.s instruction is an efficient encoding for loading arguments indexed from 4 through 255.

@No__t-0 指令将索引处的参数推送到 index,其中自变量的索引从0开始,到计算堆栈上。The ldarg.s instruction pushes the argument indexed at index, where arguments are indexed from 0 onwards, onto the evaluation stack. @No__t 的指令可用于通过从传入参数复制来将值类型或基元值加载到堆栈上。The ldarg.s instruction can be used to load a value type or a primitive value onto the stack by copying it from an incoming argument. 参数值的类型与参数的类型相同,后者由当前方法的签名指定。The type of the argument value is the same as the type of the argument, as specified by the current method's signature.

对于采用可变长度参数列表的过程,只能将 ldarg.s 指令用于初始固定参数,而不能用于签名中变量部分的参数(有关详细信息,请参阅 Arglist 指令)。For procedures that take a variable-length argument list, the ldarg.s instruction can be used only for the initial fixed arguments, not those in the variable part of the signature (see the Arglist instruction for more details).

保留小于4个字节的整数值的参数将在加载到堆栈上时展开为类型 int32Arguments that hold an integer value smaller than 4 bytes long are expanded to type int32 when they are loaded onto the stack. 浮点值扩展为其本机大小(类型 F)。Floating-point values are expanded to their native size (type F).

以下 @no__t 0 方法重载可以使用 @no__t 操作码:The following Emit method overload can use the ldarg.s opcode:

  • ILGenerator (OpCode,byte)ILGenerator.Emit(OpCode, byte)

适用于