Skip to navigation

Lander on the Acorn Archimedes

Start and end: ReturnToDesktop

Name: ReturnToDesktop [Show more] Type: Subroutine Category: Start and end Summary: Return to the desktop
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * AbortWithMemoryError calls ReturnToDesktop
.ReturnToDesktop LDMFD R13!, {R14} \ Restore the value from the stack and store \ it in R14, so R14 contains the same value \ that it had when the game was first run, \ and which we stored on the stack in the \ Entry routine \ \ So this sets R14 to the address we should \ return to when quitting the game LDR R13, stackPointerOnEntry \ Set R13 to the value that we stored in the \ Entry routine, so that the stack pointer \ is restored to the value that it had when \ the game was first run, and which we \ stored in stackPointerOnEntry in the Entry \ routine MOV PC, R14 \ Exit from the game by jumping to the \ address in R14, which will return us to \ the Desktop (or wherever the game was run \ from)