2 ; Startup code for geos
4 ; Maciej 'YTM/Elysium' Witkowiak
5 ; 26.10.99, 10.3.2000, 15.8.2001, 23.12.2002
8 .export __STARTUP__ : absolute = 1 ; Mark as startup
10 .import __RAM_START__, __RAM_SIZE__ ; Linker generated
11 .import initlib, donelib
15 .include "../inc/jumptab.inc"
17 ; ------------------------------------------------------------------------
18 ; Place the startup code in a special segment.
28 lda #<(__RAM_START__ + __RAM_SIZE__)
30 lda #>(__RAM_START__ + __RAM_SIZE__)
31 sta sp+1 ; Set argument stack ptr
33 ; Call module constructors
37 ; Push arguments and call main()
42 ; Call module destructors.
44 _exit: jsr donelib ; Run module destructors
46 jmp EnterDeskTop ; return control to the system