]> git.sur5r.net Git - cc65/blob - libsrc/geos/devel/crt0.s
Removed the empty LOWCODE segments from the startup files. This is now
[cc65] / libsrc / geos / devel / crt0.s
1 ;
2 ; This must be the *second* file on the linker command line
3 ; (.cvt header must be the *first* one)
4
5 ; Maciej 'YTM/Elysium' Witkowiak
6 ; 26.10.99, 10.3.2000, 15.8.2001, 23.12.2002
7
8         .import         __RAM_START__, __RAM_SIZE__     ; Linker generated
9         .import         initlib, donelib
10         .import         callmain
11         .import         zerobss
12         .importzp       sp
13         .export         _exit
14         .include        "../inc/jumptab.inc"
15
16 ; ------------------------------------------------------------------------
17 ; Place the startup code in a special segment.
18
19 .segment        "STARTUP"
20
21 ; Clear the BSS data
22
23         jsr     zerobss
24
25 ; Setup stack
26
27         lda     #<(__RAM_START__ + __RAM_SIZE__)
28         sta     sp
29         lda     #>(__RAM_START__ + __RAM_SIZE__)
30         sta     sp+1            ; Set argument stack ptr
31
32 ; Call module constructors
33
34         jsr     initlib
35
36 ; Push arguments and call main()
37
38         cli
39         jsr     callmain
40
41 ; Call module destructors.
42
43 _exit:  jsr     donelib         ; Run module destructors
44
45         jmp     EnterDeskTop    ; return control to the system