programb15 - 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 : Consider that two unpacked numbers are present in the AL and BL registers. We have to multiply the two numbers. The result is stored in the AX register. The AAM (BCD adjust after Multiply) is used to adjust the product to two unpacked BCD digits in AX. eg. AL = 0000 0100 = unpacked BCD 4 BL = 0000 0110 = unpacked BCD 6 MUL BL AL × BL Result in AX. AX = 0000 0000 0001 1000 = 18 H AAM AX = 0000 0010 0000 0100 = 24 i.e. Unpacked BCD for 24. ØØ Algorithm : Step I : Initialize the data segment. Step II : Get the first unpacked BCD number. Step III : Get the second unpacked BCD number. Step IV : Multiply the two numbers. Step V : Adjust result to valid unpacked BCD number in AX. Step VI : Display the result. Step VII : Stop. ØØ Flowchart : Refer flowchart 15. ØØ Program : .model small .data a db 04H b db 06H .code mov ax, @data ; Initialize data section mov ds, ax mov ah, 0 mov al, a ; Load number1 in al mov bl, b ; Load number2 in bl mul bl ; multiply numbers and result in ax
Background image of page 1

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

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

Page1 / 2

programb15 - Microprocessors & 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