In computer programming, flag can refer to one or more bits that are used to store a binary value or a Boolean variable for signaling special code conditions, such as file empty or full queue statuses.
In many cases, the binary value of a flag will be understood to represent one of several possible states or statuses.
In other cases, the binary values may represent one or more attributes in a bit field, often related to abilities or permissions, such as "can be written to" or "can be deleted".
Within microprocessors and other logic devices, flags are commonly used to control or indicate the intermediate or final state or outcome of different operations.
The flags can be utilized in subsequent operations, such as in processing conditional jump instructions.