toaruos/libc/memset.c
2018-02-25 14:13:54 +09:00

11 lines
224 B
C

#include <stddef.h>
void * memset(void * dest, int c, size_t n) {
asm volatile("cld; rep stosb"
: "=c"((int){0})
: "D"(dest), "a"(c), "c"(n)
: "flags", "memory");
return dest;
}