Assembly language rep movsd use details

  • 2020-04-02 01:33:16
  • OfStack

Mov esi, offset @s1
Mov edi, offset @s2
Mov ecx, 10
CLD
Rep movsd

1. Rep movsd every ecx! Then ecx=ecx-1 movsd moves ds: [si] to es: [di] in 32-bit assembly using esi instead of si and edi instead of di

2. Meanwhile, in general exe, ds = es program starting position, the variable s1 can be found by esi = offset @s1, and s2 can be found by edi= offset @s2

3. The movsd instruction has the property of executing esi = esi +1 and edi= edi+ 1 once when the flag bit d=0    

    When d=1, perform esi = esi +1 and edi= edi+ 1

So the meaning of this instruction is to copy ecx dwords from s1 to s2


Related articles: