RTE Instruction


The instruction RTE (ReTurn from Exception) is used to put data in both the status register and the program counter with the same instruction. This instruction is necessary when an operating system that is working in supervisor mode must leave the control to an application in user mode. The new contents in the status register and the program counter is popped from the stack. First, a word is popped into the status register, then a longword is popped into the program counter. Thus, the stack pointer is increased by six. This instruction requires that the S bit is set in the status register when the instruction is executed. Since the status register is changed after the instruction, it's possible that the processor will be in user mode then.

ADDRESS METHODS: None

DATA LENGTH: -

FLAGS: All flags are popped from the stack.

SYNTAX: RTE