2 ms·
> I wonder how big implementing the equivalent functionality with an x86 PC would be --- my guess is somewhat shorter, because the x86 ISA is denser than 6502.
by wk_end 8y ago
> I wonder how big implementing the equivalent functionality with an x86 PC would be --- my guess is somewhat shorter, because the x86 ISA is denser than 6502.
(grain of salt alert: I don't know a ton about modern PCs at this low a level)
Eh, maybe if a modern PC were just an Apple I with an x86 chip dropped into it - although even then, don't underestimate the 6502 for code density (or overestimate x86) when it comes to simple bit-banging and byte-bashing. And remember, your x86-64 CPU when it starts up isn't much more than a hot-rodded 8086, so we're comparing the 6502 to that - real mode x86 with 16-bit registers and all - rather than something more modern.
But my guess is that the complexity of modern IO would absolutely crush you in terms of complexity. For keyboard and video alone, the absolute bare minimum, you need to speak to the USB controller and across the PCI-E bus to the graphics card, and my intuition tells me this hardware wasn't designed to be easily programmable in a microscopic number of bytes.
(I also don't know how much stuff you strictly need to do to get a stable system, but looking through the pages of Advanced Options in my BIOS concerning things like memory timing and who knows what else makes me think the motherboard itself needs a fair amount of configuration on start up...)
- pjc50 8y agoYes, it all depends where you start; a similar program written as a boot sector would be quite short, but by the time you've got there a lot of BIOS and ACPI code has already run. If you want to start from the very beginning of bootup, you do indeed have to start by turning the RAM on. See http://www.drdobbs.com/parallel/booting-an-intel-architecture-system-par/232300699?pgno=2 http://www.drdobbs.com/parallel/booting-an-intel-architectur... which I found for answering https://electronics.stackexchange.com/questions/311832/can-a-cpu-function-with-nothing-more-than-a-power-supply-and-a-rom-using-only-t/311839#311839 https://electronics.stackexchange.com/questions/311832/can-a...