]> git.sur5r.net Git - cc65/blobdiff - libsrc/runtime/condes.s
Fixed a bug
[cc65] / libsrc / runtime / condes.s
index e9409753500e8c46d809e598c73a8689cfebbe75..36940530c37fbaf154ed9756a0d38144d2b6e020 100644 (file)
 ; libinit and libdone call condes with the predefined module constructor and
 ; destructor tables, they must be called from the platform specific startup
 ; code.
+
 ;
 ; The function does also export jmpvec as general purpose jump vector that
 ; lies in the data segment so it's address may be patched at runtime.
 ;
 
-               .export libinit, libdone, condes
+               .export initlib, donelib, condes
                .export jmpvec
 
                .import __CONSTRUCTOR_TABLE__, __CONSTRUCTOR_COUNT__
@@ -29,7 +30,7 @@
 ; --------------------------------------------------------------------------
 ; Initialize library modules
 
-.proc  libinit
+.proc  initlib
 
        lda     #<__CONSTRUCTOR_TABLE__
        ldx     #>__CONSTRUCTOR_TABLE__
 ; --------------------------------------------------------------------------
 ; Cleanup library modules
 
-.proc  libdone
+.proc  donelib
 
-       lda     #<__DESTRUCTOR_TABLE__
-       ldx     #>__DESTRUCTOR_TABLE__
-       ldy     #<(__DESTRUCTOR_COUNT__*2)
-       bne     condes
+       lda     #<__DESTRUCTOR_TABLE__
+       ldx     #>__DESTRUCTOR_TABLE__
+       ldy     #<(__DESTRUCTOR_COUNT__*2)
+       bne     condes
        rts
 
 .endproc
@@ -73,7 +74,11 @@ loop:        ldy     index
        sta     jmpvec+1
        sty     index
        jsr     jmpvec
-       jmp     loop
+.ifpc02
+       bra     loop
+.else
+       jmp     loop
+.endif
 
 done:  rts