From 4abab5ad6c8465a7528ccdd5f49367da05f78bbd Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Tue, 1 Oct 2024 15:47:05 +0200 Subject: Initial version --- src/string/i386/memmove.s | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/string/i386/memmove.s (limited to 'src/string/i386/memmove.s') diff --git a/src/string/i386/memmove.s b/src/string/i386/memmove.s new file mode 100644 index 0000000..2a6a504 --- /dev/null +++ b/src/string/i386/memmove.s @@ -0,0 +1,22 @@ +.global memmove +.type memmove,@function +memmove: + mov 4(%esp),%eax + sub 8(%esp),%eax + cmp 12(%esp),%eax +.hidden __memcpy_fwd + jae __memcpy_fwd + push %esi + push %edi + mov 12(%esp),%edi + mov 16(%esp),%esi + mov 20(%esp),%ecx + lea -1(%edi,%ecx),%edi + lea -1(%esi,%ecx),%esi + std + rep movsb + cld + lea 1(%edi),%eax + pop %edi + pop %esi + ret -- cgit v1.2.3