Skip to content

Instruction set architecture

wikipedia Instruction set architecture

An instruction set architecture (ISA) is an abstract model of a computer. It is also referred to as architecture or computer architecture. A realization of an ISA is called an implementation. An ISA permits multiple implementations that may vary in performance, physical size, and monetary cost (among other things); because the ISA serves as the interface between software and hardware. Software that has been written for an ISA can run on different implementations of the same ISA. This has enabled binary compatibility between different generations of computers to be easily achieved, and the development of computer families. Both of these developments have helped to lower the cost of computers and to increase their applicability. For these reasons, the ISA is one of the most important abstractions in computing today.

NOTE: 这段话在《计算机组成原理-4.1-指令系统的发展和性能要求》中也有提及。ISA和**系列计算机**的概念密切相关。

An ISA defines everything a machine language programmer needs to know in order to program a computer. What an ISA defines differs between ISAs; in general, ISAs define the supported data types, what state there is (such as the main memoryand registers) and their semantics (such as the memory consistency and addressing modes), the instruction set (the set of machine instructions that comprises a computer's machine language), and the input/output model.

An ISA specifies the behavior of machine code running on implementations of that ISA in a fashion that does not depend on the characteristics of that implementation, providing binary compatibility between implementations. This enables multiple implementations of an ISA that differ in performance, physical size, and monetary cost (among other things), but that are capable of running the same machine code, so that a lower-performance, lower-cost machine can be replaced with a higher-cost, higher-performance machine without having to replace software. It also enables the evolution of the microarchitectures of the implementations of that ISA, so that a newer, higher-performance implementation of an ISA can run software that runs on previous generations of implementations.

NOTE: 上面这段话所描述的其实是分离抽象与实现带来的好处。

If an operating system maintains a standard and compatible application binary interface (ABI) for a particular ISA, machine code for that ISA and operating system will run on future implementations of that ISA and newer versions of that operating system. However, if an ISA supports running multiple operating systems, it does not guarantee that machine code for one operating system will run on another operating system, unless the first operating system supports running machine code built for the other operating system.

An ISA can be extended by adding instructions or other capabilities, or adding support for larger addresses and data values; an implementation of the extended ISA will still be able to execute machine code for versions of the ISA without those extensions. Machine code using those extensions will only run on implementations that support those extensions.

The binary compatibility that they provide make ISAs one of the most fundamental abstractions in computing.

Example

下面罗列了一些比较常见的ISA:

Classification of ISAs

complex instruction set computer (CISC)

reduced instruction set computer (RISC)

Instructions

Machine language is built up from discrete statements or instructions. On the processing architecture, a given instruction may specify:

  • particular registers (for arithmetic, addressing, or control functions)
  • particular memory locations (or offsets to them)
  • particular addressing modes (used to interpret the operands)

More complex operations are built up by combining these simple instructions, which are executed sequentially, or as otherwise directed by control flow instructions.

Instruction types

Data handling and memory operations

Arithmetic and logic operations

NOTE: 这是最最基本的指令

Control flow operations

NOTE: 控制流指令

Coprocessor instructions

wikipedia Machine code

NOTE: 机器码,都是01。

Machine code is a strictly numerical language which is intended to run as fast as possible