commit d246f09f3710980aa19296377afad8939b72d342 Author: Nicolás A. Ortega Date: Fri Jun 3 02:16:13 2016 +0200 Added source files. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..12500a5 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +AS=as +LINKER=ld +OBJ=src/HelloWorld.o + +%.o: %.asm + $(AS) -o $@ $< + +helloworld: $(OBJ) + $(LINKER) -o $@ $^ + +.PHONY: clean + +clean: + rm $(OBJ) diff --git a/src/HelloWorld.asm b/src/HelloWorld.asm new file mode 100644 index 0000000..6501f07 --- /dev/null +++ b/src/HelloWorld.asm @@ -0,0 +1,17 @@ +.section .data + hello: + .ascii "Hello, World.\n" + +.section .text + .global _start + +_start: + mov $1, %rax + mov $1, %rdi + mov $hello, %rsi + mov $14, %rdx + syscall + + mov $60, %rax + xor %rdi, %rdi + syscall