From 9f48c6509ccd6fa1e032e612a919eb569252300e Mon Sep 17 00:00:00 2001 From: cuz Date: Sun, 14 Dec 2003 17:41:27 +0000 Subject: [PATCH] Don't use callax because condes is called in interrupt handlers git-svn-id: svn://svn.cc65.org/cc65/trunk@2755 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/runtime/condes.s | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/libsrc/runtime/condes.s b/libsrc/runtime/condes.s index 77d0b1c00..959ec4a0a 100644 --- a/libsrc/runtime/condes.s +++ b/libsrc/runtime/condes.s @@ -15,7 +15,6 @@ .export initlib, donelib, condes - .import callax .import __CONSTRUCTOR_TABLE__, __CONSTRUCTOR_COUNT__ .import __DESTRUCTOR_TABLE__, __DESTRUCTOR_COUNT__ @@ -52,7 +51,8 @@ ; -------------------------------------------------------------------------- -; 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 @@ -64,11 +64,12 @@ loop: ldy index 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 @@ -81,8 +82,8 @@ done: rts ; -------------------------------------------------------------------------- -; 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 @@ -93,4 +94,4 @@ index: .byte 0 getbyt: lda $FFFF,y rts - +jmpvec: jmp $0000 -- 2.39.5