Advertisement
VDimov01

Untitled

Mar 7th, 2022
1,610
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int test(int n, int m, int k) {
  2.     int firstResult = 0;
  3.     int secondResult = 0;
  4.  
  5.     _asm {
  6.         mov eax, 0
  7.         mov eax, n
  8.         mul k
  9.         mov ecx, eax
  10.         mov eax, 1
  11.         for:
  12.             mul ecx
  13.             dec ecx
  14.             cmp ecx,0
  15.             jg for
  16.  
  17.         mov firstResult, eax
  18.         mov eax, 0
  19.         mov eax, n
  20.         sub eax, k
  21.         mov ecx, eax
  22.         mov eax, 1
  23.             for2:
  24.             mul ecx
  25.                 dec ecx
  26.                 cmp ecx, 0
  27.                 jg for2
  28.                 mov secondResult, eax
  29.                 mov eax, 0
  30.                 mov eax, firstResult
  31.                 div secondResult
  32.                 mul m
  33.                 return:  
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement