Skip to content

ideas to improve compiler support for romable code #149

@irmen

Description

@irmen

To be able to build programs that can be put into ROM (for rom programs or stuff like a NES cartridge game, for instance), a couple of things are required.
Most notably:

  • no "inline" variables (only zeropage and bss)
  • no self-modifying code

Currently both are not achieved by the compiler. (update: Fixed all know occurrences)

An idea around better situation concerning self-modifying code is:

  • add a compiler flag to report self-modifying code issues (%option romable)
  • make sure that the compiler doesn't generate any self-modifying code in the codegen
  • or, alternatively, print a warning/error when it (still) does (I hope I got them all, but maybe I missed a few cases)
  • fix all non-ROMable code in the libraries (or document the routine explicitly as not ROM-compatible)
  • handle readonly str and initialized arrays better maybe with @mutable (see discussion below)
  • add switch to set an explicit memory address for the BSS variables section?
  • documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions