2 ; This must be the *second* file on the linker command line
3 ; (.cvt header must be the *first* one)
5 ; Maciej 'YTM/Elysium' Witkowiak
6 ; 26.10.99, 10.3.2000, 15.8.2001, 23.12.2002
8 .import __RAM_START__, __RAM_SIZE__ ; Linker generated
9 .import initlib, donelib
12 .import _MainLoop, _EnterDeskTop
17 ; ------------------------------------------------------------------------
18 ; Create an empty GEOSZP segment to avoid linker warnings
20 .segment "GEOSZP", zeropage
22 ; ------------------------------------------------------------------------
23 ; Create an empty LOWCODE segment to avoid linker warnings
27 ; ------------------------------------------------------------------------
28 ; Place the startup code in a special segment.
38 lda #<(__RAM_START__ + __RAM_SIZE__)
40 lda #>(__RAM_START__ + __RAM_SIZE__)
41 sta sp+1 ; Set argument stack ptr
43 ; Call module constructors
47 ; Pass an empty command line
55 ldy #4 ; Argument size
56 jsr _main ; call the users code
58 ; Call module destructors. This is also the _exit entry which must be called
59 ; explicitly by the code.
61 _exit: jsr donelib ; Run module destructors
63 jmp _EnterDeskTop ; return control to the system