Advertisement
wingman007

C++InlineAsm

Dec 14th, 2018
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     std::cout << "Hello, world!\n";
  7.     char answer = 0;
  8.     // cin >> answer;
  9.  
  10.     int x = 4;
  11.     int y = 3;
  12.  
  13.     __asm {
  14.         mov EAX, x
  15.         add eax, y
  16.         mov y, eax
  17.     }
  18.  
  19.     std::cout << "x + y = " << y << "\n";
  20.     cin.get();
  21.  
  22. }
  23.  
  24.  
  25. /*
  26. #include<iostream>
  27. using namespace std;
  28.  
  29. int main()
  30. {
  31.     std::cout << "Hello, world!\n";
  32.     char answer = 0;
  33.     cin >> answer;
  34. }
  35.  
  36. 4
  37.  
  38. obraten (10^1 -1 ) - 4 = 9 - 4 = 5
  39.  
  40. dopxlnitelen = obraten + 1
  41.  
  42. 3456
  43.  
  44. (10^4 -1 ) - 3456 = (10000 - 1) - 3456 = 9999 - 3456 = 6543
  45.  
  46.  
  47. 111111
  48. 101100
  49.  
  50.  
  51. 7 - 4 = 3
  52.  
  53.  
  54. 7 - 4 => 7 + 6 = 1| 3
  55.  
  56.  
  57. 7 - 8 = -1
  58.  
  59.  
  60. 7 - 8 => 7 + 2 = 9  => -1
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement