This repository has been archived on 2024-01-18. You can view files and clone it, but cannot push or open issues or pull requests.
OS_Project/Part2/A4/08_shell/libc/mem.c

14 lines
281 B
C
Raw Normal View History

2023-09-11 18:28:11 +00:00
#include "mem.h"
void memory_copy(u8 *source, u8 *dest, int nbytes) {
int i;
for (i = 0; i < nbytes; i++) {
*(dest + i) = *(source + i);
}
}
void memory_set(u8 *dest, u8 val, u32 len) {
u8 *temp = (u8 *)dest;
for ( ; len != 0; len--) *temp++ = val;
}