]> git.sur5r.net Git - cc65/blobdiff - libsrc/geos/devel/crt0.s
Fixed problems that were introduced with r4287.
[cc65] / libsrc / geos / devel / crt0.s
index 32ff757b9126692cdf2a3181e0c2793379097a9d..6d85a963107cb3d2f1cb154df3b7940b30290eb8 100644 (file)
@@ -1,28 +1,18 @@
 ;
-; This must be the *second* file on the linker command line
-; (.cvt header must be the *first* one)
-
+; Startup code for geos
+;
 ; Maciej 'YTM/Elysium' Witkowiak
 ; 26.10.99, 10.3.2000, 15.8.2001, 23.12.2002
 
+       .export         _exit
+        .export         __STARTUP__ : absolute = 1      ; Mark as startup
+
        .import         __RAM_START__, __RAM_SIZE__     ; Linker generated
        .import         initlib, donelib
-               .import         pushax
-       .import         _main
-       .import         _MainLoop, _EnterDeskTop
+       .import         callmain
        .import         zerobss
        .importzp       sp
-       .export         _exit
-
-; ------------------------------------------------------------------------
-; Create an empty GEOSZP segment to avoid linker warnings
-
-.segment       "GEOSZP", zeropage
-
-; ------------------------------------------------------------------------
-; Create an empty LOWCODE segment to avoid linker warnings
-
-.segment        "LOWCODE"
+       .include        "../inc/jumptab.inc"
 
 ; ------------------------------------------------------------------------
 ; Place the startup code in a special segment.
 
        jsr     initlib
 
-; Pass an empty command line
-
-       lda     #0
-       tax
-       jsr     pushax          ; argc
-       jsr     pushax          ; argv
+; Push arguments and call main()
 
        cli
-       ldy     #4              ; Argument size
-               jsr     _main           ; call the users code
+               jsr     callmain
 
-; Call module destructors. This is also the _exit entry which must be called
-; explicitly by the code.
+; Call module destructors.
 
 _exit: jsr     donelib         ; Run module destructors
 
-       jmp     _EnterDeskTop   ; return control to the system
+       jmp     EnterDeskTop    ; return control to the system