I just started learning assembly ( < 1 week, so please forgive me if this is stupid), but I can't seem to figure out why this code won't produce an output:
section .data
message db "Hello World!",10
section .text
global _start
_start:
mov rax,1
mov rdi,1
mov rsi,message
mov rdx,14
syscall
mov rax,60
mov rdi,0
syscall
I was following this online tutorial, along with a few others, but I can't seem to figure out why there isn't any output. It assembles and links without error (console input is: nasm -f elf64 hello.asm -o hello.o, followed by: ld hello.o -o hello. When ran, it takes a second, and then a new prompt appears).
I am on windows, which was all that I could find online for what the cause might be, but could not find a solution. I have tried using -f win64 followed by link.exe hello.obj /entry:_start /subsystem:console I have also swapped subsystem:console for subsystem:windows just in case, to no avail. I am completely lost, and all help is greatly appreciated. Thank you!
P.S. If being on windows is the problem, is there a good guide online for nasm on windows. (I have tried masm and using as, but keep running into problems with them so I decided to opt for nasm)