Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .intel_syntax noprefix
- .global main
- .text
- main:
- push offset x
- push offset y
- call scanf
- add esp,8
- fibonacci:
- push ebp
- mov ebp, esp
- mov eax, [ebp+8]
- cmp eax, 1
- ja recurse
- mov ecx, 1
- jmp exit
- recurse:
- dec eax
- mov edx, eax
- push edx
- push eax
- call fibonacci
- pop eax
- dec eax
- push ecx
- push eax
- call fibonacci
- pop eax
- add ecx, eax
- exit:
- mov esp,ebp
- pop ebp
- ret
- .data
- x: .int 0
- y: .asciz "%d"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement