by rodlette · 2y ago · 0 comments
> Simplicity > > With some practice, you could keep the whole of an 8-bit processor’s instruction set in your head.
Is it just a matter of replacing all instructions/chips/buses to be 32 bit/lane? Or is it just that in practice the 32 bit CPUs have more complex ISAs?
The reason I ask is that I'm learning RV32I, and writing a simple implementation, and wondering if there's any additional didactic value in me learning 8-bit CPUs.
Also because of the above, 16/32/64-bit ISAs have to support dealing with bytes, so they end up either including instructions to explicitly deal with them, or constantly having to mask the upper bits of values/registers.
Unfortunately 8-bit CPUs were also almost always tied with 16-bit address buses. Back then when memory was super costly, this was fine. But later on, it became their biggest limitation and all sorts of awkward paging/segmenting stuff was caked on top in order to make them work with memory sizes greater than 64k.
I sometimes wonder how things would have gone if we'd settled on having "bytes" be 12-bits (like the PDP-8) or something instead, with the first gen of address buses being 24 bits. That would have made the first generation of home computers have a lot more longevity.
Hell, I believe the PDP-11 only had 16-bit registers, imagine if we'd just started our journey that way.
Most of the small RV32 microcontrollers have a low pin count lots of on-board devices, and it's not as straightforward as gluing together a CPU, RAM, ROM, and some IO devices on a breadboard.
Basically, an answer to the questopn "how would a breadboard computer built in 1977 look if the RV32 ISA existed?"
But 8-bit CPUs have more than 8 address lines, because 256 bytes total for combined RAM, ROM and I/O space is not useful. That number I think is typically 16 although Signetics 2650 had only 12 (with the instruction set only supporting 12-bit addresses), and the Atari 6507 (6502 derivative) had 13 (instruction set still supporting 16-bit addresses but the upper 3 bits of addresses were basically ignored).
> Is it just a matter of replacing all instructions/chips/buses to be 32 bit/lane?
Depends on the 8-bit CPU really.
- The Z80 lets you combine specific register pairs to work with 16 bits and address memory through them.
- The 6502 does not, but has the whole "zero page" thing where the first 256 bytes of RAM can contain 16-bit data and pointers.
- Both the Z80 and 6502 have a stack pointer register (the 6502's being 8-bit and fixed to point to RAM locations 512-767). But the 2650 had an internal 8-byte stack and stack pointer.
- The 8051 (and the 8048 I think) has lots of instructions for manipulating individual bits in registers and RAM, and also has a division between the memory that opcodes are fetched from versus data. None of the above work like that (the F8 might).
These are things that are no longer possible on modern computers (but in return we gained a lot of performance by decoupling hardware components).
* "Graphics and sound weren’t hidden behind ‘APIs’."
* Programs were written in 8 bit assembly
* Generally, the 8 bit CPU was considered a complete package, rather than just one small piece as RV32I is.
Those sound nice to have for didactic purposes. 32 bit could do that, but the RISC-V ecosystem/community seems keener on integration with wider world, rather than keeping a small complete system.
I'll check out some 8 bit ecosystems/communities. Video game space seems active? Or maybe there's a RV32I community for writing retro style games, with some simple graphics support?
I stalled once I started trying to integrate with the SD Card on my dev board. It got un-fun and then I got distracted by the apocalypse.
But I still think it's a neat idea, to tie RISC-V to that kind of "instant on" hobbyist architecture.
EDIT: looks like this "IceStation" project ended up doing mostly what I was intending, and started not long after me, but actually shipped something. Mine was targeting a Xilinx Artix-7 board, tho.
Wow, https://github.com/dan-rodrigues/icestation-32 looks cool. Sorry for the comment spam. :)