Fibonacci in Assembly Language

It is a pattern when you add the 2 previous numbers together and to get the next number. And so on.

1. 1. 1. 2. 3. 5. 8. 13. 21. 34. 55. 89. 144. And so on.

ASSEMBLY
.data
fibonacci DWORD 100 dup (0)
.code
mov edx,offset fibonacci
mov eax,1
mov ebx,1
mov ecx,49
@@:
mov DWORD PTR [edx],eax
mov DWORD PTR [edx+4],ebx
add eax,ebx
add ebx,eax
add edx,8
sub ecx,1
jnz @B

3 comments:

abebe said...

please help me by editing thse code in assembly language

abebe said...

please help me by editing thse code in assembly language

Anonymous said...

I got this site from my buddy who informed me concerning this website
and at the moment this time I am visiting this web site and reading very informative articles here.


Here is my webpage ... extra money

Post a Comment