News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

THUMBGASM

Started by zephyrtronium, July 26, 2009, 06:11:20 PM

Previous topic - Next topic

zephyrtronium

Not really sure if this is the best place for this, but it sure as hell is where I'm gonna put it for now.

I wanted to make a simple THUMB assembler for GBA, since I don't like running crap from the command line (read: I'm not gonna use xkas) programmed in Python since I'm tired of typing crap from no$ into a hex editor. I wrote out some specifications for it, but I'll be transferring computers far too soon to be able to start working on it here, so I'll be putting them up both so I can get them easily later and so that people can provide some critique.

Edit: I've decided to take this in a slightly different direction. I'm adding the "use" assembler-level instruction, which will allow you to change the dictionary that controls instruction lookup, essentially making this plugin-compatible. If someone would write the stuff necessary, this could be used as a 65816 assembler, or an x86 assembler... anything. And with the way I'm implementing this system, plugins for THUMBGASM gain access to the full power of Python.





Why I Love Python...
  • if s.startswith('('): return int(s[s.index(')')+1:],int(s[1:s.index(')')]))
  • if not 0<=(args[0]|args[1])<=15: raise ValueError 'nonexistent register'
  • if '-' in arg: regs.extend(range(int(arg.split('-')[0].strip('rR')),int(arg.split('-')[1].strip('rR'))))



Alright, important edit time. I think I've got this finished, but I haven't done any testing quite yet. And since several large and important sections were written well after midnight, testing is necessary. PM me if you're interested, but remember that this can only assemble THUMB for GBA at the moment.

Edit again: it doesn't work because of namespaces. I'll come back to this at some point, though, I swear.