minix/lib/libc/arch/i386/string/memcpy.S
Arun Thomas 9a21d1a2fd Macros for symbols used in both ASM and C
-The macros take care of prepending the leading underscore when
 necessary.
2010-08-17 16:44:07 +00:00

23 lines
724 B
ArmAsm

/* memcpy() Author: Kees J. Bot */
/* 2 Jan 1994 */
/* void *memcpy(void *s1, const void *s2, size_t n) */
/* Copy a chunk of memory. */
/* This routine need not handle overlap, so it does not handle overlap. */
/* One could simply call __memmove, the cost of the overlap check is */
/* negligible, but you are dealing with a programmer who believes that if */
/* anything can go wrong, it should go wrong. */
/* */
#include <machine/asm.h>
ENTRY(memcpy)
push %ebp
movl %esp, %ebp
push %esi
push %edi
movl 8(%ebp), %edi /* String s1 */
movl 12(%ebp), %esi /* String s2 */
movl 16(%ebp), %ecx /* Length */
/* No overlap check here */
jmp _C_LABEL(_memcpy) /* Call the part of __memmove that copies up */