toaruos/libc/arch/x86_64/memset.c

11 lines
233 B
C
Raw Normal View History

2018-02-25 08:13:54 +03:00
#include <stddef.h>
void * memset(void * dest, int c, size_t n) {
asm volatile("cld; rep stosb"
: "=c"((int){0})
2021-05-31 04:47:02 +03:00
: "rdi"(dest), "a"(c), "c"(n)
: "flags", "memory", "rdi");
2018-02-25 08:13:54 +03:00
return dest;
}