6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Jun 06, 2024 5:00 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri Dec 29, 2017 2:27 pm 
Offline

Joined: Wed Oct 06, 2010 9:05 am
Posts: 95
Location: Palma, Spain
So we know that on NMOS 6502s, a read-modify-write instruction was implemented using one read from the effective address, and two writes (one unmodified, one modified). On CMOS, this was changed so that two reads and one write are performed.

Can anyone confirm that, on CMOS 6502s, the operation is performed on the value from the first read rather than the second? It seems fairly clear that this would be the case, as during the second read cycle, the ALU should be processing what was read in the first read cycle, but you can never be too sure. There are some gruesome cases where this could matter, e.g. RMW on a 6522 timer.

Thanks!


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 29, 2017 5:22 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10822
Location: England
I agree, it must be true - an experiment on a BBC Master, reading the timer as you suggest, would prove it.


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 29, 2017 5:33 pm 
Offline

Joined: Wed Oct 06, 2010 9:05 am
Posts: 95
Location: Palma, Spain
Thanks a lot Ed, helpful as ever! :D


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 29, 2017 6:38 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3363
Location: Ontario, Canada
RichTW wrote:
you can never be too sure.
Certainly there are cases where this could matter. But the amount of doubt about the outcome is awfully small! And running a test might actually be quite awkward to arrange, unless you can single-step or have a logic analyzer to capture what happens.

What I would do myself, in light of how very small the doubt is, would be to trust that the behavior is as presumed, and go ahead and write whatever time-critical code you require. IMO there's very little risk you'll be forced to subsequently tweak that code because the presumption was wrong.

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: