Nintendo 1504166 Programming Manual - Page 165
AGB System Calls, 17.1 System Call Operation, 17.1.1 Normal Calls
View all Nintendo 1504166 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 165 highlights
AGB Programming Manual AGB System Calls 17 AGB System Calls Please refer to the AGB System Call Reference Manual for AGB system calls. 17.1 System Call Operation 17.1.1 Normal Calls 1) When an argument is required for the system call used, after writing to registers R0-R3 call the monitor ROM system call with the "SWI". The CPU mode changes to Supervisor Mode. 2) Save the registers, SPSR_svc (formerly CPSR), R 11, R12, LR_svc (formerly PC) to the system call stack with the monitor ROM. 03007F00 USR Stack 03007FA0 SP_usr 03007F00 IRQ Stack SP_irq 03007FE0 SVC Stack 4 WORDS SP_svc 03007FA0 3) Switch from CPU mode to system mode. Call the IRQ disable flag with monitor ROM. The previous status will continue. 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 SVC Stack 4 WORDS SP_svc 03007FA0 5) Complete processing using each system call. 03007F00 USR Stack 03007FA0 SP_usr 03007F00 IRQ Stack SP_irq 03007FE0 SVC Stack 4 WORDS SP_svc 03007FA0 ©1999 - 2001 Nintendo of America Inc. 165 D.C.N. AGB-06-0001-002B4