Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global _start
- extern printf
- extern atoi
- extern exit
- section .text
- _start:
- push dword [x]
- call fibonacci
- push eax
- push fmt
- call printf
- call exit
- fibonacci:
- ;push ebp
- mov ebp, esp
- mov ecx, [ebp+4]
- xor eax, eax
- inc eax
- xor ebx, ebx
- inc ebx
- .cycle:
- mov edx, eax
- mov eax, ebx
- add ebx, edx
- dec ecx
- jnz .cycle
- mov eax, edx
- mov esp, ebp
- ;pop ebp
- ret 4
- section .data
- fmt db '%10d', 0xa, 0
- x dd 5
Advertisement
Add Comment
Please, Sign In to add comment