# inkboxsoftware/excelcpu architecture

> Architecture diagram of the GitHub repository inkboxsoftware/excelcpu, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/inkboxsoftware/excelcpu
- Repository: https://github.com/inkboxsoftware/excelcpu

## Overview

This repository provides an Excel-based 16-bit computer and a Python assembler that compiles Excel-ASM16 programs into its ROM workbook. The main workflow is to compile a program, load ROM contents into CPU RAM, and run the CPU by recalculating Excel; users can also operate it manually. The README documents CPU, memory, display, and ISA capabilities, but the spreadsheet internals are not sampled, so those components are represented at the documented level.

Main entry points: [`CPU.xlsx`](https://github.com/inkboxsoftware/excelcpu/blob/main/CPU.xlsx) (16-bit CPU), [`compileExcelASM16.py`](https://github.com/inkboxsoftware/excelcpu/blob/main/compileExcelASM16.py) (ASM16 compiler), [`sample programs`](https://github.com/inkboxsoftware/excelcpu/tree/main/sample%20programs) (Assembly source), [`ROM.xlsx`](https://github.com/inkboxsoftware/excelcpu/blob/main/ROM.xlsx) (Program ROM)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Program authoring"]
  node_asm_source["Assembly source"]
  node_binary_include["Binary include"]
  node_language_ref["Language reference<br/>[Excel-ASM16.xml]"]
end

subgraph group_assembly["Assembly and ROM"]
  node_assembler["ASM16 compiler"]
  node_rom[("Program ROM<br/>[ROM.xlsx]")]
end

subgraph group_computer["Excel computer"]
  node_isa["Instruction set"]
  node_cpu["16-bit CPU<br/>[CPU.xlsx]"]
  node_fetch["Fetch and control<br/>[CPU.xlsx]"]
  node_registers["Registers and ALU<br/>[CPU.xlsx]"]
  node_ram[("128KB RAM<br/>[CPU.xlsx]")]
  node_display["128×128 display<br/>[CPU.xlsx]"]
end

node_user(("Program author"))
node_excel["Excel runtime"]

node_user -->|"writes program"| node_asm_source
node_user -->|"includes binary"| node_binary_include
node_asm_source -->|"compiles source"| node_assembler
node_binary_include -->|"includes bytes"| node_assembler
node_language_ref -->|"defines syntax"| node_assembler
node_assembler -->|"writes program"| node_rom
node_user -->|"recalculates workbook"| node_excel
node_excel -->|"runs workbook"| node_cpu
node_user -->|"sets controls"| node_cpu
node_rom -->|"loads into"| node_ram
node_cpu -->|"follows ISA"| node_isa
node_cpu -->|"contains fetch unit"| node_fetch
node_fetch -->|"fetches instructions"| node_ram
node_fetch -->|"dispatches operations"| node_registers
node_registers -->|"reads and writes"| node_ram
node_cpu -->|"drives display"| node_display

click node_asm_source "https://github.com/inkboxsoftware/excelcpu/tree/main/sample%20programs"
click node_binary_include "https://github.com/inkboxsoftware/excelcpu/tree/main/sample%20programs"
click node_language_ref "https://github.com/inkboxsoftware/excelcpu/blob/main/Excel-ASM16.xml"
click node_assembler "https://github.com/inkboxsoftware/excelcpu/blob/main/compileExcelASM16.py"
click node_rom "https://github.com/inkboxsoftware/excelcpu/blob/main/ROM.xlsx"
click node_isa "https://github.com/inkboxsoftware/excelcpu/blob/main/instructionSet.xlsx"
click node_cpu "https://github.com/inkboxsoftware/excelcpu/blob/main/CPU.xlsx"
click node_fetch "https://github.com/inkboxsoftware/excelcpu/blob/main/CPU.xlsx"
click node_registers "https://github.com/inkboxsoftware/excelcpu/blob/main/CPU.xlsx"
click node_ram "https://github.com/inkboxsoftware/excelcpu/blob/main/CPU.xlsx"
click node_display "https://github.com/inkboxsoftware/excelcpu/blob/main/CPU.xlsx"

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_asm_source,node_binary_include,node_language_ref toneBlue
class node_assembler,node_rom toneAmber
class node_isa,node_cpu,node_fetch,node_registers,node_ram,node_display toneMint
class node_user,node_excel toneIndigo
```

## Components

### Program authoring

- [Assembly source](https://github.com/inkboxsoftware/excelcpu/tree/main/sample%20programs): `sample programs`
- [Binary include](https://github.com/inkboxsoftware/excelcpu/tree/main/sample%20programs): `sample programs`
- [Language reference](https://github.com/inkboxsoftware/excelcpu/blob/main/Excel-ASM16.xml): `Excel-ASM16.xml`

### Assembly and ROM

- [ASM16 compiler](https://github.com/inkboxsoftware/excelcpu/blob/main/compileExcelASM16.py): `compileExcelASM16.py`
- [Program ROM](https://github.com/inkboxsoftware/excelcpu/blob/main/ROM.xlsx): `ROM.xlsx`

### Excel computer

- [Instruction set](https://github.com/inkboxsoftware/excelcpu/blob/main/instructionSet.xlsx): `instructionSet.xlsx`
- [16-bit CPU](https://github.com/inkboxsoftware/excelcpu/blob/main/CPU.xlsx): `CPU.xlsx`
- [Fetch and control](https://github.com/inkboxsoftware/excelcpu/blob/main/CPU.xlsx): `CPU.xlsx`
- [Registers and ALU](https://github.com/inkboxsoftware/excelcpu/blob/main/CPU.xlsx): `CPU.xlsx`
- [128KB RAM](https://github.com/inkboxsoftware/excelcpu/blob/main/CPU.xlsx): `CPU.xlsx`
- [128×128 display](https://github.com/inkboxsoftware/excelcpu/blob/main/CPU.xlsx): `CPU.xlsx`

### Other components

- **Program author**
- **Excel runtime**

## Connections

- Program author → Assembly source: writes program (evidence: `README.md`)
- Program author → Binary include: includes binary (evidence: `README.md`)
- Assembly source → ASM16 compiler: compiles source (evidence: `README.md`)
- Binary include → ASM16 compiler: includes bytes (evidence: `compileExcelASM16.py`)
- Language reference → ASM16 compiler: defines syntax (evidence: `README.md`)
- ASM16 compiler → Program ROM: writes program (evidence: `README.md`)
- Program author → Excel runtime: recalculates workbook (evidence: `README.md`)
- Excel runtime → 16-bit CPU: runs workbook (evidence: `README.md`)
- Program author → 16-bit CPU: sets controls (evidence: `README.md`)
- Program ROM → 128KB RAM: loads into (evidence: `README.md`)
- 16-bit CPU → Instruction set: follows ISA (evidence: `README.md`)
- 16-bit CPU → Fetch and control: contains fetch unit (evidence: `README.md`)
- Fetch and control → 128KB RAM: fetches instructions (evidence: `README.md`)
- Fetch and control → Registers and ALU: dispatches operations (evidence: `README.md`)
- Registers and ALU → 128KB RAM: reads and writes (evidence: `README.md`)
- 16-bit CPU → 128×128 display: drives display (evidence: `README.md`)
