diff --git a/libsrc/cbm510/crt0.s b/libsrc/cbm510/crt0.s index d135e9618..88c9a5dfe 100644 --- a/libsrc/cbm510/crt0.s +++ b/libsrc/cbm510/crt0.s @@ -425,16 +425,16 @@ 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 - -; Enable interrupts - cli +; Call module constructors. + + jsr initlib + ; Push arguments and call main() jsr callmain @@ -443,9 +443,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 diff --git a/libsrc/cbm610/crt0.s b/libsrc/cbm610/crt0.s index 95ba67ffe..6627a9270 100644 --- a/libsrc/cbm610/crt0.s +++ b/libsrc/cbm610/crt0.s @@ -346,16 +346,16 @@ Z4: jmp Init .segment "PAGE2" -; Call module constructors, enable chained IRQs afterwards. +; Activate chained interrupt handlers, then enable interrupts. -Init: jsr initlib - lda #.lobyte(__INTERRUPTOR_COUNT__*2) +Init: lda #.lobyte(__INTERRUPTOR_COUNT__*2) sta irqcount - -; Enable interrupts - cli +; Call module constructors. + + jsr initlib + ; Push arguments and call main() jsr callmain @@ -364,9 +364,9 @@ Init: jsr initlib ; point for the break vector. _exit: pha ; Save the return code + jsr donelib ; Run module destructors lda #$00 sta irqcount ; Disable custom irq handlers - jsr donelib ; Run module destructors ; Address the system bank