[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 6502 / 65C02's Invalid Address Bus



Bryan Parkoff wrote:

>I find an interesting issue that invalid address always occur when
>page boundary is crossed.  Low Byte of Address Bus is always correct,
>but High Byte of Address Bus is always invalid until extra cycle to
>correct High Byte of Address Bus.
>    Understanding Apple //e manual claims that 65C02 has fixed invalid
>address on fourth cycle, but 65816 is not fixed.  I have not tested
>Apple //e and Apple //c yet.
>
>For example.
>
>0FFE: LDX #$FF
>1000: LDA $C051,X
>1003: RTS
>
>6502
>X = FF
>Cycle 1
>Address Bus: 1000
>Data Bus: BD
>Cycle 2
>Address Bus: 1001
>Data Bus: 51
>Cycle 3
>Address Bus: 1002
>Data Bus: C0
>Cycle 4
>Address Bus: C050
>Data Bus: IGNORE
>Cycle 5
>Address Bus: C150
>Data Bus: DATA
>
>    65C02 should always place 1002 instead of C050 on fourth cycle
>before it places C150 on fifth cycle.  I give three example
>instructions from $0FFE through $1003 for you to test on Apple II+,
>Apple //e, and Apple IIgs, but I have not tested Apple //e yet.
>    You run at *FFEG.  See what happen...GR (Low Graphic Resolution)
>is turned on at $C050 on fourth cycle since it is always in TEXT
>screen.  Please let me know what you find this out.  What do you
>think?

I think that the 6502 designers accomplished a great deal
with very little logic, and spent relatively little time on the
details of states they considered "don't care".

It is true that placing "unreferenced" addresses on the bus
for a processor that must always either read or write (since
there are not separate "read" and "write" request lines) can
create some issues for memory-mapped I/O.  It is necessary
to consider what "phantom" addresses might be generated
while code is running to avoid problems.  This is not, in
general, very difficult, though it would be nice not to have
to consder it at all.

In the specific case of the Apple II, people who write
$Csxx slot ROM code must consider these effects.

(BTW, your sugestion to re-fetch $1002 above is probably
inconsistent with the implementation.  I would expect that
the program counter has already been incremented to $1003,
but that should generally work, too.)

-michael

Check out parallel computing for 8-bit Apples on my
Home page:  http://members.aol.com/MJMahon/