Write Assembly Program to Calculate Fibonacci Series

0
2
digitalample eye
Write a assembly program to calculate fibonacci series.
Assembly program to calculate fibonacci series.
Calculate fibonacci series using assembly programming.

title"to display the Fibonanci Series"
.model small
.stack
.data
VAL1 DB 0
VAL2 DB 1
STR1 DB '00$'
STR2 DB '01$'
.CODE
PRNT MACRO
AAM
ADD AX,3030H

MOV DL,AH
MOV DH,AL
MOV AH,02H
INT 21H

MOV DL,DH
MOV AH,02H
INT 21H

ENDM

MAIN PROC
MOV AX,@DATA
MOV DS,AX

MOV DX,OFFSET STR1
MOV AH,09H
INT 21H

MOV DX,OFFSET STR2
MOV AH,09H
INT 21H

MOV AL,VAL1
MOV BL,VAL2

MOV CX,10
MOV AH,0

TOP: ADD AL,BL
MOV BH,BL
PUSH AX

PRNT

MOV DL,' '
MOV AH,02H
INT 21H

POP AX
MOV BL,AL
MOV AL,BH
LOOP TOP
MOV AX,4C00H
INT 21H
MAIN ENDP
END MAIN

LEAVE A REPLY

Please enter your comment!
Please enter your name here