programb53 - 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 a byte of data is present in the AL register and a second byte of data is present in the BL register. We have to add byte in AL with the byte in BL. Using add instruction, add the contents of 2 registers. Result will be stored in the AX register. Use AAA instruction that will check if BCD is valid, if it is not valid then 6 is added to give proper BCD result. Assume AL = 0 0 1 1 0 1 0 1 ASCII 5 BL = 0 0 1 1 1 0 0 1 ASCII 9 Example : Add AL, BL 0 0 1 1 0 1 0 1 + 0 0 1 1 1 0 0 1 0 1 1 0 1 1 1 0 Result of addition Invalid BCD + 0 1 1 0 AAM 0 0 0 0 0 1 0 0 Carry Clear higher nibble (04 H) Result in AL valid BCD. (01 H) Result in AH. The carry is stored in AH register ØØ Algorithm :
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

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