写“你好世界!”在 nasm

问题描述 投票:0回答:1

每当我尝试运行 hello.exe 时,都会等待一秒钟然后结束而不写入任何内容。

源代码:

global start
section .text
    start:
        mov rax,1
        mov rdi,1
        mov rsi,msg
        mov rdx,13
        syscall
        mov rax,60
        xor rdi,rdi
        syscall
section .data
    msg:db "Hello World!",10

编译命令:

../../../bin/NASM/nasm.exe -f win64 hello.asm

../../../bin/Golink/Golink.exe /console hello.obj
macos nasm
1个回答
0
投票

源代码适用于 Linux 机器,但您使用的是 Windows (

win64
)。

© www.soinside.com 2019 - 2024. All rights reserved.