Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Assembly Language - <b>movsb move string byte flags: not altered</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
MOVSB            Move String Byte                    Flags: not altered

MOVSB

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

    This instruction copies the byte pointed to by DS:SI into 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 byte.

  --------------------------------------------------------------------------
   Operands                  Clocks   Transfers  Bytes   Example
      -                        18         2        1     MOVSB
   (repeat)                 9+17/rep    2/rep      1     REP MOVSB

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

    Assuming BUFFER1 as been defined somewhere as:

          BUFFFER1        DB      100 DUP (?)

    the following example moves 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,100          ;CX is used by the REP prefix
  REP     MOVSB                   ;    ...and move it.

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

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