.export _atexit
.destructor doatexit, 5
.import __errno
- .import jmpvec
+ .import callax
.include "errno.inc"
beq @L9 ; Jump if done
dey
lda exitfunc_table,y
- sta jmpvec+2
+ tax
dey
lda exitfunc_table,y
- sta jmpvec+1
sty exitfunc_index
- jsr jmpvec ; Call the function
+ jsr callax ; Call the function
.ifpc02
bra doatexit
.else
@L9: rts
-.endproc
+.endproc
.export initlib, donelib, condes
- .import jmpvec
+ .import callax
.import __CONSTRUCTOR_TABLE__, __CONSTRUCTOR_COUNT__
.import __DESTRUCTOR_TABLE__, __DESTRUCTOR_COUNT__
sta getbyt+1
stx getbyt+2
- sty index
+ sty index
loop: ldy index
beq done
dey
jsr getbyt
- sta jmpvec+2
+ tax
dey
jsr getbyt
- sta jmpvec+1
sty index
- jsr jmpvec
+ jsr callax
.ifpc02
bra loop
.else