programb44 - Microprocessors & Applications (UPTU)...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Appendix B  Explanation : To compute the factorial of a number, means to multiplay the number say n with (n – 1) (n – 2) (n – 3) …1. e.g. To compute 5 ! of a number. 5 ! = 5 × 4 × 3 × 2 × 1 = 120. In our program, we will initialize the AX and BX registers with 1. We will load the number whose factorial is to be found in the CX register. We will multiply number in AX with number in BX. Result of multiplication is stored in AX register and DX register. Increment BX-check that BX is less than CX. If yes, continue the process till factorial is computed. Display the result.  Algorithm : Step I : Initialize the data segment. Step II : Load the number whose factorial is to be computed in the CX register. Step III : Initialize AX and BX registers = 1. Step IV : Multiply AX × BX. . Step V : Increment BX. Step VI : Check if BX < CX. If yes goto step 4. Step VII
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

programb44 - Microprocessors &amp; Applications (UPTU)...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online