Re: [stella] FE Bankswitching

Subject: Re: [stella] FE Bankswitching
From: "Eckhard Stolberg" <Eckhard_Stolberg@xxxxxx>
Date: Sat, 1 Mar 2003 21:28:35 +0100
> Wait for two consecutive accesses to the stack ($0100-$01FF).
> 
> IF the first access was at an EVEN address (A0 == 0) then use D5 of the
> second access.
> 
> IF the first acces was at an ODD address (A0 == 1) then use D5 of the
> access AFTER the second access (i.e. the THIRD access).

Are you sure that the part with the even address is really nessessary?
According to this desription of the JSR and RTS command:

     JSR

        #  address R/W description
       --- ------- --- -------------------------------------------------
        1    PC     R  fetch opcode, increment PC
        2    PC     R  fetch low address byte, increment PC
        3  $0100,S  R  internal operation (predecrement S?)
        4  $0100,S  W  push PCH on stack, decrement S
        5  $0100,S  W  push PCL on stack, decrement S
        6    PC     R  copy low address byte to PCL, fetch high address
                       byte to PCH

     RTS

        #  address R/W description
       --- ------- --- -----------------------------------------------
        1    PC     R  fetch opcode, increment PC
        2    PC     R  read next instruction byte (and throw it away)
        3  $0100,S  R  increment S
        4  $0100,S  R  pull PCL from stack, increment S
        5  $0100,S  R  pull PCH from stack
        6    PC     R  increment PC

a JSR would do three accessess to the stack with only two
different addresses (cycle 3 and 4 have the same address),
while a RTS does three accesses with three different addresses.

If the JSR/RTS would always be executed over the top of the
stack memory, the first access to the stack would always be
an odd address. For JSR it would be $01FF, and for RTS it
would be $01FD. The high byte of the destination address
would be read in the cycle after the second access to the
stack in both cases.

Have you ever tried your FE bankswitching hardware with
only the part for the odd address? If that wouldn't
work, it would mean that this description of the internal
behaviour of JSR/RTS is wrong. That might confirm the
description that Kroko posted.


Ciao, Eckhard Stolberg


----------------------------------------------------------------------------------------------
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/


Current Thread