Skip to content
Related Articles

Related Articles

GATE | GATE-CS-2002 | Question 29

View Discussion
Improve Article
Save Article
  • Last Updated : 06 Sep, 2021
View Discussion
Improve Article
Save Article

What are the states of the Auxiliary Carry (AC) and Carry Flag (dCY) after executing the following 8085 program?

   MVI L, 5DH
   MVI L, 6BH
   MOV A, H
   ADD L

(A) AC = 0 and CY = 0
(B) AC = 1 and CY = 1
(C) AC = 1 and CY = 0
(D) AC = 0 and CY = 0


Answer: (C)

Explanation: First we load  5D in L register But we have not stored it to the accumulator So, when we load 6B in L register, it overwrites 5D in L register and the same value 6BH is copied to accumulator

Now A = 6BH
L = 6BH
ADD L i.e. A = A + L
It will generate internal carry i.e. B + B = 22 i.e. 22 – 16 = 6
adding 2 to 6 + 6 => we get 14 => D
Hence answer is D6
Since there is internal carry only, no final carry as 14 < 16 So, Auxiliary carry flag(AC) = 1 Carry Flag(CY) = 0    

 

This solution is contributed by Mohit Gupta .

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!