Question:

After execution of ANI 0FH with accumulator = A9H, which flags are affected ?

Show Hint

Logical instructions (AND, OR, XOR) always clear the Carry and Auxiliary Carry flags (though 8085 is an exception for AC). Sign, Zero, and Parity always reflect the result.
Updated On: Aug 6, 2026
  • Sign, zero and carry
  • Carry and zero
  • Zero and parity
  • Sign, zero, parity and carry
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation

Concept:
• In 8085/8086 microprocessors, logical instructions like AND (ANA/ANI) affect the status flags in the flag register based on the result.
• For the 8085, logical operations (AND, OR, XOR) affect the Sign (S), Zero (Z), and Parity (P) flags according to the result, while the Carry (CY) flag is always cleared (0).

Step 1:
Perform the binary logic operation
Accumulator \(A = A9H = 1010 \ 1001_2\)
Immediate Data \(0FH = 0000 \ 1111_2\)
Operation: \(1010 \ 1001 \ \text{AND} \ 0000 \ 1111 = 0000 \ 1001_2\) (which is \(09H\)).

Step 2:
Determine flag status based on the result \(0000 \ 1001_2\)

Sign (S): The Most Significant Bit (MSB) is 0, so S = 0.
Zero (Z): The result is \(09H\), not zero, so Z = 0.
Parity (P): The result has 2 ones (even), so P = 1.
Carry (CY): Logical AND instructions always reset the carry flag, so CY = 0.

Step 3:
Conclusion
Since S, Z, P, and CY are all either updated based on the result or forced to a known state (cleared) by the instruction, all four are considered "affected".
Was this answer helpful?
0
0

Top CUET PG Data Science A.I Cyber Security and Computer Sci. Questions

View More Questions

Top CUET PG Microprocessors and Interfacing Questions

View More Questions