HCS08 Microcontroller Instruction Sets Explained
The Full HCS08 Instruction Set
All S08 instructions (arguably all computer instructions) can be thought of as three basic types.
Data movement – a value is read from one location and written to another. All of the load/store instructions are examples of movement from one location to a different one. One of the locations is usually somewhere in main memory and has an associated address, the other is in one of the CPU registers and has only a name. Information flow can occur in either direction (depends on the instruction). Besides the load/store instructions that involve a CPU register and main memory there are several transfer that move (copy) data from one CPU register to another. There is one instruction, mov, that copies from one memory location to another. There are also a number of instructions that write an implied value (usually ones or zeros) to a CPU register or memory location. Clra, is an example.
Data processing (ALU) – there are two types; unary and binary. Unary instructions operate on only a single value obtained from either a CPU register or a memory location and write it back (the same place) after some modification (processing). Nega is an example. Binary instructions operate on a pair of values which they combine in some fashion to produce a result. These instructions almost always have at least one of the values come from a CPU register and place the result back in that register. Add is an example. A value is obtained from register A and from a memory location. These values are combined (processed) using the arithmetic addition operation, and the result is written back in register A
Program-flow altering – where the value of the PC is (or in the case of conditional branches, might be) changed from its normal upward counting sequence. This type of instruction is used to make subroutine calls, code loops, and code if-then-else style program constructs, to name a few.
If you would like to learn more, please visit my personal website at http://engineersphere.com and to see a Assembly Language Tutorial
