Multiple choice

How are the carry flag (CY) and parity flag (PF) affected by the following instructions?

MOV A, #0F5H ADDA, #0BH

  1. CY = 0; PF = 0

  2. CY = 1; PF = 0

  3. CY = 1; PF = 1

  4. CY = 0; PF = 1

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

MOV A, #0F5H; A=F5 hex ADDA, #0BH; A=F5+0B=00F5 +0B => 1111 0101 + 0000 1011 = 0000 0000 After the addition register A(destination) contains 00, the flags are as follows: CY = 1 as there is carry out from D7. PF = 1 as the number of 1’s is zero.