Reversing : The Hacker's Guide to Reverse Engineering

(ff) #1
Table A.1 (continued)
RELATION
LEFT RIGHT BETWEEN FLAGS
OPERAND OPERAND OPERANDS AFFECTED COMMENTS
X< 0 Y< 0 X> Y OF = 0 SF = 0 ZF = 0 This is the same
as the preceding
case, with both X
and Ycontaining
negative
integers.
X> 0 Y> 0 X< Y OF = 0 SF = 1 ZF = 0 An SF = 1
represents a
negative result,
which (with OF
being unset)
indicates that Y
is larger than X.
X< 0 Y>= 0 X< Y OF = 0 SF = 1 ZF = 0 This is the same
as the preceding
case, except that
Xis negative and
Yis positive.
Again, the
combination of
SF = 1 with OF = 0
represents that Y
is greater than X.
X< 0 Y> 0 X< Y OF = 1 SF = 0 ZF = 0 This is another
similar case
where Xis
negative and Yis
positive, except
that here an
overflow is
generated, and
the result is
positive.
X> 0 Y< 0 X> Y OF = 1 SF = 1 ZF = 0 When Xis
positive and Yis
a negative
integer low
enough to
generate a
positive overflow,
both OF and SF
are set.

Deciphering Code Structures 481

21_574817 appa.qxd 3/16/05 8:52 PM Page 481

Free download pdf