I am learning assembly language, and want to make a function that will be compiled into a DLL file, My assembler is NASM, and linker is GoLink. I want the DLL file's functions to be able to be called from VB6, and I know VB6 is only able to use STDCALL functions directly. I remember reading that in STDCALL, there are certain registers that must be preserved, so that when the function is finished, the final state is the same as the initial state. I also remember reading that with CDECL the function is not required to preserve all of these registers (but I think it is required to preserve some of them), and the caller must know to return everything to its initial state before the function was called. Can you tell me exactly what must be preserved, and what is not required to be, for each of these calling conventions?
I need to know EXACTLY what must be preserved by the called function (and what doesn't need to be), in each of these 2 calling conventions, because when writing in assembly code, you are writing every executed instruction by hand. This is different than a language like C++ where the compiler automatically creates the required assembly code from the higher level instructions, based on the compiler settings you use to set the calling convention.
I need to know EXACTLY what must be preserved by the called function (and what doesn't need to be), in each of these 2 calling conventions, because when writing in assembly code, you are writing every executed instruction by hand. This is different than a language like C++ where the compiler automatically creates the required assembly code from the higher level instructions, based on the compiler settings you use to set the calling convention.