
THE 80286 INSTRUCTION SET
RET -Return from Procedure
Opcode | Instruction | Clocks· | Description | ||
CB |
| RET |
| 15,pm=25 | Return to far caller, same privilege |
CB |
| RET |
| 55 | Return, lesser privilege, switch stacks |
C3 |
| RET |
| 11 | Return to near caller, same privilege |
CA | dw | RET | dw | 15,pm=25 | RET (far), same privilege, pop dw bytes |
CA | dw | RET | dw | 55 | RET (far), lesser privilege, pop dw bytes |
C2 | dw | RET | dw | 11 | RET (near), same privilege, pop dw bytes |
|
|
|
|
| pushed before Call |
• Add 1 clock for each byte in the next instruction executed.
FLAGS MODIFIED
None
FLAGS UNDEFINED
None
OPERATION
RET transfers control to a return address located on the stack. The address is usually placed on the stack by a CALL instruction; in that case, the return is made to the instruction that follows the CALL.
There is an optional numeric parameter to RET. It gives the number of stack bytes to be released after the return address is popped. These bytes are typically used as input parameters to the procedure called.
For the
For the
In protected mode, an
The DS u;;.d ES Geg:ne~t registers !!!'!yb~ 8f:'tto 7.~rn hy the
The following list of checks and actions describes the
Second word on stack must be within stack limits else #SS(O)
Return selector RPL must be 2:: CPL else #GP (return selector)
If return selector RPL = CPL then