Flags

When we first leaned about the different registers, you may recall the F register, also known as the Flags. Sometimes paired with the A register, F has a unique function that also means it cannot be used for data storage.

The 7 Flags

Seven of the Flags bits turn on and off based on certain events. Each of the bits has a name, similar to the way each registar has a name.

Bit 1 (Carry or C): If the last operation resulted in a number that no longer fits into 8 bits, this will hold the extra bit needed.

Bit 2 (Zero or Z): If the last operation resulted in one of the registers becoming 0, the zero bit will turn on.