3 ;extern "C" int mmx_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, byte 3 ; figure out how many 8 byte chunks we have
19 and edx, byte 7 ; also figure out slack
20 test eax, eax ; Do we have any big chunks?
22 jz .slack
; If not, let's just do slack
27 movq mm0
,qword[esi] ; move 8 byte blocks using MMX
29 add esi, byte 8 ; increment pointers
31 loopnz .mmx_move
; continue until CX=0
35 rep movsb ; move 1 byte slack
37 emms
; Free up for the FPU
42 ; --------------------------------------
44 %ifdef NASM_STACK_NOEXEC
45 section .note.GNU
-stack noalloc noexec nowrite progbits