Program of Fibonacci in Assembly language

A program written in assembly language comprises of a progression of memory helper processor guidelines and meta-proclamations (referred to differently as orders, pseudo-directions and pseudo-operations), remarks and information. Assembly language guidelines as a rule comprise of an opcode mental helper pursued by a rundown of information, contentions or parameters. ..Code of the fibonacci in assembly language is given below.

.386
.model flat
.stack 4096
.data
.code
fibonacci proc
mov eax , [esp+4]
cmp eax , 1
jbe returnssame
mov ebx, eax
dec ebx
push ebx
call fibonacci
push eax
mov ebx , [esp+8]
sub ebx , 2
push ebx
call fibonacci
pop ebx
add eax , ebx
ret 4
returnssame:
ret 4
fibonacci endp
main proc
push 9
call fibonacci
mov ecx , 0
main endp
end main

Comments if have any confusion or queries. Thanks !!!

Add a Comment

Your email address will not be published. Required fields are marked *