GATE / CS ARCHIVE

GATE CSE 1992 / QUESTION 2(iv)

A computed jump using PCHL

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

GATE 1992, Q2(iv) MSQ
Report issue

Instructions & Addressing Modes

Question 2(iv), GATE 1992: 8085 PCHL copies HL to PC. Which construct is it especially useful for: if/then/else, while, case, call?
Question 2(iv), GATE 1992: 8085 PCHL copies HL to PC. Which construct is it especially useful for: if/then/else, while, case, call?
Tap to enlarge
Select all that apply
Answer & solution

Answer: C: case dispatch through a jump table (no official key was published)

A case statement can compute an index, retrieve the selected branch address from a table into HL, then use PCHL to jump directly there. This is an indirect/computed branch rather than a fixed immediate target. Ordinary if and while control are usually implemented with conditional direct branches. PCHL also does not save a return address, so it is not a complete CALL instruction. With auxiliary code an indirect jump can participate in many constructs; C identifies the characteristic direct application, not an impossibility theorem for every other use.

Original paper, page 2