Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int _start() {
- volatile char x;
- asm volatile (
- "movl $3, %%eax\n"
- "movl $0, %%ebx\n"
- "movl %%esp, %%ecx\n"
- "movl $1, %%edx\n"
- "int $0x80\n"
- :
- :"g" (&x), "g" (sizeof(x))
- :"esp", "eax", "ebx", "ecx", "edx");
- while (x != 0) {
- if (x - 'a' < 'z') {
- x = x - 'a' + 'A';
- }
- asm volatile (
- "movl 4, %%eax\n"
- "movl $1, %%ebx\n"
- "movl %%esp, %%ecx\n"
- "movl $1, %%edx\n"
- "int $0x80\n"
- :
- :"g" (&x), "g" (sizeof(x))
- :"esp", "eax", "ebx", "ecx", "edx");
- asm volatile (
- "movl $3, %%eax\n"
- "movl $0, %%ebx\n"
- "movl %%esp, %%ecx\n"
- "movl $1, %%edx\n"
- "int $0x80\n"
- :
- :"g" (&x), "g" (sizeof(x))
- :"esp","eax", "ebx", "ecx", "edx");
- }
- asm volatile (
- "movl $1, %%eax\n"
- "xorl %%ebx, %%ebx\n"
- "int $0x80\n"
- :
- :
- :"eax", "ebx");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement