Tiny tape based computer emulation in C
- 20 bytes of total RAM
- A single accumulator register
- A program counter (PC)
- A zero flag
- A basic instruction set with only 6 operations:
0x00: HLT - Halt execution
0x01: LDA - Load accumulator from memory
0x02: STA - Store accumulator to memory
0x03: ADD - Add memory value to accumulator
0x04: SUB - Subtract memory value from accumulator
0x05: JMP - Jump to address
TTE is good for learning about computer architecture fundamentals, assembly programming, and how CPUs operate at a low level.
For better clarity, set up data first, then load your program:
$ program
> 00 00 00 00 00 00 00 00 00 00 05 07 00 00 00 00 00 00 00 00
$ mem
$ program
> 01 0A 03 0B 02 0C 00
$ run
$ mem
gcc -o tte_computer tte.c
