aboutsummaryrefslogtreecommitdiff
path: root/S/str_diff.S
diff options
context:
space:
mode:
Diffstat (limited to 'S/str_diff.S')
-rw-r--r--S/str_diff.S22
1 files changed, 22 insertions, 0 deletions
diff --git a/S/str_diff.S b/S/str_diff.S
new file mode 100644
index 0000000..a90724e
--- /dev/null
+++ b/S/str_diff.S
@@ -0,0 +1,22 @@
+.globl str_diff
+.type str_diff, @function
+str_diff:
+ pushl %edi
+ pushl %esi
+ movl 12(%esp), %esi
+ movl 16(%esp), %edi
+.L1:
+ lodsb
+ scasb
+ jne .L2
+ testb %al,%al
+ jne .L1
+ xorl %eax,%eax
+ jmp .L3
+.L2:
+ sbbl %eax,%eax
+ orb $1,%al
+.L3:
+ popl %esi
+ popl %edi
+ ret