Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!noao!mcdsun!sunburn!gtx!edge!doug From: doug@edge.UUCP (Doug Pardee) Newsgroups: comp.sys.cbm Subject: Commodore Macro Assembler -- long review Message-ID: <894@edge.UUCP> Date: Mon, 10-Aug-87 18:56:22 EDT Article-I.D.: edge.894 Posted: Mon Aug 10 18:56:22 1987 Date-Received: Sun, 16-Aug-87 06:41:47 EDT Organization: Edge Computer Corporation, Scottsdale, AZ Lines: 127 Well, I finally needed to get an assembler for the ol' 64. After looking all over town, the only one available off-the-shelf was Commodore's Macro Assembler. It lists for $39.95, but the discount price was $19.95. Since I needed an assembler, and a couple of netters had indicated that it wasn't as bad as you'd expect from Commodore, and $20 ain't too much, I went with it. I've completed my first application with it, and so here are my initial thoughts. Note that my perspective is that of a professional assembly programmer -- I've been doing this stuff for 17 years on micros, minis, small and large mainframes, and custom bit-slice engines. I tend to want features that a lot of people never thought of... Overall, it's just what it claims to be. It provides a reasonable (but not great) environment for serious programming in 6502 assembly language. My major unsatisfied desire is for some real support to let me assemble modules separately and link them together. A minor gripe is that a lot of typos get through without complaint; I got burnt by this twice. Here's my list of features I consider desirable in an assembler, and how the Commodore Macro Assembler (CMA) stacks up. a) [For those which include an editor] full screen editing: CMA includes a program they call an editor which simply patches the BASIC editor so that you can save text de-tokenized without line numbers, and to load and auto-number unnumbered text. And adds a couple of features like renumber and global search and replace. You get the same "full-screen" edit capabilities that you get with BASIC: the big annoyances are having to list lines before you can edit them, and having to use the shift-space in order to indent lines which have no label. b) Mnemonics, pseudos, and overall syntax conforms to recognized standards: CMA basically does -- I'm not knowledgeable on the more exotic standards like macro definition syntax for the 6502. c) Character constants: Yes. d) String data definitions: Yes. e) Expressions in operands: CMA allows simple expressions with +-*/ only, evaluated left-to-right, no precedence nor parentheses recognized. f) Literals: No. g) Ability to "include" source from another file: CMA allows one level of include, and unlimited chaining at either include or base file level (it's limited by the 1541's inability to keep many files open at once). h) Code libraries: No; each included code segment is in its own file. i) Conditional assembly: No. j) Macros: CMA has rudimentary macros. Up to 9 positional parameters, and 4-character local symbols are generated for any unspecified parameters. Lack of conditional assembly means that all invocations must give the same instruction sequence. No "repeat" mini-macro such as Microsoft likes to put into their assemblers. Cannot call a macro with an indexed operand -- the comma marks the end of the parameter. k) Macro libraries: No. l) Symbol attributes: No, but then they wouldn't be very useful without conditional assembly anyway. m) Dsects: No, but not very important on a 6502 because of its limited addressing modes. n) Listing with generated code: Yes. Text is reformatted, with labels, opcodes, operands, and comments put into predefined columns. o) Listing control: CMA provides pseudos for titling, page-ejecting, and line skipping. An "option" pseudo controls whether the entire code for string data is printed, or just the first few bytes. It also controls listing on/off, and printing of an errors-only listing. Conflicting documentation suggests it might also be able to control printing of the symbol table. No control of macro expansion listing. p) Cross-reference: Yes. (I haven't run this yet, so this is based on what the manual says). Requires a second assembly run (1541 can't have source, include, object, and 2 cross-ref files all open at once). Then you run a separate cross-ref program. q) Register cross-ref: I doubt it; but on a 6502 it'd be superfluous. r) Relocatable object code: No. CMA does generate its own form of object code which allows scatter loading, but by absolute address only. The assembler comes with loaders for this format, and monitors which can dump memory to disk in a form which the LOAD command can then process. s) Symbolic linking of externals: No. t) Subroutine libraries: No; wouldn't be useful without relocatable object and symbolic linking anyway. A few CMA-specific comments... one of the reviews posted previously by a netter said that there was a lot of disk swapping required because the assembler's disk is full. I found this not the case -- the assembler is <10K long, and there are a half-dozen <1K utilities also on the disk. I copied them over to a working disk (no copy protection), and have plenty of room on that working disk without disk swapping... so far, at least. The documentation was adequate, covering the subject but not going into much depth. It did mention a hardware bug in the 6502 I'd never heard of: the status byte pushed by the PHP instruction has the "B" bit turned on. As with every assembler for every machine I've seen, the manual is not even close to a tutorial; novice assembly programmers should buy a textbook too. The monitor supplied is pretty simplistic. I mean, it doesn't even have a "breakpoint" command. You want breakpoints? Just patch in a 00 byte at the appropriate spot (after writing down the original contents so you can patch it back). It also mangles the system vectors such that the only way to exit the monitor is to do a hard reset; this is unnecessarily primitive. The two uncaught typos that skewered me: my first program was converted from a different assembler, which used "