plan9fox/sys/src/libc/amd64/strlen.s

17 lines
162 B
ArmAsm
Raw Normal View History

2014-02-01 09:31:41 +00:00
TEXT strlen(SB),$0
MOVL $0, AX
MOVQ $-1, CX
CLD
/*
* look for end of string
*/
MOVQ RARG, DI
REPN; SCASB
MOVQ DI, AX
SUBQ RARG, AX
SUBQ $1, AX
RET