I briefly toyed with the x64 code posted here two years ago.
https://forums.freebsd.org/threads/assembly-simple-hello-world.53274/#post-299339
I tried it again today after reading a post by user ahev.
Now I get an error.
Here's the code:
No idea why I'm getting invalid output.
https://forums.freebsd.org/threads/assembly-simple-hello-world.53274/#post-299339
I tried it again today after reading a post by user ahev.
Now I get an error.
$ nasm -f elf64 hello.asm
$ ld hello.o -o hello
$ ./hello
ELF binary type "0" not known.
Here's the code:
Code:
%include 'system.inc'
section .data
hello db 'Hello, World!', 0Ah
hbytes equ $-hello
section .text
global _start
_start:
mov rdx, dword hbytes
mov rsi, dword hello
mov rdi, 1
mov rax, SYS_write
syscall
push dword 0
sys.exit
No idea why I'm getting invalid output.