Progam of Power Recursive 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 Power recursive in assembly language is given below.

.386
.model flat
.stack 4096
.data
.code
power proc uses ebx ecx edx
mov eax , [esp+16]
mov ebx , [esp+20]
cmp eax , 1
jl return1
mov ecx , eax
dec ecx
push ebx
push ecx
call power
mov ebx, [esp+20]
mul ebx
ret 8
return1:
mov eax , 1
ret 8
power endp
main proc
push 5
push 2
call power
mov ecx , 0
main endp
end main

2 Comments

Add a Comment

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