File:  [MW Coherent from dump] / coherent / b / lib / libc / string / i386 / strlen.s
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:35 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

//////////
/ libc/string/i386/strlen.s
/ i386 C string library.
/ ANSI 4.11.6.3.
//////////

//////////
/ size_t
/ strlen(char *String)
/
/ Find length of String.
//////////

String	.equ	8

	.globl	strlen

strlen:
	push	%edi

	movl	%edi, String(%esp)	/ String address to EDI
	movl	%ecx, $-1		/ Max count to ECX
	subb	%al, %al		/ NUL to AL
	cld
	repne
	scasb				/ Scan to NUL
	movl	%eax, $-2
	subl	%eax, %ecx		/ Return length in EAX

	pop	%edi
	ret

/ end of libc/string/i386/strlen.s

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.