summaryrefslogtreecommitdiff
path: root/memdump/memcpy.S
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-09-21 16:52:35 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-09-21 16:52:35 -0700
commit5a16eeb519c87fa4c437e838af81731b8d355052 (patch)
treef59258a720429d5ad8beaf2070f73cab6a187077 /memdump/memcpy.S
parent31daeb2ddb972dc70b929da1c93288e821c87ed7 (diff)
downloadsyslinux-5a16eeb519c87fa4c437e838af81731b8d355052.tar.gz
memdump: a debugging utility to dump memory over a serial port
A memory-dumping utility which runs in real mode. Thus, it can be used to get memory dumps from a relatively pristine system.
Diffstat (limited to 'memdump/memcpy.S')
-rw-r--r--memdump/memcpy.S23
1 files changed, 23 insertions, 0 deletions
diff --git a/memdump/memcpy.S b/memdump/memcpy.S
new file mode 100644
index 00000000..76eef73c
--- /dev/null
+++ b/memdump/memcpy.S
@@ -0,0 +1,23 @@
+#
+# memcpy.S
+#
+# Simple 16-bit memcpy() implementation
+#
+
+ .text
+ .code16gcc
+ .globl memcpy
+ .type memcpy, @function
+memcpy:
+ cld
+ pushw %di
+ pushw %si
+ movw %ax,%di
+ movw %dx,%si
+ # The third argument is already in cx
+ rep ; movsb
+ popw %si
+ popw %di
+ ret
+
+ .size memcpy,.-memcpy