reference:https://www.wikihow.com/Run-NASM-on-Windows
1.首先下载并安装nasm
下载地址:NASM
2.将nasm.exe所在的根目录加到环境变量的PATH下
3.创建文件hello.asm并在文件中加入如下代码
global _main
extern _printf
section .text
_main:
push message
call _printf ;调用C的printf
add esp,4
ret
message:
db 'hello,world',10,0
4.进入cmd将hello.asm汇编成中间文件
nasm -f win32 hello.asm
5.将hello.obj转化为windows下的可执行文件
gcc hello.obj -o hello