shithub: riscv

ref: d0ae2e369e0221e796f4b58255b21ce3592d80dc
dir: /sys/src/libc/386/strlen.s/

View raw version
	TEXT	strlen(SB),$0

	MOVL	$0, AX
	MOVL	$-1, CX
	CLD
/*
 * look for end of string
 */

	MOVL	p+0(FP), DI
	REPN;	SCASB

	MOVL	DI, AX
	SUBL	p+0(FP), AX
	SUBL	$1, AX
	RET