porting vasm to a new CPU
category: code [glöplog]
I need to make an assembler for a CPU which currently has none, and I've been thinking about porting vasm to it, but I'm not sure if it's a good idea. Does anyone have any experience with this? Is there another project like vasm that I could use instead?
(Also, no, I'm not going to write one from scratch, I'm too lazy to make a good parser with proper error messages etc., and I'll probably need those.)
(Also, no, I'm not going to write one from scratch, I'm too lazy to make a good parser with proper error messages etc., and I'll probably need those.)
The alternative would be GNU binutils, but vasm is likely to be easier.
I didn't add new CPUs to it (yet), but did add extra opcodes to existing CPUs.
If you don't need a completely new syntax parser (that is, your assembler has roughly a format of OPCODE ARG1, ARG2, ARG3), you don't need too much work to get it going, I think.
The documentation (http://sun.hasenbraten.de/vasm/release/vasm_26.html#Interface) explains how to add a new CPU, and Frank Wille will be happy to help (I hope? or maybe I'm annoying him with bugreports, but he did help me with whatever I needed in vasm so far).
I didn't add new CPUs to it (yet), but did add extra opcodes to existing CPUs.
If you don't need a completely new syntax parser (that is, your assembler has roughly a format of OPCODE ARG1, ARG2, ARG3), you don't need too much work to get it going, I think.
The documentation (http://sun.hasenbraten.de/vasm/release/vasm_26.html#Interface) explains how to add a new CPU, and Frank Wille will be happy to help (I hope? or maybe I'm annoying him with bugreports, but he did help me with whatever I needed in vasm so far).
I first thought of binutils too, but looking at the diff for adding RISC-V support, I decided that it's too much effort. (Though having binutils would be nice, because it works well, and I'm also (too) used to that toolchain.)
So I guess I'll go for vasm, but I'm not sure how well it's able to deal with the instruction set, because the latter is "slightly" insane.
So I guess I'll go for vasm, but I'm not sure how well it's able to deal with the instruction set, because the latter is "slightly" insane.
Hi, you may want to check the license terms on VASM, it is not really open source in the usual sense, it is just distributed in source form.
Of course this may not affect you if you don't plan on redistributing your version :-)
Quote:
This archive may be redistributed without modifications and used for non-commercial purposes.
Of course this may not affect you if you don't plan on redistributing your version :-)
Frank would likely accept your patches, though.
Yeah, Frank Wille is actually quite responsive when you have questions or inquiries, so also feel free to talk to him directly.
He not only fixed some bugs I reported, but actually added some features I requested to both vasm and vlink, so I could switch Free Pascal to use vasm and vlink as default assembler and linker for m68k-amiga and m68k-atari, and have it as an option for powerpc-morphos and powerpc-amiga.
He not only fixed some bugs I reported, but actually added some features I requested to both vasm and vlink, so I could switch Free Pascal to use vasm and vlink as default assembler and linker for m68k-amiga and m68k-atari, and have it as an option for powerpc-morphos and powerpc-amiga.
for now I'd just need it within my group, so I guess that'd be fine. But maybe after the demo is released, it'd be nice if the assembler could be included in homebrew devkits, but WinterMute etc. might not be able to redistribute it.
Do I remember this correctly that you can distribute your own patches for vasm but not the modified binary itself?
They will happily upstream the patches anyway.
El Topo: that's true, but I don't know if distributing the binaries yourself (modified or otherwise) is allowed, because that's what's done with devkitPro: they distribute binary packages (using pacman) of the compilers etc. for various platforms. (And the only toolchain worth mentioning for the platform I'm working with, is a devkitPro one, so it'd make sense to contribute to it as well.)
I recall there being a table based assembler called tasm that was easy to expand (not to be confused with other assemblers called tasm)
sol_hsa: that's not exactly easy to find, then
¯\_(ツ)_/¯
It is not that hard actually: http://www.cpcalive.com/docs/TASMMAN.HTM
Based on a quick google trip I think I may be thinking of the telemark assembler which isn't open source or free, so, sorry about that.
Making one shouldn't be that hard... =)
Making one shouldn't be that hard... =)
I know it isn't that hard, but I'm too lazy to make my own parser, and add enough features to it to be "usable" enough