Advertisement
Neveles

Untitled

Dec 13th, 2019
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. float floatNumber;
  6.  
  7. void foo(int& num)
  8. {
  9.     int x;
  10.  
  11.     _asm
  12.     {
  13.         finit
  14.  
  15.         fstcw x
  16.         not x
  17.         or x, 1
  18.         not x
  19.  
  20.         fldcw x
  21.         fldz
  22.         fldz
  23.         fdiv
  24.         fstp floatNumber
  25.     }
  26. }
  27.  
  28. int main()
  29. {
  30.     float x, y, z;
  31.     cin >> x >> y >> z;
  32.  
  33.     _asm
  34.     {
  35.         finit
  36.         fld x
  37.         fld y
  38.         fadd
  39.         fld z
  40.         fadd
  41.         fstp z
  42.     }
  43.  
  44.     cout << "Summ: " << z << endl;
  45.     int divider = 0;
  46.     foo(divider);
  47.     cout << floatNumber;
  48.     return 0;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement