I have been writing some verilog code to create simple microprocessor simulation that has its own instruction set. So far, I have been compiling all my code in head and using hex editors to produce binary files that can be used as starting program memory. Now I need to make some popular language (like C or BASIC) compilable into my instruction set, and as writing own compiler seems to be very difficult and longtime task, I'm looking for compiler that can be extended in some way or which´s source code can be simply rewritten for different instructions.
Is there any way to do this? Does such compiler exist?
You could write a backend for a retargetable compiler such as gcc or llvm. See, for example, http://llvm.org/docs/WritingAnLLVMBackend.html or http://gcc.gnu.org/onlinedocs/gccint/Back-End.html.