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

Related Questions

Let X1, X2 be two independent normal random variables with means μ1, μ2 and standard deviations σ1, σ2 respectively. Consider Y = X1 - X2; μ1 = μ2 = 1, σ1 = 1, σ2 = 2, Then,
Consider the following system of equations in three real variables x1, x2 and x3
2x1 - x2 + 3x3 = 1
3x1 - 2x2 + 5x3 = 2
-x1 - 4x2 + x3 = 3
This system of equations has