ON 20030112@5:58:10 PM at page: http://www.sxlist.com/techref/language/asm/win32asm.htm JMN-EFP-786 James Newton published post 37633.6315740741 wadr@adinet.com.uy asks:
Can someone help me width this code :|Delete 'P-' before: '' but after: '
void __inline * memcpy(void *dest, const void *src, size_t size) {
bprintf("memcpy(0x%x,0x%x,0x%x);\n",dest,src,size);
__asm__ (
" push %%esi \n"
" push %%edi \n"
" push %%ecx \n"
" mov %0, %%esi \n"
" mov %1, %%edi \n"
" mov %2, %%ecx \n"
" push %%ecx \n"
" shr $2, %%ecx \n"
" rep movsl \n"
" pop %%ecx \n"
" and $3, %%ecx \n"
" rep movsb \n"
" pop %%ecx \n"
" pop %%edi \n"
" pop %%esi \n"
: : "S" (src), "D" (dest), "c" (size)
);
return dest;
}
I never saw before a inline assembly wrote in that way. ( width %, $, \n and between "" )
and i specially can´t understand this
: : "S" (src), "D" (dest), "c" (size)
thanks a lot