Over the coming weeks (or maybe months or even years), I’ll be posting a series of articles introducing you to the glorious, glamorous world of assembly language programming for the 6502 series of microprocessors. While, sure, there are plenty of other languages out there, and in this day and age, assembly is something of a line of last resort among “modern” computer programmers, on the Apple II, assembly remains the optimal way to build software for the best possible performance.

However, assembly language can be a little scary to newcomers, with a lot of seemingly cryptic stuff to look at and somewhat daunting code listings.

My intention with this series of articles is to introduce assembly language in a gentle, easy to manage way, taking very small steps. This will have two advantages:

  1. It should make it easier for you to follow and learn.
  2. It will reduce the size and complexity of articles, thereby hopefully letting me post more often. This will make Sean very happy.

The first thing you need to do is to select an assembler. There are a great many of them out there. The two best-known, and most highly-regarded, are arguably Merlin (which comes in both 8 and 16 bit versions) and ORCA/M (which also comes in both 8 and 16 bit versions).

Both of these options are good ones, and I can easily recommend them both. I do have some comments on them that you might want to consider while trying to decide between the two.

Merlin is easily the faster of the two assemblers. It also has a less steep learning curve, as its user interface is quite a lot simpler. That said, I find its editor to be rather quirky, with non-standard key equivalents for many things. In addition, source code files saved by Merlin have the high bits set on all the text, which means it’s not trivial to load the files in other editors, or to open them on other computers.

ORCA/M uses a Unix-like command line interface for everything. It has a significantly more powerful macro system, but that does have the drawback that the macros are rather harder to figure out how to create and use. Once you master it, however, ORCA/M’s power is formidable.

The Apple IIgs version of ORCA/M works within the ORCA shell environment, which lets you use multiple languages in one project. In ORCA, you can build your main code in, for example, C, then write key tidbits of your code in assembly to speed things up. This isn’t something you can do in Merlin.

All that said, choosing an assembler is a surprisingly personal decision. I like a great many things about both Merlin and ORCA, and use them both.

The primary drawback to Merlin is that its legal status is somewhat uncertain. The wife of its author, Glen Bredon, released it as freeware upon his death a few years back. However, it’s unclear whether or not she actually had the legal right to do so, since Roger Wagner Publishing owned the copyright to the software, and RWP has since been absorbed through multiple companies until ownership of the copyright is somewhat hard to determine.

If you can find a used copy of Merlin, you might find that you like it.

Both the 16-bit and 8-bit versions of ORCA/M, on the other hand, are still available for purchase (please note that I own the company that sells it; it’s only fair for me to mention that).

Because ORCA is still available in a clearly legal fashion, the code examples I’ll be providing will be using its syntax most of the time; however, I will strive to point out the differences as we go.

Next time, we’ll take a look at how to go about actually building code in these assemblers, so you’ll be ready to go when we start learning how to write assembly code.