Write Assembly Program to Calculate Fibonacci Series

Calculate Fibonacci Series

Here we are talking about the Assembly Level Language Program to Claculate Fibonacci Series.

Here you can learn how to calculate factorial using Assembly Level Programming.

title"to display the Fibonanci Series"
.model small
.stack
.data
VAL1 DB 0
VAL2 DB 1
STR1 DB '00

Source Code,

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

TutsMaster.org

Tutsmaster.org provides tutorials related to tech and programmings. We are also setting up a community for the users and students.