chapter  10
14 Pages

The flag register

A flag may be described as a vivid, visual indication of the status of an object or situation. In a CPU it is useful to know the status of operations in the ALU, such as whether or not a previous operation produced a zero, non-zero, negative or positive result or if there were a carry or not. The flag register carries out this function. As such, it is also frequently described as the 'status register' or condition code register. In a Z80 CPU, the flag register is the register that stores the bits which keep track of the results of ALU operations within the CPU; to a large extent, the 6502 processor status register performs exactly the same function.