I'm currently trying to emulate ARMv4T and wasn't able to find any information about this: When and exception handler returns, it has to move the saved PC value (r14) to the PC register and set the status register to the saved status register. This has to be done in the same instruction, since restoring CPSR might change to thumb mode and could thus cause the setting of PC to be interpreted incorrectly. In the technical reference manual of the ARM7TDMI (the processor I want to emulate), it says that setting PC to the saved value will also automatically restore the status register (Example for undefined exceptions), but how does the processor know when that is done?
If it restores it whenever PC is set, that wouldn't allow for subroutine calls in exception handlers and comparing the value PC is set to with the expected value seems too inefficient to me.