title: why does movsw instruction increments the si and di registers by2 while movsb instruction increments the si and di registers by 1?
body: <p>I was working with the movsb and movsw instruction in assembly language using the flat assembler. Now, i noticed that when the movsb instruction is executed the SI and DI register is incremented by 1 while the movsw instruction increments the SI AND DI register by 2. I am a bit confused why? Can anyone explain me the reason. I am adding my codes below for both the instruction with comments. Please help me out. Thanks!</p>
  
  <p>Using the movsb instruction(Flat assembler)</p>
  
  <pre><code>cld ;clear direction flag
  
  lea si,[val]  ;the memory address of source is loaded in the source register
  
  lea di,[v];the memory address of the destination is loaded in the destination register
  
  mov cx,5 ; the counter basically executes for the number of characters in the array
  
  rep movsb ; repeats the instruction for 5 times
  
  val:
       db 'A' 
       db 'B'
       db 'C'
       db 'D'
       db 'E'
  
  v db 5 DUP(?)
  </code></pre>
  
  <p>Using the movsw instruction(Flat assembler)</p>
  
  <pre><code>cld    ;clear the direction flag
  
  lea si,[a];load the address of a in source
  ;register
  lea di,[b] ;load the address of b in destination
  ;register
  mov cx,3
  rep movsw  ;copy each word from source to
  ;destination and increment the source register
  ;by 2 and destination register by 2
  
  a: 
    dw '1'
    dw '2'
    dw '3'
  
  b dw 3 DUP(?)
  </code></pre>