RET              Procedure return                                   Extension

RET [pop_value]

The standard RET instruction generates code that terminates the
current procedure appropriately. This includes generating epilog code
for a procedure that uses a high-level language interfacing
convention (i.e. terminating any ARG, LOCAL, and USES statements).

For a procedure with NOLANGUAGE as its calling convention (assembler
programs), the RET instruction will generate either a near return
(2-byte displacement) or a far return (4-byte displacement) depending
on how the procedure was declared.

The epilog code is generated for each RET statement that appears
inside a procedure. Outside of a procedure, RET will always generate
a near return.

The optional pop_value specifies a value to be added to the stack
pointer, which is equivalent to popping the specified number of bytes
from the top of the stack.

The RETCODE statement will generate a return of an appropriate size
without epilog code.