OpCodes.Starg_S 字段


将位于计算堆栈顶部的值存储在自变量槽中的指定索引处(短格式)。Stores the value on top of the evaluation stack in the argument slot at a specified index, short form.

public: static initonly System::Reflection::Emit::OpCode Starg_S;
public static readonly System.Reflection.Emit.OpCode Starg_S;
 staticval mutable Starg_S : System.Reflection.Emit.OpCode
Public Shared ReadOnly Starg_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
10 < unsigned int8 >10 < unsigned int8 > starg numstarg.s num 从堆栈中弹出顶部值并将其存储在参数槽中,num,缩写形式。Pops the top value from the stack and stores it in argument slot num, short form.

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

  1. 将弹出当前位于堆栈顶部的值并将其放入参数槽位 numThe value currently on top of the stack is popped and placed in argument slot num.

@No__t-0 指令从堆栈中弹出一个值,并将其放在参数槽 num 中。The starg.s instruction pops a value from the stack and places it in argument slot num. 值的类型必须与当前方法的签名中指定的参数的类型匹配。The type of the value must match the type of the argument, as specified in the current method's signature.

@No__t-0 指令提供了高效的编码以便与前256个参数一起使用。The starg.s instruction provides an efficient encoding for use with the first 256 arguments.

对于采用变量参数列表的过程,只能将 starg.s 指令用于初始固定参数,而不能用于签名的变量部分。For procedures that take a variable argument list, the starg.s instruction can be used only for the initial fixed arguments, not those in the variable part of the signature.

如果将存储区的参数保留为小于4个字节的整数值,则会在从堆栈移到参数时截断值。Performing a store into arguments that hold an integer value smaller than 4 bytes long truncates the value as it moves from the stack to the argument. 浮点值从其本机大小(类型 F)舍入到与参数相关联的大小。Floating-point values are rounded from their native size (type F) to the size associated with the argument.

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

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