I am writing a program in NASM, and I do not want to link it with the CRT, and so I will specify the entry point (which will be the Win32 entry point). This is the program source code:
global _myEntryPoint
section .text
_myEntryPoint:
mov eax, 12345
Now this is what I know about the Win32 entry point (please correct me if I am wrong):
- The Win32 entry point does not return a value like a normal
function does (to exit the Win32 entry point I have to call
ExitProcess()
). - The Win32 entry point does not take any arguments.
Now what I don't know is the following:
- Does the Win32 entry point have to preserve any registers values (callee-saved registers)? I think the answer is No, since when the Win32 entry point exits, it terminates the process and not return execution to a function that expects some registers values to be preserved.