Zero Factorial is interesting. It is generally agreed that 0! It may seem funny that multiplying no numbers together results in 1, but let's follow the pattern backwards from, say, 4! Like this: And in many equations using 0! = 1 just makes sense. A PDF creator can set a PDF to open in Full Screen mode, or you can set the view yourself. Full Screen mode is often used for presentations, sometimes with automatic page advancement and transitions. The pointer remains active in Full Screen mode so that you can click links and open notes. There are two ways to advance through a PDF in Full Screen mode.
- Assembly Tutorial
- Assembly Useful Resources
- Selected Reading
A recursive procedure is one that calls itself. There are two kind of recursion: direct and indirect. In direct recursion, the procedure calls itself and in indirect recursion, the first procedure calls a second procedure, which in turn calls the first procedure.
Recursion could be observed in numerous mathematical algorithms. For example, consider the case of calculating the factorial of a number. Factorial of a number is given by the equation −
![Graphic Graphic](https://media.springernature.com/lw785/springer-static/image/chp%3A10.1007%2F978-3-319-05555-8_14/MediaObjects/317334_1_En_14_Fig11_HTML.gif)
For example: factorial of 5 is 1 x 2 x 3 x 4 x 5 = 5 x factorial of 4 and this can be a good example of showing a recursive procedure. Every recursive algorithm must have an ending condition, i.e., the recursive calling of the program should be stopped when a condition is fulfilled. In the case of factorial algorithm, the end condition is reached when n is 0.
The following program shows how factorial n is implemented in assembly language. To keep the program simple, we will calculate factorial 3.
When the above code is compiled and executed, it produces the following result −