toaruos/libc/string/memcpy.c

10 lines
251 B
C
Raw Normal View History

2018-02-25 08:13:54 +03:00
#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;
}