Return from Procedure                            

86/88

Y

186

Y

286

Y

386

Y

486

Y

RET/RETF [n bytes]

Ovfl

N

Dir

N

Int

N

Trap

N

Sign

N

Zero

N

Aux

N

Prty

N

Carry

N

    RET transfers control from a called procedure back to the instruction
    following the CALL, by:

         :   Popping the word at the top of the stack into IP
         :   If the return is an intersegment return:
         :   Popping the word now at the top of the stack into CS
         :   Adding the optional-pop-value, if specified, to SP

    The assembler will generate an intrasegment RET if the procedure
    containing the RET was designated by the programmer as NEAR, and an
    intersegment RET if it was designated FAR. The optional-pop-value
    specifies a value to be added to SP, which has the effect of popping
    the specified number of bytes from the top of the stack.

------------------------------------ Timing ----------------------------------

OpCode          Instruction             386     286     86
C3              RET                     10+m    11      16
CB              RETF                    18+m    15      26
        lesser priviledge               32+m    55
C2 iw           RET imm16               10+m    11      20
CA iw           RETF imm16              18+m    15      25
        lesser priviledge               32+m    55

------------------------------------ Logic -----------------------------------

        POP IP
        if FAR RETURN (inter-segment)
                POP CS
        SP = SP + optional bytes

See Also IRET CALL JMP


Copyright © 1985 to 2022 Beta Systems                            Last modified: Wednesday, January 05, 2022 .