
While i'm learning about the development of win32api applications i'm also having fun with simple creation of functions and adding this to a library :P. My approach is treat this function calls like the ones of the win32 api: trashing and preserving the same registers of this api. Here it is the first work of this project, which btw, is just for fun and learning and practice assembly programming leaving for a moment the win32api world:
This function returns the length of a zero terminated string in eax, the param to the function will be a pointer to the string:
.386
.model flat,stdcall
option casemap:none
public strlen@4
.code
align 4
strlen@4:
push ebp
mov ebp,esp
mov edx,[ebp+8] ; Address of the string.
xor eax,eax
align 4
strloop:
cmp byte ptr[edx],0
je endloop
inc edx
inc eax
jmp strloop
align 4
endloop:
mov esp,ebp
pop ebp
ret 4
end
Attached are the lib and the obj files, just for the curious. Those of you (probably the majority here :redface:) know this things better than me (actually this is my first lib

). Btw, i downloaded and installed the build tools (not the ide) of the vs2017 (just a few files, with developer command prompts with enviromental variables and path set just for the momment of use, and for x86 and x64 with ml and ml64). I like it :icon_cool:. Here are the command lines that i used:
ml /c /coff uno.asm
and then
lib /out:lib0.lib uno.obj
. I know that this is not new for those of you (you all know who you are) but i post this here for anyone who want to destroy all this with some cool optimized code, or a better method or aproach for the construction of a library with assembly functions. :t