summaryrefslogtreecommitdiff
path: root/memdump/memset.S
diff options
context:
space:
mode:
Diffstat (limited to 'memdump/memset.S')
-rw-r--r--memdump/memset.S21
1 files changed, 21 insertions, 0 deletions
diff --git a/memdump/memset.S b/memdump/memset.S
new file mode 100644
index 00000000..86e12ab2
--- /dev/null
+++ b/memdump/memset.S
@@ -0,0 +1,21 @@
+#
+# memset.S
+#
+# Minimal 16-bit memset() implementation
+#
+
+ .text
+ .code16gcc
+ .globl memset
+ .type memset, @function
+memset:
+ cld
+ pushw %di
+ movw %ax,%di
+ movb %dl,%al
+ # The third argument is already in %cx
+ rep ; stosb
+ popw %di
+ retl
+
+ .size memset,.-memset