Page 1 of 1
help!A question
Posted: Thu Jul 30, 2009 4:54 am
by amin2312
i dont understand,like "AND Absolute,X" instruction that spend cycles is write "4 (+1 if page crossed)",what's mean "+1 if page crossed"?
who man can tell me,thank you very much
Posted: Thu Jul 30, 2009 6:45 am
by GARTHWILSON
Welcome.
Perhaps an example would be best: Let's say X contains $56. AND $1000,X will AND the value in the accumulator with what is contained at address $1056. It is still in page $10, so the indexing does not cause a crossing of page boundaries. But if you do AND $10E0,X, now $10E0+$56=$1136, so you are no longer getting a value from page $10, but rather page $11. The page boundary was crossed by the indexing, and an extra cycle was required.
Posted: Thu Jul 30, 2009 7:06 am
by amin2312
thank u.i have understand.
but if "INC Absolute,X" is "INC $10E0,$56",then the page was crossed,so it will be spend an extra cycle.why the "INC Absolute,X" instruction dont take "(+1 if page crossed)"?
INC instruction reference:http://www.obelisk.demon.co.uk/6502/reference.html#INC
Posted: Thu Jul 30, 2009 7:57 am
by GARTHWILSON
The 65c02 does do it, according to the programming manual put out by the manufacturer, WDC, available at
http://www.westerndesigncenter.com/wdc/ ... manual.pdf . It takes 6 clocks without crossing, 7 if it does cross. According to my old Synertek book, the NMOS always took 7.
The page you linked only has the NMOS 6502 instructions. Unless you are trying to use vintage equipment like the Commodore 64, I recommend going to the CMOS 6502 (65c02) as it has more instructions and addressing modes, all the bugs fixed, onboard clock oscillator, lower power (obviously), and other enhancements.
Posted: Thu Jul 30, 2009 8:59 am
by amin2312
thank you very much!!thank u solve my question,thank u again!