10.36 ERET

Exception Return.

Syntax

ERET{cond}
where:
cond
is an optional condition code.

Usage

In a processor that implements the Virtualization Extensions, you can use ERET to perform a return from an exception taken to Hyp mode.

Operation

When executed in Hyp mode, ERET loads the PC from ELR_hyp and loads the CPSR from SPSR_hyp. When executed in any other mode, apart from User or System, it behaves as:
  • MOVS PC, LR in the ARM instruction set.
  • SUBS PC, LR, #0 in the Thumb instruction set.

Notes

You must not use ERET in User or System mode. The assembler cannot warn you about this because it has no information about what the processor mode is likely to be at execution time.
ERET is the preferred synonym for SUBS PC, LR, #0 in the Thumb instruction set.

Architectures

This ARM instruction is available in ARMv7 architectures that include the Virtualization Extensions.
This 32-bit Thumb instruction is available in ARMv7 architectures that include the Virtualization Extensions.
There is no 16-bit version of this instruction in Thumb.
Related concepts
2.4 Processor modes, and privileged and unprivileged software execution
Related reference
10.55 MOV
10.138 SUBS pc, lr
10.8 Condition code suffixes
10.37 HVC
Non-ConfidentialPDF file icon PDF versionARM DUI0379G
Copyright © 2007, 2008, 2011, 2012, 2014, 2015 ARM. All rights reserved.