You are on page 1of 2

Adam’s Engineering College, Paloncha

ECE Department –MPI LAB

Experiment No.: 12 Year : III/IV B.Tech II Semester Page 1 of 2

FIBONACCI SERIES

Aim: - To write an assembly language program to find the


factorial of the given number.

Registers: - Al, BX CL and DL

Description: - Fibonacci series of a given number is found


and the result is stored in the pointer.

Ports:- None.

DATA SEGMENT

X DB ?
FACT DB 2 DUP(0)
DATA ENDS

CODE SEGMENT

ASSUME CS: CODE, DS: DATA, ES: DATA

START:
MOV CL, X
DEC CL
MOV BX, 00
INC BX
MOV A[BX], 01
MOV AL, 00
MOV DL, 01
L1: INC BX
ADD AL, DL
MOV A[BX], AL
MOV AL, DL
Lab in-charge HOD, ECE
Adam’s Engineering College, Paloncha
ECE Department –MPI LAB

Experiment No.: 12 Year : III/IV B.Tech II Semester Page 2 of 2

MOV DL, A[BX]


LOOP L1

CODE ENDS
END START

Result: Fibonacci series of a given number is obtained.

Lab in-charge HOD, ECE

You might also like