4 ms·
I decided to write a gnu as x86 interpreter, now 700 lines later, I realize that I know nothing about assembly / CPUs and should have never started. I keep goin
by moccajoghurt 14y ago
I decided to write a gnu as x86 interpreter, now 700 lines later, I realize that I know nothing about assembly / CPUs and should have never started.
I keep going until "hello world!" works but it's really depressing to realize that you underestimated the complexity of something.
This picture reminds me about the complexity.
- revelation 14y agoThats because x86 is an insanely complex architecture. Try one of the pseudo RISCs, e.g. ARM.
- protomyth 14y agoor a 6502
- StephenFalken 14y agoCheck the MIPS R4000 Microprocessor User's Manual by Joe Heinrich to get a glimpse of a truly inspiring processor architecture and its implementation: http://groups.csail.mit.edu/cag/raw/documents/R4400_Uman_book_Ed2.pdf http://groups.csail.mit.edu/cag/raw/documents/R4400_Uman_boo...
- jacquesm 14y ago> I realize that I know nothing about assembly / CPUs and should have never started. Strong disagree! Starting gained you knowledge, if only that you didn't know anything about the subject. Now that you know you know nothing you also know that there is something here for your to learn about. Before you tackle a subject this complex it might help to tackle similar problems of lesser complexity: a 6502, 6800 or 6809 assembler + emulator, then if you feel brave a 68K one, then maybe a risc chip (ARM, MIPS), and then ,if you still feel like it finally the x86 series starting with the 8086, working your way up to today. You'll be learning all the time and at the end of those exercises you'll be quite knowledgeable about CPU architectures, design pitfalls and so on. If you should decide to give up halfway you'll be in an excellent position to know what you don't know. The above circuit will take you a couple of years at least, assuming you are otherwise gainfully employed. It would be fantastic if you did it because we really do need people that have that level of insight and there are ever fewer of them.
- ChuckMcM 14y agoI agree with Jacques here, its not depressing it is enlightening to know what complexity lays below. If you have the chance, a simple FPGA evaluation board (my suggestion is the Altera DE-2-70) and some time reading about computer architecture, and you will know a ton about how computers really work. And that will give you insights into all sorts of things.
- jevinskie 14y agoI have a DE2 (35k LUTS, IIRC) and it is a great platform. Tons of peripherals to learn how to write either HDL or software drivers! VGA, RCA Video (NTSC/PAL), SRAM, DRAM, Ethernet, USB, IR, PS/2, RS232, SD card, and more! http://www.altera.com/education/univ/materials/boards/de2/unv-de2-board.html http://www.altera.com/education/univ/materials/boards/de2/un...
- dcgalloway 14y agoHey here's a good article from a old friend of mine about one somewhat tricky part which is the ALU / arithmetic flags (which he gets to after rambling a bit about various x86 simulation techniques) http://www.emulators.com/docs/nx11_flags.htm http://www.emulators.com/docs/nx11_flags.htm