The Instruction Set (Microcontrollers)

In our study of how the computer ticks, we think that you will be motivated to read this topic 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 topic 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 topic 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 topic 1. We group similar instructions together into a class and present each class one at a time. As mentioned in topic 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 topic’s outline.
At the conclusion of the topic, you will have all the tools needed to write useful programs for the 6812, in machine code. You should be able to write programs on the order of 20 instructions long, and you should be able to write the machine code for these programs. If you have a laboratory parallel to a course that uses this topic, you should be able to enter these programs, execute them, debug them, and, using this hands-on experience, you should begin to understand computing.

Next post:

Previous post: