MAC-AZM.DOC by Mike Rubenstein Most of the assembly language programs released on Micro Cornucopuia disks are set up for the M80 assembler. If you've been wondering what the .MAC extension is for, those are M80 source code programs. Many of the people that got this disk, did so to assemble the M80 source files without spending $150 for M80. It can be done. For the most part .MAC files can easily be translated to .AZM with very few changes. Unfortunately, M80 is as extremely versatile assembler which, when used to its full advantage, contains some pseudo-ops and directives that Z80MR does not understand. I will reveal the most common of these and provide some help on getting around them in this file. First things first ------------------ Rename the file to have an .AZM extension. Edit the file. Near the be- ginning of the file, you will see the pseudo op that tells M80 what mnemonics you will be using. M80 handlesboth Z80 and 8080 mnemonics. You can even switch in the middle of the program. Two pseudo-ops, .Z80 and .8080 tell the assembler which mnemonics to recognize. If there is a .Z80 there, delete it. If there is an .8080 there you will need to run the program through an 8080 to Z80 translator (like XIZ.COM, a free, public domain program by Irv Hof). At this point, run the program through the assembler. The assembler is very good at finding errors, so et it tell you what it doesn't like. You can run the program through the assembler without generating any output files (see AZM-COM.DOC) and still get the error report on the console. A CTL-P before running the assembler will dump to the printer as well. Now you can go back into the file and fix the syntax where the assembler generated errors. Dual mnemonic files ------------------- XIZ is a great translator for 8080-only files. Unfortunately there are a couple of Z80 mnemonics that are the same as 8080 mnemonics and will be dutifully translated by XIZ. The problem is that the mnemonics are the same but the instructions they represent are not. So the file will assemble OK but will run with unpredictable results. An example. JP is a valid Z80 mnemonic. It is also widely used since it is an unconditional jump (JMP in 8080) JP is also a valid 8080 mnemonic. It is the jump on parity instruction. So a Z80 JP is translated as if it was the 8080 JP which will make it: JP P in the output file. Bad news. This in itself is enough to make it too undependable to use on dual mnemonic files. To avoid the grief you can do one of two things: Translate the 8080 sections by hand if they are small enough. Split the file into smaller files where the mnemonics change. Run the 8080 sections through the translator. You can let the assembler rejoin the files using the *INCLUDE statement or use PIP or your editor to rejoin and assemble the whole mess. This is no problem and XIZ does a beautiful job if the source code is only 8080 code to start with. Macros ------ The M80 macros go through Z80MR pretty well for the most part. There are some syntax changes to be made. Precede the parameters with # signs (including locals). Also there are some macro pseudo-ops that are not supported (also not widely used). If some one writes Z80MR macros to substitute for these (and a MOD operator) please send it in and we'll include it in the macro library that we are developing for this assembler. ------------------- These are used to make the assembler generate label addresses for some other part of memory than where the file will be loaded. The file named PHASE.DOC offers some alternative ways of doing this. --------------------------------- end ----------------------------------