From 05b7131310d552c1d020061ee66147fb4e85b431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20A=2E=20Ortega?= Date: Fri, 3 Jun 2016 02:35:31 +0200 Subject: [PATCH] Added comments. --- .gitignore | 3 +++ src/HelloWorld.asm | 18 +++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..779710c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Ignore binaries +*.o +helloworld diff --git a/src/HelloWorld.asm b/src/HelloWorld.asm index 6501f07..7c3e3d3 100644 --- a/src/HelloWorld.asm +++ b/src/HelloWorld.asm @@ -1,17 +1,17 @@ .section .data hello: - .ascii "Hello, World.\n" + .ascii "Hello, World.\n" # the string .section .text .global _start _start: - mov $1, %rax - mov $1, %rdi - mov $hello, %rsi - mov $14, %rdx - syscall + mov $1, %rax # Define write syscall + mov $1, %rdi # Define stdout + mov $hello, %rsi # Give string + mov $14, %rdx # Give size of the string + syscall # Call the kernel to do work for us - mov $60, %rax - xor %rdi, %rdi - syscall + mov $60, %rax # Define exit syscall + xor %rdi, %rdi # Give return value + syscall # Call the kernel to do work for us