Which instruction is used to return from a subroutine in 8085?
RET
In the 8085 microprocessor, a subroutine is a reusable block of code that is invoked with a CALL instruction. When CALL executes, the processor automatically saves the address of the next instruction (the return address) by pushing the 16-bit Program Counter onto the stack and decrementing the Stack Pointer (SP) by 2. To come back to the main program, the reverse operation is needed, and that is exactly what RET does.
The RET instruction performs the following:
RET is the unconditional return. The 8085 also provides conditional returns (RC, RNC, RZ, RNZ, RP, RM, RPE, RPO) that return only when a specified flag condition is satisfied.
The other choices do not return from a subroutine. CALL does the opposite of RET — it transfers control into a subroutine and saves the return address. RST (Restart) is a special one-byte call to a fixed vector location, typically used for interrupts, not for returning. JMP merely changes the Program Counter to a new address without using the stack, so it neither saves nor restores any return address and cannot bring control back to the caller.
What is the function of the INTA’ signal in the 8085 microprocessor?
In the 8085 microprocessor, what will be the value of the Program Counter after execution of the instruction RST 3?
What does the instruction ORA B do in 8085?
In the 8085 microprocessor, what does the instruction PCHL do?
In the 8085 microprocessor, what operation is performed by the instruction SUI 20H?
What is the function of the INTA’ signal in the 8085 microprocessor?
In the 8085 microprocessor, what will be the value of the Program Counter after execution of the instruction RST 3?
What does the instruction ORA B do in 8085?
In the 8085 microprocessor, what does the instruction PCHL do?