In 8086, which instruction at the end of a sub-routine takes the

In 8086, which instruction at the end of a sub-routine takes the
| In 8086, which instruction at the end of a sub-routine takes the execution back to the main program?

A. JMP

B. END

C. CALL

D. RET

Please scroll down to see the correct answer and solution guide.

Right Answer is: D

SOLUTION

  • जब हम किसी मुख्य प्रोग्राम के निष्पादन के दौरान किसी भी सबरूटीन को कॉल करते हैं तो अगले निर्देश का पता स्टैक में संग्रहीत होता है
  • जब हम सबरूटीन के निष्पादन को पूरा करते हैं, तो प्रोग्राम को मूल प्रोग्राम पर वापस लौटना होगा
  • इसलिए, यह एड्रेस को पॉप आउट कर देता है जो कॉल के निष्पादन के दौरान स्टैक में संग्रहित होता है और प्रोग्राम काउंटर PC को सौंपा जाता है
  • The RET (Return) instruction is also equivalent to POP instruction. Hence it will take 3 machine Cycles (Opcode fetch, Read operation, Read operation)

Opcode

Operand

Explanation

Example

CALL

Address

Calls a subroutine and saves the return address on the stack.

CALL 2050

RET

None

Returns from the subroutine to the main program

RET

JUMP

Address

Transfer the control of execution to the specified address

JUMP 2050

LOOP

Address

Loops through a sequence of instruction until Cx = 0

LOOP 2050

END

none

Marks the termination point of the program

END