Nintendo 1504166 Programming Manual - Page 159

System-Allocated Area in Work RAM, By changing each CPU Mode SP Initial-value

Page 159 highlights

AGB Programming Manual Interrupt Control 15.1 System-Allocated Area in Work RAM Controlling interrupts entails, along with clearing the IF register and setting the IE register, first writing an interrupt jump address at addresses $7FFC-$7FFF (total of 32 bits; see figure below) in the system allocated area of Work RAM. Processing is executed in 32-bit mode for the user interrupt. To return control from the interrupt routine to the user program, the instruction "BX LR" is used. 32 bit 03007FFC Interrupt Address 03007FF8 Allocated Area * Interrupt Check Flag 03007FF4 Allocated Area 03007FF0 Sound BufferAddress Allocated Area 03007FE0 LR_SVC (formerly IBPC) R12 R11 SPSR_SVC (formerly CPSR) 03007FA0 LR_IRQ (formerly PC) R12 R3 R2 R1 R0 03007F00 SP_svc System Call Stack (4 words/1 time) SP_irq Interrupt Stack (6 words/1 time) SP_usr User Stack * Specify where to return for SoftReset( ) System Call If 0h:08000000h If not 0h:02000000h By changing each CPU Mode SP Initial-value, they can be set to an arbitrary memory map. ©1999 - 2001 Nintendo of America Inc. 159 D.C.N. AGB-06-0001-002B4

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171

AGB Programming Manual
Interrupt Control
©1999 - 2001 Nintendo of America Inc.
159
D.C.N. AGB-06-0001-002B4
15.1 System-Allocated Area in Work RAM
Controlling interrupts entails, along with clearing the IF register and setting the IE
register, first writing an interrupt jump address at addresses $7FFC-$7FFF (total of 32
bits; see figure below) in the system allocated area of Work RAM.
Processing is
executed in 32-bit mode for the user interrupt.
To return control from the interrupt
routine to the user program, the instruction “BX
LR” is used.
Interrupt Address
Allocated Area
Sound BufferAddress
03007FFC
03007FF4
LR_IRQ (formerly PC)
R0
R1
R2
R3
R12
03007FF0
Interrupt Stack
(6 words/1 time)
03007FA0
User Stack
32 bit
03007F00
SP_irq
SP_usr
Interrupt
Check Flag
03007FF8
Allocated Area
03007FE0
LR_SVC (formerly IBPC)
R12
R11
System Call Stack
(4 words/1 time)
SPSR_SVC (formerly CPSR)
SP_svc
*
Allocated
Area
* Specify where to return for SoftReset( ) System Call
If
0h:08000000h
If not 0h:02000000h
By changing each CPU Mode SP Initial-value, they can be set to an arbitrary memory map.