Skip to content

Instantly share code, notes, and snippets.

@YujiSoftware
Last active February 22, 2025 14:37
Show Gist options
  • Save YujiSoftware/88b5b2ba77dad3fab8286fbe9b0d7b46 to your computer and use it in GitHub Desktop.
Save YujiSoftware/88b5b2ba77dad3fab8286fbe9b0d7b46 to your computer and use it in GitHub Desktop.
Hello world! (by x86-64)
.global main
main:
mov $1, %rax
mov $1, %rdi
mov $str, %rsi
mov $13, %rdx
syscall
mov $60, %rax
mov $0, %rdi
syscall
.section .rodata
str:
.string "Hello World!\n"
NAME = hello.bin
CC = gcc
SRCS = hello.S
OBJS = $(SRCS:.S=.o)
$(NAME) : $(OBJS)
$(LD) -e main -o $(NAME) $(OBJS)
clean :
$(RM) $(OBJS)
@YujiSoftware
Copy link
Author

How to use

  1. make
  2. ./hello.bin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment