NAME : XLATE5 DATE : 27 OCT 84 FROM : IRV HOFF W6FFC NOTE: THIS PROGRAM MAY BE ASSEMBLED WITH ASM.COM AND WORKS FINE WITH 8080 OR 8085 COMPUTERS, AS WELL AS Z80 UNITS. XLATE takes a 8080 source code .ASM file using Intel mnemonics and creates a new Z80 source code .MAC file using Zilog mnemonics. This is done in such a manner the new program is immediately ready to run on a Microsoft Z80 assembler. XLATE adds two lines at the very beginning of the new program: .Z80 ASEG The first makes it unnecessry to add the "/Z" parameter for the M80 assembler and the second makes absolute addresses for the L80 linking loader - without such a statement in the new program, it would get only relative addresses. There are at least three other similar programs which translate 8080 source code to Z80 - MAKEZ80, IZ (Intel-Zilog) and ITOZ (Intel-to-Zilog). They will be discussed in turn. SPECIAL NOTE ------------ ZTOI (Zilog-to-Intel) is a special program that does just the oppos- ite from the other four - it takes a Zilog Z80 source code program and writes a new one in Intel 8080 source code. This is a commercial com- panion to ITOZ. It makes no attempt to alter Z80 specific commands but usually puts a statement into the program at that point as well as dis- play it on the screen: "FOLLOWING INSTRUCTION IS NOT RECOGNIZED". Both these program handle IF/ENDIF statements in an unusual manner, replacing them with COND and ENDC. Both ITOZ and ZTOI REQUIRE upper-case source code, putting out error lines if any lower-case is encountered. They are commercial programs, the rest are free. They are both under 5k in length. XLATE5 ------ XLATE5 is written in 8080 assembly language and is 39 records (under 5k). It is slightly longer than XLATE4 which was written in Z80 code which utilized a number of Z80-specific commands that do save object code length. If assembled and loaded with M80, it will come out 43 re- cords long, but that is due to L80 converting all the DS statements to 00 and adding them to the total file length. XLATE is faster than MAKEZ80, considerably faster than IZ and much slower than ITOZ which is (by far) the fastest of the group. (ITOZ is also the only commercial version, the rest being free.) Since XLATE (also IZ) only writes one record at a time, its speed will vary considerably, depending where on the disk the input and output files are physically located. It was written in May 1982 by Richard Conn who disassembled a comparable program available from Cromenco, then adapted it for public domain use. It has since been updated by Bill Al- bright and Irv Hoff. The source code is written in Z80 mnemonics and is public domain. XLATE is surely the easiest of the four to use, as only one file name is required (although two many be used if desired). XLATE5 is now written in 8080 source code, having been rewritten by Irv Hoff from the Z80-specific source code on previous versions. MAKEZ80 ------- MAKEZ80 is written in AZTEC 'C' by Richard Covert. While MAKEZ80.COM is available in public domain, he asks $25 for the source code. Current version is 3.2 dated 19 February 1984. It is 201 records (26k) long but is the "less noisey" than IZ or MAKEZ80 since it uses reasonably large buffers for file handling - the other two only use one record at a time with considerable disk activity and take unpredictable lengths of time. ITOZ is comparable to MAKEZ80 in this respect. IZ (Intel-to-Zilog) ------------------- IZ is written in PASCAL by John Hastwell-Batten. It is available in public domain. The current version is 2.0 dated June 1982. It consists actually of two programs, IZ.COM which is 200 records (26k) and IZ.DAT which is 111 records (14k). The latter contains all the data needed to convert TDL, PASM and Z80 mnemonics. The program is probably the most versatile of the three since it will accept Intel 8080 or TDL 8080 source mnemonics, PASM code, has optional global label generation, and can dis- play the "before and after" line by line on the CRT. (While it is nice to watch the translation on the CRT, doing this a few times is more than adequate and the user will likely turn off that feature on subsequent uses of the program. However, score a big one for IZ.) ================================================= Back to XLATE now. If no filename is included, a short message will remind the user and that a help message is available: A>XLATE ? This gives an excllent page of information on how to use the program. Normally, only one file name will be used: A>XLATE HELLO This assumes the file 'HELLO' is in reality a 'HELLO.ASM' 8080 source code file. The output file will then be automatically named HELLO.MAC and will be ready for immediate use with the Microsoft M80 assembler. XLATE removes any colons after labels in lines with EQU, MACRO or SET statements. It also converts any lower-case source code to upper-case. Unlike the other two programs, it does not attempt to reformat the pos- ition of the comments to column 24 if possible, but leaves them however they originally appeared. (Many people use column 32 for comments these days, which looks much better on Z80 code in particular, which has longer expression field use than 8080 code.) Two file names may be used, if preferred: A>XLATE HELLO.ASM NUNAME.MAC If the second file name already exists, a warning will be displayed asking if it should be erased or not. This can be most valuable under obvious circumstances. (MAKEZ80 and IZ would just wipe out the exist- ing program without mentioning anything.) XLATE displays a 'dot' on the CRT each ten lines of input file it handles. It puts 50 dots to a line, so two lines of dots are 1,000 program lines. This gives the user some idea of what is happening. ====================================================== DIFFERENCES BETWEEN IZ, ITOZ, MAKEZ80 AND XLATE4 ------------------------------------------------ There are substantial differences. The Microsoft M80 assembler re- quires colons after all labels, but no colons for labels in EQU, MACRO or SET lines. There MUST be a label on any EQU line. Keeping that in mind, away we go: M80 will not accept an asterisk in the first column. COLONS: Handled properly by IZ and XLATE4. Totally ignored by MAKEZ80 and ITOZ, which leaves them however they were in the original. (Count off heavily for MAKEZ80 and ITOZ here.) LABELS over 7 characters: XLATE puts a space after labels (whether EQU or not) that are too long. MAKEZ80 puts a tab, which often changes the apparance of the output file. IZ puts the label on a line by itself then starts a new line with a tab. While pleasing in appearance this provides assembly errors on EQU lines which MUST HAVE a label on the same line. It also changes the appearance of the original where we could assume the author knew the label was too long. ITOZ seems to just handle them however the author provided. (Score for XLATE here, perhaps, count off for IZ for EQU's and count off heavily for MAKEZ80. ITOZ sort of neutral.) INLINE COMMENT LINES: On source code lines with comments, XLATE leaves them where they were, whenever possible. Both IZ and MAKEZ80 put only one tab after the new expression field, regardless how many the original file had. ITOZ will also make a ragged appearance. (Score for XLATE here.) ASTERISK in first column: MAKEZ80 and ITOZ leave it an asterisk. (Produces errors with M80.) XLATE changes it to a semicolon for M80. IZ indents two tabs to column 16 thinking is is an operand character. (Score heavily for XLATE here.) LOWER-CASE source code: Converted to upper-case by XLATE. Left in lower-case by IZ and MAKEZ80, except the new Z80 instructions are upper-case, giving a rather awkward appearance. ITOZ puts out an error for each line containing any lower-case source code (as does ZTOI). (Score for XLATE here.) BLANK LINES: IZ erases all blank lines, compressing the appearance. XLATE, ITOX and MAKEZ80 all leave them as they were. (Count off for IZ here.) EASE OF USE: XLATE only requires one filename. The .ASM need not be typed. It can use two file names. ITOZ is similar to XLATE but needs the file type. MAKEZ80 requires two file names. IZ can use two file names on the command line, but if none are given, will only ask for one. In any case, it asks if you are using Intel or TDL mnemonics, if you want global labels and if you want a visual display. (Score for XLATE here.) SPEED: ITOZ (and ZTOI) are in a class by themselves, much faster than any of the others. XLATE is the pretty fast but quite noisy and unpredicable on time as it only handles one record at a time. MAKEZ80 is reasonably fast and rather quiet as uses large buf- fers. IZ is by far the slowest but can optionally display the translations as they are being done. (Score for XLATE here, count off heavily for IZ for very slow speed. It will take 3-4 times longer than XLATE.) M80 HELP: XLATE puts two lines on each file, .Z80 and ASEG. MAKEZ80 just puts a little advertisement on that mentions it was used to make the translation. IZ puts just .Z80 on, you still need to add the ASEG yourself to that file, normally. ITOZ doesn't do any- thing at all. (Score for XLATE, half-score for IZ, count off for ITOZ and MAKEZ80.) WHAT IT DID: MAKEZ80 provides no information. XLATE shows a series of dots as the program progresses, one line of 50 dots for each 500 lines of input file handled. IZ displays a nice summary at the end. ITOZ and MAKEZ80 give no information on progress or results. ERRORS: ------ ITOZ and MAKEZ80 attempts to inform the user of problems with the code during translation, much as an assembler might do. ====================================================== CONCLUSIONS: ----------- I have tried to point out the differences in the four programs that are available. XLATE5, ITOZ and ZTOI are all under 5k, the other two at least 5 times larger. I have tried to modify the previous version of XLATE to be the best of the group overall, although not as fast as ITOZ. I feel certain the typical user would prefer the results obtained from XLATE5 when compared with the other three. It is the easiest to use and in my opinion has none of the shortcomings of the others.