Let's talk about anything related to the 6502 microprocessor.
Toyman
Posts: 2 Joined: 13 Jul 2006
Post
by Toyman » Mon Jul 17, 2006 10:44 am
Hi
How does the Compare Absolute (DD) determine Page Crossing ?
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
8BIT
Posts: 1787 Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:
Post
by 8BIT » Mon Jul 17, 2006 12:57 pm
Hi
How does the Compare Absolute (DD) determine Page Crossing ?
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:
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