Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
STOS Intruction
 Detail Key Example                    Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
  Title:    Store String Data                     Flags: O D I T S Z A P C
                                                         ═════════════════
  Syntax:   STOS dest                                         -none-
            STOSB
            STOSW
            STOSD (80386/486 Only)
 
  See also: REP, LODS, MOVS
 
  Description:
 
     Stores the value in the accumulator in a string. The string
     is the destination and must be pointed to by ES:DI even if
     an operand is given. For each source element loaded, DI is
     adjusted according to the size of the operand and the status of
     the direction flag. DI is incremented if the direction flag has been
     cleared with CLD or decremented if the direction flag has been set
     with STD.
 
     If the STOS form of the instruction is used, an operand must be
     provided to indicate the size of the data elements to be
     processed. No segment override is allowed.
 
     If STOSB (bytes), STOSW (words), or STOSD (doublewords) is used,
     the instruction determines the size of the data elements to be
     processed and whether the element comes from AL, AX, or EAX.
 
     STOS and its variations are often used with the REP prefix to fill a
     string with a repeated value. Before the repeated instruction is
     executed, CX should contain the number of elements to store.
                                    -♦-