我试图在Win 10 x64计算机上安装nasm软件并运行一些简单代码。
我成功编译并链接了它:
nasm -f win32 hello.asm -o hello.obj
ld hello.obj -o hello.exe c:\windows\system32\msvcrt.dll
在尝试打开exe文件时,它没有运行。有消息:this app cannot run on your pc
,在控制台中有:Permission denied
。
另外,在其他环境中工作时,我也没有类似的问题。也许代码有问题,但是我不这么认为...
[bits 32]
extern _puts
section .data
hello:
db "Hello world!", 0xa,0
section .text
_WinMain@16:
push hello
call _puts
add esp,4
xor eax, eax
ret