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 __STACKSIZE__ ; Linker generated
12 .import initlib, donelib
16 .include "../inc/jumptab.inc"
18 ; ------------------------------------------------------------------------
19 ; Place the startup code in a special segment.
29 lda #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
31 lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
32 sta sp+1 ; Set argument stack ptr
34 ; Call module constructors
38 ; Push arguments and call main()
43 ; Call module destructors.
45 _exit: jsr donelib ; Run module destructors
47 jmp EnterDeskTop ; return control to the system