kissell@flairvax.UUCP (Kevin Kissell) (12/15/83)
I can only stand by so long in the face of such curiosity. Here is the
original "Godless" article and one of the more interesting of it's follow-ups:
From jack@hp-dcde.UUCP Thu Nov 24 00:25:54 1983
Subject: Godless 68000 instruction set - (nf)
From: jack@hp-dcde.UUCP
Path: decwrl!decvax!genrad!grkermit!masscomp!clyde!akgua!psuvax!burdvax!presby!seismo!hao!hplabs!hp-pcd!hpfcla!hp-dcde!jack
Organization: Hewlett-Packard, Fort Collins, CO
Newsgroups: net.flame
Date: Thu, 24-Nov-83 00:25:54 PST
Sender: notes_gateway@hp-pcd.UUCP
#N:hp-dcde:32700001:000:1326
hp-dcde!jack Nov 22 17:46:00 1983
Let's chat about the Motorola 68000 instruction set, shall we?
How to clear things:
data register memory address register
------------- ------ ----------------
clr.l d0 clr.l addr move.l #0,a0
or moveq #0,d0 or move.l #0,addr or move.w #0,a0
You see, moveq (move quick) is faster that a clr. How strange.
One would think the a clear operation would be fast.
Now, you just *can't* use clr on an address register.
You have to move a zero into it.
However, you can do a *word* move of zero into an address register,
because the word zero will sign extend into a long zero.
Also, you'd better not use clr on a memory-mapped I/O location,
since CLR READS BEFORE IT WRITES!!! AARRGGHH!
How to see if something is zero:
data register memory address register
------------- ------ ----------------
tst.l d0 tst.l addr cmp.l #0,a0
or move.l a0,d0
We can't use tst.l on an address register.
You can set the condition codes by moving it into a data register,
if you happen to have one lying around.
If not, you must use the big, slow, compare immediate.
Why can't I just use tst on anything?!?
And they wonder why I constantly mutter to myself...
-Jack Applin
optimizing himself to death at:
Hewlett-Packard
Ft. Collins, CO
(hplabs!hp-dcd!jack)
From alan@apollo.UUCP (Alan Lehotsky) Thu Dec 8 12:46:00 1983
Subject: Re: Godless 68000 instruction set - (nf)
From: alan@apollo.UUCP (Alan Lehotsky)
Path: decwrl!decvax!wivax!apollo!alan
Organization: Apollo Computer, Chelmsford, Mass.
Newsgroups: net.flame
Date: Thu, 8-Dec-83 12:46:00 PST
Yeah, I agree completely about the abortion that
MOTOROLA produced (aka the 68K). You should notice that you
can also do:
CMPA.W #0,An which only requires 4 bytes.
Further, the fastest, cheapest way to clear an A register
would be self-evident to an old time IBM-360 programmer, it's
SUBA An,An 2 bytes, 8 u-cycles
where-as
MOVEA.W #0,An is 4 bytes and 16 u-cycles
Having been responsible for writing the BLISS compilers
at DEC, especially for the VAX-11, it is ALWAYS painful
to discover what a sh**ty programming model the turkeys
in Austin, Tx. have. [See what happens when you let hardware
people design machines.... Just like that old joke about the
pope... "you no playa the game, you no makka the rules. Since
machines are programmed primarily by compiler-writers these days,
they should be designed with the compilers in mind!]
Just consider all the other brain-damage available...
o No indirect thru memory.
o The branch-displacements are specified in byte-deltas,
not word deltas (like on the PDP-11), so branches have
1/2 their potential range available. The low bit is ALWAYS
zero!
o Instructions like LEA and PEA don't accept the full set of "memory"
addresses. For example, something like
PEA (A4)+
is illegal!
o The BIT-test instructions are totally inept! Being restricted
to testing one of 8 bits in a single byte is almost worthless
I heard a rumor once that the 68k was originally a reasonable machine, but that
the first implementation wouldn't fit onto the available real-estate, so they
just kept pruning until it fit.
p.s. The fact that CLR, ST and SF do read-modify-write memory cycles has been fixed
in the 68010. Fat lot of good that does when there are thousands of 68000's
which we need user-mode code to be compatible with!
******************* End of Forwarded Messages *********************
Kevin D. Kissell
Fairchild Research Center
Advanced Processor Development
uucp:{ucbvax!sun decvax allegra}!decwrl!flairvax!kissell