Difficulty: Medium
Correct Answer: False
Explanation:
Introduction / Context:
This question tests precise bit masking and comparison in 8051 assembly. Correctly identifying which bit is being tested requires understanding hexadecimal masks and the CJNE instruction semantics.
Given Data / Assumptions:
Concept / Approach:
Bit values are: bit0 = 01H, bit1 = 02H, bit2 = 04H, etc. Applying ANL A, #02H zeroes all bits except bit1. If bit1 is high, A becomes 02H; if bit1 is low, A becomes 00H. The CJNE A, #02H, READ loops until A equals 02H (bit1 set). Therefore, the code checks bit1, not bit2.
Step-by-Step Solution:
Verification / Alternative check:
Had the intention been to test bit2, the mask should be #04H and the comparison should be #04H accordingly.
Why Other Options Are Wrong:
Common Pitfalls:
Off-by-one errors in bit masks (confusing bit numbering with 1-based human counting). Always map bit n to 1 << n: bit2 corresponds to 04H.
Final Answer:
False
Discussion & Comments