# hp71b/areuh architecture

> Architecture diagram of the GitHub repository hp71b/areuh, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hp71b/areuh
- Repository: https://github.com/hp71b/areuh

## Overview

##### Core Components

a. Main Processing Tools:
- Assembler (aas)
- Linker (ald)
- Message Generator (amg)

b. Utility Tools:
- File Dumper (adp)
- Download Tools (cpy)
- Executable Copier (acp)

c. Support Components:
- Entry Points Files (*.ep)
- System Libraries

##### Flow Relationships
- Source files → Assembler
- Assembler → Relocatable Object Files
- Object Files → Linker
- Linker → Executable
- Executable → Download Tools

##### Component Details

Assembler (aas):
- Internal subcomponents:
- Input Processing (ainput.c)
- Opcode Processing (aopc1.c, aopc2.c)
- Object Generation (aobj.c)

Linker (ald):
- Processes:
- Initialization (linit.c)
- Pass Processing (lpass.c)
- Symbol Resolution
- Output Generation

##### Technical Details
- File format specifications
- Entry point definitions
- System dependencies
- Build process flow

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        SRC[Source Files]
        EP[Entry Points]
        MSG[Message Sources]
    end

    subgraph "Core Tools"
        ASM[Assembler]:::core
        LNK[Linker]:::core
        MGN[Message Generator]:::core
        DMP[File Dumper]:::core
    end

    subgraph "Common Components"
        COM[Common Headers]:::common
        ERR[Error Handling]:::common
        EXP[Expression Handler]:::common
        MDP[Machine Dependencies]:::common
    end

    subgraph "HP-71 Components"
        HP71[HP-71 Base]:::hp71
        HPIL[HPIL Interface]:::hp71
        SASM[Assembly Support]:::hp71
    end

    subgraph "Utility Tools"
        CPY[Copy Tools]:::util
        LOAD[Load Tools]:::util
    end

    subgraph Output
        ROF[Relocatable Objects]
        EXE[Executable Files]
        DBG[Debug Output]
    end

    SRC --> ASM
    EP --> ASM
    ASM --> ROF
    ROF --> LNK
    LNK --> EXE
    MSG --> MGN
    ROF --> DMP
    EXE --> DMP
    DMP --> DBG

    COM --> ASM
    COM --> LNK
    COM --> DMP
    ERR --> ASM
    ERR --> LNK
    ERR --> DMP
    EXP --> ASM
    EXP --> LNK
    MDP --> ASM
    MDP --> LNK

    HP71 --> ASM
    HPIL --> ASM
    SASM --> ASM

    EXE --> CPY
    EXE --> LOAD

    %% Click Events
    click ASM "https://github.com/hp71b/areuh/tree/master/assembler/"
    click ASM "https://github.com/hp71b/areuh/blob/master/assembler/amain.c"
    click LNK "https://github.com/hp71b/areuh/tree/master/linker/"
    click LNK "https://github.com/hp71b/areuh/blob/master/linker/lmain.c"
    click MGN "https://github.com/hp71b/areuh/blob/master/msg/amg.c"
    click DMP "https://github.com/hp71b/areuh/blob/master/dump/adp.c"
    click HP71 "https://github.com/hp71b/areuh/blob/master/equ/hp71.ep"
    click HPIL "https://github.com/hp71b/areuh/blob/master/equ/hpil.ep"
    click SASM "https://github.com/hp71b/areuh/blob/master/equ/sasm.ep"
    click CPY "https://github.com/hp71b/areuh/tree/master/cpy/"
    click LOAD "https://github.com/hp71b/areuh/blob/master/load/acp.c"
    click COM "https://github.com/hp71b/areuh/blob/master/assembler/common.h"
    click ERR "https://github.com/hp71b/areuh/blob/master/assembler/err.h"
    click EXP "https://github.com/hp71b/areuh/blob/master/assembler/exp.c"
    click MDP "https://github.com/hp71b/areuh/blob/master/assembler/mdep.c"

    classDef core fill:#2374ab,stroke:#2374ab,color:#fff
    classDef common fill:#878787,stroke:#878787,color:#fff
    classDef hp71 fill:#57a773,stroke:#57a773,color:#fff
    classDef util fill:#7a306c,stroke:#7a306c,color:#fff

    %% Legend
    subgraph Legend
        L1[Core Tools]:::core
        L2[Common Components]:::common
        L3[HP-71 Specific]:::hp71
        L4[Utility Tools]:::util
    end
```
