windows32 assembly language recursive procedure.
accept, from the user, an integer greater than 0. Guard against invalid values being entered using a loop.
call the recurse sub-procedure using the cdecl protocol,
receive the results of the sub-procedure,
and display the results.
The recurse sub-procedure should (following the cdecl protocol):
recurse(0) = 3,
and recurse(n) = 5 * recurse(n-1) + 9, for n > 0.
return the value back to the calling procedure.
I did this task in C++ programming language but I am not familiar with assembly language I wanted to know how it can be done in assembly language.
What I have tried:
#include <iostream>
using namespace std;
int recursion(int n);
int main()
{
int n,result;
cout<<"Enter the integer: ";
cin>>n;
result = recursion(n);
cout<<result;
return 0;
}
int recursion(int n){
if(n>0){
return 5 * recursion(n-1)+9;
}
else{
return 3;
}
}