.export initlib, donelib, condes
- .import callax
.import __CONSTRUCTOR_TABLE__, __CONSTRUCTOR_COUNT__
.import __DESTRUCTOR_TABLE__, __DESTRUCTOR_COUNT__
; --------------------------------------------------------------------------
-; Generic table call handler
+; Generic table call handler. We cannot use callax here, since condes is also
+; used for interrupt handlers, and callax clobbers ptr1.
.proc condes
beq done
dey
jsr getbyt
- tax
+ sta jmpvec+1
dey
- jsr getbyt
+ jsr getbyt
+ sta jmpvec+2
sty index
- jsr callax
+ jsr jmpvec
.if (.cpu .bitand ::CPU_ISET_65SC02)
bra loop
.else
; --------------------------------------------------------------------------
-; Data. The getbyte routine is placed in the data segment cause it's patched
-; at runtime.
+; Data. The getbyte and jmpvec routines are placed in the data segment
+; cause they're patched at runtime.
.bss
getbyt: lda $FFFF,y
rts
-
+jmpvec: jmp $0000