# ----------------------------------------------------------------------------------------1#2# From https://cs.lmu.edu/~ray/notes/gasexamples/3#4# Writes "Hello, World" to the console using only system calls. Runs on 64-bit Linux only.5# To assemble and run:6#7# gcc -c hello.s && ld hello.o && ./a.out8#9# ----------------------------------------------------------------------------------------1011.global _start1213.text14_start:15# write(1, message, 13)16mov $1, %rax # system call 1 is write17mov $1, %rdi # file handle 1 is stdout18mov $message, %rsi # address of string to output19mov $13, %rdx # number of bytes20syscall # invoke operating system to do the write2122# exit(0)23mov $60, %rax # system call 60 is exit24xor %rdi, %rdi # we want return code 025syscall # invoke operating system to exit26message:27.ascii "Hello, world\n"282930