I was torn as to whether or not to put this in the Romhacking forum or here in the programming forum. Ultimately it seemed like programming made more sense.
Anywho. For a... 'project'... I've been needing an assembler for SNES. After toying around with xkas 0.06, xkas 0.12, wla-dx, and ca65... I had come to the realization that none of these assemblers do what I want on a level that I want them to. There is like a handful of critical features that I need, and while some assemblers have some of them, none of them have all of them.
So what to do? Create my own assembler, of course!
So here's Schasm. An assembler for the 65xx series.https://www.dropbox.com/s/wsivt454ucd884q/schasm_alpha002_2015_07_16.zip?dl=0
Note that this is an ALPHA
release in that I have done practically ZERO
testing on this, so it almost certainly has bugs. I'm going to resume my ... 'project'.... using this assembler and try to uncover bugs in the process... but I figured I would post the assembler here if anyone else is interested in trying it out to help me find problems with it.
Since it's an alpha, I do not want it to be hosted on RHDN just yet, so I did not submit it. I want to wait until I'm satisfied it's reasonably stable and reliable.
So why should anyone use this assembler over any of the others? Well, that's a subjective question. So here's a general feature list. Again note that some assemblers have some of these, but no assembler I've tried has all of them:
- Inject assembly into an existing ROM without rewriting the entire file
- system agnostic approach to file offsets. The #org address is independent of the ROM offset (why didn't any other assembler do this? They all seem to try to compute the offset based on the org address which made it clunky)
- Intelligently keep track of DB and DP to choose appropriate addressing modes for instructions (xkas *almost* did this)
- Able to specify mirrored regions for further optimization. Ex: you can declare a variable in bank $7E, and tell the assembler than part of bank $00 mirrors bank $7E (which it does on SNES), allowing you to access those vars through DP or absolute mode even when DB is not $7E (no other assembler does this! Makes it unreasonable to use symbol names in your code!)
- Text output with support for table files. DTE/MTE supported
- automatic construction of pointer tables
- sane namespace and symbol scope system (severely lacking in other assemblers)
- local symbol definitions
- nameless labels
- complex expressions: "lda (foo+5)*3,X"
- conditional assembly
- bounds checking
- ... and more!
So yeah if anyone else wants to check it out and let me know what they think and let me know if they hit any bugs with it, that'd be awesome. I certainly welcome any and all feedback.