GATE / CS ARCHIVE

GATE CSE 1995 / QUESTION 2.1

Doubling a register pair

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

GATE 1995, Q2.1 2 marks · MCQ
Report issue

Instructions & Addressing Modes

Question 2.1, GATE 1995: Which two 8085 instructions double DE and leave the result in HL: XCHG/DAD B, XTHL/DAD H, PCHL/DAD D, or XCHG/DAD H?
Tap to enlarge
Your answer
Answer & solution

Answer: D: XCHG; DAD H (no official key was published)

XCHG exchanges the DE and HL register pairs, so HL receives the original DE. DAD H then adds HL to itself and stores the 16-bit result in HL. Thus the pair produces twice the original DE, modulo 216, with carry recording overflow. DAD B would add BC rather than double HL; XTHL exchanges with stack memory; PCHL changes control flow. These different effects rule out the other sequences.

Original paper, page 3