Skip to content

RET

Operation

Pops and validates a return PC, then atomically advances SP and transfers control.

Assembler Syntax

RET

Privilege

Unprivileged

When LPA.A is one, RET validates LPC as a near return target without authenticating LPA.PA. It restores eight bytes of stack footprint when PA is zero and 16 bytes when PA is nonzero, clears LPC and LPA, and transfers within the current CS. No return-record memory location is accessed on this path.

When LPA.A is zero, RET reads one 64-bit return address from SS:SP, advances SP by eight bytes, validates the target, and transfers control to it.

  1. Read the 8-byte return address through the old SS:SP context without changing SP.

  2. Validate that address as an executable target under the current CS.

  3. Commit advanced SP and the new PC as one successful control-transfer operation.

A stack-read or target-validation fault leaves SP, PC, LPC, and LPA unchanged.

2.75in

Encodings

RET

Format: Instruction format for RET

Format: Instruction format for RET