This node is about x86 architecture1
if you will; though it applies to 8088
too). You'll probably want to read about other parts of the CPU
too, to understand how the whole thing works.
There are two types of flags in an Intel 8086/8088 flag register (which is by the way 16 bit). There are 3 control flags and 6 status flags. I'll focus on the status flags in this node. By the way; when we say that the flag is set we mean that the flag is assigned a value of 1.
The six status flags are;
- PF (parity flag) is set when the low byte of the result has even number of bits.
- ZF (zero flag) is set when the result is zero.
- SF (sign flag) is set when the result of the operation is negative.
- AF (auxiliary carry flag) is set when there is a carry out/into the bit position three.
- CF (carry flag) is set when there is a carry out into the most significant bit of the result.
- OF (overflow flag) is set when the result exceeds the positive or negative limits of the number the current register can represent.
1 Later Intel architectures (386, 486, Pentiums and whatnot) are all built on the x86 architecture. Even though there are significant additions, the basic structure remains.