Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int main() {
- int a, b, d, c;
- a = 123219;
- _asm {
- mov edi, a
- mov ebx, 0
- mov ecx, 10
- _while:
- cmp edi, 0
- je _endwhile
- mov edx, 0
- mov eax, edi
- div ecx //10
- mov edi, eax
- mov esi, edx
- mov eax, ebx
- mul ecx //10
- mov ebx, eax
- add ebx, esi
- jmp _while
- _endwhile:
- mov eax, a
- mov c, 0
- cmp eax, ebx
- jne _neq
- mov c, 1
- _neq:
- };
- if (c) {
- cout << "Palindrom";
- }
- else {
- cout << "Nu e palindrom";
- }
- cout << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement