Flag (computing)

Flag (computing)

In computer programming, flag refers to one or more bits that are used to store a binary value or code that has an assigned meaning. Flags are typically found as members of a defined data structure, such as a database record, and the meaning of the value contained in a flag will generally be defined in relation to the data structure it is part of. 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". However, there are many other possible meanings that can be assigned to flag values. One common use of flags is to mark or designate data structures for future processing.

Within microprocessors and other logic devices, flags are commonly used to control or indicate the intermediate or final state or outcome of different operations. Microprocessors typically have, for example, a status register that is composed of such flags, and the flags are used to indicate various post-operation conditions, such as when there has been an arithmetic overflow. The flags can be utilized in subsequent operations, such as in processing conditional jump instructions. For example a "je" (Jump if Equal) instruction in the X86 assembly language will result in a jump if the Z (zero) flag was set by some previous operation.

A command line switch is also referred to as a flag. Command line programs often start with an option parser that translates command line switches into flags in the sense of this article.


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Flag (disambiguation) — A flag is a colored cloth with a specified meaning.Flag may also refer to:In computers: * Flag (computing), a true/false, on/off or open/closed indicator (boolean variable) * FLAGS register (computing), a CPU register on x86 systems * Fiber Optic …   Wikipedia

  • flag — A pattern reflecting price fluctuations within a narrow range, generating a rectangular area on a graph both prior to and after sharp rises or declines. Bloomberg Financial Dictionary * * * ▪ I. flag flag 1 [flæg] verb [transitive] COMPUTING to… …   Financial and business terms

  • NUS School of Computing — COM1. The Computing Dean s Office and Department of Computer Science are located in this building …   Wikipedia

  • Carry flag — In computer processors the carry flag (usually indicated as the C flag) is a single bit in a system status (flag) register used to indicate when an arithmetic carry or borrow has been generated out of the most significant ALU bit position. When… …   Wikipedia

  • Command (computing) — In computing, a command is a directive to a computer program acting as an interpreter of some kind, in order to perform a specific task. Most commonly a command is a directive to some kind of command line interface, such as a shell. Specifically …   Wikipedia

  • IF (x86 flag) — IF (Interrupt Flag) is a system flag bit in the x86 architecture s FLAGS register, which determines whether or not the CPU will handle maskable hardware interrupts.cite web |url=http://download.intel.com/design/PentiumII/manuals/24319102.PDF|forma… …   Wikipedia

  • FLAGS register (computing) — This article discusses the flag register specific to the x86 architecture. For a general discussion about flag registers, see status register. The FLAGS register is the status register in Intel x86 microprocessors that contains the current state… …   Wikipedia

  • Abort (computing) — In a computer or data transmission system, to abort means to , usually in a controlled manner, a processing activity because it is impossible or undesirable for the activity to proceed. Such an action may be accompanied by information on the… …   Wikipedia

  • Doors (computing) — This article is about an inter process communication facility. For a requirements tracking tool by IBM, see DOORS. Doors are an inter process communication facility for Unix computer systems. They provide a form of procedure call. Contents 1… …   Wikipedia

  • Page (computing) — In a context of computer virtual memory, a page, memory page, or virtual page is a fixed length block of main memory, that is contiguous in both physical memory addressing and virtual memory addressing. A page is usually a smallest unit of data… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”