I think I'm not quite understanding what the PF
is in the eflags register. Here are two comparisons I have done to see how it works:
# a > b -- 0b01
mov $4, %rax
mov $3, %rbx
cmp %rax, %rbx # [ CF PF AF SF IF ] *PF* included
# a > b -- 0b10
mov $5, %rax
mov $3, %rbx
cmp %rax, %rbx # [ CF AF SF IF ]
# a = b -- 0b00
mov $5, %rax
mov $5, %rbx
cmp %rax, %rbx # [ PF ZF IF ] *PF* included
In the first operation, the comparison would produce 1
or 0x01
and in the second it would produce 2
or 0x10
. Why then is the parity flag set in the first one but not the second one, since both of them have one bit set to 1.