/* * Written by J.T. Conklin . * Public domain. * Adapted for NetBSD/x86_64 by Frank van der Linden */ #include ENTRY(strlen) cld /* set search forward */ xorl %eax,%eax /* set search for null terminator */ movq $-1,%rcx /* set search for lots of characters */ repne /* search! */ scasb notq %rcx /* get length by taking complement */ leaq -1(%rcx),%rax /* and subtracting one */ ret