From: cuz Date: Wed, 28 Apr 2004 09:47:57 +0000 (+0000) Subject: Set FNAM_BANK *after* calling constructors X-Git-Tag: V2.12.0~837 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6aae136a00af4770b3003035d071460844224bb7;p=cc65 Set FNAM_BANK *after* calling constructors git-svn-id: svn://svn.cc65.org/cc65/trunk@2989 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/c128/crt0.s b/libsrc/c128/crt0.s index 247fdb743..3e3576a21 100644 --- a/libsrc/c128/crt0.s +++ b/libsrc/c128/crt0.s @@ -50,11 +50,6 @@ Head: .word @Next lda #14 jsr BSOUT -; Set the bank for the file name our execution bank - - lda #0 - sta FNAM_BANK - ; Before doing anything else, we have to setup our banking configuration. ; Otherwise just the lowest 16K are actually RAM. Writing through the ROM ; to the underlying RAM works, but it is bad style. @@ -93,6 +88,13 @@ L1: lda sp,x jsr initlib +; Set the bank for the file name to our execution bank. We must do this, +; *after* calling constructors, because some of them may depend on the +; original value of this register. + + lda #0 + sta FNAM_BANK + ; If we have IRQ functions, chain our stub into the IRQ vector lda #<__IRQFUNC_COUNT__