Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
8086 program to generate Fibonacci Sequence
Here we will see how to generate Fibonacci sequence using 8086
Problem Statement
Write 8086 Assembly language program to generate Fibonacci sequence. The limit of the sequence is stored at location offset 500. The item will be stored from offset 600 onwards.
Discussion
To generate Fibonacci sequence, we are putting the 00H and 01H into memory at first. Then we are taking the limit from location offset 500. The limit is decreased by 2 at first, because 00H and 01H is already present there. Now we are taking number from previous location, then add it with the value of current location, after that storing the result into next location.
Input
|
Address |
Data |
|---|---|
… |
… |
|
500 |
E |
… |
… |
Flow Diagram

Program

Output
|
Address |
Data |
|---|---|
… |
… |
|
600 |
00 |
|
601 |
01 |
|
602 |
01 |
|
603 |
02 |
|
604 |
03 |
|
605 |
05 |
|
606 |
08 |
|
607 |
0D |
|
608 |
15 |
|
609 |
22 |
|
60A |
37 |
|
60B |
59 |
|
60C |
90 |
|
60D |
E9 |
… |
… |
Advertisements
