# yu34567890/bob16pp architecture

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

- Interactive diagram: https://gitdiagram.com/yu34567890/bob16pp
- Repository: https://github.com/yu34567890/bob16pp

## Overview

bob16++ is a command-line emulator for little-endian Bob16 binaries, preserving the base instruction set while adding arithmetic operations through TRAP 4. The user supplies a binary path; the program loads it and repeatedly executes instructions. Within the emulator, the instruction dispatcher handles base operations and routes arithmetic expansion and trap services to their handlers. The excerpts show the execution loop, instruction dispatch, and TRAP 4 call; loading details and some trap behavior are documented but not fully excerpted.

Main entry points: [`main.c`](https://github.com/yu34567890/bob16pp/blob/main/main.c) (Instruction dispatcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Emulator runtime"]
  node_runner["CLI and loader<br/>[main.c]"]
  node_machine[("Machine state<br/>[main.c]")]
end

subgraph group_instruction["Instruction handling"]
  node_dispatcher["Instruction dispatcher<br/>[main.c]"]
  node_arithmetic["Arithmetic expansion<br/>[main.c]"]
end

subgraph group_services["Trap services"]
  node_trapio["Trap I/O<br/>[main.c]"]
end

node_user(("User"))
node_binary["Bob16 binary"]

node_user -->|"runs"| node_runner
node_user -->|"provides"| node_binary
node_runner -.->|"loads"| node_machine
node_runner -->|"ticks"| node_dispatcher
node_dispatcher -->|"reads/writes"| node_machine
node_dispatcher -->|"dispatches"| node_arithmetic
node_dispatcher -->|"dispatches"| node_trapio

click node_runner "https://github.com/yu34567890/bob16pp/blob/main/main.c"
click node_machine "https://github.com/yu34567890/bob16pp/blob/main/main.c"
click node_dispatcher "https://github.com/yu34567890/bob16pp/blob/main/main.c"
click node_arithmetic "https://github.com/yu34567890/bob16pp/blob/main/main.c"
click node_trapio "https://github.com/yu34567890/bob16pp/blob/main/main.c"

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_runner,node_machine,node_user toneBlue
class node_dispatcher,node_arithmetic toneAmber
class node_trapio toneMint
class node_binary toneIndigo
```

## Components

### Emulator runtime

- [CLI and loader](https://github.com/yu34567890/bob16pp/blob/main/main.c): `main.c`
- [Machine state](https://github.com/yu34567890/bob16pp/blob/main/main.c): `main.c`

### Instruction handling

- [Instruction dispatcher](https://github.com/yu34567890/bob16pp/blob/main/main.c): `main.c`
- [Arithmetic expansion](https://github.com/yu34567890/bob16pp/blob/main/main.c): `main.c`

### Trap services

- [Trap I/O](https://github.com/yu34567890/bob16pp/blob/main/main.c): `main.c`

### Other components

- **User**
- **Bob16 binary**

## Connections

- User → CLI and loader: runs (evidence: `main.c`)
- User → Bob16 binary: provides
- CLI and loader → Machine state: loads (evidence: `main.c`)
- CLI and loader → Instruction dispatcher: ticks (evidence: `main.c`)
- Instruction dispatcher → Machine state: reads/writes (evidence: `main.c`)
- Instruction dispatcher → Arithmetic expansion: dispatches (evidence: `main.c`)
- Instruction dispatcher → Trap I/O: dispatches (evidence: `main.c`)
