I wrote a fairly complex library in ca65.* It spans two files containing assembly language code and three include files: one defining the public API, one defining the data formats and library-internal API, and one configuration file that determines which features shall and shall not be included in the library. The configuration file controls a lot of conditional assembly (.if blocks). It places variables in zero page and BSS, and it places code and data in two segments determined by the config file (which may or may not be CODE and RODATA).
I have received a request for a version of this library compatible with the ASM6 assembler. As I understand it, ASM6 does not have a counterpart to ca65 .res; all variable allocation is handled with equates. In addition, ASM6 does not have a counterpart to ca65 .segment; order of code in the output corresponds to order of code in the input. It does appear to have a counterpart to .scope as rept 1; this could be used to translate a .proc.
Is there a way to bridge this feature gap that is less complex than A. actually writing an assembler that fully parses ca65 code and evaluates its expressions and macros, or B. hand-translating each line from ca65 to ASM6 and finding some way to determine that the code produced by the ca65 version remains identical to the code produced by the ASM6 version even after I fix bugs in or add features to the ca65 version?
* The library is Pently, an audio driver.
EDIT: Yes, .segment. I've been doing too much programming for other platforms lately.
I have received a request for a version of this library compatible with the ASM6 assembler. As I understand it, ASM6 does not have a counterpart to ca65 .res; all variable allocation is handled with equates. In addition, ASM6 does not have a counterpart to ca65 .segment; order of code in the output corresponds to order of code in the input. It does appear to have a counterpart to .scope as rept 1; this could be used to translate a .proc.
Is there a way to bridge this feature gap that is less complex than A. actually writing an assembler that fully parses ca65 code and evaluates its expressions and macros, or B. hand-translating each line from ca65 to ASM6 and finding some way to determine that the code produced by the ca65 version remains identical to the code produced by the ASM6 version even after I fix bugs in or add features to the ca65 version?
* The library is Pently, an audio driver.
EDIT: Yes, .segment. I've been doing too much programming for other platforms lately.