Added comments.

This commit is contained in:
Nicolás A. Ortega 2016-06-03 02:35:31 +02:00
parent 30ea53452e
commit 05b7131310
No known key found for this signature in database
GPG Key ID: 4825F773B8D44EFF
2 changed files with 12 additions and 9 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# Ignore binaries
*.o
helloworld

View File

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