In addition to the assemblers mentioned above, there are the following asm.fs files:
arch/4stack/asm.fs arch/6502/asm.fs arch/8086/asm.fs arch/avr/asm.fs arch/c165/asm.fs arch/h8/asm.fs arch/lm32/asm.fs arch/m68k/asm.fs arch/misc/asm.fs arch/nibz40/asm.fs arch/r8c/asm.fs arch/shboom/asm.fs
These architectures may be supported by Gforth EC (embedded control), but that’s not documented here (and only sporadically elsewhere, with quite a bit documentation for the r8c port). If you want to use one of these assemblers, use the source!
If you want to contribute another assembler/disassembler, please check at https://cgit.git.savannah.gnu.org/cgit/gforth.git/tree/arch if there is such an assembler already. If you are writing them from scratch, please use a similar syntax style as the one we use (i.e., postfix, commas at the end of the instruction names, see Common Assembler); make the output of the disassembler be valid input for the assembler, and keep the style similar to the style we used.
Hints on implementation: The most important part is to have a good test suite that contains all instructions. Once you have that, the rest is easy. For actual coding you can take a look at arch/mips/disasm.fs to get some ideas on how to use data for both the assembler and disassembler, avoiding redundancy and some potential bugs. You can also look at that file (and see Advanced does> usage example) to get ideas how to factor a disassembler.
Start with the disassembler, because it’s easier to reuse data from the disassembler for the assembler than the other way round.
For the assembler, take a look at arch/alpha/asm.fs, which shows how simple it can be.