Page 2 of 2

Posted: Wed Jul 18, 2007 7:49 pm
by sje
Close to forty years ago, at least some mainframe assemblers had sufficient expressive power to allow stacks and arrays. The Compass assembler by Control Data Corporation comes to mind; an ingenious coder could create and use all kinds of high level techniques given a sufficient grasp of the language's phone book sized manual. I recall seeing Compass being used to generate object files for all sorts of different target architectures and it was no big deal. Inventive authors had no difficulty implementing macros for nested high level sequencing structures.

Then there were the macros used to calculate things like logarithms, square roots, and even the current phase of the moon. How was this done? In part by the assembler's micro (yes, micro) definition and substitution facility. A micro is a string version of a macro and a micro call could appear just about anywhere, and new symbols could be manufactured by micro substitution, concatenation, and other tricks.

As for my assembler, the eventual exact feature set is dependent upon the needs of the (private) applications I'm developing. I'm hesitant to make it freely available as I really don't have enough spare time to handle support and I won't cede the development direction to others. Again, the priority here is with my personal applications.

Posted: Thu Jul 19, 2007 6:24 pm
by blargg
Here's a pet feature that I'd like to see in a 65xx assembler: typed constants, specifically addresses and numeric constants. These allow an assembler to emit a warning when a numeric constant is used without a # sign, avoiding the obscure error of accidentally using a numeric constant as an address. I detailed how this should work in a Nesdev posting a while back.

Posted: Sat Jul 21, 2007 3:14 am
by sje
Some assemblers already have ways of imbuing symbols with various attributes. For example, a target of a "set" can have its value changed while the target of an "equ" cannot. Similarly, in relocatable assemblies some symbols are relocatable while others are not; some labels are external while others aren't.

But it's hard to have the assembler flag questionable code without having it also generate spurious warnings. For example, in perfectly valid source, the same symbol can be used as a transfer target and an immediate operand.

--------

Work on the assembler continues. I added the C "?:" operator to the expression parser and it checks out; this will assist in writing conditionals that would otherwise require a multiple line if/else/endif construct.

I'm now finishing the code allowing most of the standard C escape character sequences in character and string literals. There are eight of these ("abefnrtv") along with octal and hex code escapes. Oh, and the apostrophe and quote escapes are there as well.