build.sh: warn without opts, don't enforce C99
[rofl0r-memcpy-test.git] / memcpy_2_i386.s
blobfe7c0049aaa32139a3e435237029be890c8cd09c
1 .global mymemcpy
2 .type mymemcpy,@function
3 mymemcpy:
4 push %esi
5 push %edi
6 mov 12(%esp),%edi
7 mov 16(%esp),%esi
8 mov 20(%esp),%ecx
9 mov %edi,%eax
10 cmp $4,%ecx
11 jc 1f
12 test $3,%edi
13 jz 1f
14 2: movsb
15 dec %ecx
16 test $3,%edi
17 jnz 2b
18 1: mov %ecx,%edx
19 shr $2,%ecx
20 rep
21 movsl
22 and $3,%edx
23 jz 1f
24 2: movsb
25 dec %edx
26 jnz 2b
27 1: pop %edi
28 pop %esi
29 ret