Direction flag

Uses your system voice; voice and rate in settings.

Snapshot

≈ 2 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

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==

Text derived from https://en.wikipedia.org/w/index.php?oldid=971887103 under CC BY-SA 4.0; modifications have been made.

Provenance

snapshot enwiki-000971887103 · captured 1596914555.0 · version history

Cite this page as: encyclopegia.org, “Direction flag”, snapshot enwiki-000971887103. https://encyclopegia.org/a/direction-flag

Sources cited in this revision

No external citation was extracted for this revision. That is a statement about the source, not a claim that none exists.