Re: [stella] Instruction timing tip

Subject: Re: [stella] Instruction timing tip
From: Nick Bensema <nickb@xxxxxx>
Date: Fri, 8 Oct 2004 14:41:21 -0700 (MST)
On Fri, 8 Oct 2004, Ben Larson wrote:

> I commend your effort in trying to come up with a
> general formula.  I don't know though...I think the
> exceptions make it almost as hard as just memorizing
> the chart though, IMHO. :)

Right; I tried this approach before, when I split the instructions into
various categories, and provided cycle counts for all of the addressing
modes.  I probably should have included tables that would make it more
useful as a cheat sheet, at least.

But, really, there's no substitute for experience here.  As you program
6502 and apply cycle counting, you'll start to get a feel for it.
Especially if you're programming the 2600.  It's just like how BASIC
programmers used to have to look up all those PEEK and POKE addresses,
but had them all memorized after a while.

> As far as the exception cases, I don't think any of
> them are because of pipelining.  

Actually, if you look around the Commodore 64 programming pages long
enough, you may just find a document that describes exactly what the
6502 is doing on each instruction cycle.  I've seen this document, and
that's how I know that one-byte instructions take two cycles because
the 6502 always reads the byte after the opcode, whether it needs to
or not.  A lot of the "rules" described here probably aren't far from
the truth.

Nick Bensema <nickb@xxxxxx>   ICQ#2135445
~~~~ ~~~~~~~ ~~~~~~~~~~~~~~

Current Thread