Probability of Selected EFLAGS Bits

We all know that when studying source code, this is a safe assumption that the direction flag will be clear. The probability of a direction flag is very low.

I wanted to know about the probabilities of other flags. That's why I wrote a test program that takes separate steps of my existing software, increasing the counter for each of the first 12 bits of EFLAGS.

X86 CPU Flags Probability

The results confirm the assumption of a direction flag (DF) and, not surprisingly, show that the probability of an overflow flag (OF) is very low.

But what about other flags? The carry flag (CF), auxiliary flag (AF), zero flag (ZF) and sign flag (SF) appear to settle by 25%, but the parity flag (PF) jumps by more than 50%.

I would like to know why the probabilities of CF, AF, ZF and SF are so low.

PF , , 50-50 8- , (0 - 1) , 50% .

+4
1

, EFLAGS , , Intel 8086 (, , ) . , x86, - . ( ) .

(, ...) , , , , , . , EFLAGS , - .

, , EFLAG. , .

. "Zsim: ISA Design-Space Exploration" 3.2.3 PDF:

EFLAGS use

, , . , , , .

+2

Source: https://habr.com/ru/post/1692844/