Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- using namespace std;
- int main() {
- int number;
- int result;
- cin >> number;
- register int TMP;
- register int RST;
- _asm {
- MOV EAX, number
- MOV EBX, 10
- MOV ECX, 0
- MOV EDX, 0
- _for:
- CMP EAX, 0
- JBE _afterFor
- DIV EBX
- MOV RST, EDX
- MOV TMP, EAX
- MOV EAX, ECX
- MUL EBX
- ADD EAX, RST
- MOV ECX, EAX
- MOV EAX, TMP
- MOV EDX, 0
- JMP _for
- _afterFor:
- MOV EAX, number
- CMP EAX, ECX
- JE _if
- JMP _else
- _if:
- MOV result, 1
- JMP _final
- _else:
- MOV result, 0
- JMP _final
- _final:
- }
- cout << result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement