global length_func section .data testasd dq 0 section .text length_func: sub rsp, 8 ;enter mov r10, rdi _loop67865432: mov r9b, [rdi] cmp r9b, 0 jz _exitloop4323567 inc rdi jmp _loop67865432 _exitloop4323567: sub rdi, r10 mov rax, rdi add rsp, 8 ;exit ret