Advanced User Forum
by Russ Wetmore
Let me tell you a little about this series of columns. As you can tell by the title, I would like to cater to the more advanced Atari 400/800/1200 owner--someone who is very good with Basic and perhaps has dabbled a little in Assembly language. I will describe programming techniques and offer routines that you can use either as part of your own programs, or as tools to help you in their creation. Within a few months, I hope to begin a major project--writing a complete arcade game, with emphasis not so much on the game itself but rather on how it's created.
Programming is a highly individual process. I've been writing for microcomputers since the days of the classic TRS-80 Model I (4K Palo Alto Tiny Basic, NO SOFTWARE) and over the years have developed my own personal style and approach to solving programming problems. I will try to share some of what I have learned, but by no means do I believe that my way is the only way to do things. Give 100 programmers a problem to solve, and you'll get 100 solutions. Some solutions will be more elegant, some faster and shorter than others, but all solutions nonetheless. Take what I say with a grain of salt and as an open challenge to improve on it if you can.
Secondly, for both the advanced and not-so-advanced users, I'd like to solicit technical questions on programming and on Atari home computers in general. I'll try to answer as many as I can each issue, perhaps Hi-Res will need a separate column for these. In many cases, the same problem you're mulling over is being "mulled" by hundreds of other programmers the same time. Your questions will also help me determine the direction of this column. Please send all correspondence to my attention at the address listed in the front of the magazine.
Lastly, I'll be reviewing products, old and new, specifically written with software development in mind. (Or even some products that you can use in your programming that aren't meant to be used that way, such as Micropainter.)
This is a good place to start. Since an Assembly language programmer's most important tool is his assembler, I'll devote the rest of this first column to a review of the major assemblers currently on the market, along with my personal rating of each.
ATARI Macro Assembler (AMAC)
ATARI Assembler/Editor Cartridge
SYNASSEM, without a doubt, is the fastest of the lot, with MAC/65 coming in a close second. There are two reasons for their speed: their use of "tokens" and their assembly from memory. What are tokens? Well, let's say you write a program that has 500 LDA instructions in it. Using an assembler without tokens, means that your program must count off the three letters of the instruction 500 times, determine they mean "LDA" 500 times, and then make a decision about how to interpret the instruction 500 times. It makes sense to have the editor substitute a code for the LDA, a "token," which, upon assembly, the program uses directly to determine how to handle the LDA.
Also, both SYNASSEM and MAC/65 can assemble from source programs already stored in memory, as opposed to a disk-based file system, like Atari's Macro Assembler (AMAC).
The brunt of many jokes regarding its speed, the Atari Assembler/Editor cartridge can boast being absolutely the slowest assembler on the face of the planet. You can attribute its lack of speed to its use of floating point numbers. (Try typing in 1E2 for a line number -- it works!)
I can't tolerate any program that doesn't take the end user's level of competence into account. Almost as much time should be spent on how a program will interface with its user as on the actual program itself. To this end, I think AMAC is the easiest to use, even taking its extreme power and flexibility into account. There are no line numbers to worry about and the editor portion has true full-screen scrolling with easy to remember command abbreviations for text manipulation. The documentation is excellent and, in most cases, easy to follow.
Most of the other assemblers follow fairly standard editor and assembler conventions with a few exceptions. MAE uses very strange mnemonics for their pseudo-opcodes. For easy decoding, Eastern House limited all mnemonics to three letters, pseudo-opcodes starting with a period. This means that you have to express what a pseudo-op is in two letters, which many times doesn't accurately describe its function. (.DI means "designate internal" label, which is just an equal sign on most other assemblers.)
The booby prize for human engineering goes, hands down, to ATMASD from Elcomp. The editor uses weird key combinations that don't make any sense. The backspace key doesn't work! You have to type Control-H to wipe out a character. You can't use the arrow keys to manipulate the cursor, and the tab is a Control-I instead of the tab key. The documentation comes in a book that includes instructions for Elcomp's entire program line. Part of the docs are poorly typeset, part are printed on a daisy-wheel, and you need a magnifying glass to see any of it. The actual assembler is not that bad, but you can't see the forest for the trees.
All of the mentioned assemblers come with debugging monitors, except for AMAC. (A separate debug package, Dunion's Debugging Tool, specifically designed for use with AMAC, is available from APX.)
A good monitor is essential in an assembly language program's development, to help track down the hundreds of bugs that creep into one's code. The Atari cartridge is handy for quick debugging, even if you don't use the assembler. My personal favorite is BUG/65 which comes with the MAC/65 package.
Again, Elcomp's ATMASD loses in this category, their poorly designed monitor has limited uses. (No tracing or single-stepping, limited I/O and no assembler for "touching-up" code.)
All the above assemblers have macros, except the Atari cartridge and SYNASSEM. Macros offer you a convenient way of representing frequently used instruction sequences, and, taken to extremes, can even be used to define instructions approaching higher level languages. AMAC and ATMASD are about are about equal in power, with MAE being the hardest to use.
Almost as important as the assembler is the editor, which is, after all, where you spend most of your time. Again, AMAC is best. If you have worked with the Atari Assembler Cartridge, you should feel comfortable with MAC/65 and SYNASSEM. Their line-oriented editors are based on the cartridge format.
ATMASD is abysmal; and TED, the editor that comes with MAE, has about three times as many commands as I can personally remember. TED is line-oriented also.
Some miscellaneous points. SYNASSEM has no true listing capability. There is no paging or titling, only a line-by-line listing. AMAC has the most flexible listing facility. It's the only assembler with a true cross-reference listing. But be warned, there are bugs in this section of the program. Nothing major, but something to be aware of.
Only one assembler, MAE, boasts any kind of relocating capacity. If you don't know what this is, you probably don't need it. Let is suffice to say, that for long programs, MAE can save you a lot of assembly time near the end of the project. MAE doesn't use a true linking system. No external labels are resolved; you must track all external references in each module and change them manually. This is tantamount to the "load offset," which is provided in several of the debug portions of other Assemblers.
Most of the mentioned Assemblers come on disk, but two of them (SYNASSEM and ATMASD) can be specially ordered on cartridge for about $50 more. There are cassette versions of MAE and ATMASD (both without macros). SYNASEM and MAC/65 both offer almost direct upward compatibility with the Atari cartridge. MAC/65 can read source files without line numbers, meaning you can create files with your favorite word processor if you like.
I've rated my personal favorites in the chart that accompanies this column (1 = lowest, 10 = highest). Next month, we'll begin discussing programming techniques and how to use them.
|Editor ease of use||
nostics (Error hand-
|Debugger||Type of Editor Line, Screen||Media format: Disk, Tape, Cartridge||
bles from Disk, Memory
|5||6||10||N/A||6||2||8||5||6||L||D, C||D, M||$49.95||
|SYNASSEM||4||4||6||4||5||5||5||6||5||L||D (T)||D, M||$99.95||
Software 5221 Central Ave. Richmond,
Software 3239 Linda Dr. Winston-Salem,
10379 Lansdale Ave.
Elcomp Publishing, Inc.
53 Redrock Lane
The above are my personal ratings for assembler features. One is a low rating, 10 a high.
Russ Wetmore, author of Preppie! I, Preppie! II and Atari Sea Dragon, lives and works in Casselberry, Florida. He has received a number of programming accolades. Video Review magazine recently named Preppie! I the best computer game of 1982. Currently, Russ heads his own software firm, Star Systems Software, Inc.