Tag Archives: lichen

Writing an assembler

I have a rough assembler written for the CPU I’m designing. Enough so far to convert simple programs such as :

shoved 12 shoved 12 add

Into:

14 00 0c 14 00 0c 00

This will make generating code for testing the instruction fetch / decode unit a lot more convenient. I’m also using a python module titled ‘IntelHex’. Quartus II requires Intel Hex format or a proprietary Altera format for ROM and memory initialization files. This python module makes it easy to generate  hex files. You can find it here: https://pypi.python.org/pypi/IntelHex/1.1 . I’m documenting my assembler at this page: http://www.dillo.us/wiki/projects/doku.php?id=fpga_stack_machine_assembler