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, cat, rest;
- a = 5;
- _asm {
- mov eax, a
- mov ecx, 0
- _while:
- cmp eax, 0
- je _endwhile
- mov ebx, eax
- and ebx, 1
- add ecx, ebx
- shr eax, 1
- jmp _while
- _endwhile:
- mov b, ecx;
- /* shl eax, 2*/
- /* shr eax, 2*/
- /* rol eax, 2*/
- /* ror eax, 2*/
- /* mul cx === ax * cx */
- /* div b == dxax / b = ax rest dx */
- };
- cout << b;
- cout << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement