summaryrefslogtreecommitdiff
path: root/sys/src/ape/lib/ap/68020/memchr.s
diff options
context:
space:
mode:
authorTaru Karttunen <taruti@taruti.net>2011-03-30 15:46:40 +0300
committerTaru Karttunen <taruti@taruti.net>2011-03-30 15:46:40 +0300
commite5888a1ffdae813d7575f5fb02275c6bb07e5199 (patch)
treed8d51eac403f07814b9e936eed0c9a79195e2450 /sys/src/ape/lib/ap/68020/memchr.s
Import sources from 2011-03-30 iso image
Diffstat (limited to 'sys/src/ape/lib/ap/68020/memchr.s')
-rwxr-xr-xsys/src/ape/lib/ap/68020/memchr.s15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/src/ape/lib/ap/68020/memchr.s b/sys/src/ape/lib/ap/68020/memchr.s
new file mode 100755
index 000000000..ea2584df8
--- /dev/null
+++ b/sys/src/ape/lib/ap/68020/memchr.s
@@ -0,0 +1,15 @@
+ TEXT memchr(SB),$0
+ MOVL n+8(FP),R0
+ BEQ ret
+ MOVL s1+0(FP),A1
+ MOVL c+4(FP),R1
+
+l1: CMPB R1,(A1)+
+ BEQ eq
+ SUBL $1,R0
+ BNE l1
+ RTS
+
+eq: MOVL A1,R0
+ SUBL $1,R0
+ret: RTS