strlen() isn't easy to re-write in assembly
... at least not for me. I'm still a beginner at this assembly lark (well, x86 assembly at least).
Basically I'm trying to write my own strlen (for nothing more than educational purposes) but I, well, can't. I'm going over array access here:
(Have to put up with his terrible english).
So I want to load the first character of the argument stri into a register, is this the right way to go about it?:
I've stepped through it and bl does indeed get loaded with 'm' (oh, I pass the string "my name is LEEEEEEEEE") but I want to iterate it just to make sure. So I need to inc bl each time to access the next element, right?
_declspec(naked) int StringLen(char* stri)
mov ebp, esp
mov [l], 0
mov eax, [stri]
mov bl, byte ptr [eax]
mov esp, ebp
lea eax, [l]