开发者

Logical instructions for CIL

开发者 https://www.devze.com 2023-02-13 12:45 出处:网络
How can I 开发者_JAVA百科use logical operators like AND, OR, NOT in CIL ?There are no CIL opcodes for those operators; you need to implement them via conditional branching instead.For instance, a &

How can I 开发者_JAVA百科use logical operators like AND, OR, NOT in CIL ?


There are no CIL opcodes for those operators; you need to implement them via conditional branching instead. For instance, a && b is the same as a ? b : false, and a || b is the same as a ? true : b, both of which are relatively easy to implement in IL (e.g. you can use the brtrue opcode to do a conditional jump based on the value of a).

0

精彩评论

暂无评论...
验证码 换一张
取 消