]> git.sur5r.net Git - cc65/blobdiff - libsrc/cbm510/crt0.s
remove superfluous ".code" line
[cc65] / libsrc / cbm510 / crt0.s
index d135e96184ff4ed9168e06c220ca303b192fa923..ef2cb8c6295a8256597c2016d1e5dc6c2bc03e1b 100644 (file)
@@ -1,10 +1,9 @@
 ;
 ; Startup code for cc65 (CBM 500 version)
-;
-; This must be the *first* file on the linker command line
 ;
 
        .export         _exit
+        .export         __STARTUP__ : absolute = 1      ; Mark as startup
 
        .import         _clrscr, initlib, donelib, callirq_y
        .import         push0, callmain
@@ -425,15 +424,15 @@ ccopy2:   lda     __VIDRAM_START__,y
         lda     ExecReg
                sta     IndReg
 
-; Call module constructors, enable chained IRQs afterwards.
+; Activate chained interrupt handlers, then enable interrupts.
 
-        jsr    initlib
         lda     #.lobyte(__INTERRUPTOR_COUNT__*2)
         sta     irqcount
+       cli
 
-; Enable interrupts
+; Call module constructors.
 
-       cli
+        jsr    initlib
 
 ; Push arguments and call main()
 
@@ -443,9 +442,9 @@ ccopy2:     lda     __VIDRAM_START__,y
 ; point for the break vector.
 
 _exit:  pha                    ; Save the return code on stack
+        jsr    donelib         ; Run module destructors
        lda     #$00
         sta     irqcount        ; Disable custom irq handlers
-        jsr    donelib         ; Run module destructors
 
 ; Address the system bank