programb12 - 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 one byte is present in the AL register and another byte is present in the BL register. We have to multiply the byte in AL with the byte in BL. We will multiply the numbers using add and shift method. In this method, you add number with itself and rotate the other number each time and shift it by one bit to left alongwith carry. If carry is present add the two numbers. Initialise the count to 4 as we are scanning for 4 digits. Decrement counter each time the bits are added. The result is stored in AX. Display the result. For example : AL = 11 H, BL = 10 H, Count = 4 Step I : AX = 11 + 11 22 H Rotate BL by one bit to left along with carry. BL = 10 H 0 0 0 0 1 0 0 0 0 CY BL = 0 0 0 1 0 0 0 0 0 CY 2 0 Step II : Now decrement counter count = 3. Check for carry, carry is not there so add number with itself. AX = 22 + 22 44 H Rotate BL to left, BL = 0 0 1 0 0 0 0 0 0 CY 4 0 Carry is not there. Decrement count, count=2
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.

This note was uploaded on 08/04/2011 for the course ECON 101 taught by Professor Lucky during the Spring '11 term at Silver Lake.

Page1 / 4

programb12 - 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