How kroc/v80 works
Main Components
a) Input Processing Layer:
• Source File Reader (handles .v80, .v65 files)
• Lexical Analyzer (handles sigils, keywords, and tokens)
• Expression Parser (handles arithmetic and logical operations)
b) Core Assembly Components:
• ISA (Instruction Set Architecture) Plugins
• Symbol Table Manager (for constants and labels)
• Program Counter Manager
• Conditional Assembly Handler
c) Output Generation:
• Binary Output Generator
• Symbol File Generator (stdout)
• Error Handling System
┌─────────────────────────────────────────┐
• Source Files │
• (.v80, .v65, includes, etc.) │
• ┬───────────────────────┘
• ▼
┌─────────────────────────────────────────┐
• Input Processing Layer │
• ┤
• Lexical Analysis │
• Expression Parsing │
• Include File Resolution │
• ┬───────────────────────┘
• ▼
┌─────────────────────────────────────────┐
• Assembly Core │
• ┤
• ┌─────────────┐ ┌──────────────┐ │
• Symbol Table │◄────►│Program Counter│ │
• ┘ └──────────────┘ │
• ┌─────────────┐ ┌──────────────┐ │
• ISA Plugins │◄────►│Cond. Assembly│ │
• ┘ └──────────────┘ │
• ┬───────────────────────┘
• ▼
┌─────────────────────────────────────────┐
• Output Generation │
• ┤
• Binary Output │
• Symbol File │
• Error Messages │
• ┘
Key Relationships to Highlight
• Two-pass assembly process
• Forward reference handling
• File processing
• Symbol table management
• Error reporting flow
Implementation Details
• Size constraints (< 8KB for CP/M binary)
• File format support (.v80, .v65)
• Expression evaluation flow
• Demonstrate conditional assembly process
Additional Notes
• Simplicity of design (no macros, no linker)
• Platform independence
• Extensibility through ISA plugins
• Self-hosting capability
This design should capture both the current implementation and future expansion possibilities while maintaining clarity about the core assembly process.