[comp.sys.apple] The speed of the 6502

sdh@thumper.UUCP (02/24/87)

The 6502 runs at 1.02 Mhz.  I do not know how much of this time goes directly
to instructions.

One of the reasons that the Apple could go faster than the 4Mhz TRS-80 is that
the TRS-80 was Z-80 based, and the z-80 instructions take quite a good number
of cycles to execute (roughly 4 times as many as a 6502).

For example and indexed load in for the 6502 takes 3 or 4 cycles (depending
on certain specific conditions).  While I do not know the specifics ofr the Z-80,
it will far more cycles than 3 or 4.  When you think about it, 3 or 4 is
pretty darn efficient.  I think cycles are determined by the number of microcode
steps required to do an instruction.

Retief of the CDT
bellcore!sdh

sl109001@silver.UUCP (02/26/87)

     More specifically, the quickest instructions on the 6502 (and
65C02) flit by in 2 cycles, with the slowest taking 7 cycles.  The
loading instructions actually vary by quite a bit, depending on
where the byte is coming from.
     For example, "LDA  #4" will load the A register with the CONSTANT
integer 4 (kind of like: LET A = 4).  This takes 2 cycles.
     On the other hand, "LDA  (IND),Y" is a more complicated load,
given the fancy name of "Indexed Indirect Mode", and takes 5 or 6 cycles.
     All computers need an internal clock so that the "microcode" 
evaluation of even these tiny instructions can be timed correctly with
other processes.  For example, interrupts are not handled until a 
machine language instruction is completely finished, and this will
always be at the end of a cycle.
     What I like about the 65C02 instruction set is that it's
relatively simple (or as simple as machine language CAN be!), and 
seems well organized to me.  Once you've mastered it, other micro-
processors are easy to learn as well.
     And when you think about it, there's ultimately no such thing as
a high level language anyway. . .
____________________________________________
"May the forces of evil become confused on the way to your house."
                                -- George Carlin
Pensively,
           Phaedrus (aka Colin Klipsch)
           Indiana University
           sl109001@silver.bacs.indiana.edu