Skip to content

Repository files navigation

ARM64 CPU Simulator & Developer Tooling Platform

A high-fidelity ARM64 (AArch64) CPU simulator with comprehensive instruction decoding and a deterministic execution engine for cycle-accurate state transitions.

Features

  • High-fidelity ARM64 CPU simulator – Supports comprehensive instruction decoding and a custom deterministic execution engine for cycle-accurate state transitions
  • Sophisticated memory model – Stack, Heap, BSS, and Rodata segments for precise emulation of deep recursion and dynamic memory allocation
  • Full register and flag emulation – NZCV condition flags with 100% state transparency for assembly-level logic
  • Developer interface – Real-time register visualization, memory inspection grids, and single-step execution control for granular debugging

Supported Instructions

  • Arithmetic: ADD, ADDS, SUB, SUBS, ADDI, SUBI (immediate)
  • Logical: AND, ORR, EOR, MOV
  • Comparison: CMP (register and immediate)
  • Branches: B, BL, B.cond, CBZ, CBNZ, RET, BR, BLR
  • Memory: LDR, STR (64-bit)
  • System: SVC, NOP

Getting Started

npm install
npm run dev

Open http://localhost:5173 in your browser.

Usage

  1. Write assembly – Enter ARM64 assembly in the editor (labels supported)
  2. Assemble & Load – Compile and load the program into the simulator
  3. Step – Execute one instruction at a time for debugging
  4. Run – Execute until halt
  5. Reset – Clear state and reload

Example Program

// Counter: counts from 0 to 5
  mov x0, #0       // counter = 0
  mov x1, #5       // limit = 5
loop:
  add x0, x0, #1   // counter++
  cmp x0, x1       // counter < limit?
  b.lt loop        // if so, repeat
  svc #0           // halt

Project Structure

src/
├── simulator/       # Core simulator
│   ├── types.ts     # Type definitions
│   ├── memory.ts    # Memory model (Stack, Heap, BSS, Rodata)
│   ├── cpu.ts       # CPU state & NZCV
│   ├── decoder.ts   # Instruction decoder
│   ├── executor.ts  # Execution engine
│   └── assembler.ts # Assembly parser
├── components/      # React UI
│   ├── RegisterView.tsx
│   ├── MemoryGrid.tsx
│   ├── ExecutionControls.tsx
│   └── CodeEditor.tsx
└── App.tsx

About

A browser-based ARM64 (AArch64) CPU simulator — instruction decoding, a deterministic cycle-stepped execution engine, and a live view of registers, stack, heap, BSS and rodata.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages