65c816 (opinionated) assembler showdown

Programming the 6502 microprocessor and its relatives in assembly and other languages.
User avatar
cjs
Posts: 759
Joined: 01 Dec 2018
Location: Tokyo, Japan
Contact:

Re: 65c816 (opinionated) assembler showdown

Post by cjs »

Martin_H wrote:
For the 6502 I used Ophis because it's fast and has features like excellent macros, anonymous labels, symbol scope (useful for control structures), modules, and multiple program sections for code and data. I also used py65 to run unit tests which made for much better code.
I use ASL these days because it's got all of those features and many more, and it's pretty easy to make it syntax-compatible with all but the oddest assemblers if you need to assemble "foreign" code. It probably holds the world record for the number of CPUs it supports.

I also use py65 for simulation; I built a whole unit test framework around it (so that you can just write a pytest function that does things like `m.call(S.toupper, R(a='x'))` followed by `assert(R(a='X') == m.regs` and so on. That worked so well it led me to write a couple more simulators (6800 and 8080) in Python that also work with it, and I have more planned.

All this stuff is in the t8dev Python package, which is installable from PyPi (just `pip install t8dev`) and its accompanying r8format package. The latter also has Python code to read the `.p` output files of ASL so that you can convert it to pretty much anything you like; my terminal program uses this to be able to e.g. directly read an assembler output file and send Intel HEX records to a device.

To see my use of it, you can check out my 8bitdev repo, though unfortunately none of this is terribly well documented at the moment. But I'm happy to sit down with folks and help explain it, if anybody's interested.

Oh, and I've not tried any of this on Windows. All the Python stuff should work just fine, and the Bash scripts probably work in the MINGW Bash that comes with Git for Windows, but it's untested. That's another area where I'm willing to to help port things and make them work if there's someone who wants it and is willing to test it.
Curt J. Sampson - github.com/0cjs
Post Reply