Skip to content

Feature: KickAssembler Compatibility for ca45 #254

Description

@CTalkobt

ca45 KickAssembler Compatibility Plan

Status: Planning Phase
Target Release: v1.1
Effort Estimate: 5-8 weeks
Complexity: Medium-High

Executive Summary

This issue tracks the implementation of KickAssembler compatibility for ca45, enabling existing KickAssembler code to compile with minimal or no changes while preserving ca45's unique features.

Compatibility Goals

Phase 1: Syntax Compatibility (Weeks 1-3)

  • Accept both ." and !" directive prefixes
  • Support * = address" as alternative to .org"
  • Add output format flag for KickAssembler format generation

Phase 2: Advanced Features (Weeks 3-5)

  • Namespace support (!namespace/!endnamespace)
  • Full macro system with parameter substitution and local labels
  • Enhanced conditionals (!ifdef/!ifndef)

Phase 3: Variables & Modules (Weeks 5-6)

  • Variable declarations (!var)
  • Import/export support (!import/!export)

Phase 4: Testing & Docs (Weeks 7-8)

  • Comprehensive testing across all features
  • Update documentation
  • Create compatibility guide

Key Design Decisions

  • No breaking changes: All existing ca45 code continues working
  • Additive approach: Accept new syntax variants, map to existing handlers
  • Output flexibility: `-fkickassembler" flag allows either format
  • Phased rollout: Gather feedback between phases

Success Criteria

  • ✅ KickAssembler examples compile without error
  • ✅ Output binary matches original (via cvt_asm equivalence)
  • ✅ Existing ca45 code works unchanged
  • ✅ Performance impact < 5%
  • ✅ Full documentation and examples

Technical Components

Phase 1: Parser Enhancements

  • Files: AssemblerLexer.cpp, `AssemblerParser.cpp"
  • Changes: Directive prefix normalization, memory layout unification

Phase 2: Advanced Features

  • New files: MacroExpander.cpp, `AssemblerFormatter.cpp"
  • Changes: Namespace stack, macro registry, enhanced conditionals

Phase 3: Built-ins & Module System

  • Files: `AssemblerParser.cpp"
  • Changes: Variable evaluation, import/export mapping

Detailed Plan

See the full implementation plan document for:

  • Compatibility matrix (input/output)
  • Testing strategy (unit + integration)
  • Migration path for users
  • Known limitations and future work
  • Risk assessment and mitigation
  • Quick reference syntax mapping

Full plan: https://claude.ai/code/artifact/e7e36ff6-bc8b-46a4-8d7d-cf9fdc752105

Next Steps

  1. Review plan for feasibility and feedback
  2. Prioritize within v1.1 roadmap
  3. Begin Phase 1 implementation when approved

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

asmAssemblerenhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions