XXI Version 1.0 April 28, 1990 Gene Pizzetta XXI converts assembly source code written in Zilog Z80 mnemonics to Extended Intel mnemonics. Extended Intel is used by SLRMAC, and by Digital Research's MAC and RMAC with Z80.LIB. Opcodes for registers X and Y that include displacements are flagged, but not translated. ZCPR3 is required. USAGE: XXI {dir:}infile{.typ} {dir:}{outfile}{.typ} {/option} If no DIR or DU specification is given the current (default) drive/user is assumed. If no output filename is given, the source filename will be used. If no filetypes are given, the source filetype defaults to Z80 and the destination filetype defaults to MAC. OPTIONS: L Convert assembler instructions to lower-case. U Convert assembler instructions to upper-case. The default is for XXI to preserve the case of instructions as it finds them. TRANSLATION: This version translates all Zilog opcodes to so- called Extended Intel opcodes, except those referencing index registers X and Y that include a displacement. (Maybe I'll get those later.) The extended Intel set is used by SLR Systems' SLRMAC and by the Z80.LIB supplied by Digital Research with their MAC and RMAC assemblers. It is similar to, but not completely compatible with, the TDL extensions. Untranslated opcodes are flagged with a hash mark ("#"). In addition, the numbers of the lines containing untranslated opcodes are added to the end of the output file and are displayed on the screen. Since few programs use X and Y displacements, the flagged opcodes will normally be few. XXI will also display a warning message when it finds the ELSE and MACRO pseudo-opcodes, because those occurences may have to be edited individually before re-assembly. Asterisks at the beginning of lines will be replaced with semicolons. Lines are limited to 128 characters. Longer lines will be truncated. A dot is printed at the console for every 100 lines of the input file that is processed. EXAMPLES: A0>xxi A0>xxi // Both of these print a brief usage message. A0>xxi program Translates PROGRAM.Z80 to PROGRAM.MAC, both on the default drive (A0). A0>xxi b3:abc c:xyz /l Translates ABC.Z80 in drive/user B3 to XYZ.MAC in C0, converting all opcodes to lower-case. A0>xxi asm:myfile.mac newfile.asm Translates MYFILE.MAC in the ASM directory to NEWFILE.ASM in A0, the default directory. A0>xxi oldfile.asm d15: /u Translates OLDFILE.ASM on A0 to OLDFILE.MAC on D15, translating all opcodes to upper-case. HISTORY: I suppose there are a few like me, who learned Z80 programming with DRI's MAC and RMAC and haven't yet converted to Zilog's mnemonics. In any case I need this translator even if no one else does. XXI is based on Frank J. Zerilli's XLT80 version 1.05 (10/28/84), which was in turn based on Richard Conn's XLATE2. XLATE does the opposite of XXI; it translates Intel 8080 opcodes to Zilog Z80. XLT80 translates from Intel to Zilog, but it does not include the intrinsic Z80 instructions provided for in Digital Research's Z80.LIB for use with 8080 assemblers. In any case Zerilli's code, which was a bit kludgy, has been extensively revised, so it is even more kludgy now. Version 1.0 -- April 28, 1990 -- Gene Pizzetta Translates Zilog mnemonics to extended Intel mnemonics, except those referencing registers IX and IY. Inserts "MACLIB Z80" at head of file. XXI can probably be fooled by certain computed labels and by operands that use brackets instead of parentheses, but I have found no problems so far. The huge variety of syntax available in Zilog source files practically assures that there are some bugs lurking in the code, which is a bit of a kludge anyway. Still, it's better than nothing. If you find any problems, let me know and I'll do my best to correct them. Gene Pizzetta 481 Revere St. Revere, MA 02151 Voice: (617) 284-0891 Newton Centre Z-Node: (617) 965-7259 GEnie: E.PIZZETTA