Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Direction flag

From Wikipedia, the free encyclopedia
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Direction flag" – news ·newspapers ·books ·scholar ·JSTOR
(December 2018) (Learn how and when to remove this message)

Thedirection flag is aflag that controls theleft-to-right orright-to-left direction ofstring processing,[1] stored in theFLAGS register on allx86-compatibleCPUs.[2] It isbit 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 thememory, 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-flaginstructionCLD) — it means that string is processed beginning from lowest to highestaddress; suchinstructions mode is calledauto-incrementing mode. Both thesource index anddestination index (likeMOVS) will increase them;
  • In case it is set to 1 (using the set-direction-flag instructionSTD) — the string is processed from highest to lowest address. This is calledauto-decrementing mode.
x86-instructionMeaningFlagNotes
Direction

of string processing

Mode title
CLDclear direction flag0lowest-to-highestaddressauto-incrementing
STDset direction flag1highest-to-lowest addressauto-decrementing

References

[edit]
  1. ^3.8.1 Carry and Direction Flag Control Instructions
  2. ^Direction Flag atMSDN
x86 assembly topics
Topics
Assemblers
Programming
issues
Retrieved from "https://en.wikipedia.org/w/index.php?title=Direction_flag&oldid=971887103"
Category:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp