4 ms·
On these small CPU, size of addressable RAM is even more important than word size. I think if you want to get a BASIC running on that 4-bit CPU in the article,
by actionfromafar 4y ago
On these small CPU, size of addressable RAM is even more important than word size.
I think if you want to get a BASIC running on that 4-bit CPU in the article, the easiest is probably to create a 6502 or Z80 emulator, then run the emulator on the 4-bit CPU.
After all, someone made an ARM (32 bit CPU) emulator for an 8 bit CPU and booted Linux on that.
- Someone 4y agoI think writing a simple basic for it would be easier. The machine has enough memory (“4096 8-bit bytes for programs and 4096 4-bit nibbles for data.”), but the instruction set is lacking compared to a 6502, so it would be a limited one. I would look at Apple’s first Basic (https://en.wikipedia.org/wiki/Integer_BASIC https://en.wikipedia.org/wiki/Integer_BASIC) and trim away all but the bare essentials. Some possible simplifications: - only support variable names of length one - remove the exponentiation operator - only support 8-bit integers - only support line numbers between 0 and 255 If, then, there’s program space left, add in features.