/* hello-amd64.S : example of using int 0x80 to do Linux syscalls */ /* * gcc -nostdlib -static hello-amd64.S -o hello */ #define STDIN_FILENO 0 #define STDOUT_FILENO 1 #define STDERR_FILENO 2 #define SYS_EXIT 60 #define SYS_WRITE 1 .text .globl _start _start: mov $SYS_WRITE, %rax mov $STDOUT_FILENO, %rdi mov $hello_world, %rsi mov $hello_world_len, %rdx syscall mov $SYS_EXIT, %rax xor %rdi, %rdi syscall 1: hlt jmp 1b .data hello_world: .ascii "Hello World\n" hello_world_len = . - hello_world