2

I want to do a program by using recursion. I am going to use if-else. The question is: Do I have to return something in each case of if-else?

1
  • Perhaps you could outline your proposed recursive function using e.g. C or even just pseudo code ? Commented Apr 5, 2011 at 20:08

2 Answers 2

1

Yes, there is a stack trace for each transfer of pointer to a new location. And in order to implement recursion, you need to return something in each case of if-else, or at least after each if-else you need to perform some operation and store the result in a memory location which is global and accessible anywhere from your code.

Sign up to request clarification or add additional context in comments.

Comments

1

Recursion in assembler is not all that different from a loop.

When doing recursion in assembler, make sure you're not demolishing the variables you had in your registers!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.