# farmer2010/chubrik-processor-emulator architecture

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

- Interactive diagram: https://gitdiagram.com/farmer2010/chubrik-processor-emulator
- Repository: https://github.com/farmer2010/chubrik-processor-emulator

## Overview

This repository is a desktop emulator for the Logic Arrows processor, with an integrated assembly compiler and a separate image-to-assembly utility. The main workflow is to select an assembly program, load it, execute or step it, and inspect processor state, console output, or memory. The README documents these controls and the image conversion capability. Some internal loading and execution details are not fully shown in the excerpts, so uncertain links are omitted or marked unverified.

Main entry points: [`main.py`](https://github.com/farmer2010/chubrik-processor-emulator/blob/main/main.py) (Emulator UI), [`emulator.py`](https://github.com/farmer2010/chubrik-processor-emulator/blob/main/emulator.py) (Processor execution), [`image_to_asm.py`](https://github.com/farmer2010/chubrik-processor-emulator/blob/main/image_to_asm.py) (Image converter), [`files/programs`](https://github.com/farmer2010/chubrik-processor-emulator/tree/main/files/programs) (Assembly programs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_ui["Emulator UI<br/>[main.py]"]
  node_ui_helpers["UI rendering helpers<br/>[utils.py]"]
end

subgraph group_execution["Emulation runtime"]
  node_processor["Processor execution<br/>[emulator.py]"]
  node_memory[("Banked memory<br/>[emulator.py]")]
  node_io["Console and display I/O<br/>[emulator.py]"]
end

subgraph group_authoring["Assembly tools"]
  node_compiler["Assembly compiler<br/>[compiler.py]"]
  node_image_converter["Image converter<br/>[image_to_asm.py]"]
end

subgraph group_examples["Example programs"]
  node_programs["Assembly programs"]
end

node_operator(("Operator"))
node_clipboard["System clipboard"]

node_operator -->|"controls"| node_ui
node_ui -->|"renders with"| node_ui_helpers
node_ui -->|"controls and reads"| node_processor
node_operator -->|"selects program"| node_programs
node_ui -->|"opens files"| node_programs
node_processor -.-> node_compiler
node_processor -->|"reads and writes"| node_memory
node_processor -->|"updates ports"| node_io
node_ui --> node_image_converter
node_operator -->|"provides image"| node_image_converter
node_image_converter -->|"copies assembly"| node_clipboard

click node_ui "https://github.com/farmer2010/chubrik-processor-emulator/blob/main/main.py"
click node_ui_helpers "https://github.com/farmer2010/chubrik-processor-emulator/blob/main/utils.py"
click node_processor "https://github.com/farmer2010/chubrik-processor-emulator/blob/main/emulator.py"
click node_memory "https://github.com/farmer2010/chubrik-processor-emulator/blob/main/emulator.py"
click node_io "https://github.com/farmer2010/chubrik-processor-emulator/blob/main/emulator.py"
click node_compiler "https://github.com/farmer2010/chubrik-processor-emulator/blob/main/compiler.py"
click node_image_converter "https://github.com/farmer2010/chubrik-processor-emulator/blob/main/image_to_asm.py"
click node_programs "https://github.com/farmer2010/chubrik-processor-emulator/tree/main/files/programs"

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_ui,node_ui_helpers toneBlue
class node_processor,node_memory,node_io toneAmber
class node_compiler,node_image_converter toneMint
class node_programs toneRose
class node_operator,node_clipboard toneIndigo
```

## Components

### Desktop interface

- [Emulator UI](https://github.com/farmer2010/chubrik-processor-emulator/blob/main/main.py): `main.py`
- [UI rendering helpers](https://github.com/farmer2010/chubrik-processor-emulator/blob/main/utils.py): `utils.py`

### Emulation runtime

- [Processor execution](https://github.com/farmer2010/chubrik-processor-emulator/blob/main/emulator.py): `emulator.py`
- [Banked memory](https://github.com/farmer2010/chubrik-processor-emulator/blob/main/emulator.py): `emulator.py`
- [Console and display I/O](https://github.com/farmer2010/chubrik-processor-emulator/blob/main/emulator.py): `emulator.py`

### Assembly tools

- [Assembly compiler](https://github.com/farmer2010/chubrik-processor-emulator/blob/main/compiler.py): `compiler.py`
- [Image converter](https://github.com/farmer2010/chubrik-processor-emulator/blob/main/image_to_asm.py): `image_to_asm.py`

### Example programs

- [Assembly programs](https://github.com/farmer2010/chubrik-processor-emulator/tree/main/files/programs): `files/programs`

### Other components

- **Operator**
- **System clipboard**

## Connections

- Operator → Emulator UI: controls (evidence: `README.md`)
- Emulator UI → UI rendering helpers: renders with (evidence: `main.py`)
- Emulator UI → Processor execution: controls and reads (evidence: `main.py`)
- Operator → Assembly programs: selects program
- Emulator UI → Assembly programs: opens files (evidence: `main.py`)
- Processor execution → Assembly compiler (evidence: `emulator.py`)
- Processor execution → Banked memory: reads and writes (evidence: `emulator.py`)
- Processor execution → Console and display I/O: updates ports (evidence: `emulator.py`)
- Emulator UI → Image converter
- Operator → Image converter: provides image (evidence: `image_to_asm.py`)
- Image converter → System clipboard: copies assembly (evidence: `image_to_asm.py`)
