在nasm中编译后无法运行exe文件

时间:2019-10-16 21:17:34

标签: windows assembly x86 windows-10 nasm

我试图在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

0 个答案:

没有答案