In a disassembled code:
movsx eax,[address1]
# a few fpu computations
dec eax
# so many fpu computations
jz label2
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
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:
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.
Check your assumptions.
If fpu computations do not influence zero flag, then we can assume that it is equal to:
There exist 4 fpu instructions that modify the EFLAGS register directly. These are fcomi
, fcomip
, fucomi
, and fucomip
. They define the ZF, PF, and CF.
You would have to peruse the # so many fpu computations(2) code block for any of these. If present jz label2
will not be based on the outcome of dec eax
!
There exist 2 fpu instructions that modify the AX register. These are fstsw ax
and fnstsw ax
.
You would have to peruse both the # a few fpu computations(1) and # so many fpu computations(2) code blocks for any of these. If present EAX will not contain the value that you expect!
To answer your question about mov
and dec
having any influence on the ZF the general rule provided by @user3144770 pretty much says it all.
The Intel manual is a reliable friend in these matters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With