Page 383 - Introduction to Microcontrollers Architecture, Programming, and Interfacing of The Motorola 68HC12
P. 383
360 Chapter 12 Other Microcontrollers
Figure 12.9. Memory Spaces in the 68300 Series
can read or write a byte (the mnemonic ends in . B for byte), a 16-bit word (these end in
. W for word), or two consecutive words (these end in . L for long). If the suffix . B, . W,
or . L is omitted, it is generally assumed to be a word (. W) instruction, unless such an
option is not available. Word and long accesses must be aligned with memory so their
addresses are even numbers; byte accesses using even addresses will read or write the high
byte; and those with odd addresses will access the low byte of a word. This is consistent
with the 6812 convention that puts the most significant byte at the lower-numbered
address. Bits are numbered from right (0) to left (7) in a byte exactly as the 6812. If the
hardware is so designed, access in the supervisor mode can access different memory than
in the user mode, and fetching instructions can be done in different memories than
reading or writing data, as shown in Figure 12.9b. Otherwise all memory can be the
same regardless of whether it is accessed in supervisor mode or user mode, fetched from
program space, or memorized or recalled from data space, as shown in Figure 12.9c.
The instruction set and the addressing modes are shown in Tables 12.4 to 12.6. You
may observe the general MOVE instruction, which has variations for moving one byte
(MOVE. B), a word (MOVE . W), or two words (MOVE. L). The source is always the first
(left) operand, and the destination is the second (right) operand. Any addressing mode may
be used with the source or destination. This general instruction is equivalent to the 6812
LDAA, LDD, LDX, and so on, and STAA, STD, STX, and so on, as well as the TFR
A,B and TFR D,X instructions. It also includes a capability to move directly from
memory to memory without storing the moved word in a register. In fact, there are over
12,000 different combinations of addressing modes that give different move instructions.
There are similar byte, word, and long modes for arithmetic, logical, and edit
instructions.

