Added source files.

This commit is contained in:
Nicolás A. Ortega 2016-06-03 02:16:13 +02:00
commit d246f09f37
No known key found for this signature in database
GPG Key ID: 4825F773B8D44EFF
2 changed files with 31 additions and 0 deletions

14
Makefile Normal file
View File

@ -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)

17
src/HelloWorld.asm Normal file
View File

@ -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