hi there! i cant figure out how i could program a little function in assembly using the PCSPIM environment.
the function i want to program with recursion is:

func(n) = func(n-1) + (n-1)

this is similiar to the fibonnaci function which is:

fib(n) = fib(n-1) + fib(n-2)

and the code for the fibonnaci can be found here:

how can i change in order to make it work with:

func(n) = func(n-1) + (n-1)

i tried plenty of times but i find it hard! all help will be greately appreciated!
thanks! :)

Recommended Answers

All 2 Replies

Do you know how to write functions already?

i have sorted it. dont worry.
thanks anyway!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.