Created
April 21, 2012 10:07
-
-
Save timofurrer/2436316 to your computer and use it in GitHub Desktop.
Minimal Assembly "Hello World"
This file contains hidden or 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
.data | |
hello: | |
.string "Hallo, Welt!\n" | |
.text | |
.global _start | |
_start: | |
movl $4, %eax /* write() */ | |
movl $1, %ebx /* 1 = stdout */ | |
movl $hello, %ecx /* Adresse von hello */ | |
movl $13, %edx /* Länge des Strings */ | |
int $0x80 /* trap, Syscall absetzen */ | |
movl $1, %eax /* _exit() */ | |
movl $0, %ebx /* Status: 0 */ | |
int $0x80 |
This file contains hidden or 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
as -o asm.o asm.s; ld -o asm asm.o; strip asm; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment