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