toaruos/libc/memcpy.c
2018-02-25 14:13:54 +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;
}