Immediately after switching the page, it will work with CSR.
Please reload your browser to see how it works.
I remember there were a few other meta-assemblers I came across in the 80s-90s, so this is definitely not "unchartered territory", but it's good to see another one show up.
Of course, in the other direction there are meta-disassemblers used for analysis in tools like Ghidra.
Did you get inspiration from other assemblers or macro processors?
You have it running on a TRS-80, how does that work? I had no idea Rust could target a TRS-80.
I am getting hints of Forth, Lisp and TCL.
How would you go about laying out structs in memory?
I am sure you considered an internal DSL, what caused you go with something stand alone?
Any thoughts on adding a constraint solver, like Z3 and allowing end users to set constraints on things like the size of a jump.
I could see taking this an growing it into a compiler by making macro(macro(macros txt)))
Is there an internal IR?
Projects for inspiration
https://github.com/mattbierner/Template-Assembly
Specifying representations of machine instructions https://dl.acm.org/doi/pdf/10.1145/256167.256225
https://www.semanticscholar.org/paper/Specifying-representat...
Typed Assembly Language (TAL) https://www.cs.cornell.edu/talc/
And you haven't come across it, you are in for a treat https://en.wikipedia.org/wiki/META_II has spawned a whole trove of clones
But then I reread it and realised I was not paying attention to the usecase. It's about making it easy to write assemblers. So this isn't for your Arms and RISC-Vs it's for your random niche microcontrollers where the vendor-provided toolchain kinda sucks.
Seems cool!
I've experienced a couple of under-documented assemblers in my time. In neither case did this turn out to be that much of a problem in practice, but I guess I just don't write that much assembly.