summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/lib/memcmp.S
blob: c60b170bb14cf203ed978d9612ad48f4d0705cac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
	.text
	.code	32
	.globl	memcmp
memcmp:
	cmp	r2, #0
	beq	zero_len_out
	mov	r3, r0
1:	ldrb	r0, [r3], #1
	ldrb	r12, [r1], #1
	subs	r0, r0, r12
	bxne	lr
	subs	r2, r2, #1
	bne	1b
	bx	lr

zero_len_out:
	mov	r0, #0
	bx	lr