In the x86 assembly, is it possible to clear the parity flag in one and only one instruction that works in any initial register configuration?
This is equivalent to creating a result register with an odd number of bits with any operation that sets flags (explicitly excluding mov).
For contrast, setting the parity flag can be done in one instruction:
cmp bl, bl
And there are many ways to clear the parity flag using two instructions:
and bl, 0
or bl, 1
However, the single instruction method remains elusive.
source
share