Writing "Hello World!" in NASM

100 views Asked by At

Whenever I try to run it, "hello.exe" waits a second then ends without writing anything.

Source code:

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

Compile command:

../../../bin/NASM/nasm.exe -f win64 hello.asm
../../../bin/Golink/Golink.exe /console hello.obj
1

There are 1 answers

0
Ben A. On

The source code is intended for Linux machines, but you are on a Windows (win64).