On Wednesday, 15 January 2014 10:54:39 UTC+10, Paul Bartlett wrote:
> On Tue, 14 Jan 2014, Steven Hirsch wrote:
> >> 1. Am I the only one who strongly objects to Intel mnemonics?
>
> > I think it's vi vs. emacs by another name, but I was never comfortable with
> > Intel ASM syntax and always used Zilog mnemonics.
>
> A lot of it, I would say, is what you are first exposed to and have
> any real experience with. My personal only heavy duty assembly
> language programming was on IBM S/370 class mainframes (I did a lot of
> that!), but for MPUs, my first exposure was to Z80. So I suppose if I
> were to try to do any real Intel/Zilog work, even on an 8080, it would
> be Zilog mnemonics that would be most comfortable, because that is what
> I was first exposed to (although obviously I would have to avoid the
> hardware instructions unique to the Z80).
> --
> Paul Bartlett
I think the issue is not quite the same as the vi v. emacs argument (but
only a masochist would use vi). Further, in my case it is not a matter
of which assembler I encountered and used first because I did assembly
language programming with ASM for a considerable time before switching to
Zilog mnemonics.
hen writing programs in assembly language I much prefer to use Zilog
rather than Intel mnemonics. The reason for that has nothing to do with
the extra instructions that are available to the Z80. What I like is the
simplicity of the Zilog assembly language itself. It is a bit like
encountering the metric system; you never want to go back to the complex
mish-mash of 18th century British measurements which are still in use in
the USA and a couple of other countries.
Consider the following Intel 8080 assembly language instructions:
LDA LDAX LHLD
LXI MOV MVI
SPHL STA STAX
SHLD
All of these instructions are similar in that they perform the same logical
function, namely copying a few bits from somewhere to somewhere else. Ten
instructions which all do much the same thing! In Zilog assembly language
these instructions all share the same mnemonic, LD, with the operands
specifying the source and destination. In my view having to remember one
mnemonic instead of ten is much more reasonable.
The situation is much worse when using the macros in Z80.LIB to write Z80
code in Intel notation but I shall not discuss those beyond saying that the
number of instructions for copying a few bits from here to there increases
to 34!
It is not hard to guess why Intel chose to have ten instruction mnemonics
rather than one; it makes the task of writing an assembler so very much
easier. Once an opcode mnemonic has been identified a great deal is known
about the instruction as a whole, e.g. its length, the skeleton machine
code to be generated and the types of operand which are acceptable. On the
other hand the writer of an assembler which accepts Zilog mnemonics has a
much more difficult task; he often doesn't even know how many bytes of
machine code an instruction will occupy until the operands have been
identified and checked. Of course that is his problem and should not
concern us as users of an assembler. The Intel-mnemonic assembler writer
forces us to do his job for him every time we write an 8080 program, in
fact, almost every time we code an instruction!
I have this naive idea that computers and software are supposed to serve
users rather than the converse yet when writing assembly language programs
using Intel mnemonics I find that I am doing some of the assembler's job
for it. That is something to which I object.
Another reason why I prefer Z80 mnemonics is that whenever I write an
instruction which operates on a 16-bit register-pair I actually code the
operand as a register-pair mnemonic (e.g. PUSH BC instead of PUSH B, DEC HL
instead of DCX H). I think that makes a program somewhat easier to read.