This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

radical retrofit expands 65c02 architecture

radical retrofit expands 65c02 architecture
by on (#68051)
hello, fellow 6502 lovers

Some of you folks will be interested in this project. It is a co-processor that extends the 65c02 architecture, and it provides new registers and new instructions that are fully as fast and flexible as those of the legacy CPU. One of the main benefits is a 16 MByte address space, implemented without the constricting "window" arrangement that's the mainstay of ordinary memory expansion schemes.

I hope you enjoy the article! All feedback (and questions, especially if anything stated is unclear) are welcome.

Cheers,
Jeff

Edit: Updated link; snappier blurb :)

by on (#68053)
I wonder if anyone ever made a 32-bit 6502?

by on (#68054)
Dwedit wrote:
I wonder if anyone ever made a 32-bit 6502?


The "Terbium": http://forum.6502.org/viewtopic.php?t=785

by on (#68055)
Lol they say the 68K is better then 65816 or whatever......I take it they have never had alot of first hand experience with 65XX programming.....6809 is so much easier then 6502! :P


And why are they flipping out over all this C stuff? I'd never write C on such a understood and good chip as that. 6502 != C.



Imagine putting one of these in a NES and writing C programs for NES!.....I bet games would run at , eh, 2 frames a second. Portability FTW.


BUT ANYWAY....

That project you have is pretty amazing.....I'd be more amazed if I understood hardware at all. :) But it seems epic. Keep on adding, man! :)

by on (#68061)
Dwedit wrote:
I wonder if anyone ever made a 32-bit 6502?

ARM.

As for C on 6502 family, NovaYoshi claims to have evidence that Koei's turn-based war sims were written in C, or at least in mixed C/assembly. Specifically, he ran strings on a ROM and saw *printf() formatting commands. This would have allowed the same simulation to get compiled for 6502, Z80, GB-Z80, MC68000, and 8086, with different assembly language front-ends for each platform. In the modern era, use of C++ allows the same game with the same maps, physics, and NPC behaviors to get ported to i686 (PC 32-bit), amd64 (PC 64-bit), ARM (DS, iOS), PowerPC (Wii, 360, PS3), and MIPS (PSP), again with platform-specific front-ends.

by on (#68087)
They might ave had a custom C compilers, C complers for PC's suck. I see program in A couple 20 MB that can be done in like 512K on NES! :P

by on (#68090)
65024U wrote:
I see program in A couple 20 MB that can be done in like 512K on NES! :P

True, but that's not necessarily the compiler's fault. That's because whenever people need a certain feature they use a library for it, a library that does what they need plus tons of things they don't need. That adds up quickly.

by on (#68091)
65024U wrote:
They might ave had a custom C compilers, C complers for PC's suck. I see program in A couple 20 MB that can be done in like 512K on NES! :P

Sometimes the 20 MB allows for far more generality, allowing your program to reach a larger market. Arabic in particular reorders glyphs in the line and changes their shape based on their neighbors, and PC libraries have to support this behavior. Chinese has thousands of characters, and PC libraries need glyphs for these. PC screen resolutions and pixel depths vary from 640x480x8 bit all the way up to 1920x1080x32 bit and beyond; libraries have to support scaling of background and sprite textures, vector rendering, and color space conversion, and data needs more detail if the game isn't intentionally retraux. PCs (apart from the far smaller market of home theater PCs) have smaller screens designed for one person per machine, and libraries have to support networking to communicate among copies of the program on separate machines.

by on (#68110)
Idk....I just HATE having any more then needed on PC so it bugs me more then anyone. :P



I hope one day Mac just gives up and dies, eve though MS isn't that great, at least one platform would dominate. Thats what computers need. :P


And then....we all combine here and make our own PC! :P

by on (#68111)
Heading back on topic...

I think that the KimKlone was a really neat idea. The design seems really nifty. Definitely ++ geek points.

The only thing even remotely like it that I've come across was a guy who built a dual-processor 68B09E computer. The 68B09E uses a dual phase clock (phi-0 and phi-1, 90 degrees out of phase). The CPU only drives the bus when one of the phases is active (I forget if it is high or low). So the designer put both chips is parallel, except that he inverted one of the phases for only one of the CPUs. The CPUs shared ROM and most RAM, but did have a small, per-CPU RAM bank (for stack and private vars).

So it is similar to the KK in that the CPUs run in parallel on the SAME BUS, but totally different in that the KK's extra "processing" augments the existing CPU and is not SMP computing.

by on (#68112)
And you can always upgrade it to 6309's......Wow, that chip is insane. It's like a 32bit 8bit micro. :P



I can only imagine the logic behind this....We should hire him to make a MMC3 clone that can fit on that one chip you guys were talking about with the "Cells" :P

by on (#68115)
Who's making a dual 6809/6309 computer? 6309 is the coolest cpu ever. Please tell me it's going to have actually have a good 2D graphics chip, and not the insulting 16-color software rendering the CoCo had. I'd like to see how a 6309 could push sprites around onscreen.

by on (#68116)
Idk, it was mentioned above, but I just mentioned swapping it out. And dude, that was 8 years before NES was out so it was damn good for it's time. :P


Lol this project is like a 6809-6309 equivalent, I wish this was on a chip....imagine the power! -pokes bunnyboy- XD

by on (#68143)
65024U wrote:
Idk, it was mentioned above, but I just mentioned swapping it out. And dude, that was 8 years before NES was out so it was damn good for it's time. :P


Lol this project is like a 6809-6309 equivalent, I wish this was on a chip....imagine the power! -pokes bunnyboy- XD


CoCo3 was released in 1986 and was using software rendering, with a smaller resolution and smaller color palette than the Amiga which was released the same year. As a result, the 68000 looked God-like because it was used in systems that used powerful graphics chips, whereas the 6309 was made to look like a cheap and crappy cpu because it was used in a few bottom-of-the-barrel computers.

What did the 68000 have that the 6309 didn't? Sure the 68000 was capable of being clocked at slightly higher Mhz speeds and had a few more internal registers, but for everything else, it gets its butt kicked by the 6309.

by on (#68144)
I know I own and program on one and know that.....I thought you were talking about the Coco 1 :P XD And the 6309 isn't even as close to the 68000, 16/32 bit @ 8 or so Mhz vs 8-bit @1 Mhz.....no competition. :P





Could this be added to the 65816 or whatever the SNES uses?

by on (#68146)
65024U wrote:
I know I own and program on one and know that.....I thought you were talking about the Coco 1 :P XD And the 6309 isn't even as close to the 68000, 16/32 bit @ 8 or so Mhz vs 8-bit @1 Mhz.....no competition. :P


I'm sure he means at the same clock speed.

by on (#68149)
65024U wrote:
Could this be added to the 65816 or whatever the SNES uses?

The 65816 already has much of this in the form of the K (program segment), B (data segment), and D (direct page base) registers and 16-bit X and Y. Besides, there are only two spare opcodes: COP and WDM.

by on (#68153)
65024U wrote:
I know I own and program on one and know that.....I thought you were talking about the Coco 1 :P XD And the 6309 isn't even as close to the 68000, 16/32 bit @ 8 or so Mhz vs 8-bit @1 Mhz.....no competition. :P


Can the 68000 shift a register in 1 cycle? No it can't!
Can the 68000 multiply in 10 cycles? No it can't!
Can the 68000 add an immediate in 2 cycles? No it can't!

by on (#68157)
Lol okay okay....but still it's 16-bit/32-bit. It can move alot more data at a time easily. Not that I've programmed it...but still.



And dang.....only 2 extra opcodes? Darn.... :( Oh well. Still. Yet I say again....amazing. :3

by on (#68158)
65024U wrote:
Lol okay okay....but still it's 16-bit/32-bit. It can move alot more data at a time easily. Not that I've programmed it...but still.


6309:

LDQ #$01234567 ;;7 cycles
STQ $00 ;;8 cycles

15 cycles


68000:

MOVE.L #$01234567,(a0) ;;20 cycles

20 cycles

by on (#68161)
Hmmm I guess if you need to. But whatever, I don't really care....I'd take 68000 over it any day but thats just me. :P ^_^



Can't get 6309'sat 3Mz at all IIRC, They're rare. 68000's are everywhere....I have a couple genesis's I could gut for them too. :P

by on (#68166)
psycopathicteen
wrote:
Can the 68000 shift a register in 1 cycle? No it can't!
Can the 68000 multiply in 10 cycles? No it can't!
Can the 68000 add an immediate in 2 cycles? No it can't!

Heheheh... I'm a big 6309 fan, too. I've only ever coded for 6809, though. 68000 looks nice; I wanna try that as well.

But as for all the jousting over clocks and relative performance of different chips, wouldn't it make sense to bear in mind how many clocks are required for a bus cycle -- ie, to access memory? It doesn't impress me one way or the other if a chip's crystal frequency is high or its clocks-per-op are low. A more meaningful measure is, "how fast will it run using a given memory system -- one with 100 ns access, for example. (We were having a similar discussion over on 6502.org. Another proposed metric was, "how fast will it run using a given amount of power?")

clueless wrote:
Heading back on topic...

The only thing even remotely like [the KimKlone] that I've come across was a guy who built a dual-processor 68B09E computer.

It's pretty weird that you'd say that, Clueless. The last computer I built before the KimKlone was almost exactly like what you describe! I couldn't get my hands on '09Es, though, so I used a pair of non-E chips.

There was a 64KB DRAM array -- 64K-by-1 chips were new at the time! -- and instead of 2:1 multiplexers (eg 74257) for Row & Column it had 4:1 mux's to take Row & Column addresses from each CPU in turn. The memory ran at 3 Mhz; the CPUs at 1.5. How times have changed! Nowadays it'd be absurd to imagine main memory running TWICE AS FAST AS THE CPU!!!

Back on topic, as you say... (well, close at least!) -- check out these links. Here's a guy who, like me, saw hardware potential in the 6502 SYNC pin. It's very powerful to latch the same instruction that the CPU is latching!! But Jorge took the ball and ran in another interesting direction, quite different from the KimKlone.

http://homepage.mac.com/jorgechamorro/a ... index.html
http://forum.6502.org/viewtopic.php?t=1160

Cheers,

Jeff

by on (#68171)
I am pretty sure Coco 1 & 2 used 6809E's...especially since there is a "high speed poke" that increse the CPU speed. So go buy some trash ones somewhere and part them out if you'd need some. :) Just saying, top give an idea of where to get them. ^_^


Also.....the way 6809 works with the Y register is to add a $10 (IIRC) in front of a X register instruction. If the 65816 has 2 other opcodes unused, could you double the registers by just taking that and adding it in front of every instruction to reverse the registers used in the instruction to a extended register set to double the registers on the chip? I am understanding how this works, right? XD
Re:
by on (#107119)
3gengames wrote:
Lol this project is like a 6809-6309 equivalent, I wish this was on a chip....
Meaning that the Kimklone upgrade to 6502 is comparable to the 6309 upgrade to 6809? Interesting comparison. BTW it would've been nice to implement the KK as a chip, but unfortunately CPLDs and FPGAs didn't exist back then!

On a side note, apparently in 1978 Hitachi and Motorola set up a technology sharing deal which resulted in a huge improvement to Motorola's at-the-time inferior wafer fab process. As for the 6309, you'd almost wonder whether it was Hitachi's way of once again demonstrating their sophistication! The technology sharing agreement is discussed in this Oral history of the 68000.

clueless wrote:
I think that the KimKlone was a really neat idea. The design seems really nifty. Definitely ++ geek points.

The only thing even remotely like it that I've come across was a guy who built a dual-processor 68B09E computer. [...] The CPUs shared ROM and most RAM, but did have a small, per-CPU RAM bank (for stack and private vars).

I mentioned having built a dual 6809 computer myself, and recently I finally got around to documenting the project online.
Attachment:
6809 computer block diagram.gif
6809 computer block diagram.gif [ 15.95 KiB | Viewed 1075 times ]
FWIW there is no private memory space for either CPU, but the address map is distorted in a way that allows each CPU to have its own unique interrupt vectors.

In closing, two quick notes: Last summer I posted a one-page summary of the KK Computer.
Attachment:
KK_block_diagram_simplified.gif
KK_block_diagram_simplified.gif [ 24.67 KiB | Viewed 1075 times ]
Also, there's a new web site and forum now online, set up by some of the folks from 6502.org. Please check out anycpu.org :D

cheers,
Jeff
http://LaughtonElectronics.com