Instruction set

The instruction set (English: instruction set, which is why the term instruction is sometimes used as a synonym for programming instruction in the German technical language of computer science ) refers to computer science, the amount of machine instructions that can execute a specific microprocessor. The scope of the instruction set varies considerably depending on the processor type. Relatively large instruction sets can be found in CISC processors, the smallest possible instruction sets are sought in RISC processors. Today's high-performance processors are generally hybrid CISC / RISC processors. As the instruction set implemented in hardware (for example by micro- channels), the programmer is hidden. If a specific program in the instructions of an instruction set before, so we also speak of a program in machine language.

In a wider sense, the term, instruction set ' the instruction set (also a synonym for command set ') of a programming language in general.

Characteristics of instruction sets

An instruction set is called orthogonal if any instruction can use any addressing mode of the processor. Under the addressing mode of a processor is understood as the way how a processor, using the address information, offsets and register contents can calculate the effective address of the operand.

An instruction set is called symmetric if all data types and addressing modes of a command are allowed not only for its source, but also for its destination operand. The data types of a processor include all types that can be processed directly by machine instructions (ie without a software-based emulation).

Instruction formats

The individual instructions of an instruction set have the general format

<Opcode> { , { }} Which command is meant in each case specified by the opcode. The width of the words used in an instruction set (ie opcode / operand combinations ) varies significantly depending on the processor type. It may in particular longer than ordinary memory words, ie as the data bus width of the processor. In this case, the commands have to be loaded by a plurality of memory accesses from the memory to the processor.

This " two- operand instruction form " is a typical, but not the only occurring. There is next to both processors, the commands with only a maximum of one operand as well as those with more than three operands have. In a single operand, all commands as the second operand (implicitly) a processor internal registers must use ( the accumulator, for example ). The three- operand instructions differ by source, Linked value and result target, so that the source must not be overwritten.

Command types

The instruction set of a microprocessor is roughly composed of a few types of commands.

With data transfer commands are moved within the system. As a source and as a target while memory locations and / or processor registers come into question. The data are typically not changed and copies only, ie stay at their source location unchanged. Depending on the command, and depending on the processor type single bytes or even several can thereby be transported at once. In more complex addressing modes can both source and target additional registers and, if necessary calculations come into play in order to process data stored in tabular form, for example, by indexed addressing or to copy all memory areas. The command name usually go by the English words move ( move ), load ( load ), store (store) or transfer from.

With commands for manipulating data contents of memory cells are modified (examples: shift, convert )

Arithmetic and logical instructions perform just such operations on existing values. Here, then, is expected to be counted or run an AND operation. It is very often the Hauptoperand a processor register (in most cases, the accumulator), but not necessarily. Otherwise, the same applies to the operands as in the transfer instructions above. The command names are mostly English abbreviation for the respective operation such as ADD or AND.

Ein-/Ausgabebefehle are used for reading and writing data on the peripherals that connect media to the ' outside world of the computer '.

(Also called commands for program control) jump instructions are used to branching within a program flow, to form loops, responses to different numerical values ​​and calling subroutines ( subroutines ). This distinction is unconditional jumps and conditional jumps, the latter typically follow or miss depending on the state of certain bits of the processor state register of a branch. The command names are mostly based on the English words jump ( jump ) or branch ( branch ).

Stack commands store data on the stack ( command name usually English push, push for on the stack ) or get data back from there ( command name pop or pull for pull ). Here, the stack pointer register is updated automatically. Again, one depending on the command and processor type or move multiple bytes at a time.

Combined commands are composed of elementary actions of the above types of commands. For example, both a jump is executed and the previous program address is stored as return destination on the stack when calling a subroutine usually. Some processors support counting loops eg by commands both a count up or count down, and when it reaches the count limit (eg underflow at the counting down to zero ) conditional execute the (re - ) jump. Especially the latter commands, such as are typical of CISC processors.

Instruction set architectures

If you want to combine a family of processors with similar command set, one also speaks of an instruction set architecture (English Instruction Set Architecture, in short: ISA). Common instruction set architectures include:

  • IA -32 ( x86 or also called )
  • ARM
  • PowerPC

Examples of instruction sets