-
What are the sates of the Auxiliary Carry (AC) and carry Flag (CY) after executing the following 8085 program?
MVI H, 5DH
MVI L, 6BH
MOV A, H
ADD L
-
- AC = 0 and CY = 0
- AC = 1 and CY = 1
- AC = 1 and CY = 0
- AC = 0 and CY = 1
- AC = 0 and CY = 0
Correct Option: C
The MVI instruction loads 5DH in H register and 6BH in L register respectively. The MOV instruction moves the contents of the source to the destination i.e., the contents of register H are copied in accumulator A. And the ADD instruction adds the contents of destination register i.e., L to the accumulator A. Thus, the program performs the above functions and adds 5DH and 6BH to obtain the result as 0101 1101 (5DH) + 0110 1011 (6BH) = 1100 1000 The result 1100 1000 is stored in the flags as
Thus, the value stored in AC and CY is 1 and 0 respectively as the value of P flag is passed to AC as a carry.