Aaa-arithmetic instruction-microprocessor, Assembly Language

AAA: ASCII Adjust after Addition operation the AAA instruction is executed after an ADD instruction that adds 2 ASCII coded operands to give a byte of outcome in the AL. The AAA instruction converts the resulting contents of AL to unpack the decimal digits. After the addition operation, the AAA instruction checked the lower 4 bits of AL to examine whether it have a valid BCD number in the range 0 to 9. If it is between range 0 to 9 and AF is set to zero, AAA sets the 4 high order bits of AL to 0. The AH might be cleared before addition operation. If the lower digit of the AL is between the range 0 to 9 and AF is set, 06 are added to the AL. The upper 4 bits of the AL are cleared and the AH is incremented by the value one. If the value in the lower nibble of the AL is greater than 9 then the AL is incremented by the value 06, AH is incremented by value I, the AF and the CF flags are set to I, and the higher 4 bits of the AL are cleared to the value 0. The remaining flags are not affected. The AH is modified as sum of earlier contents (typically 00) and the carry from the adjustment, as shown in given figure. This instruction does not give precise ASCII codes of the sum, but they may be obtained by adding 3030H to  the AX.

425_ascii add.jpg

               Figure: ASCII Adjust After Addition Instruction

Posted Date: 10/12/2012 1:38:00 AM | Location : United States







Related Discussions:- Aaa-arithmetic instruction-microprocessor, Assignment Help, Ask Question on Aaa-arithmetic instruction-microprocessor, Get Answer, Expert's Help, Aaa-arithmetic instruction-microprocessor Discussions

Write discussion on Aaa-arithmetic instruction-microprocessor
Your posts are moderated
Related Questions
Ask 2. Exchange higher byte of AX and higher byte of BX registers by using memory location 0160 in between the transfer. Then stores AX and BX registers onto memory location 0174 o

General Bus Operation The 8086 has a joined data and address bus commonly referred to as a time multiplexed address and data bus. The major reason behind  multiplexing address

Multiply two numbers by using shift and rotate instruction

Write an assembly program that will compute and output tuition cost: a. accept keyboard input of the number of credit hours taken b. accept keyboard input of the type of classes 1

to find the matrix addition

SEG : Segment of a Label:- The SEG operator is which is used to decide the segment address of the, variable, label or procedure and substitutes the segment base address in plac

Physical Memory Mapped I/O and Port I/O : CPU controlled I/O comes in 2 ways. Simply the difference is whether we utilize the normal memory addresses for I/O, this is mention

OR: Logical OR: The OR instruction carries out the OR operation in the similar way as described in case of the AND operation. The restriction on source and destination operands ar

check the al-register for palindromic number

assempbly language routine that takes an array named A containing n bytes of postive numebrs and fills two arranys, array B containing n words and array C containing n long words