Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- iAPx86 - <b>stos store string flags: not altered</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
STOS            Store String                         Flags: Not altered

STOS destination_string

        Logic   [ES:eDI] . accumulator
                if DF = 0
                   eDI . eDI + n        ; n = 1 for byte, 2 for word,
                else                    ;     4 for dword (386+)
                   eDI . eDI - n
                endif

    This instruction transfers the contents of the AL, AX, or EAX
    register to the memory byte, word, or doubleword pointed to by
    ES and the destination-index register (DI or EDI). After the
    transfer is made, eDI is automatically incremented (if the
    direction flag is cleared) or decremented (if the direction flag
    is set), in preparation for storing the next element of the
    string.

    If the address-size attribute of STOS is 16 bits, DI is used for
    the destination-index register; otherwise the the address size is
    32 bits, and the EDI register will be used.

    The destination segment must be addressable from the ES register;
    it cannot be changed with a segment override.


    Note:       This instruction is always translated by the assembler
                into STOSB, Store String Byte, STOSW, Store String
                Word, or STOSD, Store String Dword, depending upon
                whether destination refers to a string of bytes, words
                or doublewords. In either case, you must explicitly
                load the eDI register with the offset of the
                destination string.

                STOSB, STOSW, and STOSD are synonyms for the byte,
                word, and doubleword STOS instructions that do not
                require an operand. They are simpler to use but
                provide no type or segment checking.


    STOS is usually preceded with a REP prefix for a block fill of CX
    or ECX bytes bytes, words, or doublewords.


    Opcode      Format
    AA          STOS m8                 ; = STOSB
    AB          STOS m16                ; = STOSW
    AB          STOS m32                ; = STOSD


    Length and timing
    Variations  Bytes   8088    186     286     386     486     Pentium
    stosb        1      11      10       3       4       5       3   NP
    stosw        1      15      10       3       4       5       3   NP
    stosd        1       -       -       -       4       5       3   NP
    rep stosb    2      9+10n   6+9n    4+3n    5+5n    7+4n*   3+n  NP
    rep stosw    2      9+14n   6+9n    4+3n    5+5n    7+4n*   3+n  NP
    rep stosd    2       -       -       -      5+5n    7+4n*   3+n  NP

                        * = 5 if n=0, 13 if n=1
                 (n = count of bytes, words or dwords)

See Also: REP MOVS LOOP CLD STD

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson