0
Write an assembly language program to print Fibonacci series upto N terms. (N is given)

Subject: Computer Organization and Architecture

Topic: Module 2

Difficulty: High

coa(24) • 1.7k  views
0  upvotes
0

.MODEL SMALL .DATA FIB DB ? MSG DB 10d,13d,"ENTER HOW MANY FIB YOU WANT : $" .CODE MOV AX,@DATA MOV DS,AX LEA SI,FIB LEA DX,MSG ; To print message on screen MOV AH,09H INT 21H MOV AH,01H ; To read value from keyboard INT 21H SUB AL,30H
MOV CL,AL ; Load the count value in CL for looping MOV AX,00H ; Starting of series 1st number MOV BX,01H ; Starting of series 2nd number MOV [SI],AX INC SI MOV [SI],BX INC SI SUB CL,02H ;Fibonacci Part L1:ADD AX,BX
; obtain 1st fib number from default numbers DAA
; Used to Present the value in Decimal Form MOV [SI],AX
; move 1st fib number to FIB array
MOV AX,BX ; then ax=bx, bx=res[si] MOV BX,[SI] INC SI LOOP L1 INT 3H END

0  upvotes
Please log in to add an answer.

Next up

Read More Questions

If you are looking for answer to specific questions, you can search them here. We'll find the best answer for you.

Search

Study Full Subject

If you are looking for good study material, you can checkout our subjects. Hundreds of important topics are covered in them.

Know More