Created
September 17, 2014 00:43
-
-
Save anonymous/1358f69b8d0c8a2ce803 to your computer and use it in GitHub Desktop.
test.c
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
char* str = "Hello world!\n"; | |
void print(){ | |
asm( "mov $13, %%edx \n\t" | |
"mov %0, %%ecx \n\t" | |
"mov $0, %%ebx \n\t" | |
"mov $4, %%eax \n\t" | |
"int $0x80 \n\t" | |
::"r"(str):"edx", "ecx", "ebx"); | |
} | |
void exit(){ | |
asm( "mov $42, %ebx \n\t" | |
"mov $1, %eax \n\t" | |
"int $0x80 \n\t" ); | |
} | |
void nomain(){ | |
print(); | |
exit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment