
72 Assembly Language Programming for the 68000 Family
The 68000 has a total of 12 different addressing modes. This may
seem like a lot, but not all of these modes are commonly used, and some
are automatically selected by many assemblers to allow more efficient
execution of instructions. You have actually learned several of these
modes already.
At this point I should mention something about the limitations on the
use of these 12 addressing modes with all instructions. Life would indeed
be nice if we could use any of these 12 addressing modes as the source
and/or destination of each and every instruction. Computer scientists
refer to the orthogonality of a machine architecture as to the degree to
which all addressing modes can be used with all instructions. A fully
orthoganal architecture would allow all combinations. Unfortunately, the
68000 is not fully orthoganal, although it comes remarkably close. We do
have to be careful. Appendix C should be used as a reference as to what
is legal and what is not.
We will now go over the details of each of the addressing modes. I
will show some simple examples of how each mode is used. First, let’s
review the addressing modes that we have already covered in previous
chapters.
Register Direct Modes
These are actually the simplest of the modes. The effective address is
the specified register itself. There are two register direct modes:
1. Dn—Data register direct
2. An—Address register direct
Any of the seven address or seven data registers can be used. Don’t forget
that some instructions will not allow an address register to be specified.
We must use a MOVEA instruction instead of MOVE, and an ADDA or
SUBA instead of ADD or SUB.
Im mediate Data
We have used immediate data addressing to place a constant in a
register or memory location. This value must be a constant value that is
known at the time of assembly. The general form of this addressing mode
is #<data>, where <data>can be a byte, word, or longword value.
Where is this constant located? It is actually located right along with the
instructor’s opcode word. You may recall that each instruction consists of at
Kommentare zu diesen Handbüchern