开发者

Logical instructions for CIL

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜