Tranvick

asm

Jun 4th, 2013
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     char s[100];
  7.     cin.getline(s, 100);
  8.     _asm {
  9.         lea edi, s
  10. _loop1:
  11.         cmp byte ptr [edi], ' '
  12.         je _end_loop1
  13.         inc edi
  14.         jmp _loop1
  15. _end_loop1:
  16.         inc edi
  17.         mov esi, edi
  18.  
  19. _loop2:
  20.         cmp byte ptr [esi], ' '
  21.         jne _end_loop2
  22.         inc esi
  23.         jmp _loop2
  24. _end_loop2:
  25.  
  26.         push esi
  27.         xor ecx, ecx
  28. _loop3:
  29.         inc ecx
  30.         cmp byte ptr [esi], 0
  31.         je _end_loop3
  32.         inc esi
  33.         jmp _loop3
  34. _end_loop3:
  35.         pop esi
  36.         cld
  37.         repne movsb
  38.     }
  39.     cout << s << endl;
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment