Monday, February 14, 2011

A Parser for GNUSim8085 Assembler Listings


Update: I am happy to announce that this functionality based off of my code will be added to GNUSim8085 in version 1.3.8.

I've been building an 8 bit microcomputer (still a work in progress) around the classic Intel 8085 processor. I found this excellent open source program, GNUSim8085, a "graphical simulator, assembler and debugger for the Intel 8085 microprocessor in Linux and Windows."

This program was extremely useful for writing and debugging my operating system. Unfortunately it had no ability to assemble the program to a binary in order to burn it to ROM, forcing me to hand assemble my programs in a hex editor.

To fix this, I wrote a parsing tool in C, it takes a GNUSim8085 assembler listing and strips out the hex data and OP codes to a binary file.

Download: gnuasm85.c


Update: I was able to get it to compile in GCC for windows, you can grab the compiled .exe here.
Instructions: Open up your assembly program in GNUSim85, make sure it runs. Set the "Load me at" value to the proper address offset. Then hit Ctrl + L to generate an assembler listing of your program and save it. Then run that assembler listing through gnuasm85 like so, "gnuasm85 foo.asm -o foo.bin".