Shop OBEX P1 Docs P2 Docs Learn Events
GNU SASM (Linux assembler) alpha version — Parallax Forums

GNU SASM (Linux assembler) alpha version

bunnibunni Posts: 38
edited 2008-01-05 04:12 in General Discussion
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

Comments

  • James NewtonJames Newton Posts: 329
    edited 2007-11-02 19:42
    That's pretty cool... IF it makes it the rest of the way to a full blown replacement for SASM.

    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!



  • bunnibunni Posts: 38
    edited 2007-11-02 21:52
    I do not intend for it to be a replacement of SASM, just an alternative. And yes, I plan to get it to the state of a full blown IDE similar to that of SXKey. I have thought about supporting everything SXKey does, I even want to try and get SX/B running on it. When I get to that stage I will most definitely have the macro support included, it will just take a little while.

    -Kris
  • bunnibunni Posts: 38
    edited 2007-11-30 01:46
    Sorry I have been put out any updates, I spent the last few weeks restructuring code to make it more functional and fix a few bugs. I will be posting a new release in the next coming week or so that is:

    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
  • PJMontyPJMonty Posts: 983
    edited 2007-12-02 23:10
    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
  • bunnibunni Posts: 38
    edited 2007-12-03 07:43
    Peter,

    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
  • PJMontyPJMonty Posts: 983
    edited 2007-12-03 18:26
    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
  • bunnibunni Posts: 38
    edited 2007-12-29 05:48
    Sorry it took so long (not like anyone uses GSASM anyway tongue.gif) but I finally sat down and churned out a new release, GSASM 0.05. I still consider it alpha stages but I would put more trust in it this time around. This release has support for the SX48 and SX52 as well as built in programing using the very nice code from gsxprog, I also fixed some other issues. The next release will probably be a while from now and have hopefully two pass abilities for variable names and the like. A GUI is also high on the list, a friend of mine might help out so that will get out of the way quicker, otherwise it will be lower on my list. I also want to look in to getting a simulator up and running. Again, if there are any testers out there, please get in touch with me, I want to make this work better.

    http://sourceforge.net/projects/gsasm/

    -Kris
  • bunnibunni Posts: 38
    edited 2008-01-03 04:57
    For those interested, I have recently set up a subversion on sourceforge, In the next week I plan to get a lot done, hopefully enough for another release, if not all updates will be on sourceforge anyway. For linux just run:

    svn co https://gsasm.svn.sourceforge.net/svnroot/gsasm

    or your favorite subversion program of your choice

    -Kris
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2008-01-05 04:12
    Good work so far Kris!

    1057
Sign In or Register to comment.