OpCodes.Shl 字段


将整数值左移(用零填充)指定的位数,并将结果推送到计算堆栈上。Shifts an integer value to the left (in zeroes) by a specified number of bits, pushing the result onto the evaluation stack.

public: static initonly System::Reflection::Emit::OpCode Shl;
public static readonly System.Reflection.Emit.OpCode Shl;
 staticval mutable Shl : System.Reflection.Emit.OpCode
Public Shared ReadOnly Shl 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
6262 shlshl 向左移动一个整数(以零为变化)。Shifts an integer to the left (shifting in zeros).

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

  1. 将值推送到堆栈上。A value is pushed onto the stack.

  2. 要移动的位数将被推送到堆栈上。The amount of bits to be shifted is pushed onto the stack.

  3. 要移动的位数以及从堆栈中弹出的值的数目;该值将向左移动指定的位数。The number of bits to be shifted and the value are popped from the stack; the value is shifted left by the specified number of bits.

  4. 将结果推送到堆栈上。The result is pushed onto the stack.

@No__t-0 指令将值(键入 int32int64native int)向左移动指定的位数。The shl instruction shifts the value (type int32, int64 or native int) left by the specified number of bits. 位数为 int32native int 类型的值。The number of bits is a value of type int32 or native int. 如果要移位的位数大于或等于所提供值的宽度(以位为单位),则返回值为未指定。The return value is unspecified if the number of bits to be shifted is greater than or equal to the width (in bits) of the supplied value.

Shl 在每个移位上的最小位置插入零位。Shl inserts a zero bit in the lowest position on each shift.

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

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