Re: Hardware emulation of 6509 using 6502?

From: Jeff Laughton <laughton_at_cyg.net>
Date: Mon, 02 Jul 2018 11:10:13 -0400
Message-ID: <20180702111013.Horde.Yxc1AVuu22IuhB702c-IT7c@www2.cyg.net>
Quoting Jim Brain <brain@jbrain.com>:

> On 6/29/2018 12:18 AM, Jeff Laughton wrote:
>>
>>
>>
>> LDA (z-pg),Y has a dead cycle only if there's a page crossing. For
>> NMOS a Partially Formed Address appears in the dead cycle (the
>> penultimate cycle). The PFA hasn't yet had carry added to its highbyte
>> -- IOW the PFA is $100 less than the intended address. For CMOS the
>> PFA is concealed internally and the dead cycle refetches the last
>> instruction byte at PC@ instead. <---- !!
>>
>> STA (z-pg),Y always has a dead cycle. During this cycle...
>> NMOS with a pg Xing puts a PFA on the bus
>> CMOS with a pg Xing refetches PC@ <----- !!
>> NMOS without a pg Xing puts the final, fully formed address on the bus
>> CMOS without a pg Xing puts the final, fully formed address on the bus
>>
>> IOW these last two cases involve a read-before-write.
>>
>> related post here: http://forum.6502.org/viewtopic.php?p=57496#p57496
> So, with some time to look over the traces, any ideas on what to change?

Jim (and all), I need to apologize.  When I examined the traces I  
learned my remarks were partially incorrect. (Btw thanks for posting  
the traces).

It's long been known that the NMOS '02 generates a PFA (Partially  
Formed Address, aka "invalid address") if there's a page crossing  
while using  Abs,X  Abs,Y  and  (z-pg),Y  address modes.  And my  
comments pertained to the "fix" for this, featured on the CMOS '02  
(Rockwell and WDC).  The fix 100% eliminates PFA's, but a *different*  
problem creeps in when a page crossing is *absent*!  All of this is  
explained in the 6502.org post I linked to.  Now, what's new:

I assumed this other problem affects all three modes mentioned, but  
your traces show that (z-pg),Y mode is actually OK now.  IOW the fix  
is only flawed with regard to Abs,X  and Abs, Y  modes.  Whew! -- did  
I manage to explain all that so it makes sense ?!

Yesterday I ran an experiment here at home just to double check.   
Unfortunately I've not yet begun looking into the matter that  
interests you!

regards to all,
Jeff
Received on 2018-07-02 18:00:05

Archive generated by hypermail 2.2.0.