Program To Calculate Fibonacci Numbers in Assembly Language Using Visual Studio PDF
Program To Calculate Fibonacci Numbers in Assembly Language Using Visual Studio PDF
Programming Tutorials
SUBSCRIBE
Chapter 3
Problem # 5:
Write a program that uses a loop to calculate the first seven values of
the Fibonacci number sequence, described by the following formula:
Fib(1) = 1, Fib(2) = 1, Fib(n) = Fib(n – 1) + Fib(n – 2).
Solution:
.386
.model flat,stdcall
.stack 4096
.data
count DWORD 5
main PROC
http://csprogrammingtutorial.blogspot.com/2017/12/Fibonacci-Numbers.html 1/3
12/9/2018 5. Program to calculate Fibonacci Numbers in Assembly Language using Visual Studio
L1:
Programming Tutorials
MOV EAX,[ESI-4]
SUBSCRIBE
MOV EBX,[ESI-8]
ADD EAX,EBX
MOV [ESI],EAX
ADD ESI, TYPE array
Loop L1
INVOKE ExitProcess,0
main ENDP
END main
Let me know in the comment sec on if you have any ques on.
Previous Post:
Next Post:
Reverse an Array
http://csprogrammingtutorial.blogspot.com/2017/12/Fibonacci-Numbers.html 2/3