Instruction types


On most machines, instructions can be classified into one of several different categories. These are fairly general, and some instructions may overlap the boundaries. Here are some common types of instructions:

  • Arithmetic

    Basic numeric and logical operations, such as add , multiply , and or , require source operands and a destination for the result. These instructions often use registers to hold one or more of the values. The arithmetic result may also cause certain flags to be set in a processor status register for later reference. fetch decode resources execution results

  • Memory reference

    Often the arithmetic instructions require the data to be resident in CPU registers and may leave the result there as well. This requires instructions to get data from the slower main memory into the registers, and to put the results back again. These instructions are known as load (get the data from memory and load into a register) and store (put the data currently in a register into memory) instructions.

  • Transfer of control

    Loops, functions, and if-then-else constructs require execution to be able to go somewhere else to change the normal sequential flow of instructions. Transfers, known as jumps or branches , allow you to effectively change the PC contents and thus force the CPU to fetch from some other location. Often branches cover a shorter range than jumps but have the ability to branch conditionally, for example, to skip over some code if the result of the last arithmetic operation was zero.

  • Input/output

    Some processors have special instructions for performing I/O, others don't. Those that lack the I/O instructions need another way to "talk" to devices. They communicate by making the devices look like memory and by using the normal memory reference instructions to get data or issue commands. This technique requires dedicating a range of memory addresses to be used for certain devices. The technique is known as memory-mapped I/O. Note that this technique is not the same as using the mmap() system call, which is at another, higher level of programming interface.

  • Miscellaneous

    Some processors have a miscellaneous group of instructions that perform various tasks . These might include rotating a value within a register, clearing or setting specified bits, and performing no operation at all.

Instructions also have formats and addressing modes. Depending on what category the operation fits in, it may need to find some data to work with. There are many different methods of doing this. Some architectures provide different, or more, modes than others. Let's talk about some of these modes.



PANIC. UNIX System Crash Dump Analysis Handbook
PANIC! UNIX System Crash Dump Analysis Handbook (Bk/CD-ROM)
ISBN: 0131493868
EAN: 2147483647
Year: 1994
Pages: 289
Authors: Chris Drake

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net