8 bit cpu emulator with custom ISA
Go to file
krolxon 57bbca6cb2 add LICENSE 2026-01-05 12:17:04 +05:30
examples add LICENSE 2026-01-05 12:17:04 +05:30
src add labels, improve documentation, add step debug 2026-01-05 12:12:57 +05:30
.gitignore initial commit 2026-01-04 18:39:25 +05:30
Cargo.lock use clap for arguement parsing 2026-01-04 23:54:56 +05:30
Cargo.toml use clap for arguement parsing 2026-01-04 23:54:56 +05:30
LICENSE add LICENSE 2026-01-05 12:17:04 +05:30
README.md add more todos 2026-01-05 12:14:24 +05:30

README.md

8-Bit CPU Emulator

CPU Architecture

  • Word Size
    • Data Width: 8 bits
    • Address width: 16 bits
    • Address space: 64 KB (0x0000- 0xFFFF)

Supported Instructions

Instruction Syntax
MOV mov reg, imm
ADD add r1, r2
SUB sub r1, r2
JMP jmp addr
JZ jz addr
JNZ jnz addr
HLT (Halt) hlt

Registers

Register Size Description
A 8-bit General
B 8-bit General
C 8-bit General
D 8-bit General
PC 16-bit Program Counter
SP 16-bit Stack pointer (unused for now)

Flags

Flag Description
Z Zero Flag
C Carry/Borrow

Usage

cargo run -- --f <examples/filename.asc>

Todo

  • Assembler
    • Lexer/Tokenizer
    • Add label support (supporting JMP/JZ/JNZ)
  • Add instructions
    • CMP
    • CALL
    • RET
  • Error handling
  • Build Debugger