asfpga is an assembler written for use in FPGA design. It can be easily modified for your instruction set.
The ultimate goal of this software is to allow a FPGA designer to easily write assembly code for a custom instruction set.
The current version allows to create a listing file, a memory dump file which can be used in debugging HDL code using $readmemh() or equivalent routine, and a binary file which can be used to program a EPROM.
Howto compile and use:
To compile:
gcc -o asfpga main.c asfpga.c error.c
To use:
./asfpga inputfileName.asm
* Comments should be preceded by a ';'.
* All labels should be preceded by a '#'
* Empty lines in the source code are not allowed => should (put ';' to indicate a carriage return)
* Instructions such as 'LDI M, LED2', should have a space after comma
* All characters *must* be upper case => turn CAPS on while coding :-)
Product's homepage