KC9UDX wrote:
The syntax for my assembler, which currently runs in BASIC, is probably very alien to anyone using a commercial assembler...That is, I learned 6502 machine language from program listings in magazines. Eventually, I found magazines with parallel listings for machine language and assembly language. That's when I wrote my first assembler, which must have had syntax like those magazine listings.
MOS Technology published the assembly language standard for the 6502 in 1975. At one time, I had a mimeographed copy of the standard given to me in 1976, but alas I didn't hang on to it years later when I purchased my present place and did a substantial housecleaning prior to the move (my wife, who knows nothing of microprocessors and all that jazz, was the cause of the "substantial" part). WDC has published and enhanced the original standard to account for the 65C816—the standard is part of the datasheet. It is always best to strictly adhere to standards so as to make assemblers as appealing as possible to a wide audience.
Quote:
To this day, I'm not very proficient in 6502, because I have no other training or study. For example, I've never used BIT, and actually don't know how.
As Garth noted,
enlightenment is only a download away.
Incidentally,
BIT works like
AND, except the former doesn't change the accumulator.
Quote:
Over the years, I added functionality based on what I thought an assembler should do. Some of that functionality ends up looking very much like commercial assemblers, I suspect, but not all of it. I also removed a lot of functionality, as well, on the grounds that it was starting to be more like a compiler than an assembler; and I decided that if I'm going to have a compiler, I may as well be using a high level language. So I'm back to using a simple two-pass assembler, and plan to keep it that way.
Up to a point, more functionality in an assembler is useful. For example, a good macro language can take quite a bit of tedium from assembly language programming and even allow some useful features, such as code structuring (Garth describes that at length on his website), to be implemented. The presence of a strong macro language in the Kowalski simulator's assembler allows me to write complex 65C816 programs, even though that assembler knows nothing about the '816 and its substantially enhanced repertoire.
However, as you noted, you can reach a point where your assembler gets too bulky and slow. Assembly language is low level, so it's best that an assembler is designed with that in mind.
Quote:
I am apparently very stubborn and a little determined, as I have been putting up with my currently working assembler for years now. Assembling my far-from-complete assembler takes an amount of time that I'm not even sure yet because I don't watch it, nor time it. My text editor, which consumed most of my time on this project currently takes about 2¼ hours to assemble.
I'd like to be a purist and use only tools running on the 65C816 to write 65C816 programs. However, given the computing power of modern MACs and PCs, I'd be foolish to not cross-assemble. My POC V1 firmware, which runs to more than 11,000 lines of code, assembles in about one second. I know that if I were to implement an assembler on POC V1 and use it to build firmware, assembly time would take far longer, even though POC V1 has plenty of (SCSI) mass storage and the '816 is clocked at 12.5 MHz. Not everything associated with ancient microprocessors has to be done with a stone axe.