Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <windows.h>
- #include <iomanip>
- #include <ctime>
- #include <stdio.h>
- #include <cmath>
- #include <stdlib.h>
- #include <conio.h>
- #include <math.h>
- #define N 255
- using namespace std;
- short int A[N], B[N];
- int temp[2];
- int R;
- int i, n;
- void main() {
- n = 5;
- A[0] = 2;
- A[1] = 3;
- A[2] = 4;
- A[3] = 5;
- A[4] = 1;
- B[0] = 6;
- B[1] = 7;
- B[2] = 8;
- B[3] = 9;
- B[4] = 10;
- //cout << "‚vvedite dlinu vektora-stroki i vysotu vektora-stolbca (ne bol'she 256) N = \n";
- //cin >> n;
- //for (i = 0;i < n;i++) {
- // cout << "‚vvedite " << i + 1 << " jelement vektora-stroki (ne bol'she 256)\n";
- // cin >> A[i];
- //}
- //for (i = 0;i < n;i++) {
- // cout << "‚vvedite " << i + 1 << " jelement vektora-stolbca (ne bol'she 256)\n";
- // cin >> B[i];
- //}
- __asm {
- pusha;
- mov ecx, n;
- lea eax, A;
- lea ebx, B;
- cycle:
- MOVQ MM0, [eax];
- MOVQ MM1, [ebx];
- PMADDWD MM1, MM0;
- PADDD MM3, MM1;
- add eax, 8;
- add ebx, 8;
- sub ecx, 4;
- cmp ecx, 0;
- jnle cycle;
- MOVQ temp, MM3;
- popa;
- }
- R = temp[0] + temp[1];
- cout << "\nR = " << R;
- _getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement