For educational purposes, I am trying to create a (32-bit) exe on Windows from assembly code that does not rely on the standard C library or Windows DLLs.
I can create a program that starts to run (and that I am able to debug with gdb) however I am not sure how to cleanly exit the program. All tutorials either link to the standard C library and define a main
function or use the ExitProcess
WinAPI call which is defined in a DLL.
On 32-Bit Linux, I'd use the int 0x80
instruction with the exit
syscall. Apparently, Windows does not meaningfully implement these interrupts.
So, is there a way to cleanly return from my program?