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
Trying to convert small programs from C to 8086 assembly language using emu 8086 emulator. I converted to low level C, but struggling with converting to the Assembly language.

Addressing mode of 8086 : Addressing mode specify a way of locating operands or data. Depending on the data types used the memory  addressing  modes and in the instruction  ,

I want to do a program as a game by using the Microcontroller 8051 with the assembly language, by using 4*4 keypad and its matrix display. I have to use the keypad for playing the

which uses BIOS interrupt INT 21 to read current system time and displays it on the top-left corner of screen.

can any one help me in my project by using assembly language

This unit introduces the topic of evaluating interactive products. It is a short unit as evaluation is discussed in more detail in Block 4. Its brevity should give you additional t

Explain the basic method for implementing paging

Write an account of your findings and produce a report containing all aspects of the above. Include a step-by-step 'simple User Guide' so that your program can be operated as inten

SUB: Subtract :- The subtract instruction subtracts the source operand from destination operand and result is left in the destination operand. Source operand might be memory locati

Write an assembly program that adds the elements in the odd indices of the following array. Use LOOP. What is the final value in the register?