Weitere Beispiele werden automatisch zu den Stichwörtern zugeordnet - wir garantieren ihre Korrektheit nicht.
One common reason to test the parity flag actually has nothing to do with parity.
For example, assume a machine where a set parity flag indicates even parity.
According to 80386 Intel manual, the parity flag is changed in the x86 processor family by the following instructions:
The parity flag is set to the bitwise XNOR of the result of the AND.
In computer processors the parity flag indicates if the number of set bits is odd or even in the binary representation of the result of the last operation.
In x86 processors, the parity flag reflects the parity only of the least significant byte of the result, and is set if the number of set bits of ones is even.
These are - Carry flag, Parity flag, Auxiliary Carry flag, Zero flag, Sign flag, Trap flag, Interrupt flag, Direction flag and Overflow flag.
The parity flag is usually used in conditional jumps, where e.g. the JP instruction jumps to the given target when the parity flag is set and the JNP instruction jumps if it is not set.