Statement:Write an assembly language program to generate fibonacci number
Source Program:
MVI D, COUNT : Initialize counter
MVI B, 00 : Initialize variable to store previous number
MVI C, 01 : Initialize variable to store current number
MOV A, B :[Add two numbers]
BACK: ADD C :[Add two numbers]
MOV B, C : Current number is now previous number
MOV C, A : Save result as a new current number
DCR D : Decrement count
JNZ BACK : if count 0 go to BACK
HLT : Stop.
Sunday, September 13, 2009
Subscribe to:
Post Comments (Atom)
hey thanks for the programs......
ReplyDeletebut how bout storing in memory?
also u r not doing DAA...
same doubt'
Deletethanks 4 d program
ReplyDeletecool yar ..logic samjha abhi//
ReplyDeletethak you for the pgm....
ReplyDeleteFor more programming at 8085
ReplyDeletewww.pradipyadav.com
100 program related 8085
can anyone post sample input and output for this program pls....
ReplyDeleteLXI H,3000H
DeleteMVI D,05H
MVI B,00H
MOV M,B
INX H
MVI C,01H
MOV M,C
INX H
BACK: MOV A,B
ADD C
DAA
MOV M,A
INX H
MOV B,C
MOV C,A
DCR D
JNZ BACK
HLT
gud program
DeleteThis comment has been removed by the author.
ReplyDeleteplzzz help any one for this program
ReplyDeleteto stored generated series number in memory...plzzz help
This comment has been removed by the author.
DeleteLXI H,2600 // Count, no of terms
DeleteMOV C,M
DCR C // Dec Count by 2
DCR C //As First 2 values are stored
LXI H,2400 //2400=0,2401=1
LXI D,2402
L1: MOV A,M
INX H
ADD M
DAA
STAX D
INX D
DEC C
JNZ L1
HLT
SOLVED PROGRAM FRNDS
ReplyDeleteLXI H,3000H
MVI D,05H
MVI B,00H
MOV M,B
INX H
MVI C,01H
MOV M,C
INX H
BACK: MOV A,B
ADD C
DAA
MOV M,A
INX H
MOV B,C
MOV C,A
DCR D
JNZ BACK
HLT
plzz help me with a program-
ReplyDeleteto represent factorial of a number
it shows errors in d first 4 lines...plzzz help..
ReplyDeleteHere is my program code for generation of fibonacci series from 1 to 100:-
ReplyDeleteMVI C,01H
LXI H,2100H
MOV M,C
MOV B,C
MOV A,C
LOOP: ADD B
CPI 01H
JC L1
CPI 64H
JNC L2
INX H
MOV M,A
L1: MOV B,C
MOV C,A
JMP LOOP
L2: HLT
OUTPUT:
2100->01
2101->01
2102->02
2103->03
2104->05
2105->08
2106->0D
2107->15
2108->22
2109->37
210A->59
Dum ni hai program mei...
ReplyDeleteremove it.....
This comment has been removed by the author.
ReplyDeleteColor CRT Monitors
ReplyDeleteKnapsack Problem using Backtracking
Issues Knowledge Representation
ARM Architecture in Detail
File Models Distributed File System
Memory Allocation
Basic Primitive Operations Queue
First Come First Serve
What is CDMA Technology
Polygon Surfaces
ReplyDeleteInput Output Instructions
Types Assembly Statement
Architecture 80486 Microprocessor
Conversion from NFA to DFA
Conversion Clause Form
IEEE 802.11 Architecture
Apriori Algorithm
Interrupt Initiated I/O