programb23 - Microprocessors& Applications(UPTU Appendix...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: Microprocessors & Applications (UPTU) Appendix B ØØ Explanation : • AAA instruction stands for ASCII Adjust for Addition. It is used whenever we want to add two decimal digits which are representated in ASCII code, without masking off “3” in upper nibble. In our program AAA instruction is not available in the instruction set of 8086. So we will first accept the two digits in AL and BL registers. Then we will mask the upper nibble i.e. “3” from AL and BL register by ANDing with 0F H, so that we will get LSB of two numbers. Then the two numbers are added. • Result of addition is in AL. We will check if the result is valid BCD. If addition > 9, then result is invalid BCD and to make it valid we will add 6. If result is valid, display the result. For example : Number 1 : 39 H 0 0 1 1 1 0 0 1 After masking 0 0 0 0 1 1 1 1 0 0 0 0 1 0 0 1 = 9 H Number 2 : 32 H 0 0 1 1 0 0 1 0 After masking 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 0 = 2 H Add : 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 1...
View Full 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 / 2

programb23 - Microprocessors& Applications(UPTU Appendix...

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