Nintendo GAME BOY ADVANCE Programming Manual page 161

Hide thumbs Also See for GAME BOY ADVANCE:
Table of Contents

Advertisement

May 25, 2005
15.5.2
Multiple Interrupts
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 mon-
itor 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).
If multiple interrupts occur, SPSR_irq will be overwritten, so you must save before enabling IRQ.
USR Stack
03007F00
The Stack problem is solved* (CPU mode is changed to user mode with system mode = privilege
here.) and IRQ is enabled.
With user interrupt processing, user stack is used because the CPU is in system mode. When call-
ing the subroutine, save LSR_usr as well.
USR Stack
03007F00
LR_usr 
User Interrupt
Processing
When an interrupt occurs, Monitor ROM does the processing (1) again, and loads each register to
the interrupt stack.
USR Stack
03007F00
LR_usr 
User Interrupt
Processing
Continue processing (2).
© 1999-2005 NINTENDO
Interrupt Operation
IRQ Stack
03007FA0
SP_usr 
6 WORDS
03007F00
IRQ Stack
03007FA0
SP_usr 
6 WORDS
SPSR_irq
03007F00
IRQ Stack
03007FA0
6 WORDS
SPSR_irq
SP_usr
03007F00
IRQ Stack
03007FA0
6 WORDS
SPSR_irq
SP_usr 
6 WORDS
03007F00
SVC Stack
03007FE0
SP-irq
03007FA0
SVC Stack
03007FE0
SP_irq
03007FA0
SVC Stack
03007FE0
SP_irq
03007FA0
SVC Stack
03007FE0
SP_irq
03007FA0
AGB-06-0001-002-B13
Released: May 27, 2005
139
SP_svc
SP_svc
SP_svc
SP_svc

Advertisement

Table of Contents
loading

Table of Contents