OpCodes.Sub 字段

定义

从其他值中减去一个值并将结果推送到计算堆栈上。Subtracts one value from another and pushes the result onto the evaluation stack.

public: static initonly System::Reflection::Emit::OpCode Sub;
public static readonly System.Reflection.Emit.OpCode Sub;
 staticval mutable Sub : System.Reflection.Emit.OpCode
Public Shared ReadOnly Sub 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
5959 subsub 从一个值中减去另一个值,返回新的数值。Subtracts one value from another, returning a new numeric value.

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

  1. value1 推送到堆栈上。value1 is pushed onto the stack.

  2. value2 推送到堆栈上。value2 is pushed onto the stack.

  3. value2 和 @no__t 从堆栈中弹出;从 @no__t 中减去 @no__t。value2 and value1 are popped from the stack; value2 is subtracted from value1.

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

未检测到用于整数运算的溢出(有关正确的溢出处理,请参阅 Sub_Ovf)。Overflow is not detected for integer operations (for proper overflow handling, see Sub_Ovf).

整数减法环绕,而不是尽量充满。Integer subtraction wraps, rather than saturates. 例如:假设8位整数,其中 value1 设置为0,value2 设置为1,则 "已包装" 结果将为255。For example: assuming 8-bit integers, where value1 is set to 0 and value2 is set to 1, the "wrapped" result will be 255.

浮点溢出返回 +infPositiveInfinity)或 -infNegativeInfinity)。Floating-point overflow returns +inf (PositiveInfinity) or -inf (NegativeInfinity).

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

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

适用于