Advertisement
Guest User

Untitled

a guest
Jan 30th, 2022
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int ac1, ac2, con, n = 6, l2 = n - 1, c[6] = { 0x0020, 0x0016, 0x0012,0x0008, 0x0004, 0x0000 };
  6. float x[6] = { -2,0.5,3,7,9.3,11 }, f[6] = { 74.4,-0.44375,59.4,-9427.8,-47211.5066,-117817.4 }, ap1, ap2;
  7. _asm {
  8. mov ecx, l2;
  9. mov ac1, 0;
  10. for1 : ;
  11. mov con, ecx;
  12. mov ecx, l2;
  13. sub ecx, ac1;
  14. push 00h;
  15. for2 : ;
  16. mov ac2, ecx;
  17. pop esi;
  18. mov esi, c[esi];
  19.  
  20. finit;
  21. fld f[esi]; pop esi; add esi, 04h; mov esi, c[esi];
  22. fld f[esi]; fsub;
  23. fstp ap1; pop esi; mov esi, c[esi]
  24.  
  25. fld x[esi]; pop esi; add esi, 04h; mov esi, c[esi];
  26. fld x[esi]; fsub;
  27. fstp ap2;
  28.  
  29. fld ap1; fld ap2;
  30. fdiv; pop esi; mov esi, c[esi];
  31. fstp f[esi];
  32.  
  33. pop esi; add esi, 04h; push esi; mov ecx, ac2;
  34. loop for2;
  35. mov ecx, con;
  36. add ac1, 1
  37. loop for1;
  38. }
  39. for (int i = 0; i < 6; i++) {
  40. cout << f[i] << "\n";
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement