Difficulty: Easy
Correct Answer: True
Explanation:
Introduction / Context:
Branch-on-zero instructions in the 8051 evaluate the Accumulator directly for JZ/JNZ. Recognizing how the condition is formed helps quickly reason about loop termination or infinite loops during code reviews.
Given Data / Assumptions:
Concept / Approach:
MOV A, #01H sets A to 1 on every pass. JNZ checks whether A ≠ 0. Since A is 1, the condition is always true, so control jumps back to STAT and repeats the same sequence forever—an infinite loop.
Step-by-Step Solution:
Verification / Alternative check:
If any instruction cleared A before JNZ (e.g., CLR A) or if JNZ tested a different flag, the loop might exit. Here, neither occurs, confirming the infinite loop.
Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
True
Discussion & Comments