This node is about x86 architecture1 (or 8086 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;

  1. PF (parity flag) is set when the low byte of the result has even number of bits.
  2. ZF (zero flag) is set when the result is zero.
  3. SF (sign flag) is set when the result of the operation is negative.
  4. AF (auxiliary carry flag) is set when there is a carry out/into the bit position three.
  5. CF (carry flag) is set when there is a carry out into the most significant bit of the result.
  6. 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.

Log in or register to write something here or to contact authors.