aboutsummaryrefslogtreecommitdiff
path: root/S/str_copy.S
diff options
context:
space:
mode:
Diffstat (limited to 'S/str_copy.S')
-rw-r--r--S/str_copy.S18
1 files changed, 18 insertions, 0 deletions
diff --git a/S/str_copy.S b/S/str_copy.S
new file mode 100644
index 0000000..c24dbac
--- /dev/null
+++ b/S/str_copy.S
@@ -0,0 +1,18 @@
+.globl str_copy
+.type str_copy, @function
+str_copy:
+ pushl %edi
+ pushl %esi
+ movl 12(%esp), %edi
+ movl 16(%esp), %esi
+.L1:
+ lodsb
+ stosb
+ testb %al,%al
+ jne .L1
+
+ leal -1(%edi), %eax
+ subl 12(%esp), %eax
+ popl %esi
+ popl %edi
+ ret