Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void func2()
- {
- cout<<"Type number: ";
- int t;
- cin>>t;
- int quan=0;
- __asm
- {
- mov eax, t
- mov ebx, 10
- beg:
- cmp eax, 0
- je end_
- jg gr
- sub ebx, 0
- jmp beg
- gr:
- cdq
- idiv ebx
- add quan,1
- jmp beg
- end_:
- mov eax, t
- cmp eax, 0
- jz null_
- jmp endl_
- null_:
- add quan, 1
- endl_:
- }
- cout<<"Quantity of numbers: "<<quan<<endl;
- }
- void func3()
- {
- int t;
- cout<<"Type number: ";
- cin>>t;
- int quan1=1, modul, power=0, res=0;
- __asm
- {
- mov eax, t
- mov ecx, eax
- mov ebx, 0
- loop1:
- mov eax, ecx
- cmp eax, 0
- jne zero1
- jmp end2
- zero1:
- and eax, 1
- shr ecx, 1
- cmp eax, 1
- je equal1
- jmp loop1
- equal1:
- inc ebx
- jmp loop1
- end2:
- mov res, ebx
- }
- cout<<"Result: "<<res<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement