8085/ALU flags: “Z (Zero) flag is reset if an ALU operation results in 0.” Determine whether the statement is correct.
-
ATrue
-
BFalse
-
CTrue only after subtraction
-
DTrue only after logical operations
-
EDepends on carry state
Answer
Correct Answer: False
Explanation
Introduction / Context:Processor status flags reflect the outcome of arithmetic/logic operations. The Zero (Z) flag indicates whether the result of an operation is numerically zero. Misinterpreting set/reset polarity leads to incorrect branching and condition checks in assembly programs.
Given Data / Assumptions:
- 8085 (and many CPUs) define Z = 1 (set) when the result equals zero.
- Z = 0 (reset) when the result is non-zero.
- Applies across arithmetic and logical ALU operations that update flags.
Concept / Approach:
The statement claims the opposite of the specification. Correct behavior: if the result is 0, the Zero flag is set; if the result is not 0, the Zero flag is reset. This allows instructions like JZ/JNZ (jump if zero / not zero) to test equality efficiently.
Step-by-Step Solution:
Consider an operation yielding 0 (e.g., SUB A from itself).CPU sets Z = 1 to indicate a zero result.Therefore, the claim “Z is reset if result is 0” is incorrect.Hence, the correct evaluation is: False.Verification / Alternative check:
Consult 8085 instruction set summaries: after ANA, ORA, XRA, ADD/SUB etc., the Zero flag is set when the result equals 00h, and cleared otherwise.
Why Other Options Are Wrong:
- True / conditional variants: contradict standard 8085 flag definitions.
- Depends on carry: Zero flag is independent of carry; they are separate bits.
Common Pitfalls:
Reversing the meaning of “set” and “reset”; assuming only arithmetic updates Zero—logical ops also update it.
Final Answer:
False