Interrupt Operation; Normal Interrupt - Nintendo 1504166 - Game Boy Advance SP Edition Console Programming Manual

Programming manual
Table of Contents

Advertisement

AGB Programming Manual

15.2 Interrupt Operation

The user can arbitrarily define the Interrupt Processing Routine, but as a general rule,
the Monitor ROM handles this processing. For further details on each register, please
refer to "ARM7TDMI Data Sheet".

15.2.1 Normal Interrupt

1) If an interrupt occurs, the CPU enters IRQ mode and control shifts to
the Monitor ROM. In Monitor ROM, save each register (R0~R3, R12,
LR_irq (former PC)) to the Interrupt Stack. The total is 6 words. Next,
call the user interrupt processing set up in 03007FFCh. Commands
called from the monitor directly must be in 32bit code format.
USR Stack
03007F00
2) User interrupt processing is done (you can reference the cause of the
interrupt with the IF Register). Also solve* problems with a stack, if
necessary.
3) Restore the registers (total of 6 words) saved to the Interrupt Stack
and return to user main processing.
USR Stack
03007F00
*Note
Only the interrupt stack is used for normal interrupt processing. Therefore,
there is a possibility of stack overflow in some cases. To solve this
problem, you can either allocate a larger interrupt stack by moving SP_usr
in advance or use user stack for both, by switching the CPU mode to the
user mode in user interrupt processing. For the latter method, see the
explanation of multiple interrupts that is discussed on the following page.
©1999 - 2001 Nintendo of America Inc.
IRQ Stack
03007FA0
SP_usr
6 W O R D S
03007F00
IRQ Stack
03007FA0
SP_usr
03007F00
160
SVC Stack
03007FE0
SP_irq
03007FA0
SVC Stack
03007FE0
SP_irq
03007FA0
D.C.N. AGB-06-0001-002B4
Interrupt Control
SP_svc
SP_svc

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Agb series

Table of Contents