装配:MOV 或 DEC 会影响零标志吗? [英] Assembly: do MOV or DEC influence zero flag?

查看:18
本文介绍了装配:MOV 或 DEC 会影响零标志吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在反汇编代码中:

movsx eax,[address1]
# a few fpu computations
dec eax
# so many fpu computations
jz label2

如果 fpu 计算不影响零标志,那么我们可以假设它等于:

If fpu computations do not influence zero flag, then we can assume that it is equal to:

# a few fpu computations
# so many fpu computations
movsx eax,[address1]
dec eax
jz label2

那么,我的问题是 movdec 对零标志有什么影响吗?

Then, my question is that do mov or dec have any influence on zero flag?

推荐答案

当然你应该在手册中查找,但这里有一个通用规则:

Of course you should look this up in the manuals but here's a general rule:

  • 移动内容的指令不会修改标志.
  • 进行计算的指令将修改标志.

所以 movsx 属于第一类,不会改变任何标志.
但是 dec 显然会进行计算,并且肯定会更改包括 ZeroFlag 在内的几个标志.

So movsx falls in the first category and will not change any flag.
But dec clearly does a computation and most certainly changes several flags including the ZeroFlag.

这篇关于装配:MOV 或 DEC 会影响零标志吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆