Skip to content

ERET

Operation

Return through a staged user context or from an architectural event.

Assembler Syntax

ERET

Privilege

Supervisor only

Classify the return source before stack access, then atomically return through a valid staged or outer-event U bank, or restore a valid active supervisor event frame.

  1. Classify the return source before any stack access. A staged direct user entry requires supervisor mode, STATUS.EA clear, STATUS.EDEPTH zero, STATUS.UO clear, and UCTL.V set. An outer user-event return requires STATUS.EA set, STATUS.EDEPTH one, STATUS.UO set, and UCTL.V set. Other active supervisor returns use the memory frame.

  2. For a U-bank return, validate UCTL, UINFO, the user segments and pointers, and the executable UPC, then atomically restore user state, clear UCTL.V, STATUS.EDEPTH, STATUS.UO, STATUS.EA, and current DFA, and perform no stack access.

  3. For a stacked return, read and decode FRAME_CONTROL at SS:SP without changing SP. Accept only the defined BASIC, ERROR, PAGE, and AUXILIARY sizes, with all reserved bits zero.

  4. Validate that saved STATUS.EDEPTH plus one equals the current depth and that saved and current STATUS.UO preserve the outer-origin chain.

  5. Read the complete selected frame and validate FRAME_CONTROL.FLAGS, FRAME_CONTROL.STATUS, CS, DS, SS, SP, and an executable canonical PC without changing architectural state.

  6. Ignore the value in the fixed-header PADDING slot at offset +0x38.

  7. Atomically restore the validated architectural state and current DFA from FRAME_CONTROL.SAVED_DFA. Hidden repeat state remains clear; if SAVED_PC identifies a repeat prefix, that prefix is decoded and executed normally after return.

  8. After restoration, admit a pending NMI before the next instruction boundary when STATUS.NI is clear and ECR.NMI_P is set.

2.75in

Encodings

ERET

Format: Instruction format for ERET

Format: Instruction format for ERET