Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- TASM 2.x / MASM 6.x Assembly Language - <b>movsw move string word flags: not altered</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
MOVSW            Move String Word                    Flags: not altered

MOVSW

          Logic:    (ES:DI) . (DS:SI)
                    if DF = 0
                        SI . SI + 2
                        DI . DI + 2
                    else
                        SI . SI - 2
                        DI . DI - 2

    This instruction copies the word pointed to by DS:SI to the location
    pointed to by ES:DI. After the move, SI and DI are incremented (if the
    direction flag is cleared) or decremented (if the direction flag is
    set), to point to the next word.

  --------------------------------------------------------------------------
   Operands                  Clocks   Transfers  Bytes   Example
      -                        26         2        1     MOVSW
   (repeat)                 9+25/rep    2/rep      1     REP MOVSW

  -------------------------------- Example ---------------------------------

    Assuming BUFFER1 as been defined somewhere as:

          BUFFFER1        DB      100 DUP (?)

    the following example moves 50 words (100 bytes) from BUFFER1 to
    BUFFER2:

          CLD                     ;Move in the forward direction
          LEA     SI, BUFFER1     ;Source address to SI
          LEA     DI, BUFFER2     ;Destination address to DI
          MOV     CX,50           ;Used by REP; moving 50 words
  REP     MOVSW                   ;    ...and move it.

See Also: MOV MOVS MOVSB CMPS LODS SCAS STOS REP CLD STD

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