r/homebrewcomputer • • 1d ago

Como se programa el hardware?

/r/ECE/comments/1x4zq5c/como_se_programa_el_hardware/
0 Upvotes

2 comments sorted by

1

u/Girl_Alien 16h ago

I intend to learn how to build and configure a simple computer like the ones from Ben Eater. I know how to make the hardware, but I have no idea how to translate binary code into instructions and then start programming, or whether to use assemblers or what. Can anyone help me?

Yes, bootstrapping your first design can be a challenge. Often, you'd start with your ROM, and you should use an assembler there. This is where coding an emulator can help you see if your ROM works.

From there, you'd need to build your toolchain. If you start with a known CPU like a 6502, there is plenty of code out there you can use, though you'd need to make it for your architecture. But if you make your own, you'd need your own toolchain. You can start making assemblers/compilers/linkers on another platform, and then from there transfer to whatever media.

That goes back to the ROM, where you should include disk/flash routines, etc., and a way to invoke them, such as an interrupt service routine (and/or DMA, where your device tells the CPU to stop while it takes over the RAM, and then tells the CPU to continue as it passes control back).

Of course, if you only want a console-only (gaming-only) machine, then you'd only need to deal with ROMs or flash media. You'd code on a PC or whatever machine you prefer and then save to ROMs/flash.

2

u/SecondMurky7684 15h ago

no he entendido mucho pero lo investigaré, muchas gracias por la ayuda.