A web-based computer architecture simulator and low-level execution environment designed to visualize CPU internals, memory management, register states, and stack manipulation in real-time.
This project bridges the gap between high-level web interfaces and low-level software engineering. It implements a custom, software-defined 16-bit Virtual Machine entirely in TypeScript/React, translating custom assembly like instructions into binary operational steps while visually mapping out hardware changes.
Instead of treating memory allocation and stack overflows as abstract concepts, this tool renders them frame-by-frame, providing an educational sandbox for debugging low-level logic.
- Real-Time Register Monitoring: Visual tracks for the Program Counter (PC), Stack Pointer (SP), Accumulator, and General-Purpose Registers.
- Interactive Stack Visualizer: Dynamic grid mapping push/pop cycles, memory layout limits, and frame pointers to catch stack overflows visually.
- Custom ISA (Instruction Set Architecture): Executes standard primitives such as memory loading, arithmetic logic routing, conditional branching, and pointer modification.
- Step-by-Step Execution Engine: Toggle between continuous execution clock cycles or manual instruction stepping to trace pointer offsets.
- Syntax Highlighting Editor: A built-in code terminal pane allowing users to draft programs, check for compilation compilation or syntax errors, and observe bytecode translation.
| Instruction | Arguments | Description |
|---|---|---|
MOV |
REG, VAL / REG, REG |
Transfers data between values and internal registers |
PUSH |
REG / VAL |
Decrements the Stack Pointer and writes data to memory |
POP |
REG |
Retrieves topmost memory stack chunk and increments SP |
ADD / SUB |
REG, REG |
Routes target data arrays through the simulated ALU |
JMP / JZ |
ADDRESS |
Alters the Program Counter directly or based on flags |
To clone this virtual machine environment onto your local machine, ensure you have Node.js (v18 or higher) installed, then run the following terminal script:
# Clone this repository
git clone https://github.com/kartikmawani/Virtual-Machine.git
# Navigate directly into the root workspace
cd Virtual-Machine
# Install build dependencies safely
npm install
# Run the local Vite dev server
npm run dev