Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <stdio.h>
- int f(int n)
- {
- _asm {
- mov ebx, [ebp + 8]
- shl ebx, 1
- mov ecx, 2
- mov esi, 1
- mov edi, 0
- while1:
- cmp ecx, ebx
- jg stopwhile1
- mov eax, esi
- mul ecx
- mov esi, eax
- add edi, esi
- inc ecx
- inc ecx
- jmp while1
- stopwhile1:
- mov eax, edi
- }
- }
- int main()
- {
- int rez = 0;
- _asm {
- push 3;
- call f
- add esp, 4
- mov rez, eax
- }
- printf("%d\n", rez);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement