programb44

# programb44 - Microprocessors Applications(UPTU Explanation...

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

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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

programb44 - Microprocessors Applications(UPTU Explanation...

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

View Full Document
Ask a homework question - tutors are online