encyclopegia.org

Direction flag

The direction flag is a flag that controls the left-to-right or right-to-left direction of string processing, stored in the FLAGS register on all x86-compatible CPUs. It is bit number 10. This flag is used to determine the direction ('forward' or 'backward') in which several bytes of data will be copied from one place in the memory, to another. The direction is important mainly when the original data position in memory and the target data position overlap. * If it is set to 0 (using the clear-direction-flag instruction CLD ) — it means that string is processed beginning from lowest to highest address; such instructions mode is called auto-incrementing mode. Both the source index and destination index (like MOVS ) will increase them; * In case it is set to 1 (using the set-direction-flag instruction STD ) — the string is processed from highest to lowest address. This is called auto-decrementing mode.

The direction flag is a flag that controls the left-to-right or right-to-left direction of string processing, stored in the FLAGS register on all x86-compatible CPUs. It is bit number 10. This flag is used to determine the direction ('forward' or 'backward') in which several bytes of data will be copied from one place in the memory, to another. The direction is important mainly when the original data position in memory and the target data position overlap. If it is set to 0 (using the clear-direction-flag instruction CLD ) — it means that string is processed beginning from lowest to highest address; such instructions mode is called auto-incrementing mode. Both the source index and destination index (like MOVS ) will increase them; In case it is set to 1 (using the set-direction-flag instruction STD ) — the string is processed from highest to lowest address. This is called auto-decrementing mode. ==References==

References

No reference rows published for this article.

Cite this article

MLA

"Direction flag." encyclopegia.org, 2020, https://encyclopegia.org/wiki/direction-flag. Accessed 24 November 2026.

Chicago

"Direction flag." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/direction-flag.

APA

encyclopegia.org. (2020). Direction flag. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/direction-flag

Accessed November 24, 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=971887103 · 0.5 · snapshot enwiki-000971887103

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

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