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
PLEASE MAY YOU ASSIST ME WITH SAMPLE CODES FOR PROGRAMING A FIRE ALARM MINI PROJECT

hi, i''m new to assembly language and my teacher told us to look for an example of the odd and even numbers program using debug.exe in ms dos as a guide since we just started. plea

Will be needing help with assembly language assignments over the course of 4 weeks

#include"lcd.asm"       ; assembly file is included for displaying lcd characters Main: PORTA EQU 0xF80  ; PORTS PORTB EQU 0xF81 PORTC EQU 0xF82 PORTD EQU 0xF83 R

Need help with 2 homework assignments

MyLocation SDWORD 14 TheTest        SDWORD 8     mov    eax,MyLocation     mov    ebx,TheTest     neg     eax,ebx     sub     eax,ebx Show exactly what lives in eax after executi

Can any one assist me with this program. I am not efficient with assembly language and I need assistance badly. I am not asking anyone to do my work I just need help step by step

External System Bus Architecture : This is a 16 bit processor with 40 pins. It has twenty address pins and out of which sixteen are utilized as data pins. This concept of by us


DIV: Unsigned Division:- This instruction performs unsigned division operation. It divides an unsigned word or double word by a 16-bit or 8-bit operand. The dividend might be in t