Nintendo 1504166 Programming Manual - Page 167
Multiple Calls, If System Call occurs during User interrupt processing, the System Call
View all Nintendo 1504166 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 167 highlights
AGB Programming Manual AGB System Calls 17.1.2 Multiple Calls 1) When an argument is required for the system call used, after reading to the registers, R0-R3, call the monitor ROM system call with the "SWI". 2) Save the registers, SPSR_svc (formerly CPSR), R12, LR_svc (formerly PC) to the system call stack with the monitor ROM. 03007F00 USR Stack 03007FA0 SP_usr IRQ Stack SP_irq 03007FE0 SVC Stack 4 WORDS SP_svc 03007F00 03007FA0 3) Switch from CPU mode to system mode. The status of the IRQ Disable Flag prior to the call is kept in System ROM. The previous conditions will be continued. 4) Save the R2 and LR_usr registers to the user stack. Other registers will be saved with each system call. 03007F00 Usr Stack LR_usr R2 Save with each System Call SP_usr 03007FA0 03007F00 IRQ Stack SP_irq 03007FE0 03007FA0 5) Interrupt occurs while executing system call. SVC Stack 4 WORDS SP_svc 03007F00 USR Stack LR_usr R2 Save with each System Call SP_usr 03007FA0 03007F00 IRQ Stack 6 WORDS SP_irq 03007FE0 03007FA0 SVC Stack 4 WORDS SP_svc 6) User interrupt processing is done. (You can reference the cause of the interrupt with the IF Register.) The CPU mode is changed to System Mode (User Mode with privilege) in order to solve the problem with stacks (to reference interrupt processing). 03007F00 USR Stack LR_usr R2 Save with each System Call User Interrupt Processing SP_usr 03007FA0 03007F00 IRQ Stack 6 WORDS SP_irq 03007FE0 03007FA0 SVC Stack 4 WORDS SP_svc àIf System Call occurs during User interrupt processing, the System Call is called using Multiple Calls. ©1999 - 2001 Nintendo of America Inc. 167 D.C.N. AGB-06-0001-002B4