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