3 ;extern "C" int asm_memcpy
4 ; (unsigned char *dest, unsigned char *src, int len);
12 pushad ; save registers
13 mov edi,[esp+36] ; get 1st argument
14 mov esi,[esp+40] ; ...2nd
15 mov eax,[esp+44] ; ...3rd
18 shr eax, 2 ; figure out how many 4 byte chunks we have
19 and edx, 3 ; also figure out slack
20 test eax, eax ; Do we have any big chunks?
22 jz .slack ; If not, just do slack
26 rep movsd ; move 4 byte chunks
30 rep movsb ; move 1 byte slack
35 ; --------------------------------------