Last active
February 22, 2025 14:37
-
-
Save YujiSoftware/88b5b2ba77dad3fab8286fbe9b0d7b46 to your computer and use it in GitHub Desktop.
Hello world! (by x86-64)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NAME = hello.bin | |
CC = gcc | |
SRCS = hello.S | |
OBJS = $(SRCS:.S=.o) | |
$(NAME) : $(OBJS) | |
$(LD) -e main -o $(NAME) $(OBJS) | |
clean : | |
$(RM) $(OBJS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use
make
./hello.bin