I've been pondering the possibility of reloctable binary modules; less so for assemblers, more so for on-calculator relocation. The idea is that rather than directly copy an program to a fixed address, it can be loaded to any address and have internal values (such as call or jump offsets, data offers and so on) recalculated as it is loaded. Relocatable machine code could be useful for whole programs, dynamically-loaded libraries and so on.
The REL file format, as used by Microsoft's 8080/Z80 compiler and linker suite (M80 and L80), would seem like a good example of what I mean, as the files used were designed to be small (using a bitstream to save space) and the tools to handle them ran on an 8080 or Z80 CPU.
Picking a standard format would seem like a sensible approach to take. We would need to establish which features would be required, for example:
- At least two places to output data to - program code (which must live below $C000) and data code (which can exist anywhere in RAM).
- Resolution of external labels, for values that cannot be determined at compile-time (eg "plotsscreen" having different addresses on the TI-82, TI-83 and TI-83+).
- Exporting of labels, such as entry points and variable addresses (more useful for libraries than programs).
Any thoughts?