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.
|
Related Programs (Click down)
Alter the contents of flag register in 8085
Multiply two 8-bit numbers
Find the negative numbers in a block of data.
Find the number of negative, zero and positive numbers