summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/i386/memcmp.S
blob: aa6d55f239fe00e7d51e8efda0e29fa940debf6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
.text
.align 0 
.global memcmp
.type	 memcmp,@function
memcmp:
	xorl %eax,%eax
	orl 12(%esp),%eax
	jz .Lempty
	pushl %esi
	pushl %edi
	movl 12(%esp),%esi
	movl 16(%esp),%edi
	movl %eax,%ecx

	rep cmpsb

	decl %esi
	decl %edi
	lodsb
	subb (%edi), %al
	movsx %al, %eax

	popl %edi
	popl %esi
.Lempty:
	ret