Advertisement
nibibibi

Untitled

Nov 30th, 2022
846
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | Software | 0 0
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5.     double array[10];
  6.     for (int i = 0; i < 10; i++) {
  7.         std::cout << "Enter " << i + 1 << "th value " << std::endl;
  8.         if (!(scanf_s("%lf", &array[i]))) {
  9.             std::cout << "Wrong input." << std::endl;
  10.             fseek(stdin, 0, SEEK_END);
  11.             i -= 1;
  12.         }
  13.     }
  14.     int mas_size = 10 * sizeof(double);
  15.     int double_size = sizeof(double);
  16.     _asm {
  17.         finit
  18.         xor esi, esi
  19.         cycle1 :
  20.         fld1
  21.             fdiv array[esi]
  22.             fstp array[esi]
  23.             add esi, double_size
  24.             cmp esi, mas_size
  25.             jne cycle1
  26.     }
  27.     std::cout << "Results:" << std::endl;
  28.     for (int i = 0; i < 10; i++) {
  29.         std::cout << array[i] << std::endl;
  30.     }
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement