Re: [stella] I think I got F8 bankswitching to work.

Subject: Re: [stella] I think I got F8 bankswitching to work.
From: Thomas Jentzsch <tjentzsch@xxxxxx>
Date: Thu, 19 Jun 2003 11:44:28 +0200
Aaron Bergstrom wrote:
> The file seems to run fine in both stella and z26.

But only due to some luck!

> Could you check it once more please?

It's not correct.

        org $1fea
        rorg $dfea
        LDX $1ff9

After the instruction the program counter (PC) is at $2fed in the other
bank. But there is "nothing", because the code starts at $2ff0:

        org $2ff0   ;other bank start
        rorg $fff0  ;
        jmp Start

But you are lucky here. DASM fills all unused gaps with $FF. And $FF is
a valid illegal opcode (ISB abs,x; ISB = increase M and subtract from A)
that doesn't crash the CPU and has the correct length of the 3 missing

So when your code starts at the 1st bank this happens:
$1fea LDX $1ff9   ; X = $FF
$2fed ISB $ffff,x ; M = $FFFF + X = $00FE
$2ff0 jmp Start   ; back on track again!

And because you initialize whole zeropage anyway, you won't notice that
change at the end of the RAM. :-)

Have fun!
Thomas Jentzsch         | *** Every bit is sacred ! ***
tjentzsch at web dot de |

Archives (includes files) at
Unsub & more at

Current Thread