Problems related to arm9-interruption and PC and LR
1, assuming the current is PC, PC-4, PC-8. Current "get to PC" = current PC, current "decoding PC" = Current PC-4,
Current "Run PC" = Current PC-8. For example, as shown in, the current "value is PC" = 16, the current "decoded PC" = 12, and the current "executed PC" = 8.
2. If an IRQ exception occurs, perform the protection operation, LR stores the next address of the address where no command is executed because FIQ or IRQ takes the lead (LR stores the value of the current PC, that is, the value of the command address ), that is, LR points to the command with the command address = 16, but the command with the command address = 12 has not been executed, and the command will continue to be executed after the return is interrupted.
3. Enter the interrupted service program
4, before the return of the interrupt, LR processing, LR = LR-4, pointing to the address of the previously decoded but not executed command (if the return directly returns PC, so there is a command in the middle that is not executed)
5. Return
Note: There are only three levels of flow shown in the figure.