Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .386
  2. .model flat
  3. option casemap :none
  4.  
  5. .data
  6.  
  7. .code
  8. fibonacci:
  9.     push ebp
  10.     mov ebp, esp
  11.     sub esp, 10h
  12.    
  13.  
  14.     cmp dword ptr [ebp + 8h], 0h
  15.     je default_0
  16.  
  17.     cmp dword ptr [ebp + 8h], 1h
  18.     je default_1
  19.  
  20.     cmp dword ptr [ebp + 8h], 2h
  21.     je default_1
  22.  
  23.  
  24.     push dword ptr [ebp + 8h]
  25.     dec dword ptr [esp]
  26.    
  27.     add eax, ecx
  28.     mov ebx, eax
  29.  
  30.     mov eax, ecx
  31.     mov ecx, ebx
  32.  
  33.     call fibonacci
  34.  
  35.     mov eax, ecx
  36.  
  37.     jmp ocisti
  38.  
  39.     default_0:
  40.         mov eax, 0h
  41.         ret
  42.  
  43.     default_1:
  44.         mov eax, 1h
  45.         ret
  46.  
  47.     ocisti:
  48.     add esp, 10h
  49.     pop ebp
  50.     retn 4h
  51.  
  52.    
  53. _start:
  54.  
  55.     mov ebx, 1h
  56.     mov ecx, 1h
  57.     mov eax, 1h
  58.  
  59.     push 0h
  60.     call fibonacci
  61.  
  62.     ret
  63. end _start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement