One big project between this, and assembler (coming soon) and compiler (coming soon)
One big project between this, and assembler (coming soon) and compiler (coming soon)
I've been having some fun with this project. Today's video will explain and demonstrates how processors fundamentally work, by demonstrating the cpu that I designed and implemented in software.
I've built a computer (theoredical model) which executes my custom instrution set architecutre (ISA). This is the list of things the compter can actually do
Sometimes, I get nerd-sniped by compilers or other low level parts of the stack, or this magical term "The hardware does it".
I made a quarantine repo to hold some of this work, so I could just get it out through my fingers and out of my mind, and move on to things that are a bit more practical. This backfire hard, the more I've worked on this project the more interested I've gotten. I don't expect I'll stop vefore finishing the rest of the coolest parts.
The final result will be 3 major peices, which together mean I can take normal C code, compiling it into my own custom assembly language with my own custom compiler, building a custom formatted binary from it, then running it on a processor that I've implemented in software (as a normal C program). Every piece here will be written by me from scratch.
(Linkedin doesn't like links, but just search in GitHub): Jkig/hardcoreC
State of the code in the video was commit: 24d1eee08e82f6d1faffcfb3435cc641381c2bd3
There are the special registers, and the general purpose registers, fundementally, we don't need to tread any of them as special, but it simplifies hardawrae to only be able to execute an instruction from here, etc, why implmemet the capability to get instructions from a pointer in any register, we don't need it.
sp, pc, and res don't need to be special, my first instinct is that status is the only register that really needs to be special, but its easier for everyone if we tread these as special, and I think we generally have a few others we treat as special to, for example lr on arm
An instruction is the minimal unit of a program. One instruction is (generally) just one line of assembly lanugage. The program counter holds (a pointer to) the next instruction to be executed.
I've built a few pieces of this already