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.
-
Classify the return source before any stack access. A staged direct user entry requires supervisor mode,
STATUS.EAclear,STATUS.EDEPTHzero,STATUS.UOclear, andUCTL.Vset. An outer user-event return requiresSTATUS.EAset,STATUS.EDEPTHone,STATUS.UOset, andUCTL.Vset. Other active supervisor returns use the memory frame. -
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. -
For a stacked return, read and decode
FRAME_CONTROLat SS:SP without changing SP. Accept only the defined BASIC, ERROR, PAGE, and AUXILIARY sizes, with all reserved bits zero. -
Validate that saved
STATUS.EDEPTHplus one equals the current depth and that saved and currentSTATUS.UOpreserve the outer-origin chain. -
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. -
Ignore the value in the fixed-header
PADDINGslot at offset +0x38. -
Atomically restore the validated architectural state and current DFA from
FRAME_CONTROL.SAVED_DFA. Hidden repeat state remains clear; ifSAVED_PCidentifies a repeat prefix, that prefix is decoded and executed normally after return. -
After restoration, admit a pending NMI before the next instruction boundary when
STATUS.NIis clear andECR.NMI_Pis set.
2.75in
Encodings
ERET
Format: Instruction format for ERET