首页
社区
课程
招聘
[求助]关于test,and,or的问题
发表于: 2008-9-12 17:12 3994

[求助]关于test,and,or的问题

2008-9-12 17:12
3994
or eax,eax
jz ExitTimes

test eax,eax
jz ExitTimes

and eax,eax
jz ExitTimes

都是什么意思?有什么区别?

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (2)
雪    币: 563
活跃值: (95)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
or eax,eax  应该是把eax清零
test eax,eax   比较 eax 是否为0
2008-9-12 22:19
0
雪    币: 293
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
OR - Inclusive Logical OR

        Usage:  OR      dest,src
        Modifies flags: CF OF PF SF ZF (AF undefined)

        Logical inclusive OR of the two operands returning the result in
        the destination.  Any bit set in either operand will be set in the
        destination.

                                 Clocks                 Size
        Operands         808x  286   386   486          Bytes

        reg,reg           3     2     2     1             2

TEST - Test For Bit Pattern

        Usage:  TEST    dest,src
        Modifies flags: CF OF PF SF ZF (AF undefined)

        Performs a logical AND of the two operands updating the flags
        register without saving the result.

                                 Clocks                 Size
        Operands         808x  286   386   486          Bytes

        reg,reg           3     2     1     1             2

AND - Logical And

        Usage:  AND     dest,src
        Modifies flags: CF OF PF SF ZF (AF undefined)

        Performs a logical AND of the two operands replacing the destination
        with the result.

                                Clocks                  Size
        Operands         808x  286   386   486          Bytes

        reg,reg           3     2     2     1             2

从结果上来说,没区别。
清零的是 xor eax,eax
2008-9-13 01:04
0
游客
登录 | 注册 方可回帖
返回
//