6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Tue Oct 08, 2024 8:19 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Jul 17, 2006 10:44 am 
Offline

Joined: Thu Jul 13, 2006 2:13 pm
Posts: 2
Hi

How does the Compare Absolute (DD) determine Page Crossing ?
Code:
FD07  CMP $8003,X

Where
Accumulator = $30
X Register = $05
Thus the Compared address will point to $8008 which = 0.

I've got a 6502 Simulator that adds an extra cycle because of a Page Crossing. Is this correct ? And if so why ?

Thanks


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 17, 2006 12:57 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1738
Location: Sacramento, CA
Toyman wrote:
Hi

How does the Compare Absolute (DD) determine Page Crossing ?
Code:
FD07  CMP $8003,X

Where
Accumulator = $30
X Register = $05
Thus the Compared address will point to $8008 which = 0.

I've got a 6502 Simulator that adds an extra cycle because of a Page Crossing. Is this correct ? And if so why ?

Thanks


As written above, your instruction should use 4 clock cycles because no page boundry was crossed. However, if it is coded like this:
Code:
FD07  CMP $80FD,X

where X=$05, then a page bountry is crossed (compare address is $8102).
In this case, an additional cycle is used (5 total). The extra cycle is needed to increment the upper word of the target address (from $80 to $81).

Hope that helps!
Daryl


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 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: