All Exams Test series for 1 year @ ₹349 only
Question

What would be the value of register AL after the execution of the following assembly language program of 8086 ?

AL = 53, CL = 29
ADD AL, CL
DAA

This question was previously asked in
UGC NET 2023 Paper 1 Question Paper (22-Jun-2023) (Shift 2)
The correct answer is

82

 The two instructions perform a packed-BCD addition: 53 plus 29 in decimal is 82, and DAA is what makes the binary hardware produce that answer.

Step 1 — the binary addition. The values are packed BCD, so each nibble holds one decimal digit.

\(53_{H}+29_{H}=7C_{H}\)

Checking nibble by nibble: \(3+9=12=C_{H}\) in the low nibble with no carry out, and \(5+2=7\) in the high nibble. The processor has done ordinary binary arithmetic and produced 7C — which is not valid BCD, since C is not a decimal digit. This is why option 1 is offered: it is the answer before the adjustment.

Step 2 — what DAA does with it. The rule is applied to each nibble in turn:

TestActionHere
Low nibble > 9, or AF = 1Add 06H, set AFC > 9, so add 06
High nibble > 9, or CF = 1Add 60H, set CF8 is not > 9, no CF — no action

\(7C_{H}+06_{H}=82_{H}\)

The high nibble is now 8, which is a legal digit and no greater than 9, so the second rule does not fire. AL = 82H — option 2, reading directly as the decimal answer 82.

Why adding 6 is the right correction. A nibble counts in sixteens but a decimal digit counts in tens, so whenever a digit sum passes 9 the binary result is short of a decimal carry by exactly \(16-10=6\). Adding 6 pushes the nibble past 16, which both generates the carry into the next digit and leaves the correct remainder behind. Here \(C+6=12_{H}\) gives a carry of 1 into the high nibble and a 2 left in the low nibble — exactly the decimal digits of 82.

Why the other options are wrong. Option 3, DC, would follow from adding 60H instead of 06H — adjusting the wrong nibble. Option 4, E8, comes from adding 66H, applying both corrections when only one was needed.

The point of packed BCD is that the digits can be read out directly for a display or printed record without any binary-to-decimal conversion, which is why it survives in calculators, tills and real-time clock chips.

Hence, AL = 82.

Was this answer helpful?

Similar Questions

  1. Given below are two statements :

    Statement I : In 8051 micro-controller register banks and stack reserves 32 bytes from locations 00 to 1F Hex

    Statement II : Bit-Addressable RAM locations are 20 H to 2 F H.

    In the light of the above statements, choose the most appropriate answer from the options given below :

  2. Find the delay generated by Timer 0 in the following code of 8051 microcontroller : clock period = 1.085 µs.

    MOV TMOD, #01H

    MOV TLO, #3DH

    MOV THO, #0A2H.

     

    SET B TRO

    Loop : J N B TFO, LOOP

    CLR TRO

    CLR TFO

  3. In "JZ Next" instruction of 8051 microcontroller, which register's content is checked to see if it is zero?

  4. Using 8051 assembly language programming numbers 54 H and 98 H are added. After addition the status of CY, AC and P flags are respectively:

  5. In 8051 microcontroller, one machine cycle lasts in 12 oscillation period. Crystal oscillator's frequency is 11.0592 MHz. Find how long it takes to execute instruction MOV R4, # 25.

  6. Advantage of segmented memory in 8086 is

    A. Allows the memory capacity to be 1M byte, although the actual address is of 16 bit size.

    B. Allows the placing of code and data portions of the same program in different parts of memory.

    C. Allows the memory capacity to be 2M byte, although the actual address is of 16 bit size.

    D. Allows the placing of code and data portion of the same program in same parts of memory.

    E. Allows the memory capacity to be 1M byte, although the actual address is of 20 bit size

    Choose the correct answer from the options given below :

  7. Which of the following statements are correct for a microcontroller ?

    A. A microcontroller has on-chip I/O ports

    B. A microcontroller has a fixed amount of RAM on the chip

    C. The flag register in the 8051 is called program standard word

    D. Auxiliary carry flag is set when there is a carry from D3 to D4 during an ADD or SUB operation

    E. Overflow flag is only used to detect errors in unsigned arithmetic operations.

    Choose the correct answer from the options given below :

  8. Match List I with List II

    LIST I (instruction of 8051 microcontroller)LIST II (Addressing mode)
    A.MOV A, # 32 HI.Register addressing mode
    B.MOV R 6, AII.Register Indirect addressing mode
    C.MOV R4, 7 FHIII.Immediate Addressing mode
    D.MOV A, @ ROIV.Direct Addresing mode

    Choose the correct answer from the options given below:

  9. The ALE line of an 8085 microprocessor is used to

  10. Contents of ‘A’ register after execution of the following 8085 microprocessor program is

    MVI A, 55 h

    MVI C, 25 h

    ADD C

    DAA


Important Questions from Microprocessors

  1. Register which is used to store values of arithmetic and logical operations is termed:

  2. How many bytes of bit addressable memory is present in 8051 based microcontrollers?

  3. A single instruction to clear the lower four bits of the accumulator in 8085 assembly language is-

  4. In Microprocessor 8085 Address/Data buffer is a/an _______ buffer.

  5. Microprocessor 8085 operates on a clock cycle with ______ duty cycle.

Need Expert Advice?
Test Series
UGC NET img
Teaching
UGC NET Library and Information Science 2024 - 2025 Mock Test Series
66 Tests 4 Tests Free
791 Attempts
4.4(17)
English, Hindi

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App