An 8 bit Virtual CPU in C that executes a custom bytecode instruction set
I built this mini project to put what i learned in computer architecture to use and to practise low level programming in C.
- Custom assembler that converts simple assembly mnemonics to machine code
- 8 bit Harvard architecture with separate program and data memory
- Pipelined execution with fetch decode execute stages
- Branching with zero flag and pipeline stall handling
- Stack implementation for push and pop operations
- Register and memory visualization in terminal
- ROM dump after execution
- Language: C (standard library only)
- No external frameworks or libraries
- Built and run with any standard C compiler
- Clone the repo: git clone https://github.com/yourusername/8-bit-harvard-computer.git
- Compile the code: gcc main.c -o cpu
- Run the program: ./cpu
- Enter instructions one per line (empty line to finish) using format INSTRUCTION OPERAND eg ADD 0x01
- Watch the CPU state update in real time