GNU SASM (Linux assembler) alpha version
Finally, just under two months I have something to show. This is the alpha version of GSASM, the GNU SX Assembler, all it does is take a source file, and spit out the proper hex file. Currently only sx18/20/28 programs work (need to work on FUSE setting for sx48/52), does not yet program the actual chip, but included is gsxprog, which will (in a few weeks I will incorporate code from gsxprog in to GSASM). The catch thus far is, everything must be kept track of, registers save for W, !WDT, and !OPTION need to be addressed by their hex addresses. Otherwise, it is almost identical in syntax to SXKey. If you have a Linux install, and spare time, please help me in finding bugs, post them here or at http://forums.parallaxinc.com/sourceforge.net/projects/gsasm. Enjoy!
-Kris
-Kris
Comments
Have you thought about the macro language in SASM? Do you plan on supporting that or no?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
---
James Newton, Host of SXList.com
james at sxlist,com 1-619-652-0593 fax:1-208-279-8767
SX FAQ / Code / Tutorials / Documentation:
http://www.sxlist.com Pick faster!
-Kris
More reliable
Works with full line of sx (18/20/28/48/52)
Can assemble and program SX device
Can read back from the device and save hex output
It is still only a single pass, so still no variable names yet.
If there is anybody that has actually tried GSASM out and likes it enough to help me bug-hunt please post here or PM me, it is to the point where syntactically my code should work, however there have been minor bugs with spacing and tabbing that effect all of the output. Also, if there is anyone who knows the .lst file format inside and out, I could most definitely use your help with getting GSASM to output proper .lst files that could be used. Thank you.
-Kris
You say you want to make properly formatted .lst files so they can "be used." Used for what?
The .lst file format isn't hidden. Just fire up the IDE, load some code and hit CTR-L. Everything you need to know about the list file format can be determined by looking at a .lst file in a text editor. It has the following elements:
1 - A right justified line counter
2 - The assembled code, variable, or constant values
3 - The original source line
All three elements are allocated a fixed number of spaces. There's nothing hidden about the format. If you want to see if you're making letter for letter equivalents, take your output and the output from the IDE and load them into any program or code editor that can show the difference between two files. Modify your program until there are no difference. Done.
A couple of things to watch out for. Make sure you handle compound instructions the same was as the IDE and notice how it handles bit variables, especially a bit variable for the zeroth bit.
Thanks,
PeterM
The only reason I ask is because I would like to move this along as quickly as possible. Yes I can sit down and write it all, but it would be nice if someone happened to have a shell that I could drop in and use with my program. I want to output .lst files so they can be used with SXSim or the SX simulator that runs on linux, the name escapes me right now.
-Kris
If you can write an assembler, you can write the code that handles the .lst format output. I'm sure that when Guenther wrote SXSim, he did exactly what I suggested in my previous post. He probably output a few .lst files, loaded them into a text editor, counted the spaces between columns and went to town. It's a static format with fixed column widths and simple output rules.
I maintain the IDE and SASM, but I didn't create either of them. As a result, all the various file formats were created by someone else and there's no spec sheet or design notes to guide me. When I need to make changes to either program and the way it affects output files, I have to reverse engineer things just like everyone else.
Since I don't have any ready answers (sorry) for the details of the .lst file, I'm not sure who else would on this forum. Guenther might, but I imagine that he would have to do what I would have to do, which is to either plow through a bunch of his source code, or manually figure out the format by loading a .lst into a text editor.
I'm sure you have the skill to figure out the format, and it's not hard to do. You must have some simple code that you test your assembler with. Well, it should assemble in the IDE as well. Assemble it, create a .lst file, and go to town. It's a day's worth of work to get it going.
Thanks,
PeterM
http://sourceforge.net/projects/gsasm/
-Kris
svn co https://gsasm.svn.sourceforge.net/svnroot/gsasm
or your favorite subversion program of your choice
-Kris
1057