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

Re: Sudoku puzzle solver for Apple II



Michael J. Mahon wrote:
Paul Schlyter wrote:

APproximately how much slower do you think a 6502 version would have
been?  10% slower?  Twice as slow?  10 times as slow?


Certainly less than twice as slow.  I'll find out what the current
speed impact would be...

Paul's message prompted me to re-look at where 65C02 ops are used, and
they are all quite easy to eliminate--most with no or negligible time impact.

The only one that has a measurable impact is the LDA (p) in setbox,
and that can be eliminated by just doing an LDA bit rather than a TXA,
which frees up the X register to hold 0, so that the LDA (p) can become
LDA (p,x).  (I don't get to use that addressing mode much--even if it is
with a constant 0 index.  ;-)

The net impact is +1 cycle in a 166K loop, for a total time cost of 0.17 seconds!

So I think I'll make the changes and replace ProDOS with an earlier
version, so unenhanced //e's will run the program, too.

BTW, this is a good example of why it's worth reevaluating earlier
decisions later in the game.  I had taken a quick look at this a
week ago, and, without really trying, didn't see an obvious fix.
Now it all seems pretty easy.  ;-)

So I guess this is another confirmation of my belief that the 65C02
extensions were largely unnecessary.

But, as noted, there are other things about the program(s) that
would keep it from running on your ][+, too--all fixable with
some more effort...

There's still that 80-column firmware issue...   Hmmm...

-michael

Fast Sudoku solver for Apple II's!
Home page:  http://members.aol.com/MJMahon/

"The wastebasket is our most important design
tool--and it's seriously underused."