GATE / CS ARCHIVE

GATE CSE 1995 / QUESTION 1.1

Clearing the low nibble

Computer Organization & Architecture · Instructions & Addressing Modes · Full GATE CSE 1995 paper

GATE 1995, Q1.1 1 mark · MCQ
Report issue

Instructions & Addressing Modes

Question 1.1, GATE 1995: Which 8085 instruction clears the accumulator’s lower four bits while retaining the upper four: XRI 0FH, ANI F0H, XRI F0H, or ANI 0FH?
Tap to enlarge
Your answer
Answer & solution

Answer: B: ANI F0H (no official key was published)

F0H is binary 11110000. AND with its four high ones preserves the corresponding accumulator bits; AND with its four low zeros clears those bits. Thus ANI F0H performs the required masking. XOR would toggle selected bits instead of necessarily clearing them. ANI 0FH does the opposite mask, preserving the low nibble and clearing the high nibble. The operation is independent of the accumulator’s initial value.

Original paper, page 1