Skip to content

Instantly share code, notes, and snippets.

@malfet
Created August 30, 2020 14:15
Show Gist options
  • Save malfet/d162075055bcd6f51edac2647d15ffe9 to your computer and use it in GitHub Desktop.
Save malfet/d162075055bcd6f51edac2647d15ffe9 to your computer and use it in GitHub Desktop.
HelloWorld in x86_64 assembly
# as -o hello.o hello.S ; cc -o hello hello.o -nostdlib
.text
.globl _start
.type _start, @function
_start:
movl $1, %eax # sys_write(
movl $1, %edi # fd = stdout,
movl $.LC0, %esi # buf = LC0,
movl $12, %edx # 12);
syscall
mov $60, %eax # sys_exit(
mov $0, %edi # 0);
syscall
.LC0:
.string "Hello World\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment