[net.micro] 6502 entomology.

SPAM@Mit-Ai@sri-unix (11/20/82)

From: David A Boulton <SPAM@Mit-Ai>

In regard to your reply to my reply to... (etc.):

    Date: 19 Nov 1982 1329-EST
    From: Larry Seiler <SEILER at MIT-XX>

	...
    I did a lot of work with the 6502 at one time (including using a logic
    analyzer to trace what it was doing), and I disagree with several of
    spam's statements.  First, I seem to recall that the 6502 manual
    stated that an indirect jump with an address across a page boundary
    (xxFF) takes an extra cycle in order to propogate the addition.

I refer you to page 9-18 of the 6502 Programming Manual (at least in 
the Rockwell edition).  In describing the bus states of the Jump Indirect
instruction:

	cycle	addr. bus	data bus	external op.	internal op.
	...
	  4     IAH,IAL		ADL		Fetch ADL	Add 1 to IAL
	  5	IAH,IAL+1	ADH		Fetch ADH	Store ADL
	  6	ADH,ADL		Next opcode	Fetch next opcode

Clearly, the carry \is not/ propagated.  Also, personal experience tells
me that the manual is correct.  I spent DAYS finding that mother!

    Second, the 6502 does NOT always throw away prefetched instruction
    bytes.  That only happens on register to register instructions.  For
    any instruction in which there is at least one data byte following the
    opcode byte in the instruction stream, the 6502 doesn't waste any
    prefetched bytes.  Finally, every computer that has a cache
    shares with the 6502 the property of reading locations it doesn't need.

Well, all I can say on this one is that a hardware engineer whom I respect
greatly concluded that the 6502 in fact threw all prefetchs away.  When
asked whether this was true, people at MOS Technology and Synertek were
very suprised, but they never denied that it was the case.  We took that
to mean 'Yes'.  Alex knows more about 6502 hardware than anyone I have ever
known, so I tend to take his statement seriously.

I hope you didn't take my message as being denigrating towards the 6502, it
certainly wasn't mean't to be.  The 6502 has a lot of advantages (mainly 
it is very fast and very cheap) but I find writing assembler for it to
be pretty tedious.  Also when you are wringing everything you can out
of the chip, these little quirks can certainly be annoying.

I'm sure that most people on the Info-Micro list must find this discussion
of the fine points of 6502 awfully boring, so perhaps we should continue
the conversation without cc'ing them.

	;S
	  spam