What x86 register denotes source location in movsb instruction?
+5
A:
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.
Chris Jester-Young
2010-10-08 03:59:36
A bit of related x86 trivia for today's youth - `SI` (or `ESI` in the 32-bit world) stands for 'source index' and `DI` stands for 'destination index', which comes from the special-purpose uses of these registers.
Michael Burr
2010-10-08 04:16:42
Also be aware the default segment registers DS and ES can be overridden to use other segment registers.
I. J. Kennedy
2010-10-08 04:44:46
@I. J. Kennedy: Only the `ds` can be overridden. The `es` is fixed.
Chris Jester-Young
2010-10-08 05:05:24
In general, any instruction that uses `ds` by default can be overridden with a segment prefix; any instruction that uses `es` (e.g., `stosb` and the like) is fixed and cannot be overridden.
Chris Jester-Young
2010-10-08 05:10:52
Thanks for the help.
2010-10-08 05:11:16