Content deleted Content added
m Bot: Migrating 1 langlinks, now provided by Wikidata on d:q121090777; 11 langlinks remaining |
|||
(19 intermediate revisions by 17 users not shown) | |||
Line 1:
{{Short description|Computer data variable}}
{{Distinguish|Command-line flag}}
In [[computer programming]], '''flag''' can refer to one or more [[bit]]s that are used to store a [[binary numeral system|binary]] value or a [[Boolean variable]] for signaling special [[Source code|code]] conditions, such as file empty or full queue statuses.<ref name="Haigh 1994 p. 59">{{cite book | last=Haigh | first=J. | title=Designing Computer Programs | publisher=Elsevier Science | year=1994 | isbn=978-0-08-050403-2 | url=https://books.google.com/books?id=DAJEMc-4qz4C&pg=PA59 | access-date=2023-07-31 | page=59}}</ref><ref name="Fitzgerald 2007 p. 49">{{cite book | last=Fitzgerald | first=M. | title=Learning Ruby: The Language that Powers Rails | publisher=O'Reilly Media | year=2007 | isbn=978-0-596-55532-0 | url=https://books.google.com/books?id=pYS_Fm5LqUYC&pg=PA49 | access-date=2023-07-31 | page=49}}</ref>
Within [[microprocessor]]s 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 [[Branch (computer science)|jump instruction]]s. For example a ''je'' (Jump if Equal) instruction in the [[X86 assembly language#
A [[Command-line interface#Command-line option|command line switch]] is also referred to as a "flag". [[Command-line interface|Command line]] programs often start with an option [[Parsing|parser]] that translates command line switches into flags in the sense of this article.▼
▲A [[Command-line interface#Command-line option|command line switch]] is also referred to as a flag. [[Command-line interface|Command line]] programs often start with an option [[Parsing|parser]] that translates command line switches into flags in the sense of this article.
==See also==
*[[Bit field]]
*[[Control register]]
*[[Enumerated type]]
*[[FLAGS register (computing)]]
*[[Program status word]]
*[[Semaphore (programming)]]
*[[Status register]]
==References==
{{reflist}}
{{DEFAULTSORT:Flag (Computing)}}
Line 20 ⟶ 26:
[[Category:Central processing unit]]
[[Category:Digital registers]]
{{operating-system-stub}}
Line 31 ⟶ 36:
[[id:Bendera (komputasi)]]
[[it:Flag]]
[[ja:フラグ (コンピュータ)]]
[[pl:Pole znacznikowe]]
|