Ubuntu 18.4
nasm -f -elf64 hello.asm, ld -s -o hello hello.o
section .text ;must be declared for linker (ld)
global _start ;tell linker entry point
_start:
mov edx, len ;message length
mov ecx, msg ;message to write
mov eax, 1 ;file descriptor (stdout)
mov eax, 4 ;system call number (sys_write)
int 0x80 ; call kernel
mov eax, 1 ;system call number (sys_exit)
int 0x80 ; call kernel
section .data
msg db 'Hello, world!',0xa
len equ $ - msg
不得不说汇编的hello尺寸小啊