# alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine architecture

> Architecture diagram of the GitHub repository alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine
- Repository: https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine

## Overview

Vole Machine is a C++ simulator for a small educational computer, with CLI and Qt GUI front ends sharing a simulation core. The main workflow is to load and validate a program, inspect or edit machine state, then execute it stepwise or to completion and view resulting state and screen output. The graph preserves the documented instruction families and GUI capabilities. Some implementation files were not sampled; edges are limited to relationships visible in excerpts, the source index, or README.

Main entry points: [`Vole-Machine/GUI/src/MainWindow.cpp`](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/MainWindow.cpp) (GUI controller), [`Vole-Machine/Core/src/Cpu.cpp`](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/Cpu.cpp) (CPU and registers), [`Vole-Machine/Core/src/Machine.cpp`](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/Machine.cpp) (Machine facade), [`Vole-Machine/CLI/src/ConsoleUI.cpp`](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/CLI/src/ConsoleUI.cpp) (Console commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontends["User interfaces"]
  node_cli["Console commands<br/>[ConsoleUI.cpp]"]
  node_consoleview["Console output<br/>[ConsoleView.cpp]"]
end

subgraph group_runtime["Simulation core"]
  node_machine["Machine facade<br/>[Machine.cpp]"]
  node_loader["Program loader<br/>[ProgramLoader.cpp]"]
  node_memory[("256-cell memory<br/>[Memory.cpp]")]
  node_screen["Screen output<br/>[Screen.cpp]"]
end

subgraph group_execution["Instruction execution"]
  node_cpu["CPU and registers<br/>[Cpu.cpp]"]
  node_decoder["Instruction decoder"]
  node_alu["ALU operations<br/>[Alu.cpp]"]
  node_aluops["Arithmetic and logic"]
  node_dataops["Data transfers"]
  node_controlops["Control instructions"]
end

subgraph group_gui["GUI views"]
  node_guiwindow["GUI controller<br/>[MainWindow.cpp]"]
  node_controlbar["Run controls<br/>[ControlBar.cpp]"]
  node_memorypanel["Memory view<br/>[MemoryPanel.cpp]"]
  node_registerpanel["Register view<br/>[RegisterPanel.cpp]"]
  node_screenpanel["Screen view<br/>[ScreenPanel.cpp]"]
  node_programlist["Program list"]
  node_snapshot["Change snapshot"]
  node_theme["Theme manager<br/>[ThemeManager.cpp]"]
  node_instructionhelp["Instruction guide"]
end

node_user(("User"))

node_user -->|"enters commands"| node_cli
node_user -->|"uses simulator"| node_guiwindow
node_cli -->|"controls machine"| node_machine
node_cli -->|"prints state"| node_consoleview
node_guiwindow -->|"controls machine"| node_machine
node_guiwindow -->|"builds controls"| node_controlbar
node_guiwindow -->|"builds view"| node_memorypanel
node_guiwindow -->|"builds view"| node_registerpanel
node_guiwindow -->|"builds view"| node_screenpanel
node_guiwindow -->|"builds view"| node_programlist
node_guiwindow -->|"opens guide"| node_instructionhelp
node_guiwindow -->|"applies theme"| node_theme
node_memorypanel -->|"reads memory"| node_memory
node_registerpanel -->|"reads registers"| node_cpu
node_guiwindow -->|"takes snapshots"| node_snapshot
node_machine -.->|"loads programs"| node_loader
node_loader -->|"validates words"| node_decoder
node_loader -->|"writes program"| node_memory
node_machine -.->|"steps execution"| node_cpu
node_cpu -->|"fetches data"| node_memory
node_cpu -->|"decodes instruction"| node_decoder
node_aluops -->|"reads and writes"| node_cpu
node_aluops -->|"computes results"| node_alu
node_dataops -->|"transfers data"| node_cpu
node_machine -.->|"exposes output"| node_screen

click node_cli "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/CLI/src/ConsoleUI.cpp"
click node_consoleview "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/CLI/src/ConsoleView.cpp"
click node_guiwindow "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/MainWindow.cpp"
click node_controlbar "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/ControlBar.cpp"
click node_memorypanel "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/MemoryPanel.cpp"
click node_registerpanel "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/RegisterPanel.cpp"
click node_screenpanel "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/ScreenPanel.cpp"
click node_programlist "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/ProgramListPanel.cpp"
click node_snapshot "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/MachineSnapshot.cpp"
click node_theme "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/ThemeManager.cpp"
click node_instructionhelp "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/InstructionSetDialog.cpp"
click node_machine "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/Machine.cpp"
click node_loader "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/ProgramLoader.cpp"
click node_memory "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/Memory.cpp"
click node_screen "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/Screen.cpp"
click node_cpu "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/Cpu.cpp"
click node_decoder "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/InstructionDecoder.cpp"
click node_alu "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/Alu.cpp"
click node_aluops "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/AluInstructions.cpp"
click node_dataops "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/DataTransferInstructions.cpp"
click node_controlops "https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/ControlInstructions.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_consoleview,node_user toneBlue
class node_machine,node_loader,node_memory,node_screen toneAmber
class node_cpu,node_decoder,node_alu,node_aluops,node_dataops,node_controlops toneMint
class node_guiwindow,node_controlbar,node_memorypanel,node_registerpanel,node_screenpanel,node_programlist,node_snapshot,node_theme,node_instructionhelp toneRose
```

## Components

### User interfaces

- [Console commands](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/CLI/src/ConsoleUI.cpp): `Vole-Machine/CLI/src/ConsoleUI.cpp`
- [Console output](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/CLI/src/ConsoleView.cpp): `Vole-Machine/CLI/src/ConsoleView.cpp`

### Simulation core

- [Machine facade](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/Machine.cpp): `Vole-Machine/Core/src/Machine.cpp`
- [Program loader](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/ProgramLoader.cpp): `Vole-Machine/Core/src/ProgramLoader.cpp`
- [256-cell memory](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/Memory.cpp): `Vole-Machine/Core/src/Memory.cpp`
- [Screen output](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/Screen.cpp): `Vole-Machine/Core/src/Screen.cpp`

### Instruction execution

- [CPU and registers](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/Cpu.cpp): `Vole-Machine/Core/src/Cpu.cpp`
- [Instruction decoder](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/InstructionDecoder.cpp): `Vole-Machine/Core/src/InstructionDecoder.cpp`
- [ALU operations](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/Alu.cpp): `Vole-Machine/Core/src/Alu.cpp`
- [Arithmetic and logic](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/AluInstructions.cpp): `Vole-Machine/Core/src/AluInstructions.cpp`
- [Data transfers](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/DataTransferInstructions.cpp): `Vole-Machine/Core/src/DataTransferInstructions.cpp`
- [Control instructions](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/Core/src/ControlInstructions.cpp): `Vole-Machine/Core/src/ControlInstructions.cpp`

### GUI views

- [GUI controller](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/MainWindow.cpp): `Vole-Machine/GUI/src/MainWindow.cpp`
- [Run controls](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/ControlBar.cpp): `Vole-Machine/GUI/src/ControlBar.cpp`
- [Memory view](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/MemoryPanel.cpp): `Vole-Machine/GUI/src/MemoryPanel.cpp`
- [Register view](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/RegisterPanel.cpp): `Vole-Machine/GUI/src/RegisterPanel.cpp`
- [Screen view](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/ScreenPanel.cpp): `Vole-Machine/GUI/src/ScreenPanel.cpp`
- [Program list](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/ProgramListPanel.cpp): `Vole-Machine/GUI/src/ProgramListPanel.cpp`
- [Change snapshot](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/MachineSnapshot.cpp): `Vole-Machine/GUI/src/MachineSnapshot.cpp`
- [Theme manager](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/ThemeManager.cpp): `Vole-Machine/GUI/src/ThemeManager.cpp`
- [Instruction guide](https://github.com/alaaal-deennabilsarhanal-maliki/oop_assignment2_vole_machine/blob/main/Vole-Machine/GUI/src/InstructionSetDialog.cpp): `Vole-Machine/GUI/src/InstructionSetDialog.cpp`

### Other components

- **User**

## Connections

- User → Console commands: enters commands
- User → GUI controller: uses simulator
- Console commands → Machine facade: controls machine (evidence: `Vole-Machine/CLI/src/ConsoleUI.cpp`)
- Console commands → Console output: prints state (evidence: `Vole-Machine/CLI/src/ConsoleUI.cpp`)
- GUI controller → Machine facade: controls machine (evidence: `Vole-Machine/GUI/src/MainWindow.cpp`)
- GUI controller → Run controls: builds controls (evidence: `Vole-Machine/GUI/src/MainWindow.cpp`)
- GUI controller → Memory view: builds view (evidence: `Vole-Machine/GUI/src/MainWindow.cpp`)
- GUI controller → Register view: builds view (evidence: `Vole-Machine/GUI/src/MainWindow.cpp`)
- GUI controller → Screen view: builds view (evidence: `Vole-Machine/GUI/src/MainWindow.cpp`)
- GUI controller → Program list: builds view (evidence: `Vole-Machine/GUI/src/MainWindow.cpp`)
- GUI controller → Instruction guide: opens guide (evidence: `Vole-Machine/GUI/src/MainWindow.cpp`)
- GUI controller → Theme manager: applies theme (evidence: `Vole-Machine/GUI/src/MainWindow.cpp`)
- Memory view → 256-cell memory: reads memory (evidence: `Vole-Machine/GUI/src/MemoryPanel.cpp`)
- Register view → CPU and registers: reads registers (evidence: `Vole-Machine/GUI/src/RegisterPanel.cpp`)
- GUI controller → Change snapshot: takes snapshots (evidence: `Vole-Machine/GUI/src/MainWindow.cpp`)
- Machine facade → Program loader: loads programs
- Program loader → Instruction decoder: validates words (evidence: `Vole-Machine/Core/src/ProgramLoader.cpp`)
- Program loader → 256-cell memory: writes program (evidence: `Vole-Machine/Core/src/ProgramLoader.cpp`)
- Machine facade → CPU and registers: steps execution
- CPU and registers → 256-cell memory: fetches data (evidence: `Vole-Machine/Core/src/Cpu.cpp`)
- CPU and registers → Instruction decoder: decodes instruction (evidence: `Vole-Machine/Core/src/Cpu.cpp`)
- Arithmetic and logic → CPU and registers: reads and writes (evidence: `Vole-Machine/Core/src/AluInstructions.cpp`)
- Arithmetic and logic → ALU operations: computes results (evidence: `Vole-Machine/Core/src/AluInstructions.cpp`)
- Data transfers → CPU and registers: transfers data (evidence: `Vole-Machine/Core/src/DataTransferInstructions.cpp`)
- Machine facade → Screen output: exposes output
