Program in ASSEMBLY language to print first 5 Fibonacci numbers

Program in ASSEMBLY language to print first 5 Fibonacci numbers

org 100h
.stack 100h
.data
Fab DB 2 DUP(1), 4 DUP(0)
.code
mov ah,(fab +0)
mov al,(fab+1)
add al,ah
mov (fab+2),al
;================================================
mov ah,(fab +1)
mov al,(fab+2)
add al,ah
mov (fab+3),al
;================================================
mov ah,(fab +2)
mov al,(fab+3)
add al,ah
mov (fab+4),al
;==============================================
mov ah,(fab +3)
mov al,(fab+4)
add al,ah
mov (fab+5),al
;==============================================
ret

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s