This commit is contained in:
Kamila Szewczyk 2023-10-08 14:54:13 +02:00
parent c5c7eeae1e
commit a48ad647ae
Signed by: Palaiologos
GPG Key ID: E34D7BADA3DACC14
3 changed files with 14 additions and 2 deletions

View File

@ -3,7 +3,7 @@ CC=sdcc
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 \
getchar.rel put_int.rel ctype.rel \
getchar.rel put_int.rel ctype.rel memcpy.rel memset.rel memmove.rel \
main.rel
.PHONY: all clean try

12
lib83/memset.c Normal file
View 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;
}

View File

@ -5,7 +5,7 @@
#include <stddef.h>
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 int memcmp(const void *s1, const void *s2, size_t n);