Hacker News new | ask | show | jobs
by hth313 1862 days ago
I looked at the Mega65 with its three (not quite) 6502 CPU variants and I just found it so weird. Basically no 16 bit operations, instead a couple of 32 bit operations. Z register is no longer 0 and you have to set it non-zero to change bank configuration. Five instructions (nine bytes) to change bank and I do not understand how you can save the previous bank setting in case you want to restore it.

If you move the stack or zero page, the well known trick of using absolute plus index register no longer works the same as on the 6502 (breaking existing code). Sure, you could hardcode a different page, but the point of moving the stack is (probably) so you could do multi-tasking. But if processes are given different stack pages, they can no longer share code (if using such well known tricks in the code). Moving zero page is in 256 steps, so you cannot use it as a movable stack frame (the 65816 can set it to any location in the first 64K).

I know there is a lot of interest in the Mega65, but I found it had so many poorly made design decisions that made me want to stay far away.

So far I find the 65816 to a well designed 16 bits ISA (I am also familiar with PDP-11, MSP430, MELPS7700 and Motorola 6812) that gives a lot of 6502 vibes, but is just a lot better. There are a couple of odd corners, probably due to the opcode space as you mention, but I would not call it a bunch of compromises.

1 comments

To be clear, the value (to me) of the MEGA65 is not that its CPU is superior. It's that the developers of the project are spending a lot of time on the hard part: cases, keyboards, software, and tooling.

They have GEOS running on it, they have backwards compat with the C64, they have games modified to use its extra capabilities, they have injected molded plastic cases, they have keyboards and keycaps manufactured, they have a version of the Kernal and BASIC ported and expanded, they have a user manual, etc.

And it's a) open source and b) open.

And b) is key because they're also making it possible for their hardware to be used with other FPGA bitstreams, including ones developed for the MiST/MiSTer. They demoed their hardware being used with a GBA core running a GBA game.

Further, they seem to have a CC65 backend -- I don't know of what quality -- but it seems C based software is running on it.

That makes it an interesting and more complete platform and consumer product.

And if I want a better 6502 variant on it, I could do that myself and use one of the various 65xx variant cores out there, or write my own.

EDIT: And, yeah, from my perspective from just casually reading their docs is that the CPU in the MEGA65 is an 8-bit CPU with bank switching and a couple weird 32-bit ops. It's not a 16-bit machine despite.

But the thing about the 816 is that it's only _sort of_ a machine with a 24-bit address bus. It effectively just has a bank switching mechanism, but not external. Mensch really just bolted some stuff onto the front of the 65C02 and widened the accumulator and registers by 8 bits. But the 16-bit registers are a pain. I just wish he'd added some new registers (and a way of combining them) instead of having the mode switch.