Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const int n = 8;
- int main() {
- char r1[n] = "1236321";
- char r2[n] = { 0 };
- __asm
- {
- mov ecx, n //ecx=n-1
- sub ecx, 1
- lea esi, r1 //esi=*r1
- add esi, ecx
- dec esi
- lea edi, r2 //edi=*r2
- std //<-
- r_beg : //reverse r1
- lodsb
- mov byte ptr[edi], al
- inc edi
- loop r_beg
- cld //->
- mov ebx, 0
- mov ecx, n //ecx=n-1
- sub ecx, 1
- lea esi, r1//esi=*r1
- lea edi, r2//edi=*r2
- repe cmpsb //cmp
- jne N_EQL
- jmp EQL
- r2_end:
- }
- EQL:
- cout << "YES" << endl;
- goto NEXT;
- N_EQL:
- cout << "NO" << endl;
- NEXT:
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement