OpCodes.Brfalse 字段


如果 valuefalse、空引用(Visual Basic 中的 Nothing)或零,则将控制转移到目标指令。Transfers control to a target instruction if value is false, a null reference (Nothing in Visual Basic), or zero.

public: static initonly System::Reflection::Emit::OpCode Brfalse;
public static readonly System.Reflection.Emit.OpCode Brfalse;
 staticval mutable Brfalse : System.Reflection.Emit.OpCode
Public Shared ReadOnly Brfalse 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
39 < int32 >39 < int32 > brfalse targetbrfalse target

brnull targetbrnull target

brzero targetbrzero target
如果 false,则分支到指定偏移量处的目标指令。Branches to a target instruction at the specified offset if false.

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

  1. 前一操作将 value 推送到堆栈上。value is pushed onto the stack by a previous operation.

  2. 从堆栈中弹出 value;如果 value @no__t 为-2,则分支到 @no__t。value is popped from the stack; if value is false, branch to target.

如果 value (类型 @no__t,`int64`,对象引用 O,托管指针 &,暂时性指针 *native int)为零,则 brfalse 指令(及其别名 @no__t 为-1,brzero)会将控制转移到指定的目标指令。(brnull0)。The brfalse instruction (and its aliases brnull and brzero) transfers control to the specified target instruction if value (of type int32, int64, object reference O, managed pointer &, transient pointer *, native int) is zero (false). 如果 @no__t 为非零(true),则在下一条指令处继续执行。If value is non-zero (true) execution continues at the next instruction.

目标指令表示为与当前指令后面的指令开头之间的4字节有符号偏移量。The target instruction is represented as a 4-byte signed offset from the beginning of the instruction following the current instruction.

如果目标指令具有一个或多个前缀代码,则只能将控制转移到其中的第一个前缀。If the target instruction has one or more prefix codes, control can only be transferred to the first of these prefixes. 控制传入和传出 trycatchfilterfinally 块无法通过此说明执行。Control transfers into and out of try, catch, filter, and finally blocks cannot be performed by this instruction.

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

  • ILGenerator (操作码、标签)ILGenerator.Emit(OpCode, Label)