← Back to context

Comment by WJW

2 days ago

Eh. The only real things you need are:

- On startup processing begins at a known address, and you put the bootloader code over there. Hardware engineers can guarantee this for you.

- Every time you execute an assembly instruction, the program counter either explicitly jumps to a new location or else it just increments by 1. Hardware people can also make this happen as easily as implementing an adder.

Don't get me wrong, there are LOTS of layers between the hardware and most "useful" programs any of us will ever write. But all of them are pretty understandable. They're often not very complicated, just tedious.

Similarly for making a basic CPU that implements the logic you’re describing. In 2006 or so I made a super simple microcontroller on an FPGA for a course project. It had a whopping 256 bytes of RAM, 1kB of ROM, and I think four 8-bit registers plus a 16-bit program counter. You could only jump +/- 256 bytes. It was largely useless but also incredibly satisfying.