programb46

# programb46 - Microprocessors Applications(UPTU Appendix B...

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

Appendix B ØØ Explanation : The LCM of two numbers is found by dividing the first number by the second number. If there is no remainder, then the first number is the LCM. If there is a remainder, the first number is added to itself to get a new number. Again divide the new number by the second number. If there is no remainder, then the new number is the LCM. If there is a remainder, the new number is added to the first number and once again this number becomes the new number. This process is continued till there is no remainder, so that LCM is found. e.g. : First number = 0002 Second number = 0004. Iteration Operation Remainder New number 1 2 % 4 2 2 + 2 = 4 2 4 % 4 0 Therefore the LCM is 4 ØØ Algorithm : Step I : Initialize the data segment. Step II : Get the first number in register AX. Step III : Get the second number in register BX. Step IV : Initialize DX = 0000. Step V

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 / 3

programb46 - Microprocessors Applications(UPTU Appendix B...

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

View Full Document
Ask a homework question - tutors are online