Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- char s[] = "Hello worlds";
- asm volatile(
- ".intel_syntax noprefix;"
- "mov eax,%0;"
- "xor ebx,ebx;"
- "xor ecx,ecx;"
- "Petla:"
- "mov ebx,[eax];"
- "cmp ebx,0;"
- "je setbegin;"
- "push ebx;"
- "inc eax;"
- "inc ecx;"
- "jmp Petla;"
- "setbegin:"
- "mov eax,%0;"
- "jmp zdejmij;"
- "zdejmij:"
- "pop [eax];"
- "ecx,1;"
- "je koniec;"
- "inc eax;"
- "dec ecx;"
- "jmp zdejmij;"
- "koniec:"
- ".att_syntax prefix;"
- :
- :"r"(s)
- :"eax","ebx","ecx","al"
- );
- printf("%s \n",s);
- return 0;
- }
- ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement