View previous topic :: View next topic |
Author |
Message |
Dr.Disrespect Grandmaster Cheater
Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Sat Apr 02, 2016 7:22 pm Post subject: FLAGS! |
|
|
Sorry for the capitalized title, but I wanna rage.
The instructions that changes the flags are making me crazy.
Suppose:
EAX == 0000021F
after the following code:
CF, PF and SF are all set to 1.
According to a tutorial, "PF : Parity Flag. Set if the number of set bits in the least significant byte is a multiple of 2." But I don't see any multiple of 2 in the numbers above....
Can anyone explain about how the flags and comparison work?
Thanks.
|
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sat Apr 02, 2016 9:45 pm Post subject: |
|
|
I don't use these flags much, so someone can correct me when I'm wrong.
CMP is equivalent to a SUB.
0513 - 021F = FD0C == 1111 1101 0000 1100
PF only reflects the least significant (last) byte.
0000 1100 contains 2 ones. 2 is an even number.
Flag set.
|
|
Back to top |
|
 |
Dr.Disrespect Grandmaster Cheater
Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Sat Apr 02, 2016 11:04 pm Post subject: |
|
|
Zanzer wrote: | I don't use these flags much, so someone can correct me when I'm wrong.
CMP is equivalent to a SUB.
0513 - 021F = FD0C == 1111 1101 0000 1100
PF only reflects the least significant (last) byte.
0000 1100 contains 2 ones. 2 is an even number.
Flag set. |
Sorry for the late reply.
Oh, its the last "byte", i thought it was "bit"... Got it, thanks.
|
|
Back to top |
|
 |
|