File:  [DVB] / dietlibc / i386 / strncmp.S
Revision 1.5: download - view: text, annotated - select for diffs
Wed Oct 15 15:32:09 2003 UTC (20 years, 7 months ago) by sanjiyan
Branches: MAIN
CVS tags: HEAD
fixing memccpy,memcmp,strncmp (reported by Gernot Tenchio)
fixing strtoXXX (Gernot Tenchio, patch modified)
fixing the *scanf return behavior (reported by Enrico Scholz)

.text
.global strncmp
.type	strncmp,function
strncmp:
	pushl	%esi
	pushl	%edi
	movl	%esp,%ecx
	movl	12(%ecx),%esi
	movl	16(%ecx),%edi
	movl	20(%ecx),%ecx
	jecxz	.Lequal
.Lloop:
	movzbl	(%esi),%eax
	movzbl	(%edi),%edx
	incl	%esi
	incl	%edi
	/* !equal ? */
	subl	%edx,%eax
	jnz	.Lout
	/* end of c-string ? */
	test	%edx,%edx
	jz	.Lequal
	/* do loop */
	decl	%ecx
	jnz	.Lloop

.Lequal:
	xorl	%eax,%eax
.Lout:
	popl %edi
	popl %esi
	ret
.size	strncmp,.-strncmp

LinuxTV legacy CVS <linuxtv.org/cvs>