pouët.net

Go to bottom

"rep movsd es:[di], fs:[si]" WOAT?

category: code [glöplog]
 
Guys, I found a funny thing here:

db 064h
rep movsd


after compilation, we get the machine code: 64F3A5
which QVIEW decodes as: repe movsd es:[edi], fs:[esi]

But I never saw in the x86 assembler documentation that movsd can have operands. Trying to find something about it in Google does not give results.

Somebody knows? Is it legal at all? :)

BB Image
added on the 2022-07-06 17:53:21 by bitl bitl
It's not an operand per se, but a "section override prefix" which overrides the default segment of the instruction, which would be DS in this case.
added on the 2022-07-06 19:22:25 by Marq Marq
I have not seen this anywhere in the x86 asm documentation. I must have been looking in the wrong place :)

And the feature is very useful :)

Does this prefix work on a real 80386 processor?
And is it the same for stos, lods?
added on the 2022-07-06 19:43:44 by bitl bitl
Quote:
Does this prefix work on a real 80386 processor?
And is it the same for stos, lods?


Yes and yes: http://ref.x86asm.net/geek.html#x64

See "proc" column (03+ = 386+).

You have other segment override prefixes that were introduced with the 8086 even. And they work on stos/lods/even non-string instructions, e.g. "move byte[es:di+3], imm".
added on the 2022-07-06 19:53:28 by VileR VileR
uh, "mov byte[es:di+3], ..." ;) exact syntax depends on assembler.
added on the 2022-07-06 19:54:53 by VileR VileR
AFAICT the target segment is always es:, i'e. you can code ds:stosw but it wont work.
es:movsw is good for moving stuff around the screen.

Oh and hi to all; I'm a newbie here; but I'm really interested in small x86 asm programs.

My 1st post was last week to Sensthals (sp?) Collider prog; I reduced it to 128 bytes.
His room1007 I'm working on and have a revamped version at 222 at present.
added on the 2022-10-23 23:10:14 by Retro123 Retro123

login

Go to top