memset
This commit is contained in:
parent
c5c7eeae1e
commit
a48ad647ae
2
Makefile
2
Makefile
|
@ -3,7 +3,7 @@ CC=sdcc
|
||||||
CFLAGS=-Ilib83 -c -mz80 --std-sdcc2x --no-std-crt0 --reserve-regs-iy --opt-code-size
|
CFLAGS=-Ilib83 -c -mz80 --std-sdcc2x --no-std-crt0 --reserve-regs-iy --opt-code-size
|
||||||
|
|
||||||
OBJS=_crt0.rel clrscr.rel putchar.rel puts.rel exit.rel gotoxy.rel __assert_fail.rel \
|
OBJS=_crt0.rel clrscr.rel putchar.rel puts.rel exit.rel gotoxy.rel __assert_fail.rel \
|
||||||
getchar.rel put_int.rel ctype.rel \
|
getchar.rel put_int.rel ctype.rel memcpy.rel memset.rel memmove.rel \
|
||||||
main.rel
|
main.rel
|
||||||
|
|
||||||
.PHONY: all clean try
|
.PHONY: all clean try
|
||||||
|
|
12
lib83/memset.c
Normal file
12
lib83/memset.c
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
void * memset(void * buf, unsigned char ch, size_t count) {
|
||||||
|
unsigned char * ret = buf;
|
||||||
|
|
||||||
|
while (count--)
|
||||||
|
*ret++ = ch;
|
||||||
|
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
extern void *memcpy(void *dest, const void *src, size_t n);
|
extern void *memcpy(void *dest, const void *src, size_t n);
|
||||||
extern void *memset(void *s, int c, size_t n);
|
extern void *memset(void *s, unsigned char c, size_t n);
|
||||||
extern void *memmove(void *dest, const void *src, size_t n);
|
extern void *memmove(void *dest, const void *src, size_t n);
|
||||||
extern int memcmp(const void *s1, const void *s2, size_t n);
|
extern int memcmp(const void *s1, const void *s2, size_t n);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user