[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
RET Return from Procedure Flags: not altered
RET optional-pop-value
Logic: POP IP
If FAR RETURN (inter-segment)
POP CS
SP . SP + optional-pop-value (if specified)
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.
--------------------------------------------------------------------------
Operands Clocks Transfers Bytes Example
(intrasegment, no pop) 20 1 1 RET
(intrasegment, with pop) 24 1 3 RET 4
(intersegment, no pop) 32 2 1 RET
(intersegment, pop) 31 2 3 RET 2
--------------------------------------------------------------------------
See Also:
IRET
CALL
JMP
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson