Last active
December 15, 2015 20:40
-
-
Save c33k/5320050 to your computer and use it in GitHub Desktop.
Assembly codes and Exercises
This file contains 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
#A Hello World in assembly language - linux x86 - by Vivek-Ramachandran | |
#compile it with the commands bellow: | |
# | |
# as -o HelloWorld.o HelloWorld.s | |
# ld -o HelloWorld HelloWorld.o | |
.data | |
HelloWorld: | |
.ascii "Hello world!\n" | |
.text | |
.globl _start | |
_start: | |
#load arguments for syscall write (number 4. You can check it with >>> cat /usr/include/unistd.h) | |
#write( index, buffer, size ) | |
movl $4, %eax | |
movl $1, %ebx | |
movl $HelloWorld, %ecx | |
movl $13, %edx #13 bytes | |
int $0x80 | |
#exit(0) | |
movl $1, %eax | |
movl $0, %ebx | |
int $0x80 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment