aboutsummaryrefslogtreecommitdiff
path: root/S/str_len.S
diff options
context:
space:
mode:
Diffstat (limited to 'S/str_len.S')
-rw-r--r--S/str_len.S11
1 files changed, 11 insertions, 0 deletions
diff --git a/S/str_len.S b/S/str_len.S
new file mode 100644
index 0000000..ba3fa7e
--- /dev/null
+++ b/S/str_len.S
@@ -0,0 +1,11 @@
+.globl str_len
+.type str_len, @function
+str_len:
+ movl 4(%esp), %ecx
+ orl $-1, %eax
+.L1:
+ incl %eax
+ cmpb $0, (%ecx, %eax)
+ jne .L1
+
+ ret