Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const int n = 6;
- const int k = 3;
- int n_ = n;
- int main() {
- int a[n], b[k];
- cout << "Fill the first 'a' array:" << endl;
- for (int i = 0; i < n; i++) {
- cin >> a[i];
- }
- cout << "Fill the second 'b' array:" << endl;
- for (int i = 0; i < k; i++) {
- cin >> b[i];
- }
- _asm {
- mov ecx,k
- mov edi,0
- beg_:
- mov ebx,b[edi]
- mov esi,0
- mov edx,ecx //save ecx
- mov ecx,n_
- beg2_:
- cmp ebx,a[esi]
- je EQL
- add esi, 4
- jmp NXT
- EQL:
- //----
- mov a[esi],99
- add esi, 4
- //----
- NXT:
- loop beg2_
- mov ecx,edx //load ecx
- add edi,4
- loop beg_
- }
- cout << "The third 'a' array:" << endl;
- for (int i = 0; i < n_; i++) {
- cout << a[i]<<endl;
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment