retagged by
625 views
1 votes
1 votes
Consider the following instructions of an 8085 microprocessor
MVI D, 6 EH
MVI E, 5 DH
MOV A, D
ADD E
If above sequence of instructions are executed, then the value of carry flag (CY) and auxiliary carry (AC) flag respectively will be

(A) CY = 0, AC = 0
(B) CY = 0, AC = 1
(C) CY = 1, AC = 1
(D) CY = 1, AC = 0
retagged by

2 Answers

Best answer
2 votes
2 votes

Auxillary flag is set when we have carry out from the lower nibble to higher nibble

carry flag is set when carry out from MSB

MVI means moving immediate (move the constant value to register)

1.MVI D, 6E H      :  D ← 0110 1110 (move the value in binary to D )
2.MVI E, 5D H      :  E ← 0101 1101  (move the value in binary to E )
3.MOV A, D          :  A ← 0110 1110(move the content of register D to register A  )
4.ADD E               :  A + E   (add content of A and E)

here U can see that there is no carry out of MSB. 

but carry out from lower nibble to higher nibble (as red arrow indicate )

so CY =  0  , AC = 1

selected by
1 votes
1 votes

1. D = 0110 1110
2. E = 0101 1101
3. A = 0110 1110
4. A + E

Auxiliary Carry: if there is a carry from lower nibble to higher nibble 
Carry : If there is a carry out of MSB
MVI: Move Immediate 
Hence answer will be CY = 0, and AC=1 

Related questions

0 votes
0 votes
0 answers
1
Ray Tomlinson asked Aug 22, 2023
229 views
is this formula is correct if it is correct then in gate 2006 Question 75 why they not used this formulahttps://gateoverflow.in/43565/gate-cse-2006-question-75
1 votes
1 votes
1 answer
3