A portion of the main program to call a subroutine SUB in an 8085 environment is given below. \(\begin{matrix}:\\\ :\\\ \rm LXI&\rm D,DISP\\\ \rm LP:\ \ \ \ \ CALL\ \ \ \ \ \ \ \ \ &\rm SUB\ \ \ \ \ \\\ :\\\ :\end{matrix}\) It is desired that control be returned to LP + DISP + 3 when the RET instruction is executed in the subroutine. The set of instructions that precede the RET instruction in the subroutine are:
A portion of the main program to call a subroutine SUB in an 8085 environment is given below. \(\begin{matrix}:\\\ :\\\ \rm LXI&\rm D,DISP\\\ \rm LP:\ \ \ \ \ CALL\ \ \ \ \ \ \ \ \ &\rm SUB\ \ \ \ \ \\\ :\\\ :\end{matrix}\) It is desired that control be returned to LP + DISP + 3 when the RET instruction is executed in the subroutine. The set of instructions that precede the RET instruction in the subroutine are: Correct Answer <p>POP H</p> <p>DAD D</p> <p>PUSH D</p>
LXI D, DISP
LP: CALL SUB
LP + 3
When CALL SUB is executed LP +3 the value is pushed in the stack
POP H ⇒ HL = LP + 3
DAD D ⇒ HL = HL + DE
LP + 3 + DE
PUSH H ⇒ The last two values of the stack will be HL value
মোঃ আরিফুল ইসলাম
Feb 20, 2025