Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5. int main()
  6. {
  7.     int n = 0;
  8.     int suma = 2;
  9.  
  10.     cout << "Podaj n : ";
  11.     cin >> n;
  12.  
  13.     int* wektor = new int[n];
  14.  
  15.     for (int i = 0; i < n; i++) {
  16.         cout << "Podaj " << i << " element wektora ";
  17.         cin >> wektor[i];
  18.     }
  19.  
  20.     __asm {
  21.  
  22.         mov ecx, n;
  23.         mov ebx, wektor;
  24.         xor eax, eax;
  25.     petla: mov edx, [ebx + 4 * ecx - 4]
  26.         imul edx, edx;
  27.         mov [ebx + 4 * ecx - 4],edx
  28.         dec ecx;
  29.         jnz petla;
  30.     }
  31.    
  32.     for (int i = 0; i < n; i++) {
  33.         cout << wektor[i] << endl;
  34.     }
  35.         return 0;
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement