Unless the timing of your program is critical or you're looking to highly optimize your program, you shouldn't need to worry about it, but for those cases when you do...
The page boundaries are every 256 bytes (that would be $100, or nearly $FF as you stated). Page boundaries aren't relative to the IP (or PC as it's called in the 6502). If your PC is at $04F0 and branches to $0510, that's crossing a page boundary at $0500, and relative instructions (branches and index mode addressing) need the extra cycle.
For the really curious, the reason why is because the 6502 uses the same 8-bit ALU to calculate addresses from offsets and index registers as it does for accumulator arithmetic. Within a page for example, branching ahead $20 bytes from $0470 means the ALU takes one cycle to add and put the $90 part of $0490 in the PC low; the $04 part doesn't need to be changed at all. However, crossing a page boundary by branching $20 bytes ahead from $04F0 takes two cycles, because the ALU has to calculate $F0 + $20 = $10 in one cycle, and then use the carry to increment the $04 in PC-high on the next cycle, to come up with $0510 in both PC low and PC high.
Scott
|