arrow
arrow
arrow
What will be the content of AL after execution of the following program? MOV AL, 39H MOV BL, 34 H ADD AL, BL AAA
Question

What will be the content of AL after execution of the following program?
MOV AL, 39H
MOV BL, 34 H
ADD AL, BL
AAA

A.

6 D H

B.

13 H

C.

33 H

D.

03 H

Correct option is D


Let's analyze the program step by step:
1 First Instruction: MOV AL, 39 H
· This instruction loads the hexadecimal value into the register AL.
· AL=39H.
2 Second Instruction: MOV BL, 34 H
· This instruction loads the hexadecimal value into the register BL.
· BL=34H.
3 Third Instruction: ADD AL, BL
· This adds the contents of AL and BL, and the result is stored in AL.
· Perform the addition:
AL=39H+34H=6DH (no carry)
· After this instruction, AL=6DH.
4 Fourth Instruction: AAA (ASCII Adjust after Addition)
· The AAA instruction adjusts the result in after adding two ASCII values.
· It checks the lower 4 bits of AL. If the lower nibble is greater than 9 , it adjusts AL to make it a valid BCD (Binary Coded Decimal).
· For AL=6DH :
· The lower nibble is DH (which is greater than 9).
· AAA adjusts AL :
AL=AL+06H and the upper nibble is cleared (set to  0 ). 
Result: AL=03H.

test-prime-package

Access ‘ISRO Electrical Engineering’ Mock Tests with

  • 60000+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
students-icon
368k+ students have already unlocked exclusive benefits with Test Prime!
test-prime-package

Access ‘ISRO Electrical Engineering’ Mock Tests with

  • 60000+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
students-icon
368k+ students have already unlocked exclusive benefits with Test Prime!
Our Plans
Monthsup-arrow