Advertisement
LipAnn

Untitled

Mar 30th, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %include "io.inc"
  2.  
  3. section .text
  4.  
  5. CNT_1:
  6.     push ebp
  7.     mov ebp, esp
  8.  
  9.     mov eax, dword[ebp + 8]
  10.     cmp eax, 0
  11.     je .end
  12.     mov ecx, 3
  13.     xor edx, edx
  14.     div ecx
  15.     cmp edx, 2
  16.     mov ecx, 0
  17.     cmove edx, ecx
  18.     push edx
  19.     push eax
  20.     call CNT_1
  21.     add eax, dword[ebp - 4]
  22. .end:    
  23.     mov esp, ebp
  24.     pop ebp
  25.     ret
  26.    
  27. global CMAIN
  28. CMAIN:
  29.     push ebp
  30.     mov ebp, esp
  31.    
  32.     GET_UDEC 4, eax
  33.     sub esp, 4
  34.     mov dword[ebp - 4], eax
  35.     call CNT_1
  36.     PRINT_UDEC 4, eax
  37.    
  38.     mov esp, ebp
  39.     pop ebp
  40.     xor eax, eax
  41.     ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement