OpCodes.Ldarg_0 字段


将索引为 0 的自变量加载到计算堆栈上。Loads the argument at index 0 onto the evaluation stack.

public: static initonly System::Reflection::Emit::OpCode Ldarg_0;
public static readonly System.Reflection.Emit.OpCode Ldarg_0;
 staticval mutable Ldarg_0 : System.Reflection.Emit.OpCode
Public Shared ReadOnly Ldarg_0 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
0202 ldargldarg.0 将参数0加载到堆栈上Load argument 0 onto stack

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

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

@No__t-0 指令是用于在索引0处加载参数值的有效编码。The ldarg.0 instruction is an efficient encoding for loading the argument value at index 0.

@No__t-0 指令将索引为0的参数推送到计算堆栈上。The ldarg.0 instruction pushes the argument indexed at 0 onto the evaluation stack. @No__t 的指令可用于通过从传入参数复制来将值类型或基元值加载到堆栈上。The ldarg.0 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.

保留小于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.0 opcode:

  • ILGenerator.Emit(OpCode)ILGenerator.Emit(OpCode)