GO-V.ORG
As seen in

Carry flag

In computer processors, the carry flag (usually indicated as the C flag) is a single bit in a system status register/flag register used to indicate when an arithmetic carry or borrow has been generated out of the most significant arithmetic logic unit (ALU) bit position.[src] The carry flag enables numbers larger than a single ALU width to be added/subtracted by carrying (adding) a binary digit from a partial addition/subtraction to the least significant bit position of a more significant word.[src] This is typically programmed by the user of the processor on the assembly or machine code level, but can also happen internally in certain processors, via digital logic or microcode, where some processors have wider registers and arithmetic instructions than (combinatorial, or "physical") ALU.[src] It is also used to extend bit shifts and rotates in a similar manner on many processors (sometimes done via a dedicated flag).[src] For subtractive operations, two (opposite) conventions are in common use: x86 processors set the carry flag on borrow, while the ARM clears the carry flag on borrow.[src]

In computer processors, the carry flag (usually indicated as the C flag) is a single bit in a system status register/flag register used to indicate when an arithmetic carry or borrow has been generated out of the most significant arithmetic logic unit (ALU) bit position.[src] The carry flag enables numbers larger than a single ALU width to be added/subtracted by carrying (adding) a binary digit from a partial addition/subtraction to the least significant bit position of a more significant word.[src] This is typically programmed by the user of the processor on the assembly or machine code level, but can also happen internally in certain processors, via digital logic or microcode, where some processors have wider registers and arithmetic instructions than (combinatorial, or "physical") ALU.[src] It is also used to extend bit shifts and rotates in a similar manner on many processors (sometimes done via a dedicated flag).[src] For subtractive operations, two (opposite) conventions are in common use: x86 processors set the carry flag on borrow, while the ARM clears the carry flag on borrow.[src] The first uses the bit as a borrow flag, setting it if a<b when computing a−b, and a borrow must be performed.[src] If a≥b, the bit is cleared.[src] A subtract with borrow ( SBB ) instruction will compute a−b−C = a−(b+C), while a subtract without borrow ( SUB ) acts as if the borrow bit were clear.[src] The 6800, 680x0, 8051, 8080/Z80, and x86 families (among others) use a borrow bit.[src] The second uses the identity that −x = (not x)+1 directly (i.e.[src] without storing the carry bit inverted) and computes a−b as a+(not b)+1.[src] The carry flag is set according to this addition, and subtract with carry computes a+not(b)+C, while subtract without carry acts as if the carry bit were set.[src] The result is that the carry bit is set if a≥b, and clear if a<b.[src] The System/360, ARM, POWER/PowerPC, 6502, MSP430, COP8, Am29000, i960, and 88000 processors use this convention.[src] The 6502 is a particularly well-known example because it does not have a subtract without carry operation, so programmers must ensure that the carry flag is set before every subtract operation where a borrow is not required.[src] The processors listed above, which include the most popular microprocessors of the last few decades, call these operations "subtract with borrow" and "subtract with carry", respectively, but the nomenclature is far from consistent.[src] The VAX, NS320xx, Fairchild Clipper and Atmel AVR architectures use the borrow bit convention, but call their a−b−C operation "subtract with carry" ( SBWC , SUBC , SUBWC and SBC ).[src] The PA-RISC and PICmicro architectures use the carry bit convention, but call their a+not(b)+C operation "subtract with borrow" ( SUBB and SUBWFB ).[src] The H8, SPARC, and Motorola 6809 use other names.[src] All use the borrow convention, but the H8 uses the mnemonic SUBX for "subtract extended".[src] SPARC also uses the SUBX mnemonic, but calls the operation "subtract with carry".[src] The 6809 calls the operation "subtract with borrow", but abbreviates it as SBC .[src] The ST6 8-bit microcontrollers are even less consistent.[src] Although they do not have any sort of "subtract with carry" instruction, they do have a carry bit which is set by subtract instructions, and the convention depends on the processor model.[src] The ST60 processor uses the "carry" convention, while the ST62 and ST63 processors use the "borrow" convention.[src] ==See also== Binary arithmetic Half-carry flag Status register ==References== ==External links== Carry Flag and Overflow Flag in binary arithmetic Carry Bit: How does it work?[src]

31 sentences · 31 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Carry flag." encyclopegia.org, 2026, https://encyclopegia.org/wiki/carry-flag. Accessed 06 December 2026.

Chicago

"Carry flag." encyclopegia.org. Accessed December 6, 2026. https://encyclopegia.org/wiki/carry-flag.

APA

encyclopegia.org. (2026). Carry flag. Retrieved December 6, 2026, from https://encyclopegia.org/wiki/carry-flag

Accessed December 6, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

flag of the Faroe Islands

stub · references available

flag

stub · references available

flag of Staffordshire

stub · references available

flag of South Carolina

stub · references available

flag of North Carolina

stub · references available

flag of Oregon

stub · references available

flag of Japan

stub · references available

flag of Jerusalem

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1376366812 · 0.5 · snapshot enwiki-001376366812

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.