Page 28 - Introduction to Microcontrollers Architecture, Programming, and Interfacing of The Motorola 68HC12
P. 28
1.2 The Instruction 5
As we shall see with the 6812 MPU, reading an instruction from memory will
require that one or more bytes be read from memory. To execute the instruction, some
bytes may also be read or written. These two activities, read and execute, seem to be read
or write operations with the memory but are quite different to the MPU, and we use
different terms for them. To fetch means to read a word from memory to be used as an
instruction in the controller. The first step in the cycle shown previously is the fetch
phase. To recall means to read a word into the MPU that is not part of the instruction.
The recall and write operations are done in the second step of the instruction, which is
called the execute phase. Thus, when we talk about fetching a word, you cart be sure
that we are talking about reading the instruction, or part of the instruction. We will not
use "fetch" to describe an operation of reading data to be input to the data operator.
The 6812's registers are shown in Figure 1.2, where the top five registers hold 16
bits and the condition code register holds 8 bits. The 16-bit D register is composed of
two 8-bit registers A and B; D, A, and B are called accumulators because arithmetic
operations can be done with their contents with the results placed back in the registers to
accumulate the result. This accumulating aspect of registers D, A, and B will be
assumed to be understood so that we often refer to (register) "D," "A," or "B" rather than
"accumulator D," "accumulator A," or "accumulator B." The registers A and B are always
the left and right halves of register D; if you put $12 in register A and $34 in register B
then read register D, it has $1234. Similarly, if you put $5678 in register D, then
reading register A gives $56 and reading register B gives $78. Registers X and Y are
Figure 1.2. Registers in the 6812