Mail Archives: djgpp/1997/04/15/06:09:28
On 14 Apr 1997, Jeff Weeks wrote:
> Which is faster?
>
> rep stosd or
> rep movsd
Those two instructions have different functionality: first copies ECX
bytes from DS:ESI to ES:EDI in direction indicated by direction flag
(set/remove with std/cld). Values of ESI and EDI grows or degrade with
value of ECX*4. ECX is zero after the end of instruction.
Second command fills ECX double words of memory at ES:EDI with value from
EAX. Direction depends from dir. flag and EDI grows with ECX*4, ECX is
zero after instruction.
As you see the purposes of thous two commands is different: first is for
memory to memory blitting, second is for uniform memory filling.
So speed comparision is a bit useless. But I think that MOVSD works slower
since it uses two memory regions, and STOSD only one.
> I've seen a few people currently using the later, which leads me to
> believe that it's faster, but my TASM book says that the former is
> faster.
Are you sure you ask your question in right newsgroup? TASM, generally
speaking, isn't good for DJGPP. Get NASM - Netwide Assembler.
> Please enlighten me, which is faster, and why? They both perform
^^ with a great pleasure :-)
> essentially the same function right?
^^^ not completly, doc ;)
- Raw text -