
The KimKlone: a radical 6502 redesign - 0x12
http://www.laughtonelectronics.com/arcana/BrideOfSonPg1.html
======
ChuckMcM
This is nice stuff. I built a TV-Typewriter using Don Lancaster's cheap video
cookbook. He pioneered this technique of 'co-processing' with the 6502.
However, if you were going to do this today, you would be better off just
building a 6502 into an FPGA [1] or buying an existing design [2] and
modifying it. Jan Gray did a nice RISC cpu [3] that clearly got some
inspiration from the the 6502 and it was very small in terms of gates
(although that isn't such a big deal these days).

It is well worth your time to get an FPGA evaluation kit (my all time favorite
is the Altera DE-2) and learn for yourself how straight forward it is to build
your own CPU which is has instructions that do things you need vs what the
manufacturer thought you might need.

[1] <http://opencores.com/project,lattice6502>

[2] <http://edablog.com/2010/05/06/mos-6502-cpu/>

[3] <http://fpgacpu.org/xsoc/cc.html>

Don's book: [http://www.abebooks.com/9780672215247/Cheap-Video-
Cookbook-L...](http://www.abebooks.com/9780672215247/Cheap-Video-Cookbook-
Lancaster-Donald-0672215241/plp)

------
kabdib
World record for a stock 6502 without cooling is ~ 25Mhz, done one semi-drunk
Friday evening in a lab at Commodore by Leonard Tramiel and associates.

"Let's see how fast this thing can go before the smoke gets out."

[Told to me by Leonard. I miss Friday beer-bashes surrounded by lab equipment,
all kinds of stuff can happen. Richard Frick has the Atari distance record for
a reverse-biased 555 timer; it blew its top about 15 feet.]

~~~
0x12
> Richard Frick has the Atari distance record for a reverse-biased 555 timer;
> it blew its top about 15 feet.

Haha! That's really funny, spectator sports for nerds :)

25Mhz is not too shabby, how did the ram hold up at those speeds?

------
0x12
Extremely clever use of the illegal opcodes in the original 6502, check out
the way he fakes the output of the databus to the processor by pretending a
different opcode was read than the one that was actually read.

Hacking at its finest.

------
Dr_Jefyll
Thank you, 0x12 and all of you, for your interest in my quirky creation.
Naturally I follow modern FPGA technology avidly, but I guess it's obvious
that my project predates that sort of thing. 2901 style Bit-Slice components
were the wonder of wonders not so long ago! But modern programmable logic
brings us to another level altogether.

Another revolution of course is the community of the Internet. My KimKlone
project was conceived and implemented as a one-man effort, and for years it
remained a de facto secret since I had no way to publicize it and almost no-
one to discuss it with. These are magical times we live in, and I'm grateful
to share your ideas and comments.

\-- Jeff

------
yanowitz
If you haven't watched this video about reverse engineering the 6502 (and how
the decoder works, etc.), find the time. It's well worth the ~50 minutes. Mind
blowing stuff:
[http://www.youtube.com/watch?v=reIYvmuWHhk&amp;sns=tw](http://www.youtube.com/watch?v=reIYvmuWHhk&amp;sns=tw)

------
minikomi
Wow... Looking over some of the machines that guy had to work on is really
great.. And a testiment to how far the printing / copying field has come!

------
zokier
I wonder how old this is. Sounds like something from mid '90s maybe?

~~~
zokier
Downvotes?

------
delinquentme
this is awesome ... but can we get a TLDR?

~~~
0x12
Guy expands 6502 to 16M address space by intercepting the databus and re-
mapping unused opcodes and clever use of the spurious signals generated by the
cpu when executing other undefined opcodes, adds a few registers to make the
whole thing transparent from an assembler programmers point of view. In other
words, there is no difference to the programmer between native and newly
minted instructions.

On top of that he boosts the speed of his forth interpreter by concentrating
on a frequently used construct called 'NEXT' in a way that should make anybody
that has tried to optimize the inner loop of some VM or language proud. After
all, what better way to optimize in such a situation than to be able to mold
the instruction set to your desire.

He then uses this home-brew Frankenstein contraption as his benchtop computer
for multiple years to do real work (instead of just shooting some pretty
pictures and calling it a day).

hth

------
soapdog
is it down?

~~~
0x12
not for me.

------
hackermom
Interesting work, but I couldn't help to notice one part: _"The KimKlone
represents an architectural extension of the 65C02. The most striking
improvement is efficient linear access to a 16 Mbyte Address Space."_

Incidentally, this is what the 65816 was made for.

~~~
rbanffy
The 65816 address space was segmented, like the 8086's.

~~~
jjss
Nope, the 65816 address space is flat. If you read the docs and look at the
opcodes I see how it can give the impression of being segmented (with all the
"bank" terminology), but it's a full 24-bit address space with no
restrictions.

~~~
rbanffy
Sort of, at least. IIRC, program code could not execute across bank
boundaries, although you could do long jumps to any 24-bit address.

~~~
dfox
Which is probably the case also for this hack. It's probably possible to
devise logic that would remove this limitation, but I assume that would be
mentioned in the article.

~~~
0x12
Read the article, he's thought of that. There is a trick with two registers in
there that allows you to pivot from one bank to another.

More explanation in the appendix on the instruction set. The opcodes are 13,
23, eb and fb:

[http://www.laughtonelectronics.com/arcana/BrideOfSon%20KK%20...](http://www.laughtonelectronics.com/arcana/BrideOfSon%20KK%20Instruction%20List.html)

Bottom of the list.

~~~
dfox
It allows you to jump between banks, but not to overflow from one bank to
another without explicit jump on the boundary.

