For 32-bit code, assuming flat model, the above are:
edi = place to copy to
esi = place to copy from
ecx = length of string (in bytes)
REP MOVSB ;REPeat: MOVe a String by Bytes
or better yet:
edi = place to copy to
esi = place to copy from
ecx = length of string (in bytes)
;we'll be needing it later on
push ecx
;we will move the string by DWORDS so divide length
;(in bytes) by 4 to get length in DWORDS
shr ecx,2
rep movsd ; REPeat: MOVe a String by Dwords
;however any extra bytes that don't fit into a DWORD will
;not get copied yet, so copy them too...
pop ecx
and ecx,03h
;if there are no extra bytes to copy, leave.
cmp ecx,0
je exit
rep movsb ;copy extra bytes that don't fit into a dword
"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
Show Off
You have to leave SOME of the work up to them.
But you got me on the E's. I missed the 32-Bit Part the first time I read the question. DataC5155
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.