I'd like to write super simple Hello World Win32
program in assembly
using the printf
to compile with ml
and link
provided with my MSVC
.
Here is the code I've written so far:
.386
.model flat, stdcall
option casemap :none
EXTERN printf :PROC ; declare printf
.data
HelloWorld db "Hello World!\n"
.code
main:
push offset HelloWorld
call printf
ret
end main
I'm compiling it like that:
ml.exe /c HelloWorld.asm
And then linking:
link HelloWorld.obj libcmt.lib
without any problems BUT when i run it (under the PowerShell
) the program doesn't display ANYTHING!
What's wrong whit the code and how to correct it to work?