OpCodes.Ceq 字段

定义

比较两个值。Compares two values. 如果这两个值相等,则将整数值 1 (int32) 推送到计算堆栈上;否则,将 0 (int32) 推送到计算堆栈上。If they are equal, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack.

public: static initonly System::Reflection::Emit::OpCode Ceq;
public static readonly System.Reflection.Emit.OpCode Ceq;
 staticval mutable Ceq : System.Reflection.Emit.OpCode
Public Shared ReadOnly Ceq 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
FE 01FE 01 ceqceq 如果 @no__t @no__t 等于-1,则推送 1;else 将0推送。Pushes 1 if value1 equals value2; else pushes 0.

堆栈转换行为顺序如下: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 从堆栈中弹出;将 value1 与 @no__t 进行比较。value2 and value1 are popped from the stack; value1 is compared to value2.

  4. 如果 value1 等于 value2,则将1推送到堆栈上;否则,将0推送到堆栈上。If value1 is equal to value2, 1 is pushed onto the stack; otherwise 0 is pushed onto the stack.

@No__t-0 指令比较 value1value2The ceq instruction compares value1 and value2. 如果 value1 等于 value2,则将1(类型 int32)推送到堆栈上。If value1 is equal to value2, then 1 (of type int32) is pushed on the stack. 否则,将0(类型 int32)推送到堆栈上。Otherwise 0 (of type int32) is pushed on the stack.

对于浮点数,如果数字无序(或两者均为 NaN),ceq 将返回0。For floating-point number, ceq will return 0 if the numbers are unordered (either or both are NaN). 无限值等于自身。The infinite values are equal to themselves.

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

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

适用于