toaruos/libc/arch/x86_64/memcpy.c
2021-05-31 10:54:11 +09:00

10 lines
251 B
C

#include <stddef.h>
void * memcpy(void * restrict dest, const void * restrict src, size_t n) {
asm volatile("cld; rep movsb"
: "=c"((int){0})
: "D"(dest), "S"(src), "c"(n)
: "flags", "memory");
return dest;
}