By Ksbunker
Was bored so decided to write my own String Length function for NULL terminated strings. Hopefully willspark some interest in this ASM subsection, it's almost dead ;-P!
Code:
szLength PROC uses ESI ECX lpString:DWORD
xor eax, eax
mov ecx, lpString
mov esi, lpString
@@:
inc esi
cmp byte ptr [esi], 0
jnz @B
sub esi, ecx
xchg eax, esi
ret
szLength ENDP