aboutsummaryrefslogtreecommitdiff
path: root/S/str_chr.S
diff options
context:
space:
mode:
authorKlaatu <[email protected]>2015-05-17 15:33:21 +1200
committerKlaatu <[email protected]>2015-05-17 15:33:21 +1200
commitb0de699679e8f1e39af847ed172d1ba605b4370c (patch)
tree01dac00471d61f727394e508c613b29cff0ceae5 /S/str_chr.S
bulk upload of source
Diffstat (limited to 'S/str_chr.S')
-rw-r--r--S/str_chr.S17
1 files changed, 17 insertions, 0 deletions
diff --git a/S/str_chr.S b/S/str_chr.S
new file mode 100644
index 0000000..5fec8b2
--- /dev/null
+++ b/S/str_chr.S
@@ -0,0 +1,17 @@
+.globl str_chr
+.type str_chr, @function
+str_chr:
+ pushl %esi
+ movl 8(%esp), %esi
+ movb 12(%esp), %ah
+.L1:
+ lodsb
+ cmpb %ah,%al
+ je .L2
+ testb %al,%al
+ jne .L1
+.L2:
+ leal -1(%esi), %eax
+ subl 8(%esp), %eax
+ popl %esi
+ ret