Page 50 - Introduction to Microcontrollers Architecture, Programming, and Interfacing of The Motorola 68HC12
P. 50

2





                         The Instruction Set















         In our study of how the computer ticks, we think that you will be motivated to read this
         chapter because it will describe the actions the computer can do. It will supply a key
         ingredient that you need to write programs, so that the computer can magnify your ideas
         as a lever can magnify your physical capabilities. The next chapter completes the study
         of the instruction set by describing the addressing modes used with these instructions.
            In order to learn the possible actions or operations that a computer may execute, you
         need to keep a perspective. There is a lot of detail. You do need to learn this detail to be
         able to program the 6812. But learning about that microcomputer must be viewed as a
         means to an end, that is, to understand the operations of any computer in general. While
         you learn the details about programming the 6812, get the feel of programming by
         constantly relating one detail to another and questioning the reason for each instruction.
         When you do this, you will learn much more than the instruction set of a particular
        computer—you will learn about computing.
            We have organized this chapter to facilitate your endeavor to compare and to
        associate details about different instructions and to offer some answers to questions that
        you might raise about these instructions. This is done by grouping similar instructions
        together and studying the groups one at a time, as opposed to listing instructions
        alphabetically or by presenting a series of examples and introducing new instructions as
        needed by each example as we did in Chapter 1. We group similar instructions together
        into a class and present each class one at a time. As mentioned in Chapter 1, the
        instructions for the 6812, as well as any other computer, may be classified as follows:

           1. Move instructions  2. Arithmetic instructions  3. Logic instructions
          4. Edit instructions  5. Control instructions  6. Input output instructions
          7. Special instructions

        We have added, as a separate section, the special instructions that are generally arithmetic
        instructions usually not used by compilers but that provide the 6812 with some unique
        capabilities. We now examine each instruction class for the 6812. This discussion of
        classes, with sections for examples and remarks, is this chapter's outline.

                                           27
   45   46   47   48   49   50   51   52   53   54   55