Advertisement
YauhenMardan

asm_8.11_r

May 17th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. const int n = 6;
  6.  
  7. int main() {
  8. int a[n], b[n], c[2 * n];
  9. cout << "Fill the first 'a' array:" << endl;
  10. for (int i = 0; i < n; i++) {
  11. cin >> a[i];
  12. }
  13. cout << "Fill the second 'b' array:" << endl;
  14. for (int i = 0; i < n; i++) {
  15. cin >> b[i];
  16. }
  17. _asm {
  18. mov esi,0
  19. mov ecx,n
  20. beg_1_:
  21. mov eax,a[esi]
  22. mov c[esi], eax
  23. add esi,4
  24. loop beg_1_
  25.  
  26. mov edi,0
  27. mov ecx, n
  28. beg_2_:
  29. mov eax, b[edi]
  30. mov c[esi], eax
  31. add esi, 4
  32. add edi,4
  33. loop beg_2_
  34. }
  35. cout << "The third 'c' array:" << endl;
  36. for (int i = 0; i < 2*n; i++) {
  37. cout << c[i]<<endl;
  38. }
  39. system("pause");
  40. return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement