What x86 register denotes source location in movsb instruction?
In short, rep repeats the following string operation ecx times. movs copies data from ds:esi to es:edi and increments or decrements the pointers based on the setting of the direction flag. As such, repeating it will move a range of memory to somewhere else.
After the move operation, the (E)SI and (E)DI registers are incremented or decremented automatically according to the setting of the DF flag in the EFLAGS register.
The register SI and DI are called index registers. These registers are usually used to process arrays or strings. SI is called source index and DI is destination index. As the name follows, SI is always pointed to the source array and DI is always pointed to the destination.
SI stands for source index. Source index is use as a pointer to the current character being read in a string instruction(LODS,MOVS, or CMPS). Source index is also available as an offset to add Bx or Bp when doing indirect addressing. example: MOV [Bx + SI] , Ax.
In 32-bit mode, esi
.
In specific, movsb
copies one byte from ds:esi
to es:edi
, the adjusts both esi
and edi
by 1, either up or down depending on the direction flag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With