Hello!
I'm trying to implement a C-Code in assembly but I couldn't figure out how to do it. The C-Code looks like this:
int fib (int n) {
if (n <= 1) {
return n;
}
return fib(n - 1) + fib(n - 2);
}
If the return part was like "return n + fib(n-1)" it would be fine. I know what to do in such a situation. But with 2 recursive functions, I don't know what to do.
I saw some examples for other assembly architectures like MIPS but didn't understand how to write them in MSP430 style.
Thanks in advance for your help!