Re: Hardware emulation of 6509 using 6502?

From: Jim Brain <brain_at_jbrain.com>
Date: Sat, 28 Jul 2018 02:00:20 -0500
Message-ID: <d1327f7b-de77-9eb5-0bc5-29dcb9b05443@jbrain.com>
On 7/25/2018 4:03 AM, smf wrote:
> On 24/07/2018 07:30, Jim Brain wrote:
>
>>> Can you set new $0/$1 while in 65816 that take effect when switching 
>>> back to 6509?
>> Sorry, but the registers disappear in '816 mode
>>
>>>
>>> And the same for setting the 65816 environment from 6509 mode before 
>>> switching?
>> nope, sorry.
>
> Does this mean you can only switch from 6509 to 65816 from a routine 
> in bank 0?
Yes, and I think that's OK, as Bank 0 is always known to exist in both 
environments.
>
> The PBR will be 0 at startup and you can't change it until you're in 
> 65816 mode. You can leave the PBR set when you return to emulation 
> mode, but if an interrupt occurs in emulation mode then it gets set 
> back to 0. So the only way to keep consistency is to handle that 
> transition from bank 0.
Yes.
>
> And if you switched to 65816 in bank 0 and can't update $0/$1 in 65816 
> mode, then returning to emulation mode needs to be done in bank 0 as 
> well.
Yep.
>
> AFAICT Interrupts in 65816 mode will be fetched from bank 0 and in 
> 6509 they will be fetched from bank 15.
I don't know how interrupts can be fetched from bank 15, unless $0 is 
set to 15, which it does not look like it is.

Jim
Received on 2018-07-28 10:00:06

Archive generated by hypermail 2.2.0.