
IZ does a fairly good job of translating assembly language source programs
written in Intel 8080 or TDL 8080 mnemonics into equivalent programs written
in Zilog Z80 mnemonics.  It even translates the macros in Z80.LIB into single
Z80 instructions.

Notes on IZ version 4.0
=======================

John Hastwell-Batten wrote IZ in Pascal/Z and he distributed the source code
so that anyone could change the program in the event of a bug being found or
if some new feature were needed.   In April 2010 I wanted to translate the
Digital Research CP/M+ BDOS source code into Zilog mnemonics and I noticed a
few quirks in that particular file which were not handled very well by IZ so
I decided to fix the translator program to handle the odd formats.  These were
the specific issues I wanted to address:

Conditional expressions starting in column 1
--------------------------------------------

if BANKED
	... whatever
else
	... something else
endif

IZ would think that "if", "else" and "endif" were labels.

Labels NOT starting in column 1
-------------------------------

move:
	; Move data length of length c from source de to
	; destination given by hl
	inr c ; in case it is zero
	move0:
		dcr c! rz ; more to move
		ldax d! mov m,a ; one byte moved
		inx d! inx h ; to next byte
		jmp move0

In this case IZ would treat the label move0: as some sort of instruction,
"move 0".

The fixes seemed simple enough but I could not find a Pascal/Z compiler that
would work with John's original source code, and Turbo Pascal didn't seem to
like it very much either.  Ultimately I decided to recode the program in C,
targeted specifically at Hi-Tech C version 3.09 which was released for use
free of charge several years ago and which I knew to be fairly robust.  This
release of IZ is the result of that effort and is distributed with the
knowledge and approval of the original author.

Other changes introduced in IZ 4.0
==================================

Lower case output
-----------------

In addition to making IZ handle the two coding styles shown above, I also
made the translated output code lower case because to me it seems visually
less aggressive

	ld	hl,(sydney)
	ld	de,33Ah

rather than

	LD	HL,(SYDNEY)
	LD	DE,33AH

Comments and characters inside strings are left alone so that

LAM:	ds	"DON'T DO THAT!",0 ; Yell at user

becomes

lam:	defb	"DON'T DO THAT",0	; Yell at user

Comment alignment
-----------------

As far as possible, IZ now lines up comments to start in column 40 simply
because I think this looks better than the original scheme which put a tab
between the instruction and the operand(s) and one more before the semicolon.

Data file location
------------------

I did not make any significant change to the logic of the program.  It still
uses an external data file to desribe and control the translation and I did
not even edit that file.  However IZ can now find IZ.DAT via the usual CP/M+
search mechanism:

	current drive and user
	user 0 of the current drive (if IZ.DAT is sys, r/o)
	user 0 of the A: drive

so it is now possible to run the program from anywhere without having a
local copy of IZ.DAT (provided you are running CP/M+ or similar).

Input and output file names
---------------------------

IZ now accepts Drive/User specifiers as part of the file name and it remembers
the relevant parts of the input file specifications when prompting for the
output file.

For this example, I am logged into user 7 on drive E: and BDOS30.ASM is in
user area 15 of the P: drive.  If I run IZ with no parameters it displays
some blurb and prompts for the input file name ...

	(Intel) source file: [E7:????????.ASM] 

The question marks ???????? identify the only part of the file name which I
really need to specify.  If my input file is in the current drive and user
area and it is an ASM file then I don't need to tell IZ that, I could just
respond with BDOS30.  However in this example the source file is elsewhere
so I tell IZ:

	(Intel) source file: [E7:????????.ASM] p15:bdos30

The order in which the user number and drive letter appear is not relevant so
I could have written 15p: instead of p15:.  If the input file were on the E:
drive then I would not have needed to tell IZ that and 15:bdos30 would have
been sufficient.  If the input file had a different extension then I could
have specified that too.  By now you should get the idea.  Just tell IZ what
you need to and it will figure out the rest.

IZ then prompts for the output file name:

	(Zilog) output file: [P15:BDOS30.Z80] 

Note that IZ uses the input file name to suggest an output file name.  If
that were all I needed then I could just press the Enter key to accept IZ's
suggestion but I can override whatever parts I choose.  If I wanted the
output to go to user area 3 of the P: drive then I could just enter 3: for
the output file name.  In this example I want the output file to be in the
current drive and user area and I want it to be a .MAC file so I just enter

	(Zilog) output file: [P15:BDOS30.Z80] e7:.mac

A final word
============

I have not tested the C version of IZ on any TDL assembly language files so I
cannot vouch for its ability to handle those.  I do not think there should be
a problem given that the original IZ logic is retained but should you notice
an error then send me an example of the code which causes the failure and I'll
try to fix it.  Or better yet, since you have the source code too, fix the
program yourself and send me the patch. :-)

If you find this program useful then feel free to express your gratitude by
sending gifts of gold coins, Australian red wine (shiraz) or tickets for a
trip to the International Space Station.  Or you could just send me an email
message ... Jon Saxton <tesseract@triton.vg>
