aboutsummaryrefslogtreecommitdiff
path: root/src/memory
diff options
context:
space:
mode:
Diffstat (limited to 'src/memory')
-rw-r--r--src/memory/memory.c16
-rw-r--r--src/memory/memory.h6
2 files changed, 22 insertions, 0 deletions
diff --git a/src/memory/memory.c b/src/memory/memory.c
new file mode 100644
index 0000000..3524787
--- /dev/null
+++ b/src/memory/memory.c
@@ -0,0 +1,16 @@
+#include "../graphics/vga.h"
+
+unsigned char *memory_copy(unsigned char *dest, const unsigned char *src, int count) {
+ // TODO: Add memory copy function
+}
+
+unsigned char *memory_set(unsigned char *dest, unsigned char val, int count) {
+ unsigned char *p = dest;
+ while (count > 0) {
+ if (!*p) break;
+ *p = val;
+ p++;
+ count--;
+ }
+ return dest;
+}
diff --git a/src/memory/memory.h b/src/memory/memory.h
new file mode 100644
index 0000000..9e2374d
--- /dev/null
+++ b/src/memory/memory.h
@@ -0,0 +1,6 @@
+#ifndef MELVIX_MEMORY_H
+#define MELVIX_MEMORY_H
+
+unsigned char *memory_set(unsigned char *dest, unsigned char val, int count);
+
+#endif