ABSTRACT

A string is a sequence of bytes, words, or doublewords that are stored in contiguous locations in memory as a one-dimensional array. Strings can be processed from low addresses to high addresses or from high addresses to low addresses, depending on the state of the direction flag (DF). If the direction flag is set (DF = 1), then the direction of processing is from high addresses to low addresses — also referred to as auto-decrement. If the direction flag is reset (DF = 0), then the direction of processing is from low addresses to high addresses — also referred to as auto-increment. The state of the direction flag can be set by the set direction flag (STD) instruction and can reset by the clear direction flag (CLD) instruction. The direction flag is located in bit 10 of the 32bit EFLAGS register, which is reproduced below in Figure 13.1.